Devices running different releases/environments

Hi everyone,

I’m trying to figure out how can I have devices in one application running different releases (multiple environments, e.g. staging, development, production).

As far as I can see so far, that is not possible, because only the master branch gets deployed, and there’s only 1 live release per application.

Does anyone have any recommendations for this? Do I need to have multiple applications based on the same repo and then have my CI deploying different branches for the different applications, e.g. git push -f <balena-remote> staging:master?

thank you,
nelson

Hi there!
You could indeed use multiple applications, or try out the staged-releases repo here: https://github.com/balena-io-projects/staged-releases
Would that help?

1 Like

hi @mikesimos,

thank you for the feedback, I will definitely look into the staged-releases repo.

Just to clarify, the staged releases are features that will be added to balenaCloud anytime soon?

thank you,
nelson

Hi, the staged-releases repository is are set of demonstration scripts with how to use our API to do staged releases. Those are part of our cloud services.
Thanks,
Zahari

hi @majorz,

I completely misunderstood that, thanks for the clarification.

Is the balenaCloud team working on or planning to add features related to this topic? The ability to deploy multiple releases from multiple git branches that would target different devices in the same application would be great.

For now, I think the most straightforward is to use multiple applications, which is not ideal but should definitely work.

thanks,
nelson

Hey @nelson ,

Yeah, I think it’d make more sense to improve the product so that these workflows that we demonstrate through the staging releases scripts become more accessible to users!

1 Like

One limitation to be aware of when using different applications: moving a device from one application to another is similar to a reinstallation: all persistent data is lost.

That’s correct, moving between applications is not designed as a way to move between different instances of the same codebase, and therefore old data is deleted as it’s assumed to be not needed in the new app.

Note that we do want to bring the staged releases functionality to the dashboard. For now it can be used with the staged releases scripts, but also with our SDK, e.g. Balena Node.js SDK - Balena Documentation

The ability to deploy multiple releases from multiple git branches that would target different devices in the same application would be great.

Once you disable rolling releases from your app, you can push arbitrary branches (either with git push balena branch:master or using balena push as described here balena CLI Documentation - Balena Documentation ), and then use release tags, device tags and device pinning to achieve this arbitrary mapping between what releases are run by what devices. This still requires a fair amount of scripting, hopefully things will get easier as we start surfacing these features on the UI.

1 Like

hi @pcarranzav,

thank for your feedback on this.

for my use case, losing all the services data when moving between balenaCloud applications is not an issue, it’s actually how I expect it to behave. I will stick with that approach for now

but it’s good to know that more functionality will be added to facilitate release/environment management into the UI

cheers,
nelson