-
Notifications
You must be signed in to change notification settings - Fork 39.8k
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
kubeadm: Implement support for using images from CI builds #49119
Conversation
Hi @kad. Thanks for your PR. I'm waiting for a kubernetes member to verify that this patch is reasonable to test. If it is, they should reply with I understand the commands that are listed here. 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. I understand the commands that are listed here. |
@luxas if you can add "ok-to-test" please |
/ok-to-test |
2152734
to
40b7fe6
Compare
those failures seems to be now on infra side (gcs push failures) |
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.
I think this can be done in way less code, without touching the API struct. In the special case of a ci/*
version, we'll just use (the constant) gcr.io/kubernetes-ci-images
repo in GetCoreImage()
We can't. gcr.io/kubernetes-ci-images contains only subset of images (the core ones). |
@kad I didn't propose to touch |
Can you a bit elaborate about "internal version of the API" ? I'll look at this possibilities. |
I'm not planning to expand the ImageRepository functionality more than we do now, instead it will eventually be possible to set all images separately via the config file. We should not over-engineer this, but keep it as simple as we can. Hardcoding the There are two sub-API groups for the kubeadm API group, an internal version and an external The external one follows a more strict, versioned scheme, but the internal version may change and have more parameters used internally if applicable. I think having an |
thing is, that this hardcoding in case of bool will be at least in two places (maybe more). e.g. accroding to your request kube-dns images are handled not via GetCoreImage(). |
@luxas updated to use only internal APIs and removed ability to configure additional image repositories. |
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.
Looks much better 👍, but still needs to be modified a little to work properly. The biggest point here is that if the user specifies the ci/
prefix on the CLI, we should lookup the tag from dl.k8s.io/ci-cross
.
if err != nil { | ||
return err | ||
} | ||
cfg.KubernetesVersion = ver | ||
|
||
// Requested version is automatic CI build, thus use KubernetesCI Image Repository for core images | ||
if useCI { |
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.
Why not just move this up to check strings.HasPrefix(cfg.KubernetesVersion, "ci/")
and set the CI repo on that condition? KubernetesValidateVersion will be much simpler then...
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.
ping
if err != nil { | ||
return err | ||
} | ||
cfg.KubernetesVersion = ver | ||
|
||
// Requested version is automatic CI build, thus use KubernetesCI Image Repository for core images | ||
if useCI { | ||
cfg.CIImageRepository = "gcr.io/kubernetes-ci-images" |
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.
probably want a constant for this
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.
ping
kubeReleaseRegex = regexp.MustCompile(`^v?(0|[1-9][0-9]*)\.(0|[1-9][0-9]*)\.(0|[1-9][0-9]*)([-0-9a-zA-Z_\.+]*)?$`) | ||
kubeReleaseLabelRegex = regexp.MustCompile(`^[[:lower:]]+(-[-\w_\.]+)?$`) | ||
kubeBucketPrefixes = regexp.MustCompile(`^((release|ci|ci-cross)/)?([-\w_\.+]+)$`) |
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.
We will only allow release
and ci
. What is indeed a little bit confusing is that we're gonna use artifacts from ci-cross
under the hood (kubeadm user uses ci/latest
=> will actually fetch ci-cross/latest.txt
for the version to use)
This is due to that the normal ci job does not push images
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.
ping
cmd/kubeadm/app/util/version.go
Outdated
if url == "" { | ||
url = kubeReleaseBucketURL + "/release" | ||
} | ||
vurl := fmt.Sprintf("%s/%s.txt", url, 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.
vurl doesn't say much to me
cmd/kubeadm/app/util/version.go
Outdated
// release/v1.7.1 -- same as above. | ||
// stable-1.7 or release/stable-1.7 -- labeled official releases | ||
// ci/v1.8.0-alpha.1.123+012345678 -- CI explicit build version | ||
// ci/latest-1.8 or ci-cross/latest-1.8 -- CI labeled builds |
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.
I don't think we should confuse the user with ci-cross
although we fetch the images from there under the hood.
Let's not support for ci-cross/
at the moment.
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.
ping
cmd/kubeadm/app/util/version.go
Outdated
// ci/latest-1.8 or ci-cross/latest-1.8 -- CI labeled builds | ||
// | ||
// Returns: version, build is release (false) or CI (true), error. | ||
func KubernetesValidateVersion(version string) (string, bool, error) { |
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.
I find the relationship between KubernetesValidateVersion and KubernetesReleaseVersion kind of strange.
What I think we want is this:
- Have a function that takes
cfg.KubernetesVersion
(may be a label) and just return the resulting "real" version we can use. Basically whatKubernetesReleaseVersion
is today.
This would do the following:
If it already is a valid version, return
If it matches (release/)?(stable|latest)(-1.[0-9]{1})?
, unconditionally trim the release/
prefix and fetch real version from dl.k8s.io/release/%s.txt
and return
If it matches ci/latest(-1.[0-9]{1})?
, unconditionally trim the ci/
prefix and fetch the real version from dl.k8s.io/ci-cross/%s.txt
and return
That will do what we want. Feel free to create private helper functions for that main function.
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.
ping
Regarding ci vs ci-cross prefix: there are two different latest.txt files in those buckets. It supports both. Having those tricks to substitute one with another invisible for user sounds like over |
@luxas any hint on how to fix those unit test failures ? they are both related to declare only internally used variable in MasterConfiguration that supposed to be not exposed to versioned external API and not to config ? |
That's not how this works. No images are pushed from the job that uploads to |
Updated. |
/lgtm Thanks! |
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: kad, luxas Associated issue: 337 The full list of commands accepted by this bot can be found here.
Needs approval from an approver in each of these OWNERS Files:
You can indicate your approval by writing |
/retest
… On 18 Aug 2017, at 18:53, k8s-ci-robot ***@***.***> wrote:
@kad: The following test failed, say /retest to rerun them all:
Test name Commit Details Rerun command
pull-kubernetes-e2e-gce-etcd3 9f3ac32 link /test pull-kubernetes-e2e-gce-etcd3
Full PR test history. Your PR dashboard. Please help us cut down on flakes by linking to an open issue when you hit one in your PR.
—
You are receiving this because you were assigned.
Reply to this email directly, view it on GitHub, or mute the thread.
|
/retest
… On 18 Aug 2017, at 20:18, k8s-ci-robot ***@***.***> wrote:
@kad: The following test failed, say /retest to rerun them all:
Test name Commit Details Rerun command
pull-kubernetes-e2e-gce-etcd3 9f3ac32 link /test pull-kubernetes-e2e-gce-etcd3
Full PR test history. Your PR dashboard. Please help us cut down on flakes by linking to an open issue when you hit one in your PR.
—
You are receiving this because you were assigned.
Reply to this email directly, view it on GitHub, or mute the thread.
|
/retest Review the full test history for this PR. |
/retest
… On 19 Aug 2017, at 06:26, k8s-ci-robot ***@***.***> wrote:
@kad: The following test failed, say /retest to rerun them all:
Test name Commit Details Rerun command
pull-kubernetes-e2e-gce-etcd3 9f3ac32 link /test pull-kubernetes-e2e-gce-etcd3
Full PR test history. Your PR dashboard. Please help us cut down on flakes by linking to an open issue when you hit one in your PR.
—
You are receiving this because you were assigned.
Reply to this email directly, view it on GitHub, or mute the thread.
|
/retest Review the full test history for this PR. |
3 similar comments
/retest Review the full test history for this PR. |
/retest Review the full test history for this PR. |
/retest Review the full test history for this PR. |
/retest |
/retest Review the full test history for this PR. |
9 similar comments
/retest Review the full test history for this PR. |
/retest Review the full test history for this PR. |
/retest Review the full test history for this PR. |
/retest Review the full test history for this PR. |
/retest Review the full test history for this PR. |
/retest Review the full test history for this PR. |
/retest Review the full test history for this PR. |
/retest Review the full test history for this PR. |
/retest Review the full test history for this PR. |
/retest |
Automatic merge from submit-queue (batch tested with PRs 50693, 50831, 47506, 49119, 50871) |
What this PR does / why we need it: Implements support for CI images in kubeadm
Which issue this PR fixes (optional, in
fixes #<issue number>(, fixes #<issue_number>, ...)
format, will close that issue when PR gets merged): fixes kubernetes/kubeadm#337Special notes for your reviewer:
Release note: