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

Save docker tag for releases in tarfile archive #79497

Merged
merged 1 commit into from Jul 2, 2019

Conversation

@javier-b-perez
Copy link
Contributor

commented Jun 27, 2019

What type of PR is this?
/kind cleanup

What this PR does / why we need it:
When we release tarfiles, these only include the official "k8s.gcr.io" and "google_containers" tags, even if we specified a different registry using KUBE_DOCKER_REGISTRY.
We should save all the associated docker tags in the archive.

Does this PR introduce a user-facing change?:

NONE
@javier-b-perez

This comment has been minimized.

Copy link
Contributor Author

commented Jun 27, 2019

/assign @listx
/assign @cblecker
/assign @dims

@BenTheElder

This comment has been minimized.

Copy link
Member

commented Jun 27, 2019

I only see make changes, should this have parity in bazel?
To be clear: we're just saving these locally? No change to the existing / staged (GCS) release artifacts?

Need to read back through the image releasing code...

@javier-b-perez

This comment has been minimized.

Copy link
Contributor Author

commented Jun 27, 2019

I only see make changes, should this have parity in bazel?
To be clear: we're just saving these locally? No change to the existing / staged (GCS) release artifacts?

Need to read back through the image releasing code...

It might be already covered by build/container.bzl:
docker_tags, docker_push_tags or tags not sure how that works

Show resolved Hide resolved build/lib/release.sh Outdated
@javier-b-perez

This comment has been minimized.

Copy link
Contributor Author

commented Jun 27, 2019

/test pull-kubernetes-e2e-gce

@fejta
Copy link
Contributor

left a comment

/lgtm
/approve
/hold

@fejta

This comment has been minimized.

Copy link
Contributor

commented Jun 28, 2019

Feel free to /hold cancel when we're satisfied comments are addressed

@listx

This comment has been minimized.

Copy link
Contributor

commented Jun 29, 2019

/lgtm
/approve

@javier-b-perez javier-b-perez force-pushed the javier-b-perez:release-lib branch from ced5153 to 43f28ef Jun 29, 2019

@k8s-ci-robot k8s-ci-robot added size/S and removed lgtm size/XS labels Jun 29, 2019

@listx

This comment has been minimized.

Copy link
Contributor

commented Jun 29, 2019

/lgtm

@k8s-ci-robot k8s-ci-robot added the lgtm label Jun 29, 2019

@javier-b-perez

This comment has been minimized.

Copy link
Contributor Author

commented Jun 29, 2019

In my tests:
$ git tag -a "v1.15.20-test.1" -m "test tag"
$ KUBE_DOCKER_IMAGE_TAG=v1.15.20-test.1 KUBE_DOCKER_REGISTRY=gcr.io/my-test-project make quick-release
+++ [0628 18:23:00] Verifying Prerequisites....
...
+++ [0628 18:28:47] Tagging docker image k8s.gcr.io/kube-scheduler:v1.15.20-test.1 as gcr.io/my-test-project/kube-scheduler-amd64:v1.15.20-test.1
+++ [0628 18:28:47] Tagging docker image k8s.gcr.io/kube-proxy:v1.15.20-test.1 as gcr.io/my-test-project/kube-proxy-amd64:v1.15.20-test.1
+++ [0628 18:28:47] Tagging docker image k8s.gcr.io/kube-controller-manager:v1.15.20-test.1 as gcr.io/my-test-project/kube-controller-manager-amd64:v1.15.20-test.1
+++ [0628 18:28:47] Tagging docker image k8s.gcr.io/cloud-controller-manager:v1.15.20-test.1 as gcr.io/my-test-project/cloud-controller-manager-amd64:v1.15.20-test.1
+++ [0628 18:28:47] Tagging docker image k8s.gcr.io/kube-apiserver:v1.15.20-test.1 as gcr.io/my-test-project/kube-apiserver-amd64:v1.15.20-test.1
+++ [0628 18:28:53] Deleting hyperkube image k8s.gcr.io/hyperkube-amd64:v1.15.20-test.1
+++ [0628 18:28:59] Deleting conformance image k8s.gcr.io/conformance-amd64:v1.15.20-test.1
+++ [0628 18:29:00] Docker builds done

Images:
$ docker images | grep kube-proxy
gcr.io/my-test-project/kube-proxy-amd64 v1.15.20-test.1 fb4efb8e975b
k8s.gcr.io/kube-proxy v1.15.20-test.1 fb4efb8e975b

manifest.json in tarfile:
:_output/release-tars/kubernetes/server/bin$ cat manifest.json
[{"Config":"fb4efb8e975bd44c79272d139c16282b168ef8a89986d8ea8fdb49bd5089f5ac.json","RepoTags":["k8s.gcr.io/kube-proxy:v1.15.20-test.1","gcr.io/my-test-project/kube-proxy-amd64:v1.15.20-test.1"],"Layers":["6a61167456edca8a516d63b6c9b3b4dca9dc4560536d2d2513011755fd3232a8/layer.tar","36f67dffe0a832b5cd8fd23b768a592c0c03e3ab2f65e86aef0fb14b11248e39/layer.tar","ca1a9dcab4f0db9788b3183260af164eaf15c54fd6f01050263c78de952c1524/layer.tar"]}]

Works as intended

@javier-b-perez

This comment has been minimized.

Copy link
Contributor Author

commented Jun 29, 2019

/test pull-kubernetes-cross
/test pull-kubernetes-kubemark-e2e-gce-big

"${DOCKER[@]}" tag "${docker_image_tag}" "${release_docker_image_tag}" 2>/dev/null
fi
else
if [[ -z "${KUBE_DOCKER_IMAGE_TAG-}" || -z "${KUBE_DOCKER_REGISTRY-}" ]]; then

This comment has been minimized.

Copy link
@cblecker

cblecker Jun 29, 2019

Member

This line looks duplicated?

This comment has been minimized.

Copy link
@javier-b-perez

javier-b-perez Jul 1, 2019

Author Contributor

correct me if I'm wrong here:
We tag the image with k8s.gcr.io + the KUBE_DOCKER_REGISTRY (if defined), but we want to keep images only when we do releases.

I think we can remove the tag docker_image_tag all the time (or maybe when release_docker_image_tag is defined), since the image was already exported (docker save) with that tag associated and the release scripts are using the archives (docker load) to push the images.
https://github.com/kubernetes/release/blob/master/lib/releaselib.sh#L911

What do you think?

This comment has been minimized.

Copy link
@cblecker

cblecker Jul 2, 2019

Member

Actually, I was wrong when I read this.. I thought you were using -n, but you're using -z to flip the logic (this would have been the else statement). So this appears to maintain current functionality. I'm okay with just leaving this as-is.

@cblecker
Copy link
Member

left a comment

/lgtm
/approve
/hold

@javier-b-perez Unless you have any other changes/questions, feel free to remove this hold.

"${DOCKER[@]}" tag "${docker_image_tag}" "${release_docker_image_tag}" 2>/dev/null
fi
else
if [[ -z "${KUBE_DOCKER_IMAGE_TAG-}" || -z "${KUBE_DOCKER_REGISTRY-}" ]]; then

This comment has been minimized.

Copy link
@cblecker

cblecker Jul 2, 2019

Member

Actually, I was wrong when I read this.. I thought you were using -n, but you're using -z to flip the logic (this would have been the else statement). So this appears to maintain current functionality. I'm okay with just leaving this as-is.

@cblecker

This comment has been minimized.

Copy link
Member

commented Jul 2, 2019

/sig release
/priority backlog

@k8s-ci-robot

This comment has been minimized.

Copy link
Contributor

commented Jul 2, 2019

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: cblecker, fejta, javier-b-perez, listx

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

@xichengliudui

This comment has been minimized.

Copy link
Contributor

commented Jul 2, 2019

/retest pull-kubernetes-cross

@javier-b-perez

This comment has been minimized.

Copy link
Contributor Author

commented Jul 2, 2019

/test pull-kubernetes-cross
/hold cancel

@cblecker

This comment has been minimized.

Copy link
Member

commented Jul 2, 2019

@javier-b-perez Looks like a legitimate failure:

W0702 16:25:18.603] !!! [0702 16:25:18]  4: build/release.sh:45 kube::release::package_tarballs(...)
W0702 16:25:18.604] Error response from daemon: invalid reference format

Do you get this locally when you run a make cross?

@javier-b-perez

This comment has been minimized.

Copy link
Contributor Author

commented Jul 2, 2019

@javier-b-perez Looks like a legitimate failure:

W0702 16:25:18.603] !!! [0702 16:25:18]  4: build/release.sh:45 kube::release::package_tarballs(...)
W0702 16:25:18.604] Error response from daemon: invalid reference format

Do you get this locally when you run a make cross?

It is a legit error, I never run the make cross without the REGISTRY vars.
The problem is the args for docker save, when empty docker complains, I need to change the order, that's all. I'm testing and will update this PR when ready.

@javier-b-perez javier-b-perez force-pushed the javier-b-perez:release-lib branch from 43f28ef to 5e93584 Jul 2, 2019

@k8s-ci-robot k8s-ci-robot removed the lgtm label Jul 2, 2019

@listx

This comment has been minimized.

Copy link
Contributor

commented Jul 2, 2019

/lgtm

@k8s-ci-robot k8s-ci-robot added the lgtm label Jul 2, 2019

@k8s-ci-robot k8s-ci-robot merged commit 2933d0a into kubernetes:master Jul 2, 2019

23 checks passed

cla/linuxfoundation javier-b-perez authorized
Details
pull-kubernetes-bazel-build Job succeeded.
Details
pull-kubernetes-bazel-test Job succeeded.
Details
pull-kubernetes-conformance-image-test Skipped.
pull-kubernetes-cross Job succeeded.
Details
pull-kubernetes-dependencies Job succeeded.
Details
pull-kubernetes-e2e-gce Job succeeded.
Details
pull-kubernetes-e2e-gce-100-performance Job succeeded.
Details
pull-kubernetes-e2e-gce-csi-serial Skipped.
pull-kubernetes-e2e-gce-device-plugin-gpu Job succeeded.
Details
pull-kubernetes-e2e-gce-iscsi Skipped.
pull-kubernetes-e2e-gce-iscsi-serial Skipped.
pull-kubernetes-e2e-gce-storage-slow Skipped.
pull-kubernetes-godeps Skipped.
pull-kubernetes-integration Job succeeded.
Details
pull-kubernetes-kubemark-e2e-gce-big Job succeeded.
Details
pull-kubernetes-local-e2e Skipped.
pull-kubernetes-node-e2e Job succeeded.
Details
pull-kubernetes-node-e2e-containerd Job succeeded.
Details
pull-kubernetes-typecheck Job succeeded.
Details
pull-kubernetes-verify Job succeeded.
Details
pull-publishing-bot-validate Skipped.
tide In merge pool.
Details
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.