Pushing/Deploying a Balena cloud pushed "app" to a fleet?

As part of our github action, we are now successfully “pushing” draft and release Balena container images using:

balena push myorg/myapp --nocache --registry-secrets /tmp/image_pull_secrets.yaml --draft --release-tag sha {github-commit-sha-here}

balena-cli succeeds:

[Success]      Successfully uploaded images

[Info]         Built on x64_01

[Success]      Release successfully created!

[Info]         Release: {balena-app-sha-here} (id: 12345678)

[Info]         ┌─────────────┬────────────┬────────────┐

[Info]         │ Service     │ Image Size │ Build Time │

[Info]         ├─────────────┼────────────┼────────────┤

[Info]         │ myapp │ 306.77 MB  │ 31 seconds │

[Info]         └─────────────┴────────────┴────────────┘

[Info]         Build finished in 1 minute, 5 seconds

In Balena Cloud, under Apps–>MyApp–>Releases we see the release, as can be seen at:
Imgur: The magic of the Internet (private info removed prior to screenshot).

Going back to the MyApp page, the “Deploy to fleet” button is disabled and just says “coming soon”.

From the cli, we tried:

balena deploy test-fleet myorg/myapp
balena deploy test-fleet myorg/myapp:{balena-app-sha-here}
balena deploy test-fleet myapp:{balena-app-sha-here}
balena deploy test-fleet {balena-app-sha-here}

all of which attempt to rebuild the app release that is already sitting in the balena cloud (same arch, same target device - Intel NUC), and then fail because those deploy cli commands don’t specify registry-secrets - on purpose, as we want to use the GitHub Actions/Balena Cloud built container, NOT build it again.

We also tried:

balena push test-fleet myorg/myapp
balena push test-fleet myorg/myapp:{balena-app-sha-here}
balena push test-fleet myapp:{balena-app-sha-here}
balena push test-fleet {balena-app-sha-here}

which all seem to function just like deploy, wanting to build locally and then deploy rather than using the existing App release/draft in balena cloud.

What am I missing here? How do we deploy to a fleet where this balena cloud hosted/built app wasn’t preloaded?

So, apparently apps and fleets are not actually integrated yet. Public apps can be pushed to fleets using the apps source github repo, but if the app is private, there is no way to do that.

I just ended up changing my github action to push to my fleet instead of to an app. That is:

balena push **myorg/test-fleet** --nocache --registry-secrets /tmp/image_pull_secrets.yaml --draft --release-tag sha {github-commit-sha-here}

@scscsc you hit the nail on the head here. We purposefully marked Apps as ‘alpha’ in the dashboard as they are not yet feature complete and do not represent everything we want to do with them.

We are pushing through a lot of cool features at the moment, and the problem that we’re having is the trade-off between waiting until everything is feature complete and changing A LOT of components all simultaneously, and drip-feeding new features so that our users get the benefit of them today. We chose the latter option as it allows us to refine our roadmap as we go and don’t accidentally spend a bunch of time building something that nobody actually wanted, but as a downside there are cases such as this where it can be a little misleading.

I think you’ve done exactly what I would have recommended here, but, perhaps another thing to consider is the use of blocks. Blocks only work with single containers, so if you have multiple containers within your app you’d have to create multiple blocks, but a block will give you a bh.cr URL to the prebuilt image which you can then use in the releases that you push to apps or fleets.

I spend a lot of my time working on these concepts at balena so have a lot of the context in my head ready to go - if you have any questions about this stuff feel free to reply here and ping me and I’ll do my best to get back to you.

You can also check out these blog posts for a bit more back story about what we’re doing:

Hope this helps!

1 Like