-
Notifications
You must be signed in to change notification settings - Fork 39.2k
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
Switch to docker buildx
for conformance image
#98569
Conversation
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>
@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 The 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. |
/approve @saschagrunert leaving lgtm to one of the release folks as i am hoping this gets tested by hand before merging as well. |
docker buildx build \ | ||
--platform linux/${ARCH} \ | ||
--load \ | ||
--pull \ |
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.
@saschagrunert are we not concerned about the base image caching issue that previously broke this when switching to buildx? (see #97982 for more info)
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 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?
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.
@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) 👍
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 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.
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
[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 |
/retest |
/retest Review the full test history for this PR. Silence the bot with an |
1 similar comment
/retest Review the full test history for this PR. Silence the bot with an |
|
||
docker build --pull -t ${REGISTRY}/conformance-${ARCH}:${VERSION} ${TEMP_DIR} | ||
docker buildx build \ |
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.
- 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?
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.
- 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.
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.
@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?
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.
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).
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?:
Additional documentation e.g., KEPs (Kubernetes Enhancement Proposals), usage docs, etc.:
/cc @kubernetes/release-engineering
/sig release testing
/priority important-soon