8000 Release ARM CLI artifacts by aliariff · Pull Request #4841 · linkerd/linkerd2 · GitHub
[go: up one dir, main page]

Skip to content

Release ARM CLI artifacts - #4841

Merged
alpeb merged 3 commits into
linkerd:mainfrom
aliariff:release-arm-artifacts
Aug 11, 2020
Merged

alpeb merged 3 commits into
linkerd:mainfrom
aliariff:release-arm-artifacts

Conversation

@aliariff
@aliariff aliariff commented Aug 5, 2020 •
Copy link
Copy Markdown
Contributor

@cpretzer @alpeb @kleimkuhler

Changes

  • Only push single docker image arch amd64 for cli-bin. Inside that image, it will consist of multiple architecture binary files. It used the multi-stage build pattern to produce those binaries. Ref
  • Add the arch name on the binary filename.

TODO

Note

  • Installer script for brew formula does not need a change, because it builds the binary directly instead of download the existing binary. Brew Formula

Manual tested in a local fork. https://github.com/aliariff/linkerd2/releases/tag/stable-test

Signed-off-by: Ali Ariff <ali.ariff12@gmail.com>
@aliariff
aliariff requested a review from a team as a code owner August 5, 2020 18:44
Signed-off-by: Ali Ariff <ali.ariff12@gmail.com>
@alpeb alpeb left a comment
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Thanks @aliariff 👍

I'm testing this locally with

DOCKER_BUILDKIT=1 DOCKER_MULTIARCH=1 DOCKER_PUSH=1 bin/docker-build-cli-bin

The final image gets built and pushed into gcr.io correctly, tagged gcr.io/linkerd-io/cli-bin:git-22f8aee9.
But the command ends with an error:

...
 => [stage-4 2/2] COPY --from=golang /out /out                                                                                                                                                                                            0.3s
 => exporting to image                                                                                                                                                                                                                   62.1s
 => => exporting layers                                                                                                                                                                                                                   7.2s
 => => exporting manifest sha256:da4812de895590b912ae0b77ebf74f567e381dad92c47af114edbb039a503d98                                                                                                                                         0.0s
 => => exporting config sha256:b3581bfd2021e102695d84acd8cf8aa508e57ad0c1aaade811962a846b78a388                                                                                                                                           0.0s
 => => pushing layers                                                                                                                                                                                                                    53.7s
 => => pushing manifest for gcr.io/linkerd-io/cli-bin:git-22f8aee9                                                                                                                                                                        1.1s
gcr.io/linkerd-io/cli-bin:git-22f8aee9
/home/alpeb/src/pr/4841/linkerd2/target/cli/darwin/linkerd
/home/alpeb/src/pr/4841/linkerd2/target/cli/windows/linkerd
/home/alpeb/src/pr/4841/linkerd2/target/cli/linux-amd64/linkerd
Error: No such container:path: 4e05b40b37f90fb3f649aa261dbfe83d821965ffed9a17f6cbf4a6ebc0ed8867:/out/linkerd-linux-arm64

And the arm binaries aren't getting copied to ./target/cli.
I think what's happening is that in the last part of bin/docker-build-cli-bin there's a docker create "$IMG" which is picking an image that resides locally in docker images, which is an intermediary image (that doesn't have the arm binaries) and not the same final one that got pushed into gcr.io.

If I issue:

DOCKER_MULTIARCH=1 bin/docker-pull-binaries git-22f8aee9

Then that local image is replaced by the full one, and indeed I succeeded on copying out of it the arm binaries.

This might happen because we couldn't use --load in docker build buildx so the final image is pushed but not loaded locally and so the last part of bin/docker-build-cli-bin can't access it. A workaround would be to pull the image before doing the copying.

...But maybe it's not suitable to use --platform=amd64 in this case? Not only because we're just targeting one arch, but If we remove that we can use --load and then the build script will be able to use local images. Let me know what you think.

@alpeb
alpeb commented Aug 5, 2020
Copy link
Copy Markdown
Member

Sorry @aliariff , my last comment was utter nonsense! I had seemingly previously built a single arch image and that's what the script used. After clearing my local cache it's working fine. I'll test now the release in my fork and report back.

@alpeb alpeb left a comment
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

The release workflow is working fine 👍

image

Would you push an empty commit to trigger the build again? It ran fine but it didn't got reported back into the PR.

Signed-off-by: Ali Ariff <ali.ariff12@gmail.com>
@aliariff
aliariff force-pushed the release-arm-artifacts branch from 1c8e7f8 to b7fc557 Compare August 6, 2020 00:16
@kleimkuhler kleimkuhler left a comment
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Thanks for testing this in your fork @alpeb.

Changes look good to me.

@alpeb
alpeb commented Aug 6, 2020
Copy link
Copy Markdown
Member

Before merging this one up, we'll wait for linkerd/website#785 to get merged first.

@alpeb
alpeb merged commit ae8bb0e into linkerd:main Aug 11, 2020
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.

3 participants

0