From b27ccfc7e9cf2f31f59e137b542a05dbd7fe4057 Mon Sep 17 00:00:00 2001 From: Patrick Ohly Date: Wed, 25 Aug 2021 16:15:49 +0200 Subject: [PATCH] Squashed 'release-tools/' changes from c0a4fb1d..65922ea2 https://github.com/kubernetes-csi/csi-release-tools/commit/65922ea2 Merge https://github.com/kubernetes-csi/csi-release-tools/pull/170 from pohly/canary-snapshot-controller https://github.com/kubernetes-csi/csi-release-tools/commit/c0bdfb3a prow.sh: deploy canary snapshot-controller in canary jobs https://github.com/kubernetes-csi/csi-release-tools/commit/0438f15a Merge https://github.com/kubernetes-csi/csi-release-tools/pull/167 from c0va23/feature/release-armv7-image https://github.com/kubernetes-csi/csi-release-tools/commit/4786f4d0 Merge https://github.com/kubernetes-csi/csi-release-tools/pull/168 from msau42/update-release-prereq https://github.com/kubernetes-csi/csi-release-tools/commit/6a2dc64a Remove requirement to be top-level approver. Only maintainers membership is required to do a release https://github.com/kubernetes-csi/csi-release-tools/commit/30a4f7bb Release armv7 image https://github.com/kubernetes-csi/csi-release-tools/commit/ac8108f1 Merge https://github.com/kubernetes-csi/csi-release-tools/pull/165 from consideRatio/pr/update-github-links-ref-to-master-to-HEAD https://github.com/kubernetes-csi/csi-release-tools/commit/999b483d docs: make github links reference HEAD instead of main https://github.com/kubernetes-csi/csi-release-tools/commit/fd670693 docs: make github links reference HEAD instead of master git-subtree-dir: release-tools git-subtree-split: 65922ea242d0a236d6cfd8a1022e78c4084a5cb6 --- README.md | 4 ++-- SECURITY_CONTACTS | 2 +- SIDECAR_RELEASE_PROCESS.md | 27 +++++++++++---------------- cloudbuild.yaml | 4 ++-- prow.sh | 19 +++++++++++++++---- 5 files changed, 31 insertions(+), 25 deletions(-) diff --git a/README.md b/README.md index b394724ce..4a4e56892 100644 --- a/README.md +++ b/README.md @@ -42,7 +42,7 @@ images. Building from master creates the main `canary` image. Sharing and updating -------------------- -[`git subtree`](https://github.com/git/git/blob/master/contrib/subtree/git-subtree.txt) +[`git subtree`](https://github.com/git/git/blob/HEAD/contrib/subtree/git-subtree.txt) is the recommended way of maintaining a copy of the rules inside the `release-tools` directory of a project. This way, it is possible to make changes also locally, test them and then push them back to the shared @@ -89,7 +89,7 @@ main All Kubernetes-CSI repos are expected to switch to Prow. For details on what is enabled in Prow, see -https://github.com/kubernetes/test-infra/tree/master/config/jobs/kubernetes-csi +https://github.com/kubernetes/test-infra/tree/HEAD/config/jobs/kubernetes-csi Test results for periodic jobs are visible in https://testgrid.k8s.io/sig-storage-csi-ci diff --git a/SECURITY_CONTACTS b/SECURITY_CONTACTS index 2af1414e0..d34984eb0 100644 --- a/SECURITY_CONTACTS +++ b/SECURITY_CONTACTS @@ -4,7 +4,7 @@ # to for triaging and handling of incoming issues. # # The below names agree to abide by the -# [Embargo Policy](https://github.com/kubernetes/sig-release/blob/master/security-release-process-documentation/security-release-process.md#embargo-policy) +# [Embargo Policy](https://github.com/kubernetes/sig-release/blob/HEAD/security-release-process-documentation/security-release-process.md#embargo-policy) # and will be removed and replaced if they violate that agreement. # # DO NOT REPORT SECURITY VULNERABILITIES DIRECTLY TO THESE NAMES, FOLLOW THE diff --git a/SIDECAR_RELEASE_PROCESS.md b/SIDECAR_RELEASE_PROCESS.md index 0cab8233c..e4b30e898 100644 --- a/SIDECAR_RELEASE_PROCESS.md +++ b/SIDECAR_RELEASE_PROCESS.md @@ -9,13 +9,8 @@ The release manager must: * Be a member of the kubernetes-csi organization. Open an [issue](https://github.com/kubernetes/org/issues/new?assignees=&labels=area%2Fgithub-membership&template=membership.md&title=REQUEST%3A+New+membership+for+%3Cyour-GH-handle%3E) in kubernetes/org to request membership -* Be a top level approver for the repository. To become a top level approver, - the candidate must demonstrate ownership and deep knowledge of the repository - through active maintenance, responding to and fixing issues, reviewing PRs, - test triage. -* Be part of the maintainers or admin group for the repository. admin is a - superset of maintainers, only maintainers level is required for cutting a - release. Membership can be requested by submitting a PR to kubernetes/org. +* Be part of the maintainers group for the repository. + Membership can be requested by submitting a PR to kubernetes/org. [Example](https://github.com/kubernetes/org/pull/1467) ## Updating CI Jobs @@ -31,16 +26,16 @@ naming convention `-on-`. 1. "-on-master" jobs are the closest reflection to the new Kubernetes version. 1. Fixes to our prow.sh CI script can be tested in the [CSI hostpath repo](https://github.com/kubernetes-csi/csi-driver-host-path) by modifying - [prow.sh](https://github.com/kubernetes-csi/csi-driver-host-path/blob/master/release-tools/prow.sh) + [prow.sh](https://github.com/kubernetes-csi/csi-driver-host-path/blob/HEAD/release-tools/prow.sh) along with any overrides in - [.prow.sh](https://github.com/kubernetes-csi/csi-driver-host-path/blob/master/.prow.sh) + [.prow.sh](https://github.com/kubernetes-csi/csi-driver-host-path/blob/HEAD/.prow.sh) to mirror the failing environment. Once e2e tests are passing (verify-unit tests will fail), then the prow.sh changes can be submitted to [csi-release-tools](https://github.com/kubernetes-csi/csi-release-tools). 1. Changes can then be updated in all the sidecar repos and hostpath driver repo by following the [update - instructions](https://github.com/kubernetes-csi/csi-release-tools/blob/master/README.md#sharing-and-updating). + instructions](https://github.com/kubernetes-csi/csi-release-tools/blob/HEAD/README.md#sharing-and-updating). 1. New pull and CI jobs are configured by adding new K8s versions to the top of - [gen-jobs.sh](https://github.com/kubernetes/test-infra/blob/master/config/jobs/kubernetes-csi/gen-jobs.sh). + [gen-jobs.sh](https://github.com/kubernetes/test-infra/blob/HEAD/config/jobs/kubernetes-csi/gen-jobs.sh). New pull jobs that have been unverified should be initially made optional by setting the new K8s version as [experimental](https://github.com/kubernetes/test-infra/blob/a1858f46d6014480b130789df58b230a49203a64/config/jobs/kubernetes-csi/gen-jobs.sh#L40). @@ -52,7 +47,7 @@ naming convention `-on-`. 1. Identify all issues and ongoing PRs that should go into the release, and drive them to resolution. 1. Download v2.8+ [K8s release notes - generator](https://github.com/kubernetes/release/tree/master/cmd/release-notes) + generator](https://github.com/kubernetes/release/tree/HEAD/cmd/release-notes) 1. Generate release notes for the release. Replace arguments with the relevant information. * Clean up old cached information (also needed if you are generating release @@ -95,15 +90,15 @@ naming convention `-on-`. 1. Check [image build status](https://k8s-testgrid.appspot.com/sig-storage-image-build). 1. Promote images from k8s-staging-sig-storage to k8s.gcr.io/sig-storage. From the [k8s image - repo](https://github.com/kubernetes/k8s.io/tree/main/k8s.gcr.io/images/k8s-staging-sig-storage), + repo](https://github.com/kubernetes/k8s.io/tree/HEAD/k8s.gcr.io/images/k8s-staging-sig-storage), run `./generate.sh > images.yaml`, and send a PR with the updated images. Once merged, the image promoter will copy the images from staging to prod. 1. Update [kubernetes-csi/docs](https://github.com/kubernetes-csi/docs) sidecar and feature pages with the new released version. 1. After all the sidecars have been released, update - CSI hostpath driver with the new sidecars in the [CSI repo](https://github.com/kubernetes-csi/csi-driver-host-path/tree/master/deploy) + CSI hostpath driver with the new sidecars in the [CSI repo](https://github.com/kubernetes-csi/csi-driver-host-path/tree/HEAD/deploy) and [k/k - in-tree](https://github.com/kubernetes/kubernetes/tree/master/test/e2e/testing-manifests/storage-csi/hostpath/hostpath) + in-tree](https://github.com/kubernetes/kubernetes/tree/HEAD/test/e2e/testing-manifests/storage-csi/hostpath/hostpath) ## Adding support for a new Kubernetes release @@ -134,7 +129,7 @@ naming convention `-on-`. 1. Once all sidecars for the new Kubernetes release are released, either bump the version number of the images in the existing [csi-driver-host-path - deployments](https://github.com/kubernetes-csi/csi-driver-host-path/tree/master/deploy) + deployments](https://github.com/kubernetes-csi/csi-driver-host-path/tree/HEAD/deploy) and/or create a new deployment, depending on what Kubernetes release an updated sidecar is compatible with. If no new deployment is needed, then add a symlink to document that there intentionally diff --git a/cloudbuild.yaml b/cloudbuild.yaml index 823fd1c5a..d88fca6f1 100644 --- a/cloudbuild.yaml +++ b/cloudbuild.yaml @@ -10,10 +10,10 @@ # because binaries will get built for different architectures and then # get copied from the built host into the container image # -# See https://github.com/kubernetes/test-infra/blob/master/config/jobs/image-pushing/README.md +# See https://github.com/kubernetes/test-infra/blob/HEAD/config/jobs/image-pushing/README.md # for more details on image pushing process in Kubernetes. # -# To promote release images, see https://github.com/kubernetes/k8s.io/tree/main/k8s.gcr.io/images/k8s-staging-sig-storage. +# To promote release images, see https://github.com/kubernetes/k8s.io/tree/HEAD/k8s.gcr.io/images/k8s-staging-sig-storage. # This must be specified in seconds. If omitted, defaults to 600s (10 mins). # Building three images in external-snapshotter takes roughly half an hour, diff --git a/prow.sh b/prow.sh index d1c7b27fa..d86034778 100755 --- a/prow.sh +++ b/prow.sh @@ -78,7 +78,7 @@ version_to_git () { # the list of windows versions was matched from: # - https://hub.docker.com/_/microsoft-windows-nanoserver # - https://hub.docker.com/_/microsoft-windows-servercore -configvar CSI_PROW_BUILD_PLATFORMS "linux amd64; linux ppc64le -ppc64le; linux s390x -s390x; linux arm64 -arm64; windows amd64 .exe nanoserver:1809 servercore:ltsc2019; windows amd64 .exe nanoserver:1909 servercore:1909; windows amd64 .exe nanoserver:2004 servercore:2004; windows amd64 .exe nanoserver:20H2 servercore:20H2" "Go target platforms (= GOOS + GOARCH) and file suffix of the resulting binaries" +configvar CSI_PROW_BUILD_PLATFORMS "linux amd64; linux ppc64le -ppc64le; linux s390x -s390x; linux arm -arm; linux arm64 -arm64; windows amd64 .exe nanoserver:1809 servercore:ltsc2019; windows amd64 .exe nanoserver:1909 servercore:1909; windows amd64 .exe nanoserver:2004 servercore:2004; windows amd64 .exe nanoserver:20H2 servercore:20H2" "Go target platforms (= GOOS + GOARCH) and file suffix of the resulting binaries" # If we have a vendor directory, then use it. We must be careful to only # use this for "make" invocations inside the project's repo itself because @@ -292,7 +292,7 @@ tests_need_alpha_cluster () { tests_enabled "parallel-alpha" "serial-alpha" } -# Enabling mock tests adds the "CSI mock volume" tests from https://github.com/kubernetes/kubernetes/blob/master/test/e2e/storage/csi_mock_volume.go +# Enabling mock tests adds the "CSI mock volume" tests from https://github.com/kubernetes/kubernetes/blob/HEAD/test/e2e/storage/csi_mock_volume.go # to the e2e.test invocations (serial, parallel, and the corresponding alpha variants). # When testing canary images, those get used instead of the images specified # in the e2e.test's normal YAML files. @@ -795,7 +795,7 @@ install_snapshot_controller() { kind load docker-image --name csi-prow ${NEW_IMG} || die "could not load the snapshot-controller:csiprow image into the kind cluster" # deploy snapshot-controller - echo "Deploying snapshot-controller" + echo "Deploying snapshot-controller from ${SNAPSHOT_CONTROLLER_YAML} with $NEW_IMG." # Replace image in SNAPSHOT_CONTROLLER_YAML with snapshot-controller:csiprow and deploy # NOTE: This logic is similar to the logic here: # https://github.com/kubernetes-csi/csi-driver-host-path/blob/v1.4.0/deploy/util/deploy-hostpath.sh#L155 @@ -832,8 +832,19 @@ install_snapshot_controller() { echo "$modified" exit 1 fi - echo "kubectl apply -f ${SNAPSHOT_CONTROLLER_YAML}(modified)" done + elif [ "${CSI_PROW_DRIVER_CANARY}" = "canary" ]; then + echo "Deploying snapshot-controller from ${SNAPSHOT_CONTROLLER_YAML} with canary images." + yaml="$(kubectl apply --dry-run=client -o yaml -f "$SNAPSHOT_CONTROLLER_YAML")" + # Ignore: See if you can use ${variable//search/replace} instead. + # shellcheck disable=SC2001 + modified="$(echo "$yaml" | sed -e "s;image: .*/\([^/:]*\):.*;image: ${CSI_PROW_DRIVER_CANARY_REGISTRY}/\1:canary;")" + diff <(echo "$yaml") <(echo "$modified") + if ! echo "$modified" | kubectl apply -f -; then + echo "modified version of $SNAPSHOT_CONTROLLER_YAML:" + echo "$modified" + exit 1 + fi else echo "kubectl apply -f $SNAPSHOT_CONTROLLER_YAML" kubectl apply -f "$SNAPSHOT_CONTROLLER_YAML"