-
Notifications
You must be signed in to change notification settings - Fork 149
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
Added support for linux/arm64 images in helm-charts #348
Conversation
6157f03
to
c2e1016
Compare
ADD https://binaries.cockroachdb.com/cockroach-v23.1.2.linux-amd64.tgz . | ||
RUN tar -zxvf cockroach-v23.1.2.linux-amd64.tgz | ||
RUN if [ "$TARGETPLATFORM" = "linux/amd64" ]; then GOARCH=amd64; elif [ "$TARGETPLATFORM" = "linux/arm64" ]; then GOARCH=arm64; else GOARCH=amd64; fi && \ | ||
curl -sS -L -O https://binaries.cockroachdb.com/cockroach-v23.1.2.linux-${GOARCH}.tgz && \ |
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.
A nit. Can you update the crdb version to the latest one? As a bonus you can move it to a variable which can be passed in. Not a blocker though, feel free to do this as a separate PR.
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.
I did even better, now the self-signer automatically picks up the latest cockroach binary version defined in the Chart.yaml. Now, no need for special code changes to upgrade cockroach binary in docker image. Please have a look.
@@ -18,13 +18,16 @@ COPY cmd/ cmd/ | |||
COPY pkg/ pkg/ | |||
|
|||
# Build the binary self-signer utility | |||
RUN go build -a -installsuffix cgo -o self-signer cmd/main.go | |||
RUN go build -o self-signer cmd/main.go | |||
|
|||
# Install the cockroach CLI |
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.
A nit. "cockroach CLI" means cockroach-cli
, which is a separate binary and doesn't contain any "server" code. Maybe adjust the comment to something like "Install the cockroach binary"?
@@ -706,3 +706,6 @@ spec: | |||
name: Helm Community | |||
url: https://artifacthub.io/packages/helm/cockroachdb/cockroachdb | |||
version: VERSION | |||
labels: | |||
operatorframework.io/arch.amd64: supported | |||
operatorframework.io/arch.arm64: supported |
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.
Yassss!!!!
c2e1016
to
9fddb04
Compare
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 these changes!
|
||
- name: Set up Docker Buildx | ||
uses: docker/setup-buildx-action@v2 | ||
|
||
- name: Login to GCR | ||
uses: docker/login-action@v1 |
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.
The latest version of this GitHub action is v3. Do you prefer to upgrade from v1?
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.
Upgrade to v3 will be done in separate PR.
@@ -43,15 +43,18 @@ jobs: | |||
- name: Checkout sources | |||
uses: actions/checkout@v2 | |||
|
|||
- name: Set up QEMU | |||
uses: docker/setup-qemu-action@v2 |
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.
The latest version of this GitHub action is v3. Do you prefer to upgrade from v2?
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.
Upgrade to v3 will be done in separate PR and will be done in all github actions.
uses: docker/setup-qemu-action@v2 | ||
|
||
- name: Set up Docker Buildx | ||
uses: docker/setup-buildx-action@v2 |
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.
The latest version of this GitHub action is v3. Do you prefer to upgrade from v2?
ADD https://binaries.cockroachdb.com/cockroach-v23.1.2.linux-amd64.tgz . | ||
RUN tar -zxvf cockroach-v23.1.2.linux-amd64.tgz | ||
# Install the cockroach binary | ||
RUN if [ "$TARGETPLATFORM" = "linux/amd64" ]; then GOARCH=amd64; elif [ "$TARGETPLATFORM" = "linux/arm64" ]; then GOARCH=arm64; else GOARCH=amd64; fi && \ |
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.
Just a minor point but if you were to add TARGETOS
and TARGETARCH
args then you can set GOOS
and GOARCH
to those values, respectively. Those args are passed in by docker buildx
(and by nerdctl build
) intrinsically.
I usually include the following block in my "build" stage so I see what's going on a bit more. I'm not suggesting this change but just putting it here for awareness. You can see where I set GOOS
and GOARCH
.
ARG BUILDOS
ARG BUILDPLATFORM
ARG BUILDARCH
ARG BUILDVARIANT
ARG TARGETPLATFORM
ARG TARGETOS
ARG TARGETARCH
ARG TARGETVARIANT
ARG BUILD_VERSION
ARG BUILD_COMMIT
RUN echo "Container image build platform details :: "
RUN echo "BUILDPLATFORM.....: $BUILDPLATFORM"
RUN echo "BUILDOS...........: $BUILDOS"
RUN echo "BUILDARCH.........: $BUILDARCH"
RUN echo "BUILDVARIANT......: $BUILDVARIANT"
RUN echo "Container image target platform details :: "
RUN echo "TARGETPLATFORM....: $TARGETPLATFORM"
RUN echo "TARGETOS..........: $TARGETOS"
RUN echo "TARGETARCH........: $TARGETARCH"
RUN echo "TARGETVARIANT.....: $TARGETVARIANT"
ENV GOOS=$TARGETOS
ENV GOARCH=$TARGETARCH
# Taints to be tolerated by the Pod of this Job. | ||
# https://kubernetes.io/docs/concepts/configuration/taint-and-toleration/ | ||
tolerations: [] | ||
|
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 adding these!
9fddb04
to
78dfebc
Compare
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.
LGTM
Fixes #330