Hi there,
I had some questions about the best way to use contracts in a multi-device fleet, which has a mix of raspberry pi 3, pi 4, pi cm4, jetson nano, and jetson xavier NX.
I need to maintain a few “variants” of a container to include the proper CUDA support for each board, and would like to use contacts to enforce the following:
- Default: Runs on all non-L4T devices (all PIs, for now)
- L4T 32.6 + Xavier NX
- L4T 32.6 + Jetson Nano
But, I don’t see a way to specify the conditions I’d need, for example:
- NOT L4T
- NOT (Jetson nano OR xavier NX)
- PI 3 OR Pi 4 OR Pi CM4
As a workaround, I’ve made a contract for every device type, but this is getting hard to maintain as the list of supported devices grows.
Any suggestions? Thanks!
Hello,
Have you looked into the “optional containers” feature of contracts: Container contracts - Balena Documentation ?
There’s also a good example here that might help: GitHub - balena-io-examples/tx2-container-contracts-sample: Sample TX2 application with optional containers tied to device L4T version
Also note “If a device in the fleet does not support L4T, and the contract specifies an L4T requirement, the device supervisor will reject the release unless the contract is marked as optional.” so that could potentially handle the NOT L4T case. Are you also using Dockerfile.template files? (Define a container - Balena Documentation)
We’re actually using a model almost exactly like that tx2 repo.
The issue is how to add a “not l4t” default case to that example.
For that “default” container, if no contract is specified, then a raspberry pi will run only that container, as desired, but the jetson will run BOTH the default and the l4t containers.
so I need a way to keep the “non-l4t” container from executing on the jetsons.
We’re not using dockerfile.templates, as those only build for the default device type in a fleet, and this is a multi-device fleet.
Resisting this after a while:
We basically have two containers, and only one of the two should run on a given devices.
Devices with “L4T” should urn the L4T version, and devices without L4T should run the non-L4T version.
I can use a contract like this to make sure that only jetson devices run the “l4t” based container.
requires:
- type: "sw.l4t"
version: "32.6"
But, how can I prevent the nvidia devices from also running the “non-l4t” container?
Something like this maybe?
requires:
- type: "sw.l4t"
version: None