Create a Service in BalenaCloud with BalenaEngine and add it to the Device Servicelist in BalenaCloud

Hi,

because it isn’t possible to build a docker-compose file with dynamic variables for a release
for one container inside the docker-compose file.
My UseCase is: I have each containers which will be absolutly stateless, but one container has per device an other release. The device get the release version for this config from a confighub server per rest api.
There is a ansible-playbook which will ask the confighub in a 5min interval, if the config has changed.

Now if create a controller container with balenaEngine and create the correct release from this container per device with an ansiblescript which get the release data from a confighub over the net.
Then the balenaEngine in the controller container create the application with the correct release.
This works fine, but the adHoc created container from inside is not visible in the balenaCloud Device Overview.

Is it possible, to add an adhoc created balenaEngine Container in this device service overview?
Or is it possible to change a one docker image release from inside? Maybe with a tag and redeploy just for one device…

Thanks for your help.

Hello, before answering your question I would like to understand a bit more about the premise:

it isn’t possible to build a docker-compose file with dynamic variables for a release
for one container inside the docker-compose file.

Could you elaborate on this? What do you mean with dynamic variables, you should be able to set per service (or per device) environment variables and control those through the API.

Or is it possible to change a one docker image release from inside? Maybe with a tag and redeploy just for one device…

You could create a release from the device, and use some form of pinning to get the release to the correct device but, as this would be rather involved, I just want to make sure there is no other pre existing tool that can cover your use case.

Hi and thanks for your response.

Maybe it give another way to deploy my use case.
I try to explain it:

We have a hosted webappikation for each customer with different release version and
then we have for each customer a iot-device in his network. the iot device is for printing, sharing, medical devices, scanning. The iot-device has an connection to the hosted wepapplikation througt a WAF.

On the iot-device runs a exchange service (samba and mounts), a print service( CUPS ), a controller service ( ansible project with cronjob each 5min ) and a wildfly service.

So the samba, print and controller service is for each customer the same. But the wildfly service is custom to the release of the webapplikation. that mean, the release of the webapplikation must be the same as the iot-device.

At this time my solution is, i deploy a empty wildfly service without the applikation (war file).
Then the controller with the ansible project get the config for the device and download the war file
from a webshare. then i use the balenaEngine to deploy the war file in the wildfly service. This works like a charm, but, in future it could be, that we have a wildfly release change and the i must create a new application with a new wildfly release for a certain release.

It would be saver, when i can deploy the hole wildfly container with the war file which fits together.

It would be very cool, when i can controll just one container ( wildfly ) from a device variable and deploy the full application with his specified release version.

At this time this is also possible, when i do not deploy the wildfly application.
The the controller with his ansible project perfom a balena-engine run … my_app:12.03
Works also, but, then i do not see the service in balena and when i deploy a new release, balena will not controll it.

i know, it is possible to pin a releases to a device, but then i must first releasing for each wildfly application and handle each dive with a pin. also when i perform a new release of the other services, i must recreate for each other releases.

maybe you have a good solution for my problem.
it is really important, that we have all automated.
we wont click to much on the balenacloud interface :slight_smile:

Thanks a lot

Hi there – thanks for the additional context. I think I understand now what you are looking for: the ability to have different lifecycles for different containers. If I’ve got that right, our term for this is “multi-app”, and it’s a feature on our roadmap. You can track the progress of this feature (and vote for it to show your interest) on our Trello board: https://trello.com/c/ihSj06yL/10-multi-app. I’ve also added your request to our internal tracking system, which we review regularly when deciding what to work on next.

I would not recommend the approach you mentioned of creating a separate, ad-hoc container. As you mentioned, it’s not visible from the Balena Cloud dashboard and is not under the supervisor’s control.

Thanks for the feedback!

All the best,
Hugh