From 469bf191b3809940a2f02f1eb0f94a51246e6e6b Mon Sep 17 00:00:00 2001 From: Chao Dai Date: Thu, 13 Jan 2022 13:15:29 -0800 Subject: [PATCH] Document why /boskos directory exists, migrate to make rule --- boskos/README.md | 8 ++++ boskos/update_prow_config.sh | 42 ------------------- .../test-infra/test-infra-trusted.yaml | 8 +++- config/prow/Makefile | 7 +++- 4 files changed, 19 insertions(+), 46 deletions(-) delete mode 100755 boskos/update_prow_config.sh diff --git a/boskos/README.md b/boskos/README.md index 39ec62f5f7c1..94bd94049e08 100644 --- a/boskos/README.md +++ b/boskos/README.md @@ -3,3 +3,11 @@ Boskos has been moved into its own repository under kubernetes-sigs: https://github.com/kubernetes-sigs/boskos + +# What's still here + +The only thing matters here is `./cmd/janitor/gcp_janitor.py` script, which is +still used by +[/scenarios/kubernetes_janitor.py#L66](https://github.com/kubernetes/test-infra/blob/d641897cea52d493ef883a4dfa6728ffdfa02dfa/scenarios/kubernetes_janitor.py#L66), +and `/scenarios` had been announced deprecated since 2018, which will be done +with https://github.com/kubernetes/test-infra/issues/20760. diff --git a/boskos/update_prow_config.sh b/boskos/update_prow_config.sh deleted file mode 100755 index 8a6a136b5418..000000000000 --- a/boskos/update_prow_config.sh +++ /dev/null @@ -1,42 +0,0 @@ -#!/usr/bin/env bash -# Copyright 2017 The Kubernetes Authors. -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Usage: updade_prow_config.sh - -set -o errexit -set -o nounset -set -o pipefail - -cd "$(git rev-parse --show-toplevel)" - -# Script triggered by prow postsubmit job -# Update boskos configmap in prow - -if [[ -a "${PROW_SERVICE_ACCOUNT:-}" ]] ; then # TODO(fejta): delete this in a subsequent PR - echo "Use GOOGLE_APPLICATION_CREDENTIALS='$PROW_SERVICE_ACCOUNT' " >&2 - echo "Migrate away from PROW_SERVICE_ACCOUNT" >&2 - gcloud auth activate-service-account --key-file="${PROW_SERVICE_ACCOUNT}" -elif [[ -a "${GOOGLE_APPLICATION_CREDENTIALS:-}" ]] ; then - gcloud auth activate-service-account --key-file="${GOOGLE_APPLICATION_CREDENTIALS}" -fi - -if ! [ -x "$(command -v kubectl)" ]; then - gcloud components install kubectl -fi - -# TODO(fejta): deploy this using the bazel target -gcloud container clusters get-credentials --project=k8s-prow-builds --zone=us-central1-f prow -kubectl create configmap resources --from-file=config=config/prow/cluster/build/boskos-resources.yaml --dry-run -o yaml | \ - kubectl --context=gke_k8s-prow-builds_us-central1-f_prow --namespace=test-pods replace configmap resources -f - diff --git a/config/jobs/kubernetes/test-infra/test-infra-trusted.yaml b/config/jobs/kubernetes/test-infra/test-infra-trusted.yaml index 39fb6aa6fed1..4ef86b1c332f 100644 --- a/config/jobs/kubernetes/test-infra/test-infra-trusted.yaml +++ b/config/jobs/kubernetes/test-infra/test-infra-trusted.yaml @@ -427,9 +427,13 @@ postsubmits: spec: serviceAccountName: deployer # TODO(fejta): should be pusher containers: - - image: gcr.io/k8s-staging-test-infra/bazelbuild:v20210930-b6c4097796-test-infra + - image: gcr.io/k8s-staging-test-infra/gcloud-in-go:v20211210-cf89952124 command: - - ./boskos/update_prow_config.sh + - make + args: + - -C + - config/prow + - update-boskos-resources annotations: testgrid-dashboards: sig-testing-maintenance testgrid-tab-name: boskos-config-upload diff --git a/config/prow/Makefile b/config/prow/Makefile index 67cb6b20d699..a4f9505e563f 100644 --- a/config/prow/Makefile +++ b/config/prow/Makefile @@ -26,10 +26,10 @@ ZONE_BUILD ?= us-central1-f JOB_NAMESPACE ?= test-pods update-config: get-cluster-credentials - kubectl create configmap config --from-file=config.yaml=config.yaml --dry-run -o yaml | kubectl replace configmap config -f - + kubectl create configmap config --from-file=config.yaml=config.yaml --dry-run=client -o yaml | kubectl replace configmap config -f - update-plugins: get-cluster-credentials - kubectl create configmap plugins --from-file=plugins.yaml=plugins.yaml --dry-run -o yaml | kubectl replace configmap plugins -f - + kubectl create configmap plugins --from-file=plugins.yaml=plugins.yaml --dry-run=client -o yaml | kubectl replace configmap plugins -f - deploy-prow: get-cluster-credentials kubectl apply -f ./cluster/prowjob-crd/legacy/prowjob-schemaless_customresourcedefinition.yaml @@ -38,6 +38,9 @@ deploy-prow: get-cluster-credentials deploy-build: get-build-cluster-credentials kubectl apply -f ./cluster/build/ +update-boskos-resources: get-build-cluster-credentials + kubectl create configmap resources --from-file=config=./cluster/build/boskos-resources.yaml --dry-run=client -o yaml | kubectl --namespace=test-pods replace configmap resources -f - + deploy-monitoring: get-cluster-credentials $(MAKE) -C ./cluster/monitoring apply