-
Notifications
You must be signed in to change notification settings - Fork 769
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
ci: add support for linux-arm64 build #1214
Changes from 42 commits
611f66b
03f7631
c3d5fcc
d20df49
e2a8c75
8208229
927736e
0e5f3e6
7504f0d
605f574
c93a7f3
46cd321
f7e6989
26cbde8
46a7f0b
2fa7291
2e3b22f
73bf94e
175dfc5
7e7ee99
f9ee704
5ff797f
764d23f
8bb73b8
dc05c39
93f2c1e
61c715f
3f7fc65
04bedb6
e58e92b
0205739
0a16573
b375768
f906868
015c182
36781de
cc73353
79f3e37
ebc5de8
72b45c8
daee554
2b9437a
1218cd5
af7b7be
b719fe8
0abe741
74957f6
d8be410
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -19,22 +19,24 @@ | |
# Stage 1: Fetch binaries | ||
###################################### | ||
# node:... Docker image is based on buildpack-deps:stretch | ||
FROM buildpack-deps:stretch AS prepare | ||
FROM buildpack-deps:bullseye AS prepare | ||
|
||
ARG BUILDIFIER_VERSION=1.0.0 | ||
ARG BUILDIFIER_VERSION=5.1.0 | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This change is required because Buildifier 1.0.0 does not exist for arm64 |
||
ARG PROTOBUF_VERSION=3.19.4 | ||
ARG TARGETARCH | ||
|
||
RUN apt-get -qq update && apt-get -qq install -y curl unzip | ||
|
||
WORKDIR /tmp | ||
|
||
RUN curl -sSL https://github.com/protocolbuffers/protobuf/releases/download/v$PROTOBUF_VERSION/\ | ||
protoc-$PROTOBUF_VERSION-linux-x86_64.zip -o protoc.zip && \ | ||
RUN case $TARGETARCH in arm64) arch="aarch_64"; ;; amd64) arch="x86_64"; ;; *) echo "ERROR: Machine type $TARGETARCH not supported."; ;; esac && \ | ||
curl -sSL https://github.com/protocolbuffers/protobuf/releases/download/v$PROTOBUF_VERSION/\ | ||
protoc-$PROTOBUF_VERSION-linux-$arch.zip -o protoc.zip && \ | ||
unzip -qq protoc.zip && \ | ||
cp ./bin/protoc /usr/local/bin/protoc | ||
|
||
RUN wget -nv -O buildifier \ | ||
https://github.com/bazelbuild/buildtools/releases/download/$BUILDIFIER_VERSION/buildifier && \ | ||
https://github.com/bazelbuild/buildtools/releases/download/$BUILDIFIER_VERSION/buildifier-linux-$TARGETARCH && \ | ||
chmod +x ./buildifier && \ | ||
cp ./buildifier /usr/local/bin/buildifier | ||
|
||
|
@@ -49,10 +51,11 @@ RUN ./scripts/init_submodules.sh | |
###################################### | ||
# Stage 2: Copy source files and build | ||
###################################### | ||
FROM node:12.22.6-stretch AS copy-and-build | ||
FROM node:16-bullseye AS copy-and-build | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This change prevents the following error under arm64 when running the closure compiler as follows:
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. |
||
|
||
ARG MAKEFLAGS=-j8 | ||
ARG BAZEL_VERSION=4.1.0 | ||
ARG BAZELISK_VERSION=1.11.0 | ||
ARG TARGETARCH | ||
|
||
RUN mkdir -p /var/www/html/dist | ||
RUN echo "\nloglevel=error\n" >> $HOME/.npmrc | ||
|
@@ -61,12 +64,10 @@ COPY --from=prepare /usr/local/bin/protoc /usr/local/bin/ | |
COPY --from=prepare /usr/local/bin/buildifier /usr/local/bin/ | ||
COPY --from=prepare /github/grpc-web/third_party /github/grpc-web/third_party | ||
|
||
RUN wget -nv -O bazel-installer.sh \ | ||
https://github.com/bazelbuild/bazel/releases/download/$BAZEL_VERSION/\ | ||
bazel-$BAZEL_VERSION-installer-linux-x86_64.sh && \ | ||
chmod +x ./bazel-installer.sh && \ | ||
./bazel-installer.sh && \ | ||
rm ./bazel-installer.sh | ||
RUN wget -nv -O /usr/local/bin/bazelisk \ | ||
https://github.com/bazelbuild/bazelisk/releases/download/v$BAZELISK_VERSION/bazelisk-linux-$TARGETARCH && \ | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Use of bazelisk is required, since There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Thanks for the explanation! May i ask you a favor to list out all the dependency updates you've made in this PR in a bullet-point summary? (Feel free to mention all other notable changes you made as well!) |
||
chmod +x /usr/local/bin/bazelisk && \ | ||
bazelisk | ||
|
||
WORKDIR /github/grpc-web | ||
|
||
|
@@ -75,8 +76,8 @@ WORKDIR /github/grpc-web | |
COPY ./WORKSPACE ./WORKSPACE | ||
COPY ./javascript/net/grpc/web/generator javascript/net/grpc/web/generator | ||
|
||
RUN bazel build javascript/net/grpc/web/generator:protoc-gen-grpc-web && \ | ||
cp $(bazel info bazel-genfiles)/javascript/net/grpc/web/generator/protoc-gen-grpc-web \ | ||
RUN bazelisk build javascript/net/grpc/web/generator:protoc-gen-grpc-web && \ | ||
cp $(bazelisk info bazel-genfiles)/javascript/net/grpc/web/generator/protoc-gen-grpc-web \ | ||
/usr/local/bin/protoc-gen-grpc-web | ||
|
||
COPY ./javascript ./javascript | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
group "release" { | ||
strophy marked this conversation as resolved.
Show resolved
Hide resolved
|
||
targets = ["prereqs", "protoc-plugin"] | ||
} | ||
|
||
target "prereqs" { | ||
dockerfile = "./net/grpc/gateway/docker/prereqs/Dockerfile" | ||
} | ||
|
||
target "protoc-plugin" { | ||
dockerfile = "./net/grpc/gateway/docker/protoc_plugin/Dockerfile" | ||
tags = ["docker.io/grpcweb/protoc-plugin"] | ||
contexts = { | ||
"grpcweb/prereqs" = "target:prereqs" | ||
} | ||
} |
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.
This change was made to match base image versions with the requirement to use
node16:bullseye
below