-
Notifications
You must be signed in to change notification settings - Fork 349
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
fix: Add M1/ARM support for the test suite #516
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for the PR @fizx ! Just a few questions on whether we could avoid another docker-compose file, but thanks for proactively tackling this!
docker-compose.aarch64.yml
Outdated
context: . | ||
dockerfile: "protoc.Dockerfile" | ||
args: | ||
- "ARCH=aarch_64" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hm, could we avoid a separate docker-compose.aarch64.yml
and instead do something like ARCH=${ARCH:-x86_64}
and pass in ARCH
from aliases.sh
?
@@ -1,10 +1,11 @@ | |||
# Docker image for protoc | |||
FROM node:17-alpine3.14 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fwiw I think we could also make this:
FROM --platform=linux/amd64 node:17-alpine3.13
Which would tell docker to just always run this as x86, even on M1s...
I think I slightly prefer that for simplicity, b/c this is meant as just a helper to execute protoc and so I don't think the perf overhead of emulating the x86 on an M1 would be a big deal/afaiu.
@boukeversteegh do you have any preference on which approach?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@stephenh please see my reply below. reply-by-mail doesn't seem to work as well
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ah yep! I saw it, was just deferring to @fizx ; I guess specifically I'd like to avoid introducing a 2nd docker-compose.yml
, so Kyle I think it's up to you if you'd like to either:
- Update the current
docker-compose.yml
to take a$ARCH
-type arg, or - Update the
FROM
to just always use--platform=linux/amd64
Fwiw here's a snippet of how we use a "sometimes-set-but-default-in-case" build arg in one of our docker-compose.yml
s:
db:
build:
context: .
dockerfile: ./db.dockerfile
args:
TEST_PARALLELISM: ${TEST_PARALLELISM:-8}
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Specifying architectures in the FROM line has been a source of much pain for me when porting other code to M1/ARM. I hope the updated solution is simple enough.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@fizx ah sure! I just know that it's a thing (pinning an architecture in FROM
); I haven't really used it personally / don't own an M1, so happy to defer since that's been a source of issues.
The ARCH build arg looks great, thanks!
Nice to support the new macs of course!
If it can be done with a single config for all systems, I'd say that this
would be better. The eventual compilation of proto files to TS has to be
fast too though, but then we need to decide whether or not providing an
optimized dockerized protoc is within the scope of the project or not.
I'd say for now that x86 sounds good if it does the job to keep the setup
small and simple, but open to hear other ideas.
…On Sat, Feb 19, 2022, 01:04 Stephen Haberman ***@***.***> wrote:
***@***.**** commented on this pull request.
Thanks for the PR @fizx <https://github.com/fizx> ! Just a few questions
on whether we could avoid another docker-compose file, but thanks for
proactively tackling this!
------------------------------
In docker-compose.aarch64.yml
<#516 (comment)>:
> @@ -0,0 +1,11 @@
+version: "3"
+services:
+ protoc:
+ build:
+ context: .
+ dockerfile: "protoc.Dockerfile"
+ args:
+ - "ARCH=aarch_64"
Hm, could we avoid a separate docker-compose.aarch64.yml and instead do
something like ARCH=${ARCH:-x86_64} and pass in ARCH from aliases.sh?
------------------------------
In protoc.Dockerfile
<#516 (comment)>:
> @@ -1,10 +1,11 @@
# Docker image for protoc
FROM node:17-alpine3.14
Fwiw I think we could also make this:
FROM --platform=linux/amd64 node:17-alpine3.13
Which would tell docker to just always run this as x86, even on M1s...
I think I slightly prefer that for simplicity, b/c this is meant as just a
helper to execute protoc and so I don't think the perf overhead of
emulating the x86 on an M1 would be a big deal/afaiu.
@boukeversteegh <https://github.com/boukeversteegh> do you have any
preference on which approach?
—
Reply to this email directly, view it on GitHub
<#516 (review)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AAANFJTS7S55662E2VLB7HTU33M7XANCNFSM5OZBDNPQ>
.
You are receiving this because you were mentioned.Message ID:
***@***.***>
|
On my M1, the dockerfile now builds, and yarn build:test now works. Code should be cleaner too.
|
## [1.106.2](v1.106.1...v1.106.2) (2022-02-27) ### Bug Fixes * Add M1/ARM support for the test suite ([#516](#516)) ([7cf5625](7cf5625))
🎉 This PR is included in version 1.106.2 🎉 The release is available on: Your semantic-release bot 📦🚀 |
Fixes #515