From 712659952e2da7801fbd8b0235ceb764211e0a70 Mon Sep 17 00:00:00 2001 From: sayantani11 Date: Fri, 23 Jul 2021 21:08:52 +0530 Subject: [PATCH 1/8] Modified all the hardcoded GCS URIs to dl.k8s.io --- hack/terraform-gcr-init/user_project.tf | 2 +- .../test/ci/cluster-template-prow-ci-version.yaml | 12 ++++++------ ...luster-template-prow-machine-pool-ci-version.yaml | 12 ++++++------ .../test/ci/patches/control-plane-ci-version.yaml | 6 +++--- .../patches/machine-deployment-ci-version.yaml | 6 +++--- .../patches/machine-pool-ci-version.yaml | 6 +++--- 6 files changed, 22 insertions(+), 22 deletions(-) diff --git a/hack/terraform-gcr-init/user_project.tf b/hack/terraform-gcr-init/user_project.tf index e01d87a9bd8..c2848a8a1b8 100644 --- a/hack/terraform-gcr-init/user_project.tf +++ b/hack/terraform-gcr-init/user_project.tf @@ -42,7 +42,7 @@ resource "google_storage_bucket_acl" "acl" { ] provisioner "local-exec" { - command = "gsutil -m acl ch -r -u AllUsers:READ gs://artifacts.${google_project.project.project_id}.appspot.com" + command = "gsutil -m acl ch -r -u AllUsers:READ dl.k8s.io/artifacts.${google_project.project.project_id}.appspot.com" } depends_on = ["null_resource.gcr"] diff --git a/templates/test/ci/cluster-template-prow-ci-version.yaml b/templates/test/ci/cluster-template-prow-ci-version.yaml index c335c9a5980..767160786f9 100644 --- a/templates/test/ci/cluster-template-prow-ci-version.yaml +++ b/templates/test/ci/cluster-template-prow-ci-version.yaml @@ -123,7 +123,7 @@ spec: echo "* testing CI version $$CI_VERSION" # Check for semver if [[ "$${CI_VERSION}" =~ ^v[0-9]+\.[0-9]+\.[0-9]+$ ]]; then - CI_URL="gs://kubernetes-release/release/$$CI_VERSION/bin/linux/amd64" + CI_URL="dl.k8s.io/kubernetes-release/release/$$CI_VERSION/bin/linux/amd64" VERSION_WITHOUT_PREFIX="${CI_VERSION#v}" DEBIAN_FRONTEND=noninteractive apt-get install -y apt-transport-https curl curl -s https://packages.cloud.google.com/apt/doc/apt-key.gpg | apt-key add - @@ -137,9 +137,9 @@ spec: DEBIAN_FRONTEND=noninteractive apt-get install -y $$CI_PACKAGE=$$PACKAGE_VERSION done else - CI_URL="gs://k8s-release-dev/ci-periodic/$$CI_VERSION/bin/linux/amd64" + CI_URL="dl.k8s.io/k8s-release-dev/ci-periodic/$$CI_VERSION/bin/linux/amd64" if ! $${GSUTIL} ls "$${CI_URL}" > /dev/null; then - CI_URL="gs://k8s-release-dev/ci/$$CI_VERSION/bin/linux/amd64" + CI_URL="dl.k8s.io/k8s-release-dev/ci/$$CI_VERSION/bin/linux/amd64" fi for CI_PACKAGE in "$${PACKAGES_TO_TEST[@]}"; do echo "* downloading binary: $$CI_URL/$$CI_PACKAGE" @@ -311,7 +311,7 @@ spec: echo "* testing CI version $$CI_VERSION" # Check for semver if [[ "$${CI_VERSION}" =~ ^v[0-9]+\.[0-9]+\.[0-9]+$ ]]; then - CI_URL="gs://kubernetes-release/release/$$CI_VERSION/bin/linux/amd64" + CI_URL="dl.k8s.io/kubernetes-release/release/$$CI_VERSION/bin/linux/amd64" VERSION_WITHOUT_PREFIX="${CI_VERSION#v}" DEBIAN_FRONTEND=noninteractive apt-get install -y apt-transport-https curl curl -s https://packages.cloud.google.com/apt/doc/apt-key.gpg | apt-key add - @@ -325,9 +325,9 @@ spec: DEBIAN_FRONTEND=noninteractive apt-get install -y $$CI_PACKAGE=$$PACKAGE_VERSION done else - CI_URL="gs://k8s-release-dev/ci-periodic/$$CI_VERSION/bin/linux/amd64" + CI_URL="dl.k8s.io/k8s-release-dev/ci-periodic/$$CI_VERSION/bin/linux/amd64" if ! $${GSUTIL} ls "$${CI_URL}" > /dev/null; then - CI_URL="gs://k8s-release-dev/ci/$$CI_VERSION/bin/linux/amd64" + CI_URL="dl.k8s.io/k8s-release-dev/ci/$$CI_VERSION/bin/linux/amd64" fi for CI_PACKAGE in "$${PACKAGES_TO_TEST[@]}"; do echo "* downloading binary: $$CI_URL/$$CI_PACKAGE" diff --git a/templates/test/ci/cluster-template-prow-machine-pool-ci-version.yaml b/templates/test/ci/cluster-template-prow-machine-pool-ci-version.yaml index a5d60bbb1f2..0edcb58b76f 100644 --- a/templates/test/ci/cluster-template-prow-machine-pool-ci-version.yaml +++ b/templates/test/ci/cluster-template-prow-machine-pool-ci-version.yaml @@ -123,7 +123,7 @@ spec: echo "* testing CI version $$CI_VERSION" # Check for semver if [[ "$${CI_VERSION}" =~ ^v[0-9]+\.[0-9]+\.[0-9]+$ ]]; then - CI_URL="gs://kubernetes-release/release/$$CI_VERSION/bin/linux/amd64" + CI_URL="dl.k8s.io/kubernetes-release/release/$$CI_VERSION/bin/linux/amd64" VERSION_WITHOUT_PREFIX="${CI_VERSION#v}" DEBIAN_FRONTEND=noninteractive apt-get install -y apt-transport-https curl curl -s https://packages.cloud.google.com/apt/doc/apt-key.gpg | apt-key add - @@ -137,9 +137,9 @@ spec: DEBIAN_FRONTEND=noninteractive apt-get install -y $$CI_PACKAGE=$$PACKAGE_VERSION done else - CI_URL="gs://k8s-release-dev/ci-periodic/$$CI_VERSION/bin/linux/amd64" + CI_URL="dl.k8s.io/k8s-release-dev/ci-periodic/$$CI_VERSION/bin/linux/amd64" if ! $${GSUTIL} ls "$${CI_URL}" > /dev/null; then - CI_URL="gs://k8s-release-dev/ci/$$CI_VERSION/bin/linux/amd64" + CI_URL="dl.k8s.io/k8s-release-dev/ci/$$CI_VERSION/bin/linux/amd64" fi for CI_PACKAGE in "$${PACKAGES_TO_TEST[@]}"; do echo "* downloading binary: $$CI_URL/$$CI_PACKAGE" @@ -313,7 +313,7 @@ spec: echo "* testing CI version $$CI_VERSION" # Check for semver if [[ "$${CI_VERSION}" =~ ^v[0-9]+\.[0-9]+\.[0-9]+$ ]]; then - CI_URL="gs://kubernetes-release/release/$$CI_VERSION/bin/linux/amd64" + CI_URL="dl.k8s.io/kubernetes-release/release/$$CI_VERSION/bin/linux/amd64" VERSION_WITHOUT_PREFIX="${CI_VERSION#v}" DEBIAN_FRONTEND=noninteractive apt-get install -y apt-transport-https curl curl -s https://packages.cloud.google.com/apt/doc/apt-key.gpg | apt-key add - @@ -327,9 +327,9 @@ spec: DEBIAN_FRONTEND=noninteractive apt-get install -y $$CI_PACKAGE=$$PACKAGE_VERSION done else - CI_URL="gs://k8s-release-dev/ci-periodic/$$CI_VERSION/bin/linux/amd64" + CI_URL="dl.k8s.io/k8s-release-dev/ci-periodic/$$CI_VERSION/bin/linux/amd64" if ! $${GSUTIL} ls "$${CI_URL}" > /dev/null; then - CI_URL="gs://k8s-release-dev/ci/$$CI_VERSION/bin/linux/amd64" + CI_URL="dl.k8s.io/k8s-release-dev/ci/$$CI_VERSION/bin/linux/amd64" fi for CI_PACKAGE in "$${PACKAGES_TO_TEST[@]}"; do echo "* downloading binary: $$CI_URL/$$CI_PACKAGE" diff --git a/templates/test/ci/patches/control-plane-ci-version.yaml b/templates/test/ci/patches/control-plane-ci-version.yaml index 10840e0713f..9e922073e0a 100644 --- a/templates/test/ci/patches/control-plane-ci-version.yaml +++ b/templates/test/ci/patches/control-plane-ci-version.yaml @@ -44,7 +44,7 @@ spec: echo "* testing CI version $$CI_VERSION" # Check for semver if [[ "$${CI_VERSION}" =~ ^v[0-9]+\.[0-9]+\.[0-9]+$ ]]; then - CI_URL="gs://kubernetes-release/release/$$CI_VERSION/bin/linux/amd64" + CI_URL="dl.k8s.io/kubernetes-release/release/$$CI_VERSION/bin/linux/amd64" VERSION_WITHOUT_PREFIX="${CI_VERSION#v}" DEBIAN_FRONTEND=noninteractive apt-get install -y apt-transport-https curl curl -s https://packages.cloud.google.com/apt/doc/apt-key.gpg | apt-key add - @@ -58,9 +58,9 @@ spec: DEBIAN_FRONTEND=noninteractive apt-get install -y $$CI_PACKAGE=$$PACKAGE_VERSION done else - CI_URL="gs://k8s-release-dev/ci-periodic/$$CI_VERSION/bin/linux/amd64" + CI_URL="dl.k8s.io/k8s-release-dev/ci-periodic/$$CI_VERSION/bin/linux/amd64" if ! $${GSUTIL} ls "$${CI_URL}" > /dev/null; then - CI_URL="gs://k8s-release-dev/ci/$$CI_VERSION/bin/linux/amd64" + CI_URL="dl.k8s.io/k8s-release-dev/ci/$$CI_VERSION/bin/linux/amd64" fi for CI_PACKAGE in "$${PACKAGES_TO_TEST[@]}"; do echo "* downloading binary: $$CI_URL/$$CI_PACKAGE" diff --git a/templates/test/ci/prow-ci-version/patches/machine-deployment-ci-version.yaml b/templates/test/ci/prow-ci-version/patches/machine-deployment-ci-version.yaml index 52ad190d7e6..9068571f3ed 100644 --- a/templates/test/ci/prow-ci-version/patches/machine-deployment-ci-version.yaml +++ b/templates/test/ci/prow-ci-version/patches/machine-deployment-ci-version.yaml @@ -42,7 +42,7 @@ spec: echo "* testing CI version $$CI_VERSION" # Check for semver if [[ "$${CI_VERSION}" =~ ^v[0-9]+\.[0-9]+\.[0-9]+$ ]]; then - CI_URL="gs://kubernetes-release/release/$$CI_VERSION/bin/linux/amd64" + CI_URL="dl.k8s.io/kubernetes-release/release/$$CI_VERSION/bin/linux/amd64" VERSION_WITHOUT_PREFIX="${CI_VERSION#v}" DEBIAN_FRONTEND=noninteractive apt-get install -y apt-transport-https curl curl -s https://packages.cloud.google.com/apt/doc/apt-key.gpg | apt-key add - @@ -56,9 +56,9 @@ spec: DEBIAN_FRONTEND=noninteractive apt-get install -y $$CI_PACKAGE=$$PACKAGE_VERSION done else - CI_URL="gs://k8s-release-dev/ci-periodic/$$CI_VERSION/bin/linux/amd64" + CI_URL="dl.k8s.io/k8s-release-dev/ci-periodic/$$CI_VERSION/bin/linux/amd64" if ! $${GSUTIL} ls "$${CI_URL}" > /dev/null; then - CI_URL="gs://k8s-release-dev/ci/$$CI_VERSION/bin/linux/amd64" + CI_URL="dl.k8s.io/k8s-release-dev/ci/$$CI_VERSION/bin/linux/amd64" fi for CI_PACKAGE in "$${PACKAGES_TO_TEST[@]}"; do echo "* downloading binary: $$CI_URL/$$CI_PACKAGE" diff --git a/templates/test/ci/prow-machine-pool-ci-version/patches/machine-pool-ci-version.yaml b/templates/test/ci/prow-machine-pool-ci-version/patches/machine-pool-ci-version.yaml index 98f788230cd..16025014445 100644 --- a/templates/test/ci/prow-machine-pool-ci-version/patches/machine-pool-ci-version.yaml +++ b/templates/test/ci/prow-machine-pool-ci-version/patches/machine-pool-ci-version.yaml @@ -40,7 +40,7 @@ spec: echo "* testing CI version $$CI_VERSION" # Check for semver if [[ "$${CI_VERSION}" =~ ^v[0-9]+\.[0-9]+\.[0-9]+$ ]]; then - CI_URL="gs://kubernetes-release/release/$$CI_VERSION/bin/linux/amd64" + CI_URL="dl.k8s.io/kubernetes-release/release/$$CI_VERSION/bin/linux/amd64" VERSION_WITHOUT_PREFIX="${CI_VERSION#v}" DEBIAN_FRONTEND=noninteractive apt-get install -y apt-transport-https curl curl -s https://packages.cloud.google.com/apt/doc/apt-key.gpg | apt-key add - @@ -54,9 +54,9 @@ spec: DEBIAN_FRONTEND=noninteractive apt-get install -y $$CI_PACKAGE=$$PACKAGE_VERSION done else - CI_URL="gs://k8s-release-dev/ci-periodic/$$CI_VERSION/bin/linux/amd64" + CI_URL="dl.k8s.io/k8s-release-dev/ci-periodic/$$CI_VERSION/bin/linux/amd64" if ! $${GSUTIL} ls "$${CI_URL}" > /dev/null; then - CI_URL="gs://k8s-release-dev/ci/$$CI_VERSION/bin/linux/amd64" + CI_URL="dl.k8s.io/k8s-release-dev/ci/$$CI_VERSION/bin/linux/amd64" fi for CI_PACKAGE in "$${PACKAGES_TO_TEST[@]}"; do echo "* downloading binary: $$CI_URL/$$CI_PACKAGE" From 9a9273cc0a1e94ff9062eab293d2a490820e03a4 Mon Sep 17 00:00:00 2001 From: sayantani11 Date: Sat, 24 Jul 2021 00:17:18 +0530 Subject: [PATCH 2/8] Replaced dl.k8s.io with gs:// where it was necessary --- hack/terraform-gcr-init/user_project.tf | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/hack/terraform-gcr-init/user_project.tf b/hack/terraform-gcr-init/user_project.tf index c2848a8a1b8..e01d87a9bd8 100644 --- a/hack/terraform-gcr-init/user_project.tf +++ b/hack/terraform-gcr-init/user_project.tf @@ -42,7 +42,7 @@ resource "google_storage_bucket_acl" "acl" { ] provisioner "local-exec" { - command = "gsutil -m acl ch -r -u AllUsers:READ dl.k8s.io/artifacts.${google_project.project.project_id}.appspot.com" + command = "gsutil -m acl ch -r -u AllUsers:READ gs://artifacts.${google_project.project.project_id}.appspot.com" } depends_on = ["null_resource.gcr"] From 8ce66a1853bff0669594e98a47c7c4c6810fddb7 Mon Sep 17 00:00:00 2001 From: sayantani11 Date: Sat, 24 Jul 2021 00:32:38 +0530 Subject: [PATCH 3/8] removed the GSUTIL install and replaced the GSUTIL calls with wget --- ...template-prow-machine-pool-ci-version.yaml | 30 +++++-------------- 1 file changed, 8 insertions(+), 22 deletions(-) diff --git a/templates/test/ci/cluster-template-prow-machine-pool-ci-version.yaml b/templates/test/ci/cluster-template-prow-machine-pool-ci-version.yaml index 0edcb58b76f..136210ea13f 100644 --- a/templates/test/ci/cluster-template-prow-machine-pool-ci-version.yaml +++ b/templates/test/ci/cluster-template-prow-machine-pool-ci-version.yaml @@ -99,14 +99,7 @@ spec: set -o pipefail set -o errexit [[ $(id -u) != 0 ]] && SUDO="sudo" || SUDO="" - GSUTIL=gsutil - if ! command -v $${GSUTIL} > /dev/null; then - curl -sSL https://sdk.cloud.google.com > /tmp/gcl && bash /tmp/gcl --install-dir=~/gcloud --disable-prompts > /dev/null 2>&1 - GSUTIL=~/gcloud/google-cloud-sdk/bin/gsutil - # For faster downloads - pip install --no-cache-dir -U crcmod - fi - $${GSUTIL} version + # This test installs release packages or binaries that are a result of the CI and release builds. # It runs '... --version' commands to verify that the binaries are correctly installed # and finally uninstalls the packages. @@ -138,12 +131,12 @@ spec: done else CI_URL="dl.k8s.io/k8s-release-dev/ci-periodic/$$CI_VERSION/bin/linux/amd64" - if ! $${GSUTIL} ls "$${CI_URL}" > /dev/null; then + if ! $${wget} ls "$${CI_URL}" > /dev/null; then CI_URL="dl.k8s.io/k8s-release-dev/ci/$$CI_VERSION/bin/linux/amd64" fi for CI_PACKAGE in "$${PACKAGES_TO_TEST[@]}"; do echo "* downloading binary: $$CI_URL/$$CI_PACKAGE" - $${GSUTIL} cp "$$CI_URL/$$CI_PACKAGE" "$$CI_DIR/$$CI_PACKAGE" + $${wget} cp "$$CI_URL/$$CI_PACKAGE" "$$CI_DIR/$$CI_PACKAGE" chmod +x "$$CI_DIR/$$CI_PACKAGE" mv "$$CI_DIR/$$CI_PACKAGE" "/usr/bin/$$CI_PACKAGE" done @@ -151,7 +144,7 @@ spec: fi for CI_CONTAINER in "$${CONTAINERS_TO_TEST[@]}"; do echo "* downloading package: $$CI_URL/$$CI_CONTAINER.$$CONTAINER_EXT" - $${GSUTIL} cp "$$CI_URL/$$CI_CONTAINER.$$CONTAINER_EXT" "$$CI_DIR/$$CI_CONTAINER.$$CONTAINER_EXT" + $${wget} cp "$$CI_URL/$$CI_CONTAINER.$$CONTAINER_EXT" "$$CI_DIR/$$CI_CONTAINER.$$CONTAINER_EXT" $${SUDO} ctr -n k8s.io images import "$$CI_DIR/$$CI_CONTAINER.$$CONTAINER_EXT" || echo "* ignoring expected 'ctr images import' result" $${SUDO} ctr -n k8s.io images tag k8s.gcr.io/$$CI_CONTAINER-amd64:"$${CI_VERSION//+/_}" k8s.gcr.io/$$CI_CONTAINER:"$${CI_VERSION//+/_}" $${SUDO} ctr -n k8s.io images tag k8s.gcr.io/$$CI_CONTAINER-amd64:"$${CI_VERSION//+/_}" gcr.io/k8s-staging-ci-images/$$CI_CONTAINER:"$${CI_VERSION//+/_}" @@ -289,14 +282,7 @@ spec: set -o pipefail set -o errexit [[ $(id -u) != 0 ]] && SUDO="sudo" || SUDO="" - GSUTIL=gsutil - if ! command -v $${GSUTIL} > /dev/null; then - curl -sSL https://sdk.cloud.google.com > /tmp/gcl && bash /tmp/gcl --install-dir=~/gcloud --disable-prompts > /dev/null 2>&1 - GSUTIL=~/gcloud/google-cloud-sdk/bin/gsutil - # For faster downloads - pip install --no-cache-dir -U crcmod - fi - $${GSUTIL} version + # This test installs release packages or binaries that are a result of the CI and release builds. # It runs '... --version' commands to verify that the binaries are correctly installed # and finally uninstalls the packages. @@ -328,12 +314,12 @@ spec: done else CI_URL="dl.k8s.io/k8s-release-dev/ci-periodic/$$CI_VERSION/bin/linux/amd64" - if ! $${GSUTIL} ls "$${CI_URL}" > /dev/null; then + if ! $${wget} ls "$${CI_URL}" > /dev/null; then CI_URL="dl.k8s.io/k8s-release-dev/ci/$$CI_VERSION/bin/linux/amd64" fi for CI_PACKAGE in "$${PACKAGES_TO_TEST[@]}"; do echo "* downloading binary: $$CI_URL/$$CI_PACKAGE" - $${GSUTIL} cp "$$CI_URL/$$CI_PACKAGE" "$$CI_DIR/$$CI_PACKAGE" + $${wget} cp "$$CI_URL/$$CI_PACKAGE" "$$CI_DIR/$$CI_PACKAGE" chmod +x "$$CI_DIR/$$CI_PACKAGE" mv "$$CI_DIR/$$CI_PACKAGE" "/usr/bin/$$CI_PACKAGE" done @@ -341,7 +327,7 @@ spec: fi for CI_CONTAINER in "$${CONTAINERS_TO_TEST[@]}"; do echo "* downloading package: $$CI_URL/$$CI_CONTAINER.$$CONTAINER_EXT" - $${GSUTIL} cp "$$CI_URL/$$CI_CONTAINER.$$CONTAINER_EXT" "$$CI_DIR/$$CI_CONTAINER.$$CONTAINER_EXT" + $${wget} cp "$$CI_URL/$$CI_CONTAINER.$$CONTAINER_EXT" "$$CI_DIR/$$CI_CONTAINER.$$CONTAINER_EXT" $${SUDO} ctr -n k8s.io images import "$$CI_DIR/$$CI_CONTAINER.$$CONTAINER_EXT" || echo "* ignoring expected 'ctr images import' result" $${SUDO} ctr -n k8s.io images tag k8s.gcr.io/$$CI_CONTAINER-amd64:"$${CI_VERSION//+/_}" k8s.gcr.io/$$CI_CONTAINER:"$${CI_VERSION//+/_}" $${SUDO} ctr -n k8s.io images tag k8s.gcr.io/$$CI_CONTAINER-amd64:"$${CI_VERSION//+/_}" gcr.io/k8s-staging-ci-images/$$CI_CONTAINER:"$${CI_VERSION//+/_}" From b5fb5e24a1661d2c32ac1e831cd1efab98ee48af Mon Sep 17 00:00:00 2001 From: sayantani11 Date: Sat, 24 Jul 2021 00:38:18 +0530 Subject: [PATCH 4/8] Gsutil replaced by wget --- ...luster-template-prow-machine-pool-ci-version.yaml | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/templates/test/ci/cluster-template-prow-machine-pool-ci-version.yaml b/templates/test/ci/cluster-template-prow-machine-pool-ci-version.yaml index 136210ea13f..47c618b31ab 100644 --- a/templates/test/ci/cluster-template-prow-machine-pool-ci-version.yaml +++ b/templates/test/ci/cluster-template-prow-machine-pool-ci-version.yaml @@ -131,12 +131,12 @@ spec: done else CI_URL="dl.k8s.io/k8s-release-dev/ci-periodic/$$CI_VERSION/bin/linux/amd64" - if ! $${wget} ls "$${CI_URL}" > /dev/null; then + if ! wget"$${CI_URL}" > /dev/null; then CI_URL="dl.k8s.io/k8s-release-dev/ci/$$CI_VERSION/bin/linux/amd64" fi for CI_PACKAGE in "$${PACKAGES_TO_TEST[@]}"; do echo "* downloading binary: $$CI_URL/$$CI_PACKAGE" - $${wget} cp "$$CI_URL/$$CI_PACKAGE" "$$CI_DIR/$$CI_PACKAGE" + wget"$$CI_URL/$$CI_PACKAGE" "$$CI_DIR/$$CI_PACKAGE" chmod +x "$$CI_DIR/$$CI_PACKAGE" mv "$$CI_DIR/$$CI_PACKAGE" "/usr/bin/$$CI_PACKAGE" done @@ -144,7 +144,7 @@ spec: fi for CI_CONTAINER in "$${CONTAINERS_TO_TEST[@]}"; do echo "* downloading package: $$CI_URL/$$CI_CONTAINER.$$CONTAINER_EXT" - $${wget} cp "$$CI_URL/$$CI_CONTAINER.$$CONTAINER_EXT" "$$CI_DIR/$$CI_CONTAINER.$$CONTAINER_EXT" + wget"$$CI_URL/$$CI_CONTAINER.$$CONTAINER_EXT" "$$CI_DIR/$$CI_CONTAINER.$$CONTAINER_EXT" $${SUDO} ctr -n k8s.io images import "$$CI_DIR/$$CI_CONTAINER.$$CONTAINER_EXT" || echo "* ignoring expected 'ctr images import' result" $${SUDO} ctr -n k8s.io images tag k8s.gcr.io/$$CI_CONTAINER-amd64:"$${CI_VERSION//+/_}" k8s.gcr.io/$$CI_CONTAINER:"$${CI_VERSION//+/_}" $${SUDO} ctr -n k8s.io images tag k8s.gcr.io/$$CI_CONTAINER-amd64:"$${CI_VERSION//+/_}" gcr.io/k8s-staging-ci-images/$$CI_CONTAINER:"$${CI_VERSION//+/_}" @@ -314,12 +314,12 @@ spec: done else CI_URL="dl.k8s.io/k8s-release-dev/ci-periodic/$$CI_VERSION/bin/linux/amd64" - if ! $${wget} ls "$${CI_URL}" > /dev/null; then + if ! wget"$${CI_URL}" > /dev/null; then CI_URL="dl.k8s.io/k8s-release-dev/ci/$$CI_VERSION/bin/linux/amd64" fi for CI_PACKAGE in "$${PACKAGES_TO_TEST[@]}"; do echo "* downloading binary: $$CI_URL/$$CI_PACKAGE" - $${wget} cp "$$CI_URL/$$CI_PACKAGE" "$$CI_DIR/$$CI_PACKAGE" + wget"$$CI_URL/$$CI_PACKAGE" "$$CI_DIR/$$CI_PACKAGE" chmod +x "$$CI_DIR/$$CI_PACKAGE" mv "$$CI_DIR/$$CI_PACKAGE" "/usr/bin/$$CI_PACKAGE" done @@ -327,7 +327,7 @@ spec: fi for CI_CONTAINER in "$${CONTAINERS_TO_TEST[@]}"; do echo "* downloading package: $$CI_URL/$$CI_CONTAINER.$$CONTAINER_EXT" - $${wget} cp "$$CI_URL/$$CI_CONTAINER.$$CONTAINER_EXT" "$$CI_DIR/$$CI_CONTAINER.$$CONTAINER_EXT" + wget"$$CI_URL/$$CI_CONTAINER.$$CONTAINER_EXT" "$$CI_DIR/$$CI_CONTAINER.$$CONTAINER_EXT" $${SUDO} ctr -n k8s.io images import "$$CI_DIR/$$CI_CONTAINER.$$CONTAINER_EXT" || echo "* ignoring expected 'ctr images import' result" $${SUDO} ctr -n k8s.io images tag k8s.gcr.io/$$CI_CONTAINER-amd64:"$${CI_VERSION//+/_}" k8s.gcr.io/$$CI_CONTAINER:"$${CI_VERSION//+/_}" $${SUDO} ctr -n k8s.io images tag k8s.gcr.io/$$CI_CONTAINER-amd64:"$${CI_VERSION//+/_}" gcr.io/k8s-staging-ci-images/$$CI_CONTAINER:"$${CI_VERSION//+/_}" From 9b2d21c89df36c73a29ce088ddcebe247e3e3128 Mon Sep 17 00:00:00 2001 From: sayantani11 Date: Sat, 24 Jul 2021 00:51:40 +0530 Subject: [PATCH 5/8] Replaced the .Gsutil ls command --- .../ci/cluster-template-prow-machine-pool-ci-version.yaml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/templates/test/ci/cluster-template-prow-machine-pool-ci-version.yaml b/templates/test/ci/cluster-template-prow-machine-pool-ci-version.yaml index 47c618b31ab..b69d47afb13 100644 --- a/templates/test/ci/cluster-template-prow-machine-pool-ci-version.yaml +++ b/templates/test/ci/cluster-template-prow-machine-pool-ci-version.yaml @@ -131,7 +131,7 @@ spec: done else CI_URL="dl.k8s.io/k8s-release-dev/ci-periodic/$$CI_VERSION/bin/linux/amd64" - if ! wget"$${CI_URL}" > /dev/null; then + if ! CI_URL="https://storage.googleapis.com/k8s-release-dev/ci/$${KUBERNETES_VERSION}/bin/linux/amd64""$${CI_URL}" > /dev/null; then CI_URL="dl.k8s.io/k8s-release-dev/ci/$$CI_VERSION/bin/linux/amd64" fi for CI_PACKAGE in "$${PACKAGES_TO_TEST[@]}"; do @@ -314,7 +314,7 @@ spec: done else CI_URL="dl.k8s.io/k8s-release-dev/ci-periodic/$$CI_VERSION/bin/linux/amd64" - if ! wget"$${CI_URL}" > /dev/null; then + if ! CI_URL="https://storage.googleapis.com/k8s-release-dev/ci/$${KUBERNETES_VERSION}/bin/linux/amd64""$${CI_URL}" > /dev/null; then CI_URL="dl.k8s.io/k8s-release-dev/ci/$$CI_VERSION/bin/linux/amd64" fi for CI_PACKAGE in "$${PACKAGES_TO_TEST[@]}"; do From 877b889ab0c258bd2540f7d9c248decfe12e3da6 Mon Sep 17 00:00:00 2001 From: sayantani11 Date: Sat, 24 Jul 2021 01:00:45 +0530 Subject: [PATCH 6/8] small error fixed in wget command --- .../ci/cluster-template-prow-machine-pool-ci-version.yaml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/templates/test/ci/cluster-template-prow-machine-pool-ci-version.yaml b/templates/test/ci/cluster-template-prow-machine-pool-ci-version.yaml index b69d47afb13..10ab836835f 100644 --- a/templates/test/ci/cluster-template-prow-machine-pool-ci-version.yaml +++ b/templates/test/ci/cluster-template-prow-machine-pool-ci-version.yaml @@ -136,7 +136,7 @@ spec: fi for CI_PACKAGE in "$${PACKAGES_TO_TEST[@]}"; do echo "* downloading binary: $$CI_URL/$$CI_PACKAGE" - wget"$$CI_URL/$$CI_PACKAGE" "$$CI_DIR/$$CI_PACKAGE" + wget "$${CI_URL}/$${CI_PACKAGE}" -O "$${CI_DIR}/$${CI_PACKAGE} chmod +x "$$CI_DIR/$$CI_PACKAGE" mv "$$CI_DIR/$$CI_PACKAGE" "/usr/bin/$$CI_PACKAGE" done @@ -144,7 +144,7 @@ spec: fi for CI_CONTAINER in "$${CONTAINERS_TO_TEST[@]}"; do echo "* downloading package: $$CI_URL/$$CI_CONTAINER.$$CONTAINER_EXT" - wget"$$CI_URL/$$CI_CONTAINER.$$CONTAINER_EXT" "$$CI_DIR/$$CI_CONTAINER.$$CONTAINER_EXT" + wget"$$CI_URL/$$CI_CONTAINER.$$CONTAINER_EXT" -O "$$CI_DIR/$$CI_CONTAINER.$$CONTAINER_EXT" $${SUDO} ctr -n k8s.io images import "$$CI_DIR/$$CI_CONTAINER.$$CONTAINER_EXT" || echo "* ignoring expected 'ctr images import' result" $${SUDO} ctr -n k8s.io images tag k8s.gcr.io/$$CI_CONTAINER-amd64:"$${CI_VERSION//+/_}" k8s.gcr.io/$$CI_CONTAINER:"$${CI_VERSION//+/_}" $${SUDO} ctr -n k8s.io images tag k8s.gcr.io/$$CI_CONTAINER-amd64:"$${CI_VERSION//+/_}" gcr.io/k8s-staging-ci-images/$$CI_CONTAINER:"$${CI_VERSION//+/_}" @@ -319,7 +319,7 @@ spec: fi for CI_PACKAGE in "$${PACKAGES_TO_TEST[@]}"; do echo "* downloading binary: $$CI_URL/$$CI_PACKAGE" - wget"$$CI_URL/$$CI_PACKAGE" "$$CI_DIR/$$CI_PACKAGE" + wget "$${CI_URL}/$${CI_PACKAGE}" -O "$${CI_DIR}/$${CI_PACKAGE} chmod +x "$$CI_DIR/$$CI_PACKAGE" mv "$$CI_DIR/$$CI_PACKAGE" "/usr/bin/$$CI_PACKAGE" done @@ -327,7 +327,7 @@ spec: fi for CI_CONTAINER in "$${CONTAINERS_TO_TEST[@]}"; do echo "* downloading package: $$CI_URL/$$CI_CONTAINER.$$CONTAINER_EXT" - wget"$$CI_URL/$$CI_CONTAINER.$$CONTAINER_EXT" "$$CI_DIR/$$CI_CONTAINER.$$CONTAINER_EXT" + wget"$$CI_URL/$$CI_CONTAINER.$$CONTAINER_EXT" -O "$$CI_DIR/$$CI_CONTAINER.$$CONTAINER_EXT" $${SUDO} ctr -n k8s.io images import "$$CI_DIR/$$CI_CONTAINER.$$CONTAINER_EXT" || echo "* ignoring expected 'ctr images import' result" $${SUDO} ctr -n k8s.io images tag k8s.gcr.io/$$CI_CONTAINER-amd64:"$${CI_VERSION//+/_}" k8s.gcr.io/$$CI_CONTAINER:"$${CI_VERSION//+/_}" $${SUDO} ctr -n k8s.io images tag k8s.gcr.io/$$CI_CONTAINER-amd64:"$${CI_VERSION//+/_}" gcr.io/k8s-staging-ci-images/$$CI_CONTAINER:"$${CI_VERSION//+/_}" From fc65ad9b72437e2fc6dc914339e1ecff4fb0e14a Mon Sep 17 00:00:00 2001 From: sayantani11 Date: Sat, 24 Jul 2021 18:41:12 +0530 Subject: [PATCH 7/8] Changes to commands --- ...luster-template-prow-machine-pool-ci-version.yaml | 12 ++++-------- 1 file changed, 4 insertions(+), 8 deletions(-) diff --git a/templates/test/ci/cluster-template-prow-machine-pool-ci-version.yaml b/templates/test/ci/cluster-template-prow-machine-pool-ci-version.yaml index 10ab836835f..e286e643667 100644 --- a/templates/test/ci/cluster-template-prow-machine-pool-ci-version.yaml +++ b/templates/test/ci/cluster-template-prow-machine-pool-ci-version.yaml @@ -130,9 +130,7 @@ spec: DEBIAN_FRONTEND=noninteractive apt-get install -y $$CI_PACKAGE=$$PACKAGE_VERSION done else - CI_URL="dl.k8s.io/k8s-release-dev/ci-periodic/$$CI_VERSION/bin/linux/amd64" - if ! CI_URL="https://storage.googleapis.com/k8s-release-dev/ci/$${KUBERNETES_VERSION}/bin/linux/amd64""$${CI_URL}" > /dev/null; then - CI_URL="dl.k8s.io/k8s-release-dev/ci/$$CI_VERSION/bin/linux/amd64" + CI_URL="dlCI_URL="https://storage.googleapis.com/k8s-release-dev/ci/$${KUBERNETES_VERSION}/bin/linux/amd64".k8s.io/k8s-release-dev/ci-periodic/$$CI_VERSION/bin/linux/amd64" fi for CI_PACKAGE in "$${PACKAGES_TO_TEST[@]}"; do echo "* downloading binary: $$CI_URL/$$CI_PACKAGE" @@ -144,7 +142,7 @@ spec: fi for CI_CONTAINER in "$${CONTAINERS_TO_TEST[@]}"; do echo "* downloading package: $$CI_URL/$$CI_CONTAINER.$$CONTAINER_EXT" - wget"$$CI_URL/$$CI_CONTAINER.$$CONTAINER_EXT" -O "$$CI_DIR/$$CI_CONTAINER.$$CONTAINER_EXT" + wget "$$CI_URL/$$CI_CONTAINER.$$CONTAINER_EXT" -O "$$CI_DIR/$$CI_CONTAINER.$$CONTAINER_EXT" $${SUDO} ctr -n k8s.io images import "$$CI_DIR/$$CI_CONTAINER.$$CONTAINER_EXT" || echo "* ignoring expected 'ctr images import' result" $${SUDO} ctr -n k8s.io images tag k8s.gcr.io/$$CI_CONTAINER-amd64:"$${CI_VERSION//+/_}" k8s.gcr.io/$$CI_CONTAINER:"$${CI_VERSION//+/_}" $${SUDO} ctr -n k8s.io images tag k8s.gcr.io/$$CI_CONTAINER-amd64:"$${CI_VERSION//+/_}" gcr.io/k8s-staging-ci-images/$$CI_CONTAINER:"$${CI_VERSION//+/_}" @@ -313,9 +311,7 @@ spec: DEBIAN_FRONTEND=noninteractive apt-get install -y $$CI_PACKAGE=$$PACKAGE_VERSION done else - CI_URL="dl.k8s.io/k8s-release-dev/ci-periodic/$$CI_VERSION/bin/linux/amd64" - if ! CI_URL="https://storage.googleapis.com/k8s-release-dev/ci/$${KUBERNETES_VERSION}/bin/linux/amd64""$${CI_URL}" > /dev/null; then - CI_URL="dl.k8s.io/k8s-release-dev/ci/$$CI_VERSION/bin/linux/amd64" + CI_URL="https://storage.googleapis.com/k8s-release-dev/ci/$${KUBERNETES_VERSION}/bin/linux/amd64" fi for CI_PACKAGE in "$${PACKAGES_TO_TEST[@]}"; do echo "* downloading binary: $$CI_URL/$$CI_PACKAGE" @@ -327,7 +323,7 @@ spec: fi for CI_CONTAINER in "$${CONTAINERS_TO_TEST[@]}"; do echo "* downloading package: $$CI_URL/$$CI_CONTAINER.$$CONTAINER_EXT" - wget"$$CI_URL/$$CI_CONTAINER.$$CONTAINER_EXT" -O "$$CI_DIR/$$CI_CONTAINER.$$CONTAINER_EXT" + wget "$$CI_URL/$$CI_CONTAINER.$$CONTAINER_EXT" -O "$$CI_DIR/$$CI_CONTAINER.$$CONTAINER_EXT" $${SUDO} ctr -n k8s.io images import "$$CI_DIR/$$CI_CONTAINER.$$CONTAINER_EXT" || echo "* ignoring expected 'ctr images import' result" $${SUDO} ctr -n k8s.io images tag k8s.gcr.io/$$CI_CONTAINER-amd64:"$${CI_VERSION//+/_}" k8s.gcr.io/$$CI_CONTAINER:"$${CI_VERSION//+/_}" $${SUDO} ctr -n k8s.io images tag k8s.gcr.io/$$CI_CONTAINER-amd64:"$${CI_VERSION//+/_}" gcr.io/k8s-staging-ci-images/$$CI_CONTAINER:"$${CI_VERSION//+/_}" From c70b5f1551851e649726d5b6c372eb5f2bc67eb3 Mon Sep 17 00:00:00 2001 From: sayantani11 Date: Mon, 26 Jul 2021 22:14:03 +0530 Subject: [PATCH 8/8] changes to cluster-template-prow-machine-pool-ci-version.yaml --- ...template-prow-machine-pool-ci-version.yaml | 34 ++++++++++++++----- 1 file changed, 26 insertions(+), 8 deletions(-) diff --git a/templates/test/ci/cluster-template-prow-machine-pool-ci-version.yaml b/templates/test/ci/cluster-template-prow-machine-pool-ci-version.yaml index e286e643667..0edcb58b76f 100644 --- a/templates/test/ci/cluster-template-prow-machine-pool-ci-version.yaml +++ b/templates/test/ci/cluster-template-prow-machine-pool-ci-version.yaml @@ -99,7 +99,14 @@ spec: set -o pipefail set -o errexit [[ $(id -u) != 0 ]] && SUDO="sudo" || SUDO="" - + GSUTIL=gsutil + if ! command -v $${GSUTIL} > /dev/null; then + curl -sSL https://sdk.cloud.google.com > /tmp/gcl && bash /tmp/gcl --install-dir=~/gcloud --disable-prompts > /dev/null 2>&1 + GSUTIL=~/gcloud/google-cloud-sdk/bin/gsutil + # For faster downloads + pip install --no-cache-dir -U crcmod + fi + $${GSUTIL} version # This test installs release packages or binaries that are a result of the CI and release builds. # It runs '... --version' commands to verify that the binaries are correctly installed # and finally uninstalls the packages. @@ -130,11 +137,13 @@ spec: DEBIAN_FRONTEND=noninteractive apt-get install -y $$CI_PACKAGE=$$PACKAGE_VERSION done else - CI_URL="dlCI_URL="https://storage.googleapis.com/k8s-release-dev/ci/$${KUBERNETES_VERSION}/bin/linux/amd64".k8s.io/k8s-release-dev/ci-periodic/$$CI_VERSION/bin/linux/amd64" + CI_URL="dl.k8s.io/k8s-release-dev/ci-periodic/$$CI_VERSION/bin/linux/amd64" + if ! $${GSUTIL} ls "$${CI_URL}" > /dev/null; then + CI_URL="dl.k8s.io/k8s-release-dev/ci/$$CI_VERSION/bin/linux/amd64" fi for CI_PACKAGE in "$${PACKAGES_TO_TEST[@]}"; do echo "* downloading binary: $$CI_URL/$$CI_PACKAGE" - wget "$${CI_URL}/$${CI_PACKAGE}" -O "$${CI_DIR}/$${CI_PACKAGE} + $${GSUTIL} cp "$$CI_URL/$$CI_PACKAGE" "$$CI_DIR/$$CI_PACKAGE" chmod +x "$$CI_DIR/$$CI_PACKAGE" mv "$$CI_DIR/$$CI_PACKAGE" "/usr/bin/$$CI_PACKAGE" done @@ -142,7 +151,7 @@ spec: fi for CI_CONTAINER in "$${CONTAINERS_TO_TEST[@]}"; do echo "* downloading package: $$CI_URL/$$CI_CONTAINER.$$CONTAINER_EXT" - wget "$$CI_URL/$$CI_CONTAINER.$$CONTAINER_EXT" -O "$$CI_DIR/$$CI_CONTAINER.$$CONTAINER_EXT" + $${GSUTIL} cp "$$CI_URL/$$CI_CONTAINER.$$CONTAINER_EXT" "$$CI_DIR/$$CI_CONTAINER.$$CONTAINER_EXT" $${SUDO} ctr -n k8s.io images import "$$CI_DIR/$$CI_CONTAINER.$$CONTAINER_EXT" || echo "* ignoring expected 'ctr images import' result" $${SUDO} ctr -n k8s.io images tag k8s.gcr.io/$$CI_CONTAINER-amd64:"$${CI_VERSION//+/_}" k8s.gcr.io/$$CI_CONTAINER:"$${CI_VERSION//+/_}" $${SUDO} ctr -n k8s.io images tag k8s.gcr.io/$$CI_CONTAINER-amd64:"$${CI_VERSION//+/_}" gcr.io/k8s-staging-ci-images/$$CI_CONTAINER:"$${CI_VERSION//+/_}" @@ -280,7 +289,14 @@ spec: set -o pipefail set -o errexit [[ $(id -u) != 0 ]] && SUDO="sudo" || SUDO="" - + GSUTIL=gsutil + if ! command -v $${GSUTIL} > /dev/null; then + curl -sSL https://sdk.cloud.google.com > /tmp/gcl && bash /tmp/gcl --install-dir=~/gcloud --disable-prompts > /dev/null 2>&1 + GSUTIL=~/gcloud/google-cloud-sdk/bin/gsutil + # For faster downloads + pip install --no-cache-dir -U crcmod + fi + $${GSUTIL} version # This test installs release packages or binaries that are a result of the CI and release builds. # It runs '... --version' commands to verify that the binaries are correctly installed # and finally uninstalls the packages. @@ -311,11 +327,13 @@ spec: DEBIAN_FRONTEND=noninteractive apt-get install -y $$CI_PACKAGE=$$PACKAGE_VERSION done else - CI_URL="https://storage.googleapis.com/k8s-release-dev/ci/$${KUBERNETES_VERSION}/bin/linux/amd64" + CI_URL="dl.k8s.io/k8s-release-dev/ci-periodic/$$CI_VERSION/bin/linux/amd64" + if ! $${GSUTIL} ls "$${CI_URL}" > /dev/null; then + CI_URL="dl.k8s.io/k8s-release-dev/ci/$$CI_VERSION/bin/linux/amd64" fi for CI_PACKAGE in "$${PACKAGES_TO_TEST[@]}"; do echo "* downloading binary: $$CI_URL/$$CI_PACKAGE" - wget "$${CI_URL}/$${CI_PACKAGE}" -O "$${CI_DIR}/$${CI_PACKAGE} + $${GSUTIL} cp "$$CI_URL/$$CI_PACKAGE" "$$CI_DIR/$$CI_PACKAGE" chmod +x "$$CI_DIR/$$CI_PACKAGE" mv "$$CI_DIR/$$CI_PACKAGE" "/usr/bin/$$CI_PACKAGE" done @@ -323,7 +341,7 @@ spec: fi for CI_CONTAINER in "$${CONTAINERS_TO_TEST[@]}"; do echo "* downloading package: $$CI_URL/$$CI_CONTAINER.$$CONTAINER_EXT" - wget "$$CI_URL/$$CI_CONTAINER.$$CONTAINER_EXT" -O "$$CI_DIR/$$CI_CONTAINER.$$CONTAINER_EXT" + $${GSUTIL} cp "$$CI_URL/$$CI_CONTAINER.$$CONTAINER_EXT" "$$CI_DIR/$$CI_CONTAINER.$$CONTAINER_EXT" $${SUDO} ctr -n k8s.io images import "$$CI_DIR/$$CI_CONTAINER.$$CONTAINER_EXT" || echo "* ignoring expected 'ctr images import' result" $${SUDO} ctr -n k8s.io images tag k8s.gcr.io/$$CI_CONTAINER-amd64:"$${CI_VERSION//+/_}" k8s.gcr.io/$$CI_CONTAINER:"$${CI_VERSION//+/_}" $${SUDO} ctr -n k8s.io images tag k8s.gcr.io/$$CI_CONTAINER-amd64:"$${CI_VERSION//+/_}" gcr.io/k8s-staging-ci-images/$$CI_CONTAINER:"$${CI_VERSION//+/_}"