-
Notifications
You must be signed in to change notification settings - Fork 136
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
[FR] gcr.io/bazel-public/bazel images for linux/arm64 #2020
Comments
@meteorcloudy just wanted to know if there's any blocker and/or "dependency" blocking this. From reading continuous-integration/bazel/oci/README.md Lines 1 to 10 in 9db28ad
I understand that the images are built anywhere and the only requirement is that whoever builds it should have push permissions to the registry. If so, would it be possible to do this? I understand it's labeled as Also, would you be open to automatically build the Docker image(s) with GitHub Actions? That way it would be fully automated. Thanks! |
One major blocker is that we don't currently have Linux arm64 machine on Bazel CI. One question, can we actually push different images for different arch under |
But even if you don't use it to run Bazel CI jobs in Can you confirm that the images are built by hand by one of you? Or you actually use some remote build servers and you don't have arm64 servers there to produce the image?
When I build images, I usually build multi-platform images with If you have access to an M{1,2,3,4} mac, you can try building a multi-platform image there. If so, you should use Docker Desktop because it already comes with muti-platform QEMU VMs that are needed to build such images. I'm happy to help with this, as I'd like to have the image so I can use it in my Mac! :) |
We are actually building those image in a CI pipeline on a GCP Linux VM, do you mean we can actually build the arm64 image on a amd64 machine by adding |
Out of curiosity, is the config for this setup public? I haven't checked the repo thoroughly, maybe it's already here :-?
You should probably be able to set it up, yeah. Docker Desktop in Mac already comes with the right QEMU VMs and all the "plumbing" so it's as easy as just using the From the link I pasted re. building multi-platform images, there are some prerequisites (mostly, enable the One of those is using build clusters with multiple native nodes but the other one is the one I mentioned, using QEMU VMs. Since you already run in a VM, I guess it'll all depend on being able to use nested virtualization and then, following those steps in the Docker docs to setup QEMU inside the VM and then setup Docker manually to run with QEMU. |
I've just checked and it looks like you are already using GH Actions to build the release for the It does support multi-platform images out-of-the-box: 😄 https://docs.docker.com/build/ci/github-actions/multi-platform/ And it'll be 10x easier than setting up a nested VM in GCP, I think! |
The pipeline config is at https://github.com/bazelbuild/continuous-integration/blob/master/pipelines/docker-update.yml
Hmm, the problem is that we still need to push the image to GCP's artifact registry, there is some security implications if we want to do it in GitHub Action. We currently don't have time to properly set that up. |
Ah, I see... then, here's another idea: You could setup and use the GH Action to create the Docker image and push it to GH's Also, if the image is in the GH registry, you can link the image to the repo. IMHO, this way, you get the best of both worlds: you get to build multi-platform images easily, the images are clearly associated to the repo and you get two mirrors for the images 🚀 Plus, the setup can be done in parallel, so that you keep the current external pipeline and only if everything looks good on the GH side, you can decide to change it to a "pull from What do you think? 😄 |
Sorry, I just don't see much value to create & maintain another pipeline for now. In fact, I don't quite understand why people need those docker image for Bazel at all. Why not just download the Bazel binary with Bazelisk? It's much easier. |
So then, why do you have Bazel CI images that don't use Bazelisk? And why are you basing your image off the official Ubuntu image? 😄 IMO people definitely will benefit from having official images in many ways. Here are a few off the top of my head:
Finally, re. maintaining two pipelines, you are already maintaining a bunch more, plus you already maintain a Github Workflow to publish the release artifact. Sure, it's one more pipeline, but it would take most of the actions off the current one, so you would be trading. The current build pipeline would just become a simple "sync pipeline". For the cost of "maintaining another pipeline", you would be gaining (1) another mirror for the images and more importantly (2) multiple platforms that people can then test against, using the official Bazel CI image. Currently, people can only test one architecture. In my book, it's a good trade-off. Anyway, thanks for all the info and explaining everything. If you change your mind, I'm happy to help with this! I'll probably build my own Bazel image and will probably setup the build pipeline, so it should be easy to copy it in here. If I do, I'll keep this issue up-to-date so we can talk more in the future about this. Thanks!! |
We are actually not using continuous-integration/buildkite/docker/ubuntu2404/Dockerfile Lines 71 to 72 in b05134e
which only has Bazelisk installed.
|
Here's my take on Bazel images being built with GH Actions: https://github.com/jjmaestro/bzldocker 😄
Oh, I see! Cool, thanks! I'll definitely have a look and compare with my approach!
Happy to kick it off! I can whip up something based off what I've been playing with in my repo and what you already have / already use. What do you think? |
@jjmaestro Sounds good! Maybe you can start a new proposal here https://github.com/bazel-contrib/SIG-rules-authors/discussions |
OK, I've checked IMHO
|
Cool! Will do! 🙌 Are there any guidelines about how to write a proposal? I'll go over open and closed ones to learn, but if there's any documentation, please let me know :) |
Following the "Getting Started with Bazel Docker Container" tutorial, I wanted to check the Bazel Docker image and when I tried it, I got the following warning:
Would it be possible to generate
gcr.io/bazel-public/bazel
images forlinux/arm64
to avoid having to run the image with Rosetta?Thanks!
The text was updated successfully, but these errors were encountered: