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

Add support for --docker_platform flag #994

Merged
merged 3 commits into from
Aug 8, 2023
Merged

Add support for --docker_platform flag #994

merged 3 commits into from
Aug 8, 2023

Conversation

lamcw
Copy link
Contributor

@lamcw lamcw commented Jan 24, 2023

When generating configs on a Mac (esp. ones with Apple silicon) using a Linux image, the docker daemon raises a warning

$ docker create --rm [a_linux_amd64_image] sleep infinity
The requested image's platform (linux/amd64) does not match the detected host platform (linux/arm64/v8) and no specific platform was requested
ff56913949408cfbad8d5b6d29888a741c2e1f2f3767695c78e75886619725ca

The rbe_config_gen expects the docker create command to return the container ID (which is 64 characters in length). The above warning breaks the contract and therefore will fail the config generation.

A possible solution is to add a --docker_platform flag to rbe_config_gen so that when it invokes docker create, a matching platform can be used to create the container (e.g. rbe_config_gen --docker_platform=linux/amd64 runs docker create --rm --platform linux/amd64 ...).

Closes #993

Signed-off-by: Thomas Lam <thomaslam@canva.com>
Signed-off-by: Thomas Lam <thomaslam@canva.com>
@lamcw
Copy link
Contributor Author

lamcw commented Aug 4, 2023

Hey @smukherj1 @DaveGay sorry for the ping, can you PTAL at this PR?

@DaveGay
Copy link
Collaborator

DaveGay commented Aug 4, 2023

Change looks good but buildkite doesn't seem to like it?

@lamcw
Copy link
Contributor Author

lamcw commented Aug 8, 2023

@DaveGay the error is in master as well https://buildkite.com/bazel/bazel-toolchains/builds/26184#0189d288-690f-431f-8e65-12afd8d9526c

Can we merge this and fix the buildifier error in a follow up PR?

@DaveGay DaveGay merged commit 059f56e into bazelbuild:master Aug 8, 2023
2 checks passed
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.

Running rbe_configs_gen on macOS for Apple Silicon to generate configs for x86 Linux doesn't work
2 participants