Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Arm64 build #196

Closed
maxemann96 opened this issue Jan 5, 2024 · 7 comments · Fixed by #197
Closed

Arm64 build #196

maxemann96 opened this issue Jan 5, 2024 · 7 comments · Fixed by #197

Comments

@maxemann96
Copy link

Is your feature request related to a problem? Please describe.
I want to run a kubernetes cluster with only arm64 nodes, as a result I need an arm64 build for every software I use.

Describe the solution you'd like
Also building a docker image for arm64

Describe alternatives you've considered
No alternatives

Additional context
The nginx base image is already available as arm64

Thanks in advance for creating and maintaining this image. Very useful for my use case.

@4141done
Copy link
Collaborator

4141done commented Jan 5, 2024

Hello!

Thank you for bringing this up! It is on my list of things to do but having someone complain certainly helps with prioritization. You should see this change coming in fairly soon. See my reply to this issue regarding a refactor I'm doing at the moment to decouple the integration tests from the build process and move the integration test suite into Javascript. I'm tracking that work here: #191

@hmehta
Copy link

hmehta commented Jan 8, 2024

Hi!

This would be so wonderful! We are moving from AMD64->ARM64 and this is one of the few things we are using that not yet supports ARM64. So a big upvote from here for bumping this up a notch on the todo list :)

@ehginanjar
Copy link

ehginanjar commented Jan 11, 2024

Hi @maxemann96

I've had similar case, building the image so I can test it on my M1 Pro. In this case I used docker, so I tried to build the image by using this command docker buildx build --platform linux/arm64. Source. So maybe this solution can be tested on your side as well. Cheers!

@4141done
Copy link
Collaborator

@maxemann96 and @hmehta : I have a provisional PR for an overhaul of the build and test pipeline in case you have comments here: #197
You don't necessarily have to review it but any comments are welcome.

More importantly, it produced a test image that you can see here: https://github.com/nginxinc/nginx-s3-gateway/pkgs/container/nginx-s3-gateway%2Fnginx-oss-s3-gateway/166168166?tag=latest-new-build-test

Would you mind testing to see if this works for you?

@maxemann96
Copy link
Author

@4141done the test image is running properly, thanks :)

@hmehta
Copy link

hmehta commented Jan 12, 2024

@4141done I confirm that the image works for us too. Thanks a lot!

@4141done
Copy link
Collaborator

Thank you both for confirming. Arm64 images will start being built after that PR is merged. I'm just waiting on code review from my co-maintainers.

4141done added a commit that referenced this issue Jan 12, 2024
# What
Allows us to push multi-architecture builds for `linux/amd64` and `linux/arm64` on merge to master. Fixes: #196

Tests are performed by building the relevant image and tagging it with the image name the tests expect.  This follows the original implementation in `test.sh`.  This will likely change to an explicit image name specification as we move the test suite in to Javascript but it's being maintained for now in the interest of simplicity.

## Goals
* To decouple image build from the test run. This will help as we refactor the test suite for this issue #191.
* Not have CI take a long time due to multi-architecture builds for interim pushes to pull requests.
* CI should fail fast if any of the image builds or tests fail
* Parallelize builds as much as possible.


## Notes
* Since the `unprivileged` and `latest-njs` images build off the base `oss` image, there were some strange moves that had to be done to make that work without rebuilding the base image every time. Specifically, we had to set `setup-buildx-action` to run in `docker` driver mode so we can simply `load` the base image. Otherwise we would have had to use a local repository.  However, in `docker` mode `upload-artifact` doesn't like the file produced so we have to save the file again.
* I wanted to build images once and then run tests against them and push at the end. However, there was not a clean way to get the full multi-architecture images all the way to the push step so I just build them again against all architectures and perform tests in the runner architecture.  This saves us from needing conditionals in the test portions.
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 a pull request may close this issue.

4 participants