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

Use image promoter release process #1089

Closed
8 tasks done
serathius opened this issue Mar 7, 2020 · 41 comments
Closed
8 tasks done

Use image promoter release process #1089

serathius opened this issue Mar 7, 2020 · 41 comments
Assignees
Labels
help wanted Denotes an issue that needs help from a contributor. Must meet "help wanted" guidelines. kind/feature Categorizes issue or PR as related to a new feature. lifecycle/stale Denotes an issue or PR has remained open with no activity and has become stale.

Comments

@serathius
Copy link
Contributor

serathius commented Mar 7, 2020

Using k8s release process would allow to migrate to official k8s repositories without depending on Googlers. It also supports automated build process which will make it more auditable and secure.

We should also stop depending on quay.io registry if official option can be used.

Staging repo was already setup by @brancz kubernetes/k8s.io#384

/kind feature
Tasks based on https://github.com/kubernetes/k8s.io/tree/master/k8s.gcr.io

Migrate to promotion process:

  • Create google group image release (@dims)
  • Create staging repo (@justinsb)
  • Add image promotion config in test-infra
  • Add image promotion instructions in RELEASE.md
  • Replace quay.io repository with k8s.gcr.io as default - we decided to support both

Automate builds:

/cc @lilic please confirm that plan makes sense for you.

@k8s-ci-robot k8s-ci-robot added the kind/feature Categorizes issue or PR as related to a new feature. label Mar 7, 2020
@serathius
Copy link
Contributor Author

serathius commented Mar 7, 2020

@dims
Can you create [email protected] google group?

@serathius
Copy link
Contributor Author

/cc @dims

@serathius
Copy link
Contributor Author

/cc @justinsb
Can you create staging repo for kube-state-metrics?

@lilic
Copy link
Member

lilic commented Mar 7, 2020

Last time there was still an issue with the tool, is this solved now? kubernetes/k8s.io#384 (comment)

@serathius
Copy link
Contributor Author

I think yes, because gcr.io/google-containers is deprecated. Googler no longer can release new images to it.
https://github.com/kubernetes/k8s.io/tree/master/k8s.gcr.io/images/DO-NOT-MODIFY-legacy-backfill

I will confirm it with someone from sig-release

@serathius
Copy link
Contributor Author

@bartsmykla Can you confirm that new pipeline is fully functional?

@bartsmykla
Copy link

Yes, it's working :-)

@bartsmykla
Copy link

@serathius it looks like staging repo already exists: https://console.cloud.google.com/gcr/images/k8s-staging-kube-state-metrics/GLOBAL and as kubernetes/k8s.io#384 was merged almost half a year ago I'm sure the google group was already created. :-)

@serathius
Copy link
Contributor Author

How can I verify this? I can mark it as done

@bartsmykla
Copy link

These are the IAM roles for this project: https://github.com/kubernetes/k8s.io/blob/master/audit/projects/k8s-staging-kube-state-metrics/iam.json

I'm not entirely sure how to verify that but if I would guess looking at IAMs members of this group should have access to GCB for the project. Try to go here: https://console.cloud.google.com/navigation-error;errorUrl=%2Fcloud-build%3ForganizationId%3D&project%3Dk8s-staging-kube-state-metrics and check if it will let you in :-)

@bartsmykla
Copy link

bartsmykla commented Mar 7, 2020

Oooor... it should be easier to just check if you are a member of that group: https://groups.google.com/a/kubernetes.io/forum/#!myforums :-D

@serathius
Copy link
Contributor Author

I'm not owner of kube-state-metrics so I cannot check that.

@bartsmykla
Copy link

@serathius so the only way is to wait for one of the members or @dims to look and confirm, but the only case when the group would not exist is when the reconcile tool would not work and as far as I'm aware it's not the case and every project which was added later is able to get the access to its repositories and push images to them.

@serathius
Copy link
Contributor Author

/help

@k8s-ci-robot
Copy link
Contributor

@serathius:
This request has been marked as needing help from a contributor.

Please ensure the request meets the requirements listed here.

If this request no longer meets these requirements, the label can be removed
by commenting with the /remove-help command.

In response to this:

/help

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 help wanted Denotes an issue that needs help from a contributor. Must meet "help wanted" guidelines. label Mar 7, 2020
@serathius
Copy link
Contributor Author

@lilic Can you confirm that group exits?
It should be visible in https://groups.google.com/a/kubernetes.io/forum/#!search/k8s-infra-staging-kube-state-metrics

@serathius
Copy link
Contributor Author

/assign @justinsb @lilic

@lilic
Copy link
Member

lilic commented Mar 7, 2020

I am part of k8s-infra-staging-kube-state-metrics group yes and I can confirm I can access the. https://console.cloud.google.com/cloud-build/builds?organizationId=&project=k8s-staging-kube-state-metrics
But only for staging, do we need the production ones as per @nikhita comment:

When it is ready, we can start having prod ones too.

@serathius
Copy link
Contributor Author

Acces to production images should only be done by automated CI. This is done by image promoter, which watches content of file https://github.com/kubernetes/k8s.io/blob/master/k8s.gcr.io/images/k8s-staging-kube-state-metrics/images.yaml

@bartsmykla
Copy link

It's exactly as @serathius said :-)

@fejta-bot
Copy link

