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

Add manifest support for release images #516

Merged
merged 2 commits into from
Sep 4, 2018

Conversation

mkumatag
Copy link
Member

@mkumatag mkumatag commented Feb 10, 2018

This will enable pushing manifest image for release images

Refer #248 for more information.

@k8s-ci-robot k8s-ci-robot added do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. size/M Denotes a PR that changes 30-99 lines, ignoring generated files. labels Feb 10, 2018
@mkumatag
Copy link
Member Author

/cc @luxas @ixdy

Copy link
Member

@luxas luxas left a comment

Choose a reason for hiding this comment

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

anago Outdated
# Check for manifest-tool, if not install it
if [[ ! -f $(which manifest-tool) ]]; then
MANIFEST_TOOL_PATH=${MANIFEST_TOOL_PATH:-$(mktemp -d -t manifest)}
PATH=$MANIFEST_TOOL_PATH:$PATH
Copy link
Member

Choose a reason for hiding this comment

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

@ixdy @david-mcmahon Where do you want to put this? Globally in e.g. /usr/local/bin if not present or in temp or whatever?

An alternative would be to use download the latest docker 18.02 client binary and use that for "official" pushing

Copy link
Contributor

Choose a reason for hiding this comment

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

I'd prefer this to instruct the user to Do The Right Thing and install it somewhere permanent.

Copy link
Member

Choose a reason for hiding this comment

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

+1 to David's comment

Copy link
Member Author

Choose a reason for hiding this comment

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

I've already included this tool in Dockerfile.k8s-cloud-builder file and will be used if we use cloud-builder. Above flow is only for people who are trying it out locally. Having said that I'll add an instruction to install the tool and rerun the script if we don't find a tool in the path.

@david-mcmahon @jdumars @luxas @ixdy Does is it make sense?

Copy link
Contributor

Choose a reason for hiding this comment

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

Yes, just look at the way the other prerequisites check and notify on dependencies and follow suit. There is still local usage of the tooling so we want to get that right.

Copy link
Member Author

Choose a reason for hiding this comment

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

@david-mcmahon @jdumars fixed it, PTAL latest commit. -Thanks

@@ -927,8 +929,8 @@ release::docker::release () {

# 'gcloud docker' gives lots of internal_failure's so add retries to
# all of the invocations
for arch in "${KUBE_SERVER_PLATFORMS[@]##*/}"; do
for binary in "${binaries[@]}"; do
for binary in "${binaries[@]}"; do
Copy link
Member

Choose a reason for hiding this comment

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

Why reverse the loop flow here?

Copy link
Member Author

Choose a reason for hiding this comment

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

This reverse will help me running manifest in outer loop for every binary.

Copy link
Member

Choose a reason for hiding this comment

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

This branch of the if/else is defunct starting with kubernetes 1.8 (kubernetes/kubernetes#47939). You should probably add this new logic to the release::docker::release_from_tarfiles function instead.

@mkumatag mkumatag changed the title [WIP] Add manifest support for release images Add manifest support for release images Feb 11, 2018
@k8s-ci-robot k8s-ci-robot removed the do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. label Feb 11, 2018
@mkumatag
Copy link
Member Author

I tried running the build anago but faced permission issues, can someone please help me mock the release and make sure it is creating manifest images!

@jdumars
Copy link
Member

jdumars commented Feb 13, 2018

I am not sure this is possible without certain Google privs. @calebamiles might be able to verify that.

@@ -910,6 +910,8 @@ release::docker::release () {
"kube-proxy"
"hyperkube"
)
# ml_platforms should be in the os1/arch1,os2/arch2,os3/arch3 form
Copy link
Member

Choose a reason for hiding this comment

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

what does ml stand for? I keep reading "machine learning", which I'm sure is wrong.

@@ -910,6 +910,8 @@ release::docker::release () {
"kube-proxy"
"hyperkube"
)
# ml_platforms should be in the os1/arch1,os2/arch2,os3/arch3 form
local -r ml_platforms= $(echo "${KUBE_SERVER_PLATFORMS[@]}" | sed "s/ /,/g")
Copy link
Member

Choose a reason for hiding this comment

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

instead of using sed, you could do something like

local -r platforms=$(IFS=, ; echo "${KUBE_SERVER_PLATFORMS[*]}")

(I think)

@mkumatag
Copy link
Member Author

@ixdy fixed all your review comments, can you PTAL?

@calebamiles can you please invoke mock release see how are things?

@mkumatag
Copy link
Member Author

ping @ixdy @calebamiles

@mkumatag mkumatag force-pushed the manifest branch 3 times, most recently from 00dfcc0 to ca87d64 Compare February 23, 2018 05:18
anago Outdated
if [[ ! -f $(which manifest-tool) ]]; then
logecho -r "$FAILED"
logecho "No manifest-tool found in the path. Please install it from" \
"https://github.com/estesp/manifest-tool/releases and set the path variable"
Copy link
Contributor

Choose a reason for hiding this comment

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

...and ensure it is on the PATH.

Copy link
Member Author

Choose a reason for hiding this comment

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

@david-mcmahon fixed it, PTAL.

@BenTheElder
Copy link
Member

/cc

@k8s-ci-robot k8s-ci-robot requested a review from BenTheElder March 2, 2018 05:07
@david-mcmahon
Copy link
Contributor

Based on the *UPDATE (Feb 2018)" item in the https://github.com/estesp/manifest-tool README, should we shift here to a pure docker solution to this?

@mkumatag
Copy link
Member Author

mkumatag commented Mar 7, 2018

docker solution got merged via docker/cli#138 which will be in v18.02.0-ce release, so that is the reason I was using this tool.

@BenTheElder
Copy link
Member

Kubernetes isn't even on 17.x last I checked. Might be worth using something else for a while until people are ready to use such a recent docker version?

@david-mcmahon
Copy link
Contributor

Giving this a try and getting:

$ manifest-tool push from-args --platforms linux/amd64,linux/arm,linux/arm64,linux/ppc64le,linux/s390x --template gcr.io/kubernetes-release-test/kube-aggregator-ARCH:v1.11.0-alpha.1 --target gcr.io/kubernetes-release-test/kube-aggregator:v1.11.0-alpha.1
FATA[0004] Inspect of image "gcr.io/kubernetes-release-test/kube-aggregator-ppc64le:v1.11.0-alpha.1" failed with error: denied: Permission denied for "v1.11.0-alpha.1" from request "/v2/kubernetes-release-test/kube-aggregator-ppc64le/manifests/v1.11.0-alpha.1".  

@dims
Copy link
Member

dims commented Aug 24, 2018

@deitch can you please log issues for what's broken for multi-arch clusters separately from this one? i'd like to track it

@deitch
Copy link

deitch commented Aug 24, 2018

I would be happy to, but I need to do it methodically. Forgive me if it takes a week or two for me to find a day to sit down and document. :-)

@dims
Copy link
Member

dims commented Aug 24, 2018

@deitch Ack no worries! :)

@dims
Copy link
Member

dims commented Aug 27, 2018

@mkumatag Don't we have to enable the experimental support on the CLI and docker daemon in this script?

@jdumars
Copy link
Member

jdumars commented Aug 27, 2018

Is this still "priority/critical-urgent"?

@dims
Copy link
Member

dims commented Aug 28, 2018

@jdumars we'd like to sort this out for 1.12 release. the earlier we can try this out the better our chances of ensuring we have the right images when we cut the release.

@mkumatag
Copy link
Member Author

@mkumatag Don't we have to enable the experimental support on the CLI and docker daemon in this script?

Yes, experimental support should be enabled only in the cli and not in the daemon but not sure whether we should enable part of script!

@BenTheElder
Copy link
Member

Yes, experimental support should be enabled only in the cli and not in the daemon but not sure whether we should enable part of script!

Can we detect that it is not enabled then print out instructions to enable it? We probably shouldn't muck with docker config in the scripts.

@ixdy
Copy link
Member

ixdy commented Aug 28, 2018

Maybe check that docker version -f '{{.Client.Experimental}}' equals true?

$ docker version -f '{{.Client.Experimental}}'
true

@mkumatag
Copy link
Member Author

Maybe check that docker version -f '{{.Client.Experimental}}' equals true?

$ docker version -f '{{.Client.Experimental}}'
true

added the check, ptal to the latest commit.

anago Outdated
fi
logecho -r "$OK"

# TODO: Remove this section once docker manifest command promted
Copy link
Member

Choose a reason for hiding this comment

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

promted -> promoted.

Copy link
Member Author

Choose a reason for hiding this comment

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

will do that..

anago Outdated
logecho -n "Checking Docker CLI Experimental status: "
cli_experimental=$(docker version --format '{{.Client.Experimental}}' | cut -d"-" -f1)
if [[ "${cli_experimental}" == "false" ]]; then
echo "dsdmsdsmdsdsd :>>>>${cli_experimental}<<<<<"
Copy link
Member

Choose a reason for hiding this comment

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

remove debug statement please

Copy link
Member Author

Choose a reason for hiding this comment

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

oops.. :P my bad...

@dims
Copy link
Member

dims commented Aug 29, 2018

Tiny nit @mkumatag

@mkumatag
Copy link
Member Author

Tiny nit @mkumatag

fixed them..

@dims
Copy link
Member

dims commented Aug 29, 2018

/lgtm

@k8s-ci-robot k8s-ci-robot added the lgtm "Looks good to me", indicates that a PR is ready to be merged. label Aug 29, 2018
@BenTheElder
Copy link
Member

Generally LGTM, we should get this tested out. 😬 Thanks for keeping after this!

@jdumars
Copy link
Member

jdumars commented Sep 2, 2018

I'm basically LGTM as well, but would like @tpepper to be involved as well.

@tpepper
Copy link
Member

tpepper commented Sep 4, 2018

/milestone v1.12

@tpepper
Copy link
Member

tpepper commented Sep 4, 2018

I'm good with this commit and LGTM, but would like a @calebamiles review here also.

@calebamiles
Copy link
Contributor

/approve

@k8s-ci-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: calebamiles, dims, mkumatag

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

@k8s-ci-robot k8s-ci-robot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Sep 4, 2018
@k8s-ci-robot k8s-ci-robot merged commit ff17b75 into kubernetes:master Sep 4, 2018
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. cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. lgtm "Looks good to me", indicates that a PR is ready to be merged. priority/critical-urgent Highest priority. Must be actively worked on as someone's top priority right now. sig/release Categorizes an issue or PR as relevant to SIG Release. size/M Denotes a PR that changes 30-99 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.