Data Usage Container Contracts

When I start using container contracts, will my devices use more data because they will be pushed multiple different containers?

Each service can define the contract requirements that it enforces, and if a contract’s requirements are not met, the release is not deployed to the device,
source

This seems to indicate that the answer is, “no, the container won’t be sent if the requirements are not met” So using this docker-compose.yml template

version: '2'
services:
  tx2_28_3:
    build: ./tx2_28_3
    privileged: true
    network_mode: host
    labels:
      io.balena.features.optional: 1
  tx2_32_2:
    build: ./tx2_32_2
    privileged: true
    network_mode: host
    labels:
      io.balena.features.optional: 1
  tx2_32_4_2:
    build: ./tx2_32_4_2
    privileged: true
    network_mode: host
    labels:
      io.balena.features.optional: 1

Would only use as much data as sending one of these containers, not the data cost of sending all of them. Is that correct?

Hello, yes you are correct. Just bear in mind that when you push your application to balenaCloud all the containers are packaged and sent. It’s only when a release is deployed to a device where the container contract logic kicks in. So device won’t incur in useless data costs, but your dev machine to balenaCloud still needs to push everything.

1 Like

Does that mean that build times (and development loops) can end up 3x slower if I have 3 devices that I need to maintain?

Yes, pushing 3 images to balenaCloud will definitely take more time. Perhaps if this is a problem and there are enough deviations in the builds it’s better to create separate apps for each case?

Oof. I’ll just try to avoid it

thank you