Skip to content

Multiplatform builds - arm64 support#2

Merged
fedjo merged 10 commits intomainfrom
dev/build-arm64
Oct 23, 2025
Merged

Multiplatform builds - arm64 support#2
fedjo merged 10 commits intomainfrom
dev/build-arm64

Conversation

@fedjo
Copy link

@fedjo fedjo commented Aug 27, 2025

Summary

This PR adds support for arm64 builds and introduces platform-specific Docker configurations.

Changes

  • Added arm64 build support (tested on Raspberry Pi 3B).

  • Created a Docker image for arm64 architecture.

  • Split Docker Compose files per platform:

    • docker-compose.x86_64.yml
    • docker-compose.arm64.yml

    Reason: MongoDB v4 is not officially available for arm64; using a community-maintained image instead.

  • Split Dockerfiles per platform (not required now, but prepared for future needs).

  • Added a workflow:

    • Automatically builds the x86_64 image.
    • Allows manual cross-build for arm64.

Notes

  • Once upgraded to MongoDB 6, we can potentially consolidate into a single docker-compose.yml.
  • Future improvement: consider adding a self-hosted runner on Raspberry Pi for arm64 CI builds.

Local Build Instructions (Raspberry Pi)

To build and run manually on a RPI:

git clone <repository>
docker compose -f docker-compose.arm64.yml build
docker compose -f docker-compose.arm64.yml pull
docker compose -f docker-compose.arm64.yml up

@fedjo fedjo changed the title Dev/build arm64 Multiplatform builds - arm64 support Aug 27, 2025
@fedjo
Copy link
Author

fedjo commented Aug 28, 2025

@vlf-stefan-drobic I experience an issue where it seems that the images I build do not use the cache. I remember you faces the same issue do you have a workaround on this?

@vlf-stefan-drobic
Copy link

@vlf-stefan-drobic I experience an issue where it seems that the images I build do not use the cache. I remember you faces the same issue do you have a workaround on this?

It might be related to the permissions of the github actions, that was causing issues last time, I can take a more detailed look during the following days and see what's causing the issues, besides this LGTM!

@vlf-stefan-drobic
Copy link

@vlf-stefan-drobic I experience an issue where it seems that the images I build do not use the cache. I remember you faces the same issue do you have a workaround on this?

It might be related to the permissions of the github actions, that was causing issues last time, I can take a more detailed look during the following days and see what's causing the issues, besides this LGTM!

Caching might not work when dealing with multiple images or the caches might get dumped if they aren't used for more than ~one week. Might need to check up on this, but may be causing issues, could you provide any details as to what types of issues you were experiencing.
Also, if you were running the build process as a 'on pull request' while developing, could you provide the messages that were printed during those, they could help in understanding what the root issue is.
@fedjo

@vlf-stefan-drobic
Copy link

@vlf-stefan-drobic I experience an issue where it seems that the images I build do not use the cache. I remember you faces the same issue do you have a workaround on this?

It might be related to the permissions of the github actions, that was causing issues last time, I can take a more detailed look during the following days and see what's causing the issues, besides this LGTM!

Caching might not work when dealing with multiple images or the caches might get dumped if they aren't used for more than ~one week. Might need to check up on this, but may be causing issues, could you provide any details as to what types of issues you were experiencing. Also, if you were running the build process as a 'on pull request' while developing, could you provide the messages that were printed during those, they could help in understanding what the root issue is. @fedjo

@fedjo Any updates on this?

@fedjo
Copy link
Author

fedjo commented Sep 8, 2025

@vlf-stefan-drobic I experience an issue where it seems that the images I build do not use the cache. I remember you faces the same issue do you have a workaround on this?

It might be related to the permissions of the github actions, that was causing issues last time, I can take a more detailed look during the following days and see what's causing the issues, besides this LGTM!

Caching might not work when dealing with multiple images or the caches might get dumped if they aren't used for more than ~one week. Might need to check up on this, but may be causing issues, could you provide any details as to what types of issues you were experiencing. Also, if you were running the build process as a 'on pull request' while developing, could you provide the messages that were printed during those, they could help in understanding what the root issue is. @fedjo

@fedjo Any updates on this?

@vlf-stefan-drobic As I understand from latest run here https://github.com/openagri-eu/OpenAgri-WeatherService/actions/runs/17551977274

The stage build-amd64 uses previously cached image but build-arm64 does not use and instead rebuilds image from scratch. Do I get it correct?

@arruda
Copy link
Member

arruda commented Oct 23, 2025

@fedjo do we really need to worry about caching for arm64 build? If I understand correctly, the arm64 build will only be triggered manually from time to time, right? if that's the case, then maybe it's not worth worrying so much about the cache for this build.

@fedjo
Copy link
Author

fedjo commented Oct 23, 2025

@fedjo do we really need to worry about caching for arm64 build? If I understand correctly, the arm64 build will only be triggered manually from time to time, right? if that's the case, then maybe it's not worth worrying so much about the cache for this build.

You are right Felipe. I was about to merge this PR, when I just saw your comment

@fedjo fedjo merged commit 082c118 into main Oct 23, 2025
3 checks passed
@fedjo fedjo deleted the dev/build-arm64 branch October 23, 2025 14:10
@fedjo fedjo restored the dev/build-arm64 branch October 23, 2025 14:14
@fedjo fedjo deleted the dev/build-arm64 branch November 5, 2025 09:03
fedjo added a commit that referenced this pull request Nov 24, 2025
* Multiplatform builds - arm64 support (#2)

* Add Dockerfile and compose file for arm64

* Rename docker files to x86 architecture

* Add multi platform workflow with qemu

* Typo

* Sanitize branch name for docker image tag

* Rename file

* Try platform build in two jobs

* Correct label tags

* Create correct manifest

* Debug caching in arm64

* Add category field when creating FC activity type, fix some typing errors (#10)

* Add optional, hasAgriParcel field to FC Observation (#9)

* Add optional, hasAgriParcel field to FC Observation

* Change value type to dict

* Fix pydantic inherit error (#11)

* Run eagerly all build jobs and update manifest (#12)

* Robust build in workflow and compose
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants