I am trying to use openBalena to build and deploy a multi-container app previously used with BalenaCloud (the paid version). In BalenaCloud, I used to be able to do a “balena push AppName” to update the app in the cloud, and it would use cache and only rebuild the parts of the app (the containers) that have changed. In openBalena, this does not seem to be the case anymore. I tried “balena build” and “balena deploy” to push the app to my server, and in either case, the entire app (every container) gets rebuilt, although changes were only made in a single container. How can I make it so that only the parts of the app are rebuilt and pushed to production devices that have been changed? In development mode, the “balena push” command recognizes if the source code has changed and updates only the container that has been changed. But does this not work for production devices? Could someone please explain if there is something fundamental that I am misunderstanding?
One additional observation. The build process seems to be indeed using cache until the following warning appears:
[Warning] The requested image's platform (linux/arm/v7) does not match the detected host platform (linux/amd64/v3) and no specific platform was requested.
From that point on, it looks like the cache is no longer used. Does that make sense?
Hey @mwolleben , welcome back to the forums!
Just to clarify, when using openBalena and balena push you are pushing to a device in development mode? openBalena does not include cloud builders like balenaCloud does, so you must be doing something like balena push mydevice.local
and not balena push org/fleet
, correct?
As long as that’s the process you are following, then the cache state is entirely local to the device engine you are developing on. If the device changes, or has the cache invalidated for any reason, it will need to build from scratch.
So for example:
balena push mydevice.local
balena push mydevice.local
… should use the on-device engine cache fairly effectively.
But something like
balena push mydevice.local
balena push myotherdevice.local
… will not have any cache on the second device to use (unless it was previously pushed to).
Note that these devices must be in development mode to work. Production devices cannot be used with the live push workflow.
Regarding the image platform warning, it might depend which base image is raising that warning, and whether it is a false-positive or not. Many of our older balenalib base-images do not have the architectures provided in the manifest, so you may see that warning depending on your base image.
Another reason you may see that warning is as described, is the device you are developing on the same architecture as the base images you are using in your Dockerfile?
I hope this helps!
I think you are correct. I tried to push to the fleet from my desktop computer and not to a specific device. Now I am pushing to the fleet from a device which is identical to the devices in the fleet and everything works.
Thanks for the clarification.