Issues go stale after 90d of inactivity.
Mark the issue as fresh with /remove-lifecycle stale.
Stale issues rot after an additional 30d of inactivity and eventually close.

If this issue is safe to close now please do so with /close.

Send feedback to sig-testing, kubernetes/test-infra and/or fejta.
/lifecycle stale

@k8s-ci-robot k8s-ci-robot added the lifecycle/stale Denotes an issue or PR has remained open with no activity and has become stale. label Jun 8, 2020
@serathius
Copy link
Contributor Author

/remove-lifecycle stale

@k8s-ci-robot k8s-ci-robot removed the lifecycle/stale Denotes an issue or PR has remained open with no activity and has become stale. label Jun 8, 2020
@lilic
Copy link
Member

lilic commented Jun 9, 2020

@tariq1890 said he is interested in doing this, if not I can take it. Tariq do you have time for this?

@lilic
Copy link
Member

lilic commented Jun 15, 2020

Both of my PRs are merged. Now how to check the process actually works 🤔

@serathius
Copy link
Contributor Author

Thanks for handling this Lili
When we were migrating Metrics Server it required additional changes in our build rules.

Hope this helps

@mrueg
Copy link
Member

mrueg commented Jul 16, 2020

@lilic @tariq1890 anything I can do to help out here? I would be interested in getting kube-state-metrics images for arm64.

@lilic
Copy link
Member

lilic commented Jul 17, 2020

@mrueg the above mentioned by Marek sounds like great two things to be done in kube-state-metrics as well, thanks! :)

@mrueg
Copy link
Member

mrueg commented Jul 22, 2020

Looks like it's not working as expected, see: https://prow.k8s.io/view/gs/kubernetes-jenkins/logs/post-kube-state-metrics-push-images/1285961432038379522 anyone with access to gcp can look at those logs?

@lilic
Copy link
Member

lilic commented Jul 23, 2020

Yes opened PR to fix this, looking at the current failure as well. PR for that out as well.

@lilic
Copy link
Member

lilic commented Jul 23, 2020

I believe everything was done on this list. Last PR should be #1175 We can close this issue now?

@serathius
Copy link
Contributor Author

Could we make one full release using new pipeline before? Would make sense to test if everything works e2e

@lilic
Copy link
Member

lilic commented Jul 24, 2020

Sounds good, we plan on doing this with the 2.0 release.

@mrueg
Copy link
Member

mrueg commented Jul 26, 2020

@mrueg
Copy link
Member

mrueg commented Jul 29, 2020

Ah I figured, cloudbuild.yaml is calling make pushhere: https://github.com/kubernetes/kube-state-metrics/blob/master/Makefile#L114 which only creates and pushes a regular and am64 container image. That will require some rework in the Makefile then. I'll try to have a look at that in the next couple of days.

@lilic
Copy link
Member

lilic commented Jul 31, 2020

Seems like this worked, we are now seeing multiple arch images in gcr. Thanks @mrueg for the work!

@mrueg
Copy link
Member

mrueg commented Jul 31, 2020

Great, let me know if you want a backport to 1.9 (I already see a 1.9.7 tag appeared on gcr?).

@lilic
Copy link
Member

lilic commented Jul 31, 2020

Backport sounds great!

@mrueg
Copy link
Member

mrueg commented Jul 31, 2020

Great, let me know if you want a backport to 1.9 (I already see a 1.9.7 tag appeared on gcr?).

I can do the backport, one thing I'm wondering about is, that Makefile defines the version per cat VERSION (which leads to the docker image being updated on every push so a version becomes a moving target).

I would suggest the following logic:

  • Read VERSION file
  • Check if current commit is tagged with that version
  • If it does, create a docker image with the version of VERSION ->
    kube-state-metrics:v1.9.8
  • If it does not, create a docker image with the version of VERSION and add git shortcommit (that creates a tag per commit) e.g. kube-state-metrics:v1.9.8-aabbccdd
    or add "-next" or similar (that's a moving target then) kube-state-metrics:v1.9.8-next

@lilic @paulfantom @serathius any preference here?

@lilic
Copy link
Member

lilic commented Jul 31, 2020

Yes, I noticed as well have plans to correct this for when we do the 2.0 release as we are not using the image promotion process until 2.0 release, we have not discussed this yet with the maintainers. Do you mind opening a separate issue instead thanks!

@fejta-bot
Copy link

Issues go stale after 90d of inactivity.
Mark the issue as fresh with /remove-lifecycle stale.
Stale issues rot after an additional 30d of inactivity and eventually close.

If this issue is safe to close now please do so with /close.

Send feedback to sig-testing, kubernetes/test-infra and/or fejta.
/lifecycle stale

@k8s-ci-robot k8s-ci-robot added the lifecycle/stale Denotes an issue or PR has remained open with no activity and has become stale. label Oct 29, 2020
@lilic
Copy link
Member

lilic commented Oct 29, 2020

Since this image promotion now works and we have a good workflow, closing this issue. Thanks all!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
help wanted Denotes an issue that needs help from a contributor. Must meet "help wanted" guidelines. kind/feature Categorizes issue or PR as related to a new feature. lifecycle/stale Denotes an issue or PR has remained open with no activity and has become stale.
Projects
None yet
Development

No branches or pull requests

7 participants