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

Stage sources via k/release API (krel) #61

Merged
merged 1 commit into from
Nov 16, 2020

Conversation

saschagrunert
Copy link
Member

We now stage the sources directly via the API provided by k/release rather than the deprecated push-build.sh script (lives in k/release, too).

Side note: The API has not been e2e tested yet. I hope that we can do this with an additional job in test-infra which uses kubetest2 to periodically stage a built release.

@k8s-ci-robot k8s-ci-robot added the cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. label Sep 25, 2020
@k8s-ci-robot k8s-ci-robot added the size/XL Denotes a PR that changes 500-999 lines, ignoring generated files. label Sep 25, 2020
@saschagrunert saschagrunert force-pushed the stage-via-krel branch 2 times, most recently from b80647e to 780502a Compare September 25, 2020 10:13
Copy link
Contributor

@amwat amwat left a comment

Choose a reason for hiding this comment

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

Really love that we are moving away from the push-build script!

FYI if you want to test this locally this flow gets triggered by

kubetest2 gke --build --strategy=make --stage=gs://your-bucket

go.mod Outdated Show resolved Hide resolved
@saschagrunert saschagrunert force-pushed the stage-via-krel branch 2 times, most recently from b8bfb4c to f0810f5 Compare October 1, 2020 13:00
@saschagrunert saschagrunert changed the title Stage sources via k/release API (krel) WIP: Stage sources via k/release API (krel) Oct 1, 2020
@k8s-ci-robot k8s-ci-robot added the do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. label Oct 1, 2020
@saschagrunert
Copy link
Member Author

This is ready for review. PTAL

Unfortunately I was not able to test it locally:

> go run main.go gke --build --strategy=make --stage=gs://kubernetes-release-gcb/kubetest2-test
Error: could not find kubetest2 deployer "gke"

@saschagrunert saschagrunert changed the title WIP: Stage sources via k/release API (krel) Stage sources via k/release API (krel) Oct 8, 2020
@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 Oct 8, 2020
@amwat
Copy link
Contributor

amwat commented Oct 12, 2020

make install and make install-deployer-gke should give you the necessary binaries for local testing.

@saschagrunert
Copy link
Member Author

make install and make install-deployer-gke should give you the necessary binaries for local testing.

Thanks! I think the path for the bazel release tars was wrong there:

