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

Switch to docker buildx for conformance image #98569

Merged
merged 1 commit into from
Jan 29, 2021

Conversation

saschagrunert
Copy link
Member

What type of PR is this?

/kind cleanup

What this PR does / why we need it:

The conformance test image previously used the FROM --platform …
syntax which is something we (SIG Release) consider as deprecated.

Therefore we now switch to docker buildx, which can specify the
--platform directly.

Which issue(s) this PR fixes:

None

Special notes for your reviewer:

Does this PR introduce a user-facing change?:

None

Additional documentation e.g., KEPs (Kubernetes Enhancement Proposals), usage docs, etc.:

None

/cc @kubernetes/release-engineering
/sig release testing
/priority important-soon

The conformance test image previously used the `FROM --platform …`
syntax which is something we (SIG Release) consider as deprecated.

Therefore we now switch to `docker buildx`, which can specify the
`--platform` directly.

Signed-off-by: Sascha Grunert <mail@saschagrunert.de>
@k8s-ci-robot k8s-ci-robot added release-note-none Denotes a PR that doesn't merit a release note. kind/cleanup Categorizes issue or PR as related to cleaning up code, process, or technical debt. size/S Denotes a PR that changes 10-29 lines, ignoring generated files. sig/release Categorizes an issue or PR as relevant to SIG Release. sig/testing Categorizes an issue or PR as relevant to SIG Testing. priority/important-soon Must be staffed and worked on either currently, or very soon, ideally in time for the next release. cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. labels Jan 29, 2021
@k8s-ci-robot
Copy link
Contributor

@saschagrunert: This issue is currently awaiting triage.

If a SIG or subproject determines this is a relevant issue, they will accept it by applying the triage/accepted label and provide further guidance.

The triage/accepted label can be added by org members by writing /triage accepted in a comment.

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository.

@k8s-ci-robot k8s-ci-robot added the needs-triage Indicates an issue or PR lacks a `triage/foo` label and requires one. label Jan 29, 2021
@k8s-ci-robot k8s-ci-robot added area/conformance Issues or PRs related to kubernetes conformance tests area/release-eng Issues or PRs related to the Release Engineering subproject labels Jan 29, 2021
@dims
Copy link
Member

dims commented Jan 29, 2021

/approve

@saschagrunert leaving lgtm to one of the release folks as i am hoping this gets tested by hand before merging as well.

@k8s-ci-robot k8s-ci-robot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Jan 29, 2021
docker buildx build \
--platform linux/${ARCH} \
--load \
--pull \
Copy link
Contributor

Choose a reason for hiding this comment

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

@saschagrunert are we not concerned about the base image caching issue that previously broke this when switching to buildx? (see #97982 for more info)

Copy link
Member Author

@saschagrunert saschagrunert Jan 29, 2021

Choose a reason for hiding this comment

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

Just a bit (?) 😇

I tested it right now and it seems to work:
https://console.cloud.google.com/cloud-build/builds/478d0c13-4dfc-4f0c-9d82-5fff0708c810?project=kubernetes-release-test

Can you share some more insights which error cases we might face?

Copy link
Contributor

Choose a reason for hiding this comment

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

@saschagrunert we were previously hitting a bug with the base image not being cached on registry mirror, but it is possible that issue has been addressed on GCR side (#92042) 👍

Copy link
Member

Choose a reason for hiding this comment

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

this is also addressed on the buildx side going forward (should fallback to the non mirror endpoint like docker build does), thought it may be some time before we're using the patched version.

Copy link
Contributor

@hasheddan hasheddan left a comment

Choose a reason for hiding this comment

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

/lgtm

@k8s-ci-robot k8s-ci-robot added the lgtm "Looks good to me", indicates that a PR is ready to be merged. label Jan 29, 2021
@k8s-ci-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: dims, hasheddan, saschagrunert

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@hasheddan
Copy link
Contributor

/retest

@fejta-bot
Copy link

/retest
This bot automatically retries jobs that failed/flaked on approved PRs (send feedback to fejta).

Review the full test history for this PR.

Silence the bot with an /lgtm cancel or /hold comment for consistent failures.

1 similar comment
@fejta-bot
Copy link

/retest
This bot automatically retries jobs that failed/flaked on approved PRs (send feedback to fejta).

Review the full test history for this PR.

Silence the bot with an /lgtm cancel or /hold comment for consistent failures.

@k8s-ci-robot k8s-ci-robot merged commit b184272 into kubernetes:master Jan 29, 2021
@k8s-ci-robot k8s-ci-robot added this to the v1.21 milestone Jan 29, 2021
@saschagrunert saschagrunert deleted the conformance-buildx branch February 1, 2021 07:40

docker build --pull -t ${REGISTRY}/conformance-${ARCH}:${VERSION} ${TEMP_DIR}
docker buildx build \
Copy link
Member

Choose a reason for hiding this comment

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

  • where is buildx being initialized in the case that the host does not have it initialized already?
  • we're not setting the DOCKER_CLI_EXPERIMENTAL=enabled anywhere that I see either?

Copy link
Member Author

Choose a reason for hiding this comment

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

  • where is buildx being initialized in the case that the host does not have it initialized already?

Currently nowhere, we have an init-buildx.sh script in k/release which could be vendored over here: https://github.com/kubernetes/release/blob/master/hack/init-buildx.sh

Do we wanna do that?

  • we're not setting the DOCKER_CLI_EXPERIMENTAL=enabled anywhere that I see either?

Same as above, the CI / release process right now ensures that it is set. Following docker versions will set it per default as well: https://github.com/docker/cli/blob/e31e00585363e6a989e37fa92cf06481ea218344/docs/deprecated.md#configuration-options-for-experimental-cli-features

Anyways, we can still add it to the build scripts, which should not hurt.

Copy link
Contributor

Choose a reason for hiding this comment

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

@saschagrunert Related: looks like we are not setting it currently in the build canary (https://prow.k8s.io/view/gcs/kubernetes-jenkins/logs/ci-kubernetes-build-canary/1355584153801723904)

Do you want to go ahead and handle setup in k/k or try to just fix jobs in intermediate?

Copy link
Member

Choose a reason for hiding this comment

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

Currently nowhere, we have an init-buildx.sh script in k/release which could be vendored over here: https://github.com/kubernetes/release/blob/master/hack/init-buildx.sh

well I'd say yes, but the original source for that is in fact:
https://github.com/kubernetes-sigs/kind/commits/master/hack/build/init-buildx.sh
🙃

Without this, you can't consistently rely on there being a builder provisioned, causing builds to fail on clean hosts (except on docker desktop, where there's one provided OOTB).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
approved Indicates a PR has been approved by an approver from all required OWNERS files. area/conformance Issues or PRs related to kubernetes conformance tests area/release-eng Issues or PRs related to the Release Engineering subproject cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. kind/cleanup Categorizes issue or PR as related to cleaning up code, process, or technical debt. lgtm "Looks good to me", indicates that a PR is ready to be merged. needs-triage Indicates an issue or PR lacks a `triage/foo` label and requires one. priority/important-soon Must be staffed and worked on either currently, or very soon, ideally in time for the next release. release-note-none Denotes a PR that doesn't merit a release note. sig/release Categorizes an issue or PR as relevant to SIG Release. sig/testing Categorizes an issue or PR as relevant to SIG Testing. size/S Denotes a PR that changes 10-29 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

6 participants