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 a simple way to run grpc-java test inside emulated ARM64 docker container #7812

Merged
merged 2 commits into from
Jan 19, 2021

Conversation

jtattermusch
Copy link
Contributor

Not ready to merge, but demonstrates a neat way how to test grpc-java on x86 using a docker container and ARM emulator with just a few commands.

FTR I tried this on my linux workstation and the entire build & tests took ~40mins (which is reasonable considering the fact that the ARM environment is being emulated).

CC @ejona86

Copy link
Member

@ejona86 ejona86 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why do you say this isn't ready for merge?

It's pretty reasonable already, although I do think I'd suggest changing it to be closer to run_in_docker.sh: it shouldn't hard-code what to run and instead you should pass the command you want to run. The chmod stuff isn't necessary here though, as it is its own environment that doesn't need to mix with the normal development. But we probably do want to keep the workdir in a bind-mounted folder so that the build results can be dug through if there are failures or the like. It'd be harder, but we could also configure gradle to write to a different output directory (using -PbuildDir=build-arm or putting it in ~/.gradle/; it looks like that exposes some build script issues though).

But I'd be okay if those sorts of things were done in follow-ups as they prove helpful.

buildscripts/grpc-java-linux-arm64-tests/Dockerfile Outdated Show resolved Hide resolved
@jtattermusch jtattermusch changed the title DO NOT MERGE: add a simple way to run grpc-java test inside emulated ARM64 docker container Add a simple way to run grpc-java test inside emulated ARM64 docker container Jan 18, 2021
Copy link
Contributor Author

@jtattermusch jtattermusch left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ok, this is now ready for final review.

  • grpc-java workspace gets used directly (no copies)
  • it now sets the docker --user option to avoid polluting the grpc-java workspace with files owned by root
  • overall I'm happy that the solution ended up being quite minimalist and it's still pretty easy to use.

@jtattermusch jtattermusch marked this pull request as ready for review January 19, 2021 10:43
@ejona86 ejona86 merged commit 76c5a65 into grpc:master Jan 19, 2021
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Jun 3, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants