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

CI: Build multi-platform Docker images #727

Merged
merged 27 commits into from
Oct 2, 2020

Conversation

rinx
Copy link
Contributor

@rinx rinx commented Sep 25, 2020

Description:

  • use buildx for docker builds
  • build amd64 & arm64 images (nightly, tags)
  • publish to docker.io and ghcr.io

Related Issue:

Nothing

How Has This Been Tested?:

Nothing

Environment:

  • Go Version: 1.15.2
  • Docker Version: 19.03.8
  • Kubernetes Version: 1.18.2
  • NGT Version: 1.12.1

Types of changes:

  • Bug fix [type/bug]
  • New feature [type/feature]
  • Add tests [type/test]
  • Security related changes [type/security]
  • Add documents [type/documentation]
  • Refactoring [type/refactoring]
  • Update dependencies [type/dependency]
  • Update benchmarks and performances [type/bench]
  • Update CI [type/ci]

Changes to Core Features:

  • Have you added an explanation of what your changes do and why you'd like us to include them?
  • Have you written new tests for your core changes, as applicable?
  • Have you successfully ran tests with your changes locally?

Checklist:

  • I have read the CONTRIBUTING document.
  • I have checked open Pull Requests for the similar feature or fixes?
  • I have added tests and benchmarks to cover my changes.
  • I have ensured all new and existing tests passed.
  • I have commented my code, particularly in hard-to-understand areas
  • I have updated the documentation accordingly.

@vdaas-ci
Copy link
Collaborator

[CHATOPS:HELP] ChatOps commands.

  • 🙆‍♀️ /approve - approve
  • 💌 /changelog - add changelog comment
  • 🍱 /format - format codes and add licenses
  • /gen-test - generate test codes
  • 🏷️ /label - add labels
  • /rebase - rebase master

@rinx rinx force-pushed the feature/ci/multi-platform-docker-images branch 4 times, most recently from 1789c41 to 75f5ff1 Compare September 25, 2020 09:43
@github-actions github-actions bot added size/L and removed size/M labels Sep 28, 2020
@rinx rinx force-pushed the feature/ci/multi-platform-docker-images branch 7 times, most recently from 342d715 to e818805 Compare October 1, 2020 08:54
@kpango
Copy link
Collaborator

kpango commented Oct 2, 2020

could you please write a description ?
I understand multi-platform buildx feature and CI's but I don't get about BASE_TAG resouns and others

@rinx
Copy link
Contributor Author

rinx commented Oct 2, 2020

introduced BASE_TAG because using 'latest' tag is a bad practice.

@rinx
Copy link
Contributor Author

rinx commented Oct 2, 2020

/rebase

@vdaas-ci
Copy link
Collaborator

vdaas-ci commented Oct 2, 2020

[REBASE] Rebase triggered by rinx for branch: feature/ci/multi-platform-docker-images

Signed-off-by: Rintaro Okamura <rintaro.okamura@gmail.com>
Signed-off-by: Rintaro Okamura <rintaro.okamura@gmail.com>
Signed-off-by: Rintaro Okamura <rintaro.okamura@gmail.com>

:green_heart: fix build

Signed-off-by: Rintaro Okamura <rintaro.okamura@gmail.com>

:green_heart: fix platforms

Signed-off-by: Rintaro Okamura <rintaro.okamura@gmail.com>
Signed-off-by: Rintaro Okamura <rintaro.okamura@gmail.com>
Signed-off-by: Rintaro Okamura <rintaro.okamura@gmail.com>
rinx added 10 commits October 2, 2020 01:56
Signed-off-by: Rintaro Okamura <rintaro.okamura@gmail.com>
Signed-off-by: Rintaro Okamura <rintaro.okamura@gmail.com>
Signed-off-by: Rintaro Okamura <rintaro.okamura@gmail.com>
Signed-off-by: Rintaro Okamura <rintaro.okamura@gmail.com>
Signed-off-by: Rintaro Okamura <rintaro.okamura@gmail.com>
Signed-off-by: Rintaro Okamura <rintaro.okamura@gmail.com>
Signed-off-by: Rintaro Okamura <rintaro.okamura@gmail.com>
Signed-off-by: Rintaro Okamura <rintaro.okamura@gmail.com>
Signed-off-by: Rintaro Okamura <rintaro.okamura@gmail.com>
Signed-off-by: Rintaro Okamura <rintaro.okamura@gmail.com>
@vdaas-ci vdaas-ci force-pushed the feature/ci/multi-platform-docker-images branch from e42034f to 45c1faa Compare October 2, 2020 01:56
@rinx rinx marked this pull request as ready for review October 2, 2020 01:57
@rinx rinx requested a review from kpango October 2, 2020 01:57
Copy link
Collaborator

@kpango kpango left a comment

Choose a reason for hiding this comment

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

Others looks good to me

&& rm "go${GO_VERSION}.linux-amd64.tar.gz" \
&& ln -s /opt/go/bin/go /usr/bin/ \
COPY --from=golang /usr/local/go /opt/go
RUN ln -s /opt/go/bin/go /usr/bin/ \
Copy link
Collaborator

Choose a reason for hiding this comment

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

$GOROOT/bin includes multiple binary. it would be better to add $GOROOT/bin to $PATH

Copy link
Contributor Author

Choose a reason for hiding this comment

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

thanks. fixed

Signed-off-by: Rintaro Okamura <rintaro.okamura@gmail.com>
Comment on lines 43 to 44
COPY --from=golang /usr/local/go /opt/go
RUN ln -s /opt/go/bin/go /usr/bin/ \
Copy link
Collaborator

Choose a reason for hiding this comment

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

Suggested change
COPY --from=golang /usr/local/go /opt/go
RUN ln -s /opt/go/bin/go /usr/bin/ \
COPY --from=golang /usr/local/go ${GOROOT}
RUN ln -s ${GOROOT}/bin/go /usr/bin/ \

Copy link
Contributor Author

Choose a reason for hiding this comment

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

revised but it's different a little

Signed-off-by: Rintaro Okamura <rintaro.okamura@gmail.com>
kpango
kpango previously approved these changes Oct 2, 2020
@kpango
Copy link
Collaborator

kpango commented Oct 2, 2020

/rebase
/format
/approve

@vdaas-ci
Copy link
Collaborator

vdaas-ci commented Oct 2, 2020

[REBASE] Rebase triggered by kpango for branch: feature/ci/multi-platform-docker-images

@vdaas-ci
Copy link
Collaborator

vdaas-ci commented Oct 2, 2020

[FORMAT] Updating license headers and formatting go codes triggered by kpango.

vdaas-ci
vdaas-ci previously approved these changes Oct 2, 2020
Copy link
Collaborator

@vdaas-ci vdaas-ci left a comment

Choose a reason for hiding this comment

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

[APPROVED] This PR is approved by kpango.

@rinx
Copy link
Contributor Author

rinx commented Oct 2, 2020

I'm checking the failed CI build. please wait for a moment.

@rinx
Copy link
Contributor Author

rinx commented Oct 2, 2020

it failed on exporting layer phase because of 500 error of the registry. i've just restarted it.

Signed-off-by: Rintaro Okamura <rintaro.okamura@gmail.com>
@rinx rinx dismissed stale reviews from vdaas-ci and kpango via ec8bf00 October 2, 2020 02:47
Signed-off-by: Rintaro Okamura <rintaro.okamura@gmail.com>
@kpango kpango merged commit 0d5880f into master Oct 2, 2020
@kpango kpango deleted the feature/ci/multi-platform-docker-images branch October 2, 2020 05:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants