feat: Add build support for ARM images (#2167)#3554
Conversation
Codecov Report
@@ Coverage Diff @@
## master #3554 +/- ##
==========================================
- Coverage 41.58% 41.35% -0.23%
==========================================
Files 115 115
Lines 16463 16598 +135
==========================================
+ Hits 6846 6864 +18
- Misses 8731 8846 +115
- Partials 886 888 +2
Continue to review full report at Codecov.
|
|
@paulfantom thanks a lot for the feedback! I've updated the PR. Seems like Kustomize was recently updated to Note that I haven't included the Kustomize version update in this PR yet, I believe that would be more suitable as a different PR. Need to look more into how to do that, currently tried with (alinbalutoiu@1d3704b) |
jannfis
left a comment
There was a problem hiding this comment.
Thanks a lot for this awesome PR @alinbalutoiu!
I personally think ARM is an often under-appreciated platform, and this PR is a great step forward for the reach of ArgoCD. I have locally build & tested a new image, and it all seems to be well so far!
I would love to merge this PR, however, what do you think of also having the ability to download the ARM CLIs from the server, as it is possible with the other binaries? You can have a look at #3015 - which introduced the Windows CLI - what needs to be done for that. I'd love to see this, but we can also do it in another PR - I guess that'd be fine as well for me. Maybe a seperate PR would be even better, because there's another build toolchain related PR in the queue I want to merge timely, which touches some of the files contained in this PR as well.
Please let me know what you think about it and whether you'd like to implement it.
|
Thanks a lot for the review @jannfis ! To be honest it didn't seem obvious why the ArgoCD CLIs for Windows / Darwin were uploaded in the Linux container image, so I got them removed from the ARM image (https://github.com/argoproj/argo-cd/pull/3554/files#diff-b67911656ef5d18c4ae36cb6741b7965R245-R246). In my opinion it would be better to move out the CLIs from the container image (the ARM CLI would add an extra ~50MB to the size of the image), and replace that with direct links to the GitHub release page. It should also decrease the container image size making the image pull faster. What do you think about that? Also please note that this PR requires a version bump for kustomize from Regarding the build process, would you be open to integrate Drone CI (free for Open Source projects) as it comes with ARM support? I can help with that if you're interested. |
Yes, that's probably the right to head to. Our image got quite bloated lately, as was also mentioned in #3674. Probably moving out the CLI binaries to their own Docker images would be the way to go, and I like the idea of linking from the downloads page in UI to a GitHub release too.
The
We're just about to migrate the CI from CircleCI to GitHub actions. Lets see how that works out, and then check if and how we can use Drone for some of the steps. I have not yet had a thorough look at Drone, but I figured it's the next cool kid on the block for doing CI :) But tbh, at this point in time I'd rather would like to connect ARM runners to GH actions. Is it possible to use Drone as external GitHub actions runner? Anyway, I'll merge this PR anytime soon so I can further prepare the PR for migration of CI to GH actions. When that's also merged, we can do the upgrade to Kustomze v3.6.x (there's already #3655) without having to also update & publish the Does it sound good to you? |
Should I remove the ARM CLIs from the image in that case? https://github.com/argoproj/argo-cd/pull/3554/files#diff-b67911656ef5d18c4ae36cb6741b7965R170-R171
Connecting an ARM runner to GH actions would definitely be a better option if you have the possibility to provide some ARM systems for that. Here's the .drone.yml I've used to build the ARM images.
I'd be more than happy to see the support for ARM builds added to the official tree. Sounds good to me! |
Probably a good idea :) I just noticed it too while inspecting the image built from your PR. So yeah, would be great if you could adapt the build process to not copy the images into the final image. Afterwards, I'll approve & merge this PR. In the meanwhile, we should figure out how to proceed with handling the CLIs in the future. /cc @alexmt |
Signed-off-by: Alin Balutoiu <alinbalutoiu@gmail.com>
|
I've removed copying the ARM CLIs in the final image. If anyone needs the binaries, they would need to build the image and fetch the CLI from inside the container image. Note that I'm still avoiding building the Darwin and Windows CLIs on ARM systems to improve the build speed. Note that I've added as a temporary workaround this: https://github.com/argoproj/argo-cd/pull/3554/files#diff-54d4bdaa54a651a05076c4dfffacfed1R14-R18 Build output can be seen here: https://cloud.drone.io/alinbalutoiu/argo-cd/18 |
I think we should integrate their build into the release process and publish the binaries from the releases page, so that people wanting to use the ARM binaries for the CLI do not have to build a complete image themselves.
I've already seen that, but thanks for the additional hint. I guess we can fix that until the next release. On a second thought, maybe it might even make sense to setup a Drone pipeline for building all Docker images without pushing them. Thanks for providing your drone.yml configuration, I'll see what I can do from it! :)
It's green, as well as the CircleCI checks. 🎉 |
jannfis
left a comment
There was a problem hiding this comment.
LGTM, thanks for this PR and the discussions!
If you're interested in the Drone pipeline which builds the Docker images for ARM without pushing them here it is: alinbalutoiu@c54e5d9 Glad to see this being merged, thanks for the review and merging the PR! |
|
@alinbalutoiu Using |
|
@LS80 thanks for noticing that, I built yesterday the images for the latest version and it worked fine, but I have checked only with helm. I'll look into the issue with kustomize. |
|
Are you still looking for a home to build for arm and arm64? |
|
Was able to use @alinbalutoiu ARM built containers to deploy argo-cd quite easily: |
|
I am maintaining my fork of argocd in which the only addition is a custom CI pipeline which builds images for aarch64 and amd64, and pushes them to quay.io/paulfantom/argocd. This uses github actions and doesn't need any external hosting. Personally, I don't have time to make this part of argocd project but if anyone wants to integrate it into argo-cd project and needs help in understanding how it works feel free to reach out. |
|
That looks great @paulfantom , thanks for sharing it. I will look into integrating it in the ArgoCD project when I get the time. |
Any plans to create new CI which builds ARM arch too ? |
Since ArgoCD is written in Go, the code can be compiled on other architectures as well.
Unfortunately, I haven't found an option for CircleCI to run the build on the ARM architecture, so there are no automated builds for the ARM images.
For the convenience, I have created a Drone pipeline which supports both arm and arm64 to show the build status for the ARM images for this PR: https://cloud.drone.io/alinbalutoiu/argo-cd/13
Images are being pushed automatically to https://hub.docker.com/r/alinbalutoiu/argocd/tags
To build the ARM images, you need to run
make armimagefrom an arm device (such as a raspberry pi for example).It is currently running on my home Raspberry Pi 4 without any issues.
Closes #2167
Closes #3120
Checklist: