Skip to content

Instantly share code, notes, and snippets.

@toolboc
Last active January 28, 2020 22:02
Show Gist options
  • Save toolboc/a6b46a04b0ae17a7ec5ea5cb9ae6d4fb to your computer and use it in GitHub Desktop.
Save toolboc/a6b46a04b0ae17a7ec5ea5cb9ae6d4fb to your computer and use it in GitHub Desktop.
Script to allow for install of Azure Pipelines Agent on Nvidia JetsonTX2 with support for IoT Edge build tasks
#!/bin/bash
#
# Setup Azure Dev-Ops ARM32
#
### update your system with the latest drivers
sudo apt-get update
### Install the ARM32 gcc toolchain
sudo apt-get -y install gcc-arm-linux-gnueabihf
### Symlink the relevant kernel modules
sudo ln -s /usr/arm-linux-gnueabihf/lib/ld-linux-armhf.so.3 /lib/ld-linux-armhf.so.3
sudo ln -s /usr/arm-linux-gnueabihf/lib/libdl.so.2 /lib/libdl.so.2
sudo ln -s /usr/arm-linux-gnueabihf/lib/libpthread.so /lib/libpthread.so
sudo ln -s /usr/arm-linux-gnueabihf/lib/libpthread.so.0 /lib/libpthread.so.0
sudo ln -s /usr/arm-linux-gnueabihf/lib/libstdc++.so.6 /lib/libstdc++.so.6
sudo ln -s /usr/arm-linux-gnueabihf/lib/libm.so.6 /lib/libm.so.6
sudo ln -s /usr/arm-linux-gnueabihf/lib/libgcc_s.so.1 /lib/libgcc_s.so.1
sudo ln -s /usr/arm-linux-gnueabihf/lib/libc.so.6 /lib/libc.so.6
sudo ln -s /usr/arm-linux-gnueabihf/lib/librt.so.1 /lib/librt.so.1
### Enable installation of armhf packages
sudo dpkg --add-architecture armhf
### Install armhf version of libcurl and libicu
sudo apt-get -y install apt-get install libcurl3:armhf libgtk3-nocsd0:armhf libicu60:armhf
### create folder structure for build agent
mkdir ~/agent && cd ~/agent
### Install dotnet core arm32 package
wget -P ~/agent/ https://download.visualstudio.microsoft.com/download/pr/10b96626-02d8-415a-be85-051a2a48d0c2/5ec51d3d9f092ba558fb5f1f03d26699/dotnet-sdk-2.1.403-linux-arm.tar.gz
mkdir -p $HOME/dotnet && tar zxf dotnet-sdk-2.1.403-linux-arm.tar.gz -C $HOME/dotnet
export DOTNET_ROOT=$HOME/dotnet
export PATH=$PATH:$HOME/dotnet
### Install linux arm32 Azure Devops Pipelines Agent package
export AGENT_VERSION=2.141.2
wget -P ~/agent/ https://vstsagentpackage.azureedge.net/agent/${AGENT_VERSION}/vsts-agent-linux-arm-${AGENT_VERSION}.tar.gz
tar xzf vsts-agent-linux-arm-${AGENT_VERSION}.tar.gz
### install agent dependencies
cd ~/agent/bin
sudo ./installdependencies.sh
cd ..
### configure build agent
./config.sh
#(echo y; echo "https://dev.azure.com/{REPO_NAME}"; echo ""; \
# echo "{PAT_TOKEN}"; \
# echo "ARM32"; echo "ARM32"; \
# echo "work") | ./config.sh
### remove packages after installation
rm -r vsts-agent-linux-arm-${AGENT_VERSION}.tar.gz
rm -r dotnet-sdk-2.1.403-linux-arm.tar.gz
rm -r $HOME/dotnet
### run as a service
sudo ./svc.sh install
sudo ./svc.sh start
### install IoT dev dependencies
cd ~
sudo apt-get -y install libssl-dev libffi-dev jq python-pip
pip install iotedgedev
sudo mv ~/.local/bin/iotedgedev /usr/local/bin
wget https://azurecliprod.blob.core.windows.net/install.py -O azure-cli-install.py && \
chmod +x azure-cli-install.py && \
yes "" | ./azure-cli-install.py
sudo mv ~/.local/bin/az /usr/local/bin
### install Docker
curl -fsSL https://get.docker.com -o get-docker.sh
sudo sh get-docker.sh
sudo gpasswd -a nvidia docker
reboot
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment