We've selected our favorite tips and tricks created by Michael Crump and are delivering fresh technical content on Azure all April! Miss a day (or more)? Catch up with the series.
Don't have Azure? Grab a free subscription.
In this post we will cover how to run the arm32v7 Azure Pipelines Agent on Aarch 64 devices.
With the release of the Nvidia Jetson line of hardware, computationally heavy processing can now be performed at the Edge with GPU-powered small form-factor devices. This opens up a realm of possibilities for developing IoT Solutions that typically rely on external services for heavy AI/ML workloads. When coupled with modern DevOps solutions like Azure DevOps, we can create powerful pipelines for building and delivering GPU enabled solutions to devices safely and securely.
Microsoft's Director of IoT recently announced an official partnership to deliver Edge solutions using Nvidia hardware:
Wouldn't it be awesome to build those solutions on the hardware itself using the power of Azure DevOps Pipelines?
The Nvidia Jetson line of hardware is capable of running a 64-bit Ubuntu OS through provisioning via the Nvidia JetPack Installer. We will assume that you have followed the instructions to flash the 64-bit Ubuntu OS to your Jetson device and are now looking to leverage it as a build server by installing the Azure Pipelines Agent.
As of writing, the Azure Pipelines Agent does not provide an aarch64 compatible release. ARM64 support is currently in the works and is expected to be available with the release of dotnet core 3.0. In the meantime, you can take advantage of the currently available arm32v7 agent and a few steps to allow you to run the arm32v7 agent on an aarch64 compatible Debian-based OS. This will allow you to use the device as a build agent in Azure DevOps and give full access to the underlying native aarch64 development environment for any pipelines that the agent is employed in.
To accomplish this, we take advantage of the fact that arm32 binaries are backwards compatible with arm64 architectures, provided that relevant dependencies are satisfied.
To begin, we will install the arm32 gcc compiler on our device with:
sudo apt-get install gcc-arm-linux-gnueabihf
This package will bring along an armhf compatible dynamic linker. We will symlink this so that it becomes available via the default LD_LIBRARY_PATH (/lib) :
sudo ln -s /usr/arm-linux-gnueabihf/lib/ld-linux-armhf.so.3 /lib/ld-linux-armhf.so.3
Additional modules will also be required by the Azure DevOps Pipeline Agent so we need to make sure those are also available in /lib :
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
Next, we need to install the relevant external dependencies required by the Azure DevOps Pipeline Agent and ensure that they are the armhf flavor which the Agent requires. To begin, we enable installation of arm32 packages with:
dpkg --add-architecture armhf
To update our package sources with available armhf packages, we run:
sudo apt-get update
Then we install the necessary dependencies by explicitly requesting the armhf compatible versions:
sudo apt-get -y install apt-get install libcurl3:armhf libgtk3-nocsd0:armhf libicu60:armhf
Finally, we install the dotnet core arm32 dependency with:
wget 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
Once these steps are complete, you should be able to proceed with installation and registration of the ARM32 agent:
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
cd ~/agent/bin
sudo ./installdependencies.sh
cd ..
./config.sh
Finally, configure the agent to connect to register as a build agent with your Azure DevOps instance by following the documentation to Deploy an Azure DevOps Pipeline agent on Linux.
You should now be able to see your device listed as a registered agent in your Azure DevOps instance and can now use it to build your GPU-powered IoT solutions in your Azure DevOps Pipelines with a native aarch64 environment!
If you would like to run all of these steps from a compact and convenient shell script, which also includes installation of the IoT Edge development dependencies for building custom pipelines, you may use the gist below:
Want more Azure DevOps? Check out our quickstarts and tutorials!
We'll be posting articles every day in April, so stay tuned or jump ahead and check out more tips and tricks now.
Top comments (0)