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

GCB for staging #356

Merged
merged 2 commits into from
Sep 11, 2019
Merged

GCB for staging #356

merged 2 commits into from
Sep 11, 2019

Conversation

thockin
Copy link
Member

@thockin thockin commented Sep 5, 2019

Enable GCB builds for staging repos

Enable GCB API.

Create a scratch bucket for logs and stuff.

Allow the prow svcacct to trigger builds and log.

Remove retention policy for staging buckets (not needed for most and
disallowed for GCB scratch)

After this change, a small prow PR and a YAML file in your repo and you
can post-submit build and push to staging GCR without human hands
touching it.

@k8s-ci-robot k8s-ci-robot added cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. size/L Denotes a PR that changes 100-499 lines, ignoring generated files. wg/k8s-infra labels Sep 5, 2019
@thockin
Copy link
Member Author

thockin commented Sep 5, 2019

If we're OK to clear retention, I can do that manually once and then remove that entirely.

Copy link
Member

@Katharine Katharine left a comment

Choose a reason for hiding this comment

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

lib.sh/ensure-staging-storage.sh changes LGTM. I have no idea about the ensure-main-project.sh ones.

infra/gcp/lib.sh Outdated
--member "serviceAccount:${PROW_SVCACCT}" \
--role roles/cloudbuild.builds.builder

# Allow prow to access build logs.
Copy link
Member

Choose a reason for hiding this comment

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

tiny nit: objectViewer allows prow to access build logs; objectCreator allows it to provide the build source to GCB

@thockin
Copy link
Member Author

thockin commented Sep 6, 2019 via email

Copy link
Member

@vincepri vincepri left a comment

Choose a reason for hiding this comment

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

/lgtm
/assign @dims @cblecker

@k8s-ci-robot k8s-ci-robot added the lgtm "Looks good to me", indicates that a PR is ready to be merged. label Sep 10, 2019
@thockin
Copy link
Member Author

thockin commented Sep 10, 2019

/hold

I will run the retention clear once and then remove it from here, once I get ACK from someone like @justinsb

@k8s-ci-robot k8s-ci-robot added the do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. label Sep 10, 2019
@dims
Copy link
Member

dims commented Sep 10, 2019

/approve

(in principle, looks like vince and katharine has done in-depth reviews)

@k8s-ci-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: dims

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 10, 2019
Copy link
Member

@justinsb justinsb left a comment

Choose a reason for hiding this comment

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

LGTM

BUCKET="gs://${PROJECT}"
# The names of the buckets
STAGING_BUCKET="gs://${PROJECT}"
SCRATCH_BUCKET="gs://${PROJECT}-scratch"
Copy link
Member

Choose a reason for hiding this comment

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

Wasn't clear what scratch was for. Reading context I can see it's for prow logs (I believe), but would be good to have a comment to that effect.

Copy link
Member

Choose a reason for hiding this comment

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

@justinsb It's actually for uploading source tarballs for the GCB builds

Copy link
Member

Choose a reason for hiding this comment

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

It does both of those things!

@justinsb
Copy link
Member

lgtm also! Only one nit that the purpose of the scratch buckets wasn't obvious

@thockin
Copy link
Member Author

thockin commented Sep 11, 2019 via email

@k8s-ci-robot k8s-ci-robot removed the lgtm "Looks good to me", indicates that a PR is ready to be merged. label Sep 11, 2019
@thockin
Copy link
Member Author

thockin commented Sep 11, 2019

I added a comment, but maybe renaming it is better. @Katharine - where is the "foo-scratch" name used?

@Katharine
Copy link
Member

Katharine commented Sep 11, 2019

@thockin It's used in the test-infra configs: https://github.com/kubernetes/test-infra/blob/master/config/jobs/image-pushing/k8s-staging-cluster-api.yaml#L20

There is no other reference to it. Renaming to -gcb or similar seems fine to me.

The terraform code will handle this.
Enable GCB API.

Create a scratch bucket for logs and stuff.

Allow the prow svcacct to trigger builds and log.

Remove retention policy for staging buckets (not needed for most and
disallowed for GCB scratch)

After this change, a small prow PR and a YAML file in your repo and you
can pos-submit build and push to staging GCR without human hands
touching it.
@thockin
Copy link
Member Author

thockin commented Sep 11, 2019

Great. I have renamed it here. Upon LGTM, I will run it for all stagings, PR a change to test-infra to change ref, and when that merges, remove the old scratch bucket

@thockin thockin removed the do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. label Sep 11, 2019
@thockin
Copy link
Member Author

thockin commented Sep 11, 2019

hold is removed

@vincepri
Copy link
Member

Giving it another look

Copy link
Member

@vincepri vincepri left a comment

Choose a reason for hiding this comment

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

/lgtm

@k8s-ci-robot k8s-ci-robot added the lgtm "Looks good to me", indicates that a PR is ready to be merged. label Sep 11, 2019
@k8s-ci-robot k8s-ci-robot merged commit 54f7d1a into kubernetes:master Sep 11, 2019
@detiber
Copy link
Member

detiber commented Sep 11, 2019

@thockin @dims @Katharine sounds like we need to coordinate the running of this updated script and getting the prow job updated.

@thockin
Copy link
Member Author

thockin commented Sep 11, 2019

Running now to make the new buckets. Once that is done, we can coordinate prow config PR before removing the -scratch bucket

@thockin
Copy link
Member Author

thockin commented Sep 11, 2019

@thockin
Copy link
Member Author

thockin commented Sep 11, 2019

All staging projects have been activated, GCB enabled, buckets created. Game on.

@thockin thockin deleted the gcb-for-staging branch November 1, 2019 18:15
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. size/L Denotes a PR that changes 100-499 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

8 participants