Greetings @bw908,
Is there a facility to restrict which hardware can accept a docker-compose update based on e.g. the OS’s hardware IDs via the OTA/Torizon platform? Or is this something we would have to construct ourselves?
Currently there’s no mechanism to do something exactly like this. The reason being that each ECU really only cares about itself. So docker-compose
ECUs don’t care about the OS much. Even the compatibility you mentioned is just a web UI thing. It doesn’t actually affect the update logic. It just prevents you from doing incompatible online updates via the web UI, meaning it doesn’t really affect offline updates.
Now, in theory you could do something like this. What dictates the configuration for how docker-compose and other secondary type updates behave is the secondaries.json
file. We ship a default configuration as seen here: meta-toradex-torizon/recipes-sota/config/files/secondaries.json at dunfell-5.x.y · torizon/meta-toradex-torizon · GitHub
As you can see we dictate that the hardware id is of type docker-compose
. However, you can override this and supply your own configuration file for this. To do this see step 1 on this article: How to Use Subsystem Updates | Toradex Developer Center
Once you have your override configuration file in place you can dictate whatever hardware ID you want. For example something like:
{
"docker-compose": [
{
"partial_verifying": false,
"ecu_hardware_id": "docker-compose-A",
"full_client_dir": "/var/sota/storage/docker-compose",
"ecu_private_key": "sec.private",
"ecu_public_key": "sec.public",
"firmware_path": "/var/sota/storage/docker-compose/docker-compose.yml",
"target_name_path": "/var/sota/storage/docker-compose/target_name",
"metadata_path": "/var/sota/storage/docker-compose/metadata"
},
{
"partial_verifying": false,
"ecu_hardware_id": "docker-compose-B",
"full_client_dir": "/var/sota/storage/docker-compose",
"ecu_private_key": "sec.private",
"ecu_public_key": "sec.public",
"firmware_path": "/var/sota/storage/docker-compose/docker-compose.yml",
"target_name_path": "/var/sota/storage/docker-compose/target_name",
"metadata_path": "/var/sota/storage/docker-compose/metadata"
]
}
The magic here is that anything under the docker-compose
header will be it’s own “seperate ECU” that uses the docker-compose
update logic. So in this example I have defined 2 ECUs that use the docker-compose
update logic with the only difference being ecu_hardware_id
. Meaning this device would accept updates for packages that have hardware ids of docker-compose-B
or docker-compose-A
.
Now another thing is that you probably want to also define different file-paths for each unit here for full_client_dir
, firmware_path
, target_name_path
, and metadata_path
. Otherwise they’ll overwrite each other on updates which you may not want. Though keep in mind all of our default tools and services assume that the single docker-compose.yml
on your system is at /var/sota/storage/docker-compose/docker-compose.yml
. So, if you change this you may need to add or adapt several things on Torizon.
Finally, you of course need to make sure you upload your docker-compose packages with your new revised hardware ids. Though having said this I just realized TorizonCore Builder prohibits hardware ids other than docker-compose
for docker-compose packages.
You can probably get around this by just uploading to our platform via the API instead. Anyways, assuming TorizonCore Builder eventually does allow this, would something like this approach I’ve described work for your process? Or is it still missing something?
All that said, let me bring this up internally cause I think what you have here is a pretty sensible and valid use-case, assuming I understood you correctly.
Best Regards,
Jeremias