func extractBuiltTars() error {
allBuilds, err := K8sDir("kubernetes", "_output", "gcs-stage")
if err != nil {
return err
}

Fixed it in this PR. Now it seems to work:

> kubetest2 gke \
    --repo-root=$PWD \
    --build \
    --strategy=make \
    --stage=gs://kubernetes-release-gcb/ci/kubetest2
…
INFO[0413] Using Bazel build version
INFO[0413] Found build version: v1.20.0-alpha.1.227_89fdf5e7d3769a
INFO[0413] BuildDir is not set, setting it automatically
INFO[0413] Release is build by bazel, setting BuildDir to bazel-bin/build
INFO[0413] Latest version is v1.20.0-alpha.1.227_89fdf5e7d3769a
INFO[0413] Checking bucket kubernetes-release-gcb for write permissions
INFO[0413] Staging local artifacts
INFO[0413] Cleaning staging dir bazel-bin/build/gcs-stage/v1.20.0-alpha.1.227_89fdf5e7d3769a
INFO[0413] Removing bazel-bin/build/gcs-stage/v1.20.0-alpha.1.227_89fdf5e7d3769a
INFO[0413] Creating bazel-bin/build/gcs-stage/v1.20.0-alpha.1.227_89fdf5e7d3769a
INFO[0413] Copying release tarballs
INFO[0413] Trying to copy dir bazel-bin/build/release-tars to bazel-bin/build/gcs-stage/v1.20.0-alpha.1.227_89fdf5e7d3769a
INFO[0413] Trying to copy file bazel-bin/build/release-tars/.dummy to bazel-bin/build/gcs-stage/v1.20.0-alpha.1.227_89fdf5e7d3769a/.dummy (required: false)
INFO[0413] Copied .dummy
INFO[0413] Trying to copy file bazel-bin/build/release-tars/_client-bin.args to bazel-bin/build/gcs-stage/v1.20.0-alpha.1.227_89fdf5e7d3769a/_client-bin.args (required: false)
INFO[0413] Copied _client-bin.args
INFO[0413] Trying to copy file bazel-bin/build/release-tars/_client-bin.tar to bazel-bin/build/gcs-stage/v1.20.0-alpha.1.227_89fdf5e7d3769a/_client-bin.tar (required: false)
INFO[0414] Copied _client-bin.tar
…
INFO[0557] Done
INFO[0557] Skipping not existing extra dir bazel-bin/build/gcs-stage/v1.20.0-alpha.1.227_89fdf5e7d3769a/extra
INFO[0557] Skipping not existing plain binaries dir bazel-bin/build/release-stage
INFO[0557] Writing checksums
INFO[0557] Writing artifact hashes to SHA256SUMS/SHA512SUMS files
INFO[0702] Trying to copy file SHA256SUMS to bazel-bin/build/gcs-stage/v1.20.0-alpha.1.227_89fdf5e7d3769a/SHA256SUMS (required: true)
INFO[0702] Copied SHA256SUMS
INFO[0702] Trying to copy file SHA512SUMS to bazel-bin/build/gcs-stage/v1.20.0-alpha.1.227_89fdf5e7d3769a/SHA512SUMS (required: true)
INFO[0702] Copied SHA512SUMS
INFO[0702] Hashing files in bazel-bin/build/gcs-stage/v1.20.0-alpha.1.227_89fdf5e7d3769a
INFO[0832] GCS destination is ci/kubetest2/v1.20.0-alpha.1.227_89fdf5e7d3769a
INFO[0832] Pushing release artifacts from bazel-bin/build/gcs-stage/v1.20.0-alpha.1.227_89fdf5e7d3769a to gs://kubernetes-release-gcb/ci/kubetest2/v1.20.0-alpha.1.227_89fdf5e7d3769a
Building synchronization state...
Starting synchronization...
…

Artifacts are located there: https://console.cloud.google.com/storage/browser/kubernetes-release-gcb/ci?pageState=(%22StorageObjectListTable%22:(%22f%22:%22%255B%255D%22))&prefix=&forceOnObjectsSortingFiltering=false

Depends on some fixes to be merged in https://github.com/kubernetes/release/pull/1629/files

pkg/build/make.go Outdated Show resolved Hide resolved
pkg/build/release_push_build.go Show resolved Hide resolved
pkg/build/release_push_build.go Show resolved Hide resolved
@k8s-ci-robot k8s-ci-robot removed the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label Oct 14, 2020
@saschagrunert
Copy link
Member Author

Alrigtht, gave it another try with the changed build type:

> kubetest2 gke --repo-root . --build --strategy=make --stage=gs://kubernetes-release-gcb/ci

The build results can be found here: https://console.cloud.google.com/storage/browser/kubernetes-release-gcb/ci?pageState=(%22StorageObjectListTable%22:(%22f%22:%22%255B%255D%22))&prefix=&forceOnObjectsSortingFiltering=false

Another small fix for noupdatelatest is in flight there: kubernetes/release#1638

@saschagrunert
Copy link
Member Author

PTAL @amwat

Copy link
Contributor

@amwat amwat left a comment

Choose a reason for hiding this comment

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

Let's give this a shot!
nothing is currently using the make strategy. But I'll follow up this with changes to the gce build to start using this.

/lgtm
/approve
/hold

pkg/build/release_push_build.go Outdated Show resolved Hide resolved
@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 Nov 13, 2020
@k8s-ci-robot k8s-ci-robot added the lgtm "Looks good to me", indicates that a PR is ready to be merged. label Nov 13, 2020
@k8s-ci-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: amwat, saschagrunert

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 Nov 13, 2020
Copy link

@justaugustus justaugustus left a comment

Choose a reason for hiding this comment

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

@saschagrunert -- Once kubernetes/release#1731 merges, can you pull it in here?

The logic for handling GCS suffixes gets fixed in that one.
/hold

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

@saschagrunert saschagrunert left a comment

Choose a reason for hiding this comment

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

@saschagrunert -- Once kubernetes/release#1731 merges, can you pull it in here?

The logic for handling GCS suffixes gets fixed in that one.
/hold

Done 👍

@amwat
Copy link
Contributor

amwat commented Nov 13, 2020

/lgtm

@k8s-ci-robot k8s-ci-robot added the lgtm "Looks good to me", indicates that a PR is ready to be merged. label Nov 13, 2020
We now stage the sources directly via the API provided by k/release
rather than the deprecated push-build.sh script (lives in k/release,
too).

Signed-off-by: Sascha Grunert <[email protected]>
@k8s-ci-robot k8s-ci-robot removed the lgtm "Looks good to me", indicates that a PR is ready to be merged. label Nov 16, 2020
@saschagrunert
Copy link
Member Author

Had to rebase once again to include the latest krel fixes
/unhold

@k8s-ci-robot k8s-ci-robot removed the do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. label Nov 16, 2020
@amwat
Copy link
Contributor

amwat commented Nov 16, 2020

/lgtm

@k8s-ci-robot k8s-ci-robot added the lgtm "Looks good to me", indicates that a PR is ready to be merged. label Nov 16, 2020
@k8s-ci-robot k8s-ci-robot merged commit d773dbd into kubernetes-sigs:master Nov 16, 2020
@saschagrunert saschagrunert deleted the stage-via-krel branch November 16, 2020 21:11
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/XL Denotes a PR that changes 500-999 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants