ADU Agent Container¶
Pantavisor turns the all the runtime into a set of containers. This means the updates you push from Azure Device Update UI are going to be simply that: a set of containers that can be added, updated or removed. This includes the Azure Device Update agent, which have been containerized to be run on a Pantavisor enabled device.
The container contents are defined in the
Dockerfile.template and built for arm32, arm64 and x64 architectures from GitLab CI with the help of container-ci. To sum up, the components of the container are:
- Azure Device Update service with PVControl content handler
- Delivery Optimization service: dependecy of ADU agent used to download the updates
- pvcontrol: used by the ADU PVControl Handler for communication with Pantavisor
NOTE: the containers are not natively run by Docker but by Pantavisor. The dockerfile is only used to define the container root file system.
- Download latest flashable image:
NOTE: RPi or BPi images are recommended, as x64 lacks OEM partition support. x64 will work too, but you will have to manually edit the configuration in the device during runtime.
- Flash the downloaded image in an SD card:
Uncompress and flash your device:
unxz rpi64_azure_stable.img.xz umount /dev/mmcblk0* sudo dd if=rpi64_azure_stable.img of=/dev/mmcblk0 bs=32M sync
- Set your adu-conf.txt into the 2nd partition of the newly flashed SD card:
NOTE: Remember your device has to be previously registered in Azure IOT Hub.
Prepare your adu-conf.txt with this format:
connection_string=<your connection string here> aduc_manufacturer=Fabrikam aduc_model=Toaster
sudo dd if=adu-conf.txt of=/dev/mmcblk0p2 bs=1M sync
Insert your SD card in the device, turn it on and check its connected in Azure IOT Hub
Clone the current running revision in your host computer with pvr
First, you will need to know your device IP. If your host computer is in the same network, you can use pvr device scan command.
After that, clone the revision into your computer with:
pvr clone http://192.168.1.122:12368/cgi-bin/pvr my-checkout
- Make changes in the checkout. For example, we are going to install a new NGINX container from DockerHub.
cd my-checkout pvr app add --from nginx:stable-alpine webserver pvr add . pvr commit
- Convert the pvr checkout into ADU format with the pvr2adu script
pvr2adu -p Pantacor -n Toaster -m Fabrikam -d Toaster -v 1.1 -o out
- Deploy the resulting manifest from Device Update
- Step 3 reduced if we flash the configuration with a mechanism similar to the one we use in our image-service.
- Steps that require interaction with Azure UI (steps 3 and 4) could be automated using Azure API
- Pantabox could make the updation requests easier (steps 5, 6, 7 and 8) if we could deploy updates using Azure API