So I have a Pi 3 B+ and a Pi 0 w. The intention was to develop my application in local development mode on my Pi 3, then move over the hat to the Pi 0 and install the application in normal production mode on the Pi 0 w.
I’ve discovered that the devices are not considered compatible in the same application, however.
What is the reason for this, and what is the recommended way of implementing a scheme like this?
Is making two applications and pushing to both the only solution?
I guess each application only has a single compilation target makes sense, but it would seem like a commonly desired feature to be able to push portable code to multiple device types.
Fortunately for me, I am able to delete the raspberry pi 3 application from balena cloud entirely, and I can just use local pushing to test on my Pi 3.
We have support for exactly this sort of design pattern. We provide a special Dockerfile template to allow our builders to inject your Dockerfile with the appropriate values for architecture and machine name, depending on which application you are pushing to. Here is the corresponding documentation for that feature, please try it out and let us know how it works for you!
that would be a very useful feature but I’m afraid there’s no such thing between Raspis 1 and 2+3 (would be somehow like asking to have portable code between Linux and Windows).
If I understand correctly how Balena works, they build and deploy a single Docker container on your device. A Docker container is nothing but a chroot environment, sort of a “directory” completely isolated from the rest of your device filesystem. They must build multiple container for different architectures.
I know about and use the templating feature. However, to actually deploy this code to multiple types of devices, I still need to create two balenaCloud applications, where I duplicate my environment variables and push to both.
What’s the point of the .template if I still need to push to each device type anyway?
Now, if you have multiple apps (one for armv7 devices, one for armv8) necessitated by the (present) limitation on architecture-homogeneous apps, you can still benefit from the .template file being a means to deploy your single codebase to the apps. You can also make use of the CLI & SDK to synchronize deployment of environment variables to the apps.