Issue with contracts on newer supervisors

Hey there,

We have a relatively complex fleet in order to load specific drivers for different hw platforms in the same fleet, rather than using templating.
Link GitHub - ChameleonCloud/chi-edge-workers: Balena fleet to deploy workers for CHI@Edge

In particular, we need a contract to load containers either only on a specific hw type, such as:

type: "sw.container"
slug: "enforce-no-cuda-rpi4-64"
name: "Enforce non-l4t platform for rpi4-64"
requires:
  - type: "hw.device-type"
    name: "raspberrypi4-64"

On supervisor v17.0.3, no containers with a hw.device-type contract were matched, even when the device type matched. (And this worked before.)

After updating to v17.0.5 (and later), ALL containers specifying a hw.device-type contract were matched and downloaded, even if the device type was not a match.

I see that there were recent refactorings to the contract handling int he supervisor, are there updated docs available?

Thank you!

I was able to fix this, it seems that at some point having a “contract.yml” file in each service directory was deprecated in favor of having it specified in the docker compose file?

Keeping the same requirements, but porting them from contract.yml to the docker-compose format fixed our deployment issues.

You are correct - the old contract interface has been replaced with feature labels. The updated documentation is here: Multiple containers | balena
Also note the balenaCLI version requirement to continue using a contract.yml file.