From be2de6411b6aaf634845849e6564ab2459bacb93 Mon Sep 17 00:00:00 2001 From: Daniel Hiller Date: Fri, 20 Dec 2024 11:03:28 +0100 Subject: [PATCH 01/10] publish_image.sh: replace docker with podman Signed-off-by: Daniel Hiller --- images/publish_image.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/images/publish_image.sh b/images/publish_image.sh index 1ddfae8acc..1f3e867e55 100755 --- a/images/publish_image.sh +++ b/images/publish_image.sh @@ -65,13 +65,13 @@ get_image_tag() { build_image() { local build_target="${1:?}" local image_name="${2:?}" - docker build . -t "$image_name" -t "$build_target" + podman build . -t "$image_name" -t "$build_target" } publish_image() { local full_image_name="${1:?}" - docker push "${full_image_name}" + podman push "${full_image_name}" } get_full_image_name() { From 933fc5337a85c67f5ed7e45ac8013122ac0a28c9 Mon Sep 17 00:00:00 2001 From: Daniel Hiller Date: Fri, 20 Dec 2024 13:42:42 +0100 Subject: [PATCH 02/10] rehearse: use Containerfile for push Signed-off-by: Daniel Hiller --- external-plugins/rehearse/Containerfile | 19 +++++++++++++++++++ external-plugins/rehearse/Makefile | 11 ++++++----- 2 files changed, 25 insertions(+), 5 deletions(-) create mode 100644 external-plugins/rehearse/Containerfile diff --git a/external-plugins/rehearse/Containerfile b/external-plugins/rehearse/Containerfile new file mode 100644 index 0000000000..254c74b1c6 --- /dev/null +++ b/external-plugins/rehearse/Containerfile @@ -0,0 +1,19 @@ +FROM quay.io/kubevirtci/golang:v20241213-57bd934 as builder +ENV GOPROXY=https://proxy.golang.org|direct \ + GOFLAGS="-mod=vendor -ldflags=-extldflags=\"-static\"" \ + CGO_ENABLED=0 \ + GOOS=linux \ + GOARCH=amd64 +ENV GIMME_GO_VERSION=1.21.6 +RUN mkdir kubevirt && \ + cd kubevirt && \ + git clone https://github.com/kubevirt/project-infra.git && \ + cd project-infra && \ + /usr/local/bin/runner.sh /bin/sh -ce "go mod vendor" && \ + /usr/local/bin/runner.sh /bin/sh -ce "env GOPROXY=off go build -tags netgo -o /go/bin/rehearse ./external-plugins/rehearse/plugin/main.go" && \ + /usr/local/bin/runner.sh /bin/sh -ce "go clean -cache -modcache" && \ + cd .. && rm -rf ./project-infra + +FROM gcr.io/k8s-prow/git:v20231107-c87e01249e +COPY --from=builder /go/bin/rehearse /usr/bin/rehearse +ENTRYPOINT ["/usr/bin/rehearse"] diff --git a/external-plugins/rehearse/Makefile b/external-plugins/rehearse/Makefile index 8afa984037..8512e4b7b0 100644 --- a/external-plugins/rehearse/Makefile +++ b/external-plugins/rehearse/Makefile @@ -1,17 +1,18 @@ +CONTAINER_IMAGE := referee +CONTAINER_REPO := quay.io/kubevirtci/$(CONTAINER_IMAGE) .PHONY: all clean format test push all: format test push -bazelbin := bazelisk build: - $(bazelbin) build //external-plugins/rehearse/plugin + go build ./... format: gofmt -w . test: - $(bazelbin) test //external-plugins/rehearse/... + go test ./... push: - $(bazelbin) run --stamp --workspace_status_command="./hack/print-workspace-status-no-git-tag.sh" //external-plugins/rehearse/plugin:push - bash -x ../../hack/update-deployments-with-latest-image.sh quay.io/kubevirtci/rehearse + cd ../../images && ./publish_image.sh $(CONTAINER_IMAGE) quay.io kubevirtci + bash -x ../../hack/update-deployments-with-latest-image.sh $(CONTAINER_REPO) From 57c06e74288cbd73ee8dc1bd78e39fb7395fe418 Mon Sep 17 00:00:00 2001 From: Daniel Hiller Date: Fri, 20 Dec 2024 14:10:35 +0100 Subject: [PATCH 03/10] release-blocker: use Containerfile for push Signed-off-by: Daniel Hiller --- external-plugins/release-blocker/Makefile | 11 ++++++----- .../project-infra-postsubmits.yaml | 2 +- images/release-blocker/Containerfile | 19 +++++++++++++++++++ 3 files changed, 26 insertions(+), 6 deletions(-) create mode 100644 images/release-blocker/Containerfile diff --git a/external-plugins/release-blocker/Makefile b/external-plugins/release-blocker/Makefile index 759d04931a..9b3fa83838 100644 --- a/external-plugins/release-blocker/Makefile +++ b/external-plugins/release-blocker/Makefile @@ -1,17 +1,18 @@ +CONTAINER_IMAGE := release-blocker +CONTAINER_REPO := quay.io/kubevirtci/$(CONTAINER_IMAGE) .PHONY: all clean format test push all: format test push -bazelbin := bazelisk build: - $(bazelbin) build //external-plugins/release-blocker:release-blocker + go build ./... format: gofmt -w . test: - $(bazelbin) test //external-plugins/release-blocker:* + go test ./... push: - $(bazelbin) run //external-plugins/release-blocker:push - bash -x ../../hack/update-jobs-with-latest-image.sh quay.io/kubevirtci/release-blocker + cd ../../images && ./publish_image.sh $(CONTAINER_IMAGE) quay.io kubevirtci + bash -x ../../hack/update-jobs-with-latest-image.sh $(CONTAINER_REPO) diff --git a/github/ci/prow-deploy/files/jobs/kubevirt/project-infra/project-infra-postsubmits.yaml b/github/ci/prow-deploy/files/jobs/kubevirt/project-infra/project-infra-postsubmits.yaml index 8724f45006..dda05728e8 100644 --- a/github/ci/prow-deploy/files/jobs/kubevirt/project-infra/project-infra-postsubmits.yaml +++ b/github/ci/prow-deploy/files/jobs/kubevirt/project-infra/project-infra-postsubmits.yaml @@ -79,7 +79,7 @@ postsubmits: - "-c" - | cat "$QUAY_PASSWORD" | podman login --username $(cat "$QUAY_USER") --password-stdin=true quay.io - bazelisk run //external-plugins/release-blocker:push + make -C ./external-plugins/release-blocker push resources: requests: memory: "8Gi" diff --git a/images/release-blocker/Containerfile b/images/release-blocker/Containerfile new file mode 100644 index 0000000000..8001889635 --- /dev/null +++ b/images/release-blocker/Containerfile @@ -0,0 +1,19 @@ +FROM quay.io/kubevirtci/golang:v20241213-57bd934 as builder +ENV GOPROXY=https://proxy.golang.org|direct \ + GOFLAGS="-mod=vendor -ldflags=-extldflags=\"-static\"" \ + CGO_ENABLED=0 \ + GOOS=linux \ + GOARCH=amd64 +ENV GIMME_GO_VERSION=1.21.6 +RUN mkdir kubevirt && \ + cd kubevirt && \ + git clone https://github.com/kubevirt/project-infra.git && \ + cd project-infra && \ + /usr/local/bin/runner.sh /bin/sh -ce "go mod vendor" && \ + /usr/local/bin/runner.sh /bin/sh -ce "env GOPROXY=off go build -tags netgo -o /go/bin/release-blocker ./external-plugins/release-blocker" && \ + /usr/local/bin/runner.sh /bin/sh -ce "go clean -cache -modcache" && \ + cd .. && rm -rf ./project-infra + +FROM gcr.io/k8s-prow/git:v20231107-c87e01249e +COPY --from=builder /go/bin/release-blocker /usr/bin/release-blocker +ENTRYPOINT ["/usr/bin/release-blocker"] From 55b042c9ba7462063cc4e4f8db86653c157778e5 Mon Sep 17 00:00:00 2001 From: Daniel Hiller Date: Fri, 20 Dec 2024 14:19:38 +0100 Subject: [PATCH 04/10] ci-usage-exporter: use Containerfile for push Signed-off-by: Daniel Hiller --- .../project-infra-postsubmits.yaml | 3 ++- images/ci-usage-exporter/Containerfile | 19 +++++++++++++++++++ 2 files changed, 21 insertions(+), 1 deletion(-) create mode 100644 images/ci-usage-exporter/Containerfile diff --git a/github/ci/prow-deploy/files/jobs/kubevirt/project-infra/project-infra-postsubmits.yaml b/github/ci/prow-deploy/files/jobs/kubevirt/project-infra/project-infra-postsubmits.yaml index dda05728e8..0625ae4fad 100644 --- a/github/ci/prow-deploy/files/jobs/kubevirt/project-infra/project-infra-postsubmits.yaml +++ b/github/ci/prow-deploy/files/jobs/kubevirt/project-infra/project-infra-postsubmits.yaml @@ -700,7 +700,8 @@ postsubmits: - "-c" - | cat "$QUAY_PASSWORD" | podman login --username $(cat "$QUAY_USER") --password-stdin=true quay.io - bazelisk run //robots/cmd/ci-usage-exporter:push + cd images + ./publish_image.sh ci-usage-exporter quay.io kubevirtci resources: requests: memory: "8Gi" diff --git a/images/ci-usage-exporter/Containerfile b/images/ci-usage-exporter/Containerfile new file mode 100644 index 0000000000..190e3590ad --- /dev/null +++ b/images/ci-usage-exporter/Containerfile @@ -0,0 +1,19 @@ +FROM quay.io/kubevirtci/golang:v20241213-57bd934 as builder +ENV GOPROXY=https://proxy.golang.org|direct \ + GOFLAGS="-mod=vendor -ldflags=-extldflags=\"-static\"" \ + CGO_ENABLED=0 \ + GOOS=linux \ + GOARCH=amd64 +ENV GIMME_GO_VERSION=1.21.6 +RUN mkdir kubevirt && \ + cd kubevirt && \ + git clone https://github.com/kubevirt/project-infra.git && \ + cd project-infra && \ + /usr/local/bin/runner.sh /bin/sh -ce "go mod vendor" && \ + /usr/local/bin/runner.sh /bin/sh -ce "env GOPROXY=off go build -tags netgo -o /go/bin/ci-usage-exporter ./robots/cmd/ci-usage-exporter" && \ + /usr/local/bin/runner.sh /bin/sh -ce "go clean -cache -modcache" && \ + cd .. && rm -rf ./project-infra + +FROM gcr.io/k8s-prow/git:v20231107-c87e01249e +COPY --from=builder /go/bin/ci-usage-exporter /usr/bin/ci-usage-exporter +ENTRYPOINT ["/usr/bin/ci-usage-exporter"] From 71590db2f776864ec3ea442173daddb804556036 Mon Sep 17 00:00:00 2001 From: Daniel Hiller Date: Fri, 20 Dec 2024 14:29:02 +0100 Subject: [PATCH 05/10] phased: use Containerfile for push Signed-off-by: Daniel Hiller --- external-plugins/phased/Containerfile | 19 +++++++++++++++++++ external-plugins/phased/Makefile | 11 ++++++----- 2 files changed, 25 insertions(+), 5 deletions(-) create mode 100644 external-plugins/phased/Containerfile diff --git a/external-plugins/phased/Containerfile b/external-plugins/phased/Containerfile new file mode 100644 index 0000000000..fee6325532 --- /dev/null +++ b/external-plugins/phased/Containerfile @@ -0,0 +1,19 @@ +FROM quay.io/kubevirtci/golang:v20241213-57bd934 as builder +ENV GOPROXY=https://proxy.golang.org|direct \ + GOFLAGS="-mod=vendor -ldflags=-extldflags=\"-static\"" \ + CGO_ENABLED=0 \ + GOOS=linux \ + GOARCH=amd64 +ENV GIMME_GO_VERSION=1.21.6 +RUN mkdir kubevirt && \ + cd kubevirt && \ + git clone https://github.com/kubevirt/project-infra.git && \ + cd project-infra && \ + /usr/local/bin/runner.sh /bin/sh -ce "go mod vendor" && \ + /usr/local/bin/runner.sh /bin/sh -ce "env GOPROXY=off go build -tags netgo -o /go/bin/phased ./external-plugins/phased/plugin/main.go" && \ + /usr/local/bin/runner.sh /bin/sh -ce "go clean -cache -modcache" && \ + cd .. && rm -rf ./project-infra + +FROM gcr.io/k8s-prow/git:v20231107-c87e01249e +COPY --from=builder /go/bin/phased /usr/bin/phased +ENTRYPOINT ["/usr/bin/phased"] diff --git a/external-plugins/phased/Makefile b/external-plugins/phased/Makefile index 89bec02ffd..0146594c1c 100644 --- a/external-plugins/phased/Makefile +++ b/external-plugins/phased/Makefile @@ -1,17 +1,18 @@ +CONTAINER_IMAGE := referee +CONTAINER_REPO := quay.io/kubevirtci/$(CONTAINER_IMAGE) .PHONY: all clean format test push all: format test push -bazelbin := bazelisk build: - $(bazelbin) build //external-plugins/phased/plugin + go build ./plugin/... format: gofmt -w . test: - $(bazelbin) test //external-plugins/phased/... + go test ./plugin/... push: - $(bazelbin) run --stamp --workspace_status_command="./hack/print-workspace-status-no-git-tag.sh" //external-plugins/phased/plugin:push - bash -x ../../hack/update-deployments-with-latest-image.sh quay.io/kubevirtci/phased + cd ../../images && ./publish_image.sh $(CONTAINER_IMAGE) quay.io kubevirtci + bash -x ../../hack/update-deployments-with-latest-image.sh $(CONTAINER_REPO) From 7264b08944f1db5edf128d9291d0daae97cd7d20 Mon Sep 17 00:00:00 2001 From: Daniel Hiller Date: Fri, 20 Dec 2024 15:56:49 +0100 Subject: [PATCH 06/10] flake-report-creator: use Containerfile for push Signed-off-by: Daniel Hiller --- images/flake-report-creator/Containerfile | 19 +++++++++++++++++++ robots/cmd/flake-report-creator/Makefile | 11 ++++++++--- 2 files changed, 27 insertions(+), 3 deletions(-) create mode 100644 images/flake-report-creator/Containerfile diff --git a/images/flake-report-creator/Containerfile b/images/flake-report-creator/Containerfile new file mode 100644 index 0000000000..a48bad0925 --- /dev/null +++ b/images/flake-report-creator/Containerfile @@ -0,0 +1,19 @@ +FROM quay.io/kubevirtci/golang:v20241213-57bd934 as builder +ENV GOPROXY=https://proxy.golang.org|direct \ + GOFLAGS="-mod=vendor -ldflags=-extldflags=\"-static\"" \ + CGO_ENABLED=0 \ + GOOS=linux \ + GOARCH=amd64 +ENV GIMME_GO_VERSION=1.21.6 +RUN mkdir kubevirt && \ + cd kubevirt && \ + git clone https://github.com/kubevirt/project-infra.git && \ + cd project-infra && \ + /usr/local/bin/runner.sh /bin/sh -ce "go mod vendor" && \ + /usr/local/bin/runner.sh /bin/sh -ce "env GOPROXY=off go build -tags netgo -o /go/bin/flake-report-creator ./robots/cmd/flake-report-creator" && \ + /usr/local/bin/runner.sh /bin/sh -ce "go clean -cache -modcache" && \ + cd .. && rm -rf ./project-infra + +FROM gcr.io/k8s-prow/git:v20231107-c87e01249e +COPY --from=builder /go/bin/flake-report-creator /usr/bin/flake-report-creator +ENTRYPOINT ["/usr/bin/flake-report-creator"] diff --git a/robots/cmd/flake-report-creator/Makefile b/robots/cmd/flake-report-creator/Makefile index c38f621adb..cdbea49149 100644 --- a/robots/cmd/flake-report-creator/Makefile +++ b/robots/cmd/flake-report-creator/Makefile @@ -1,3 +1,6 @@ +CONTAINER_IMAGE := flake-report-creator +CONTAINER_REPO := quay.io/kubevirtci/$(CONTAINER_IMAGE) + .PHONY: all clean verify format test all: format verify test push @@ -5,13 +8,15 @@ format: gofmt -w . test: - bazel test //robots/cmd/flake-report-creator/...:* //robots/pkg/flakefinder/...:* + go test ./... ../pkg/flakefinder/...:* verify: ../build-verify.sh push: - ../push.sh flake-report-creator + cd ../../../images && ./publish_image.sh $(CONTAINER_IMAGE) quay.io kubevirtci + bash -x "../../../hack/update-jobs-with-latest-image.sh" "$(CONTAINER_REPO)" + bash -x "../../../hack/update-scripts-with-latest-image.sh" "$(CONTAINER_REPO)" clean: - bazel clean --expunge + go clean -cache -modcache From cc5950128372289822ffcb7dd666ac767b7496e4 Mon Sep 17 00:00:00 2001 From: Daniel Hiller Date: Fri, 20 Dec 2024 16:06:11 +0100 Subject: [PATCH 07/10] flakefinder: use Containerfile for push Also remove binary name from job definition as not required any more. Signed-off-by: Daniel Hiller --- .../kubemacpool/kubemacpool-periodics.yaml | 6 ------ ...ter-network-addons-operator-periodics.yaml | 6 ------ ...containerized-data-importer-periodics.yaml | 6 ------ .../kubevirt/kubevirt/kubevirt-periodics.yaml | 8 -------- .../kubernetes-nmstate-periodics.yaml | 6 ------ images/flakefinder/Containerfile | 19 +++++++++++++++++++ robots/cmd/flakefinder/Makefile | 9 +++++++-- 7 files changed, 26 insertions(+), 34 deletions(-) create mode 100644 images/flakefinder/Containerfile diff --git a/github/ci/prow-deploy/files/jobs/k8snetworkplumbingwg/kubemacpool/kubemacpool-periodics.yaml b/github/ci/prow-deploy/files/jobs/k8snetworkplumbingwg/kubemacpool/kubemacpool-periodics.yaml index ba9e14d2ec..056fbe1d04 100644 --- a/github/ci/prow-deploy/files/jobs/k8snetworkplumbingwg/kubemacpool/kubemacpool-periodics.yaml +++ b/github/ci/prow-deploy/files/jobs/k8snetworkplumbingwg/kubemacpool/kubemacpool-periodics.yaml @@ -11,8 +11,6 @@ periodics: env: - name: GOOGLE_APPLICATION_CREDENTIALS value: /etc/gcs/service-account.json - command: - - "/app/robots/cmd/flakefinder/app.binary" args: - --dry-run=false - --token=/etc/github/oauth @@ -46,8 +44,6 @@ periodics: env: - name: GOOGLE_APPLICATION_CREDENTIALS value: /etc/gcs/service-account.json - command: - - "/app/robots/cmd/flakefinder/app.binary" args: - --dry-run=false - --token=/etc/github/oauth @@ -81,8 +77,6 @@ periodics: env: - name: GOOGLE_APPLICATION_CREDENTIALS value: /etc/gcs/service-account.json - command: - - "/app/robots/cmd/flakefinder/app.binary" args: - --dry-run=false - --token=/etc/github/oauth diff --git a/github/ci/prow-deploy/files/jobs/kubevirt/cluster-network-addons-operator/cluster-network-addons-operator-periodics.yaml b/github/ci/prow-deploy/files/jobs/kubevirt/cluster-network-addons-operator/cluster-network-addons-operator-periodics.yaml index 44dc4f7843..51685ecab7 100644 --- a/github/ci/prow-deploy/files/jobs/kubevirt/cluster-network-addons-operator/cluster-network-addons-operator-periodics.yaml +++ b/github/ci/prow-deploy/files/jobs/kubevirt/cluster-network-addons-operator/cluster-network-addons-operator-periodics.yaml @@ -11,8 +11,6 @@ periodics: spec: containers: - image: quay.io/kubevirtci/flakefinder:v20230112-ec14f598 - command: - - "/app/robots/cmd/flakefinder/app.binary" args: - --dry-run=false - --token=/etc/github/oauth @@ -32,8 +30,6 @@ periodics: spec: containers: - image: quay.io/kubevirtci/flakefinder:v20230112-ec14f598 - command: - - "/app/robots/cmd/flakefinder/app.binary" args: - --dry-run=false - --token=/etc/github/oauth @@ -53,8 +49,6 @@ periodics: spec: containers: - image: quay.io/kubevirtci/flakefinder:v20230112-ec14f598 - command: - - "/app/robots/cmd/flakefinder/app.binary" args: - --dry-run=false - --token=/etc/github/oauth diff --git a/github/ci/prow-deploy/files/jobs/kubevirt/containerized-data-importer/containerized-data-importer-periodics.yaml b/github/ci/prow-deploy/files/jobs/kubevirt/containerized-data-importer/containerized-data-importer-periodics.yaml index c3833c7981..5c1bcd84b4 100644 --- a/github/ci/prow-deploy/files/jobs/kubevirt/containerized-data-importer/containerized-data-importer-periodics.yaml +++ b/github/ci/prow-deploy/files/jobs/kubevirt/containerized-data-importer/containerized-data-importer-periodics.yaml @@ -11,8 +11,6 @@ periodics: spec: containers: - image: quay.io/kubevirtci/flakefinder:v20230112-ec14f598 - command: - - "/app/robots/cmd/flakefinder/app.binary" args: - --dry-run=false - --token=/etc/github/oauth @@ -33,8 +31,6 @@ periodics: spec: containers: - image: quay.io/kubevirtci/flakefinder:v20230112-ec14f598 - command: - - "/app/robots/cmd/flakefinder/app.binary" args: - --dry-run=false - --token=/etc/github/oauth @@ -55,8 +51,6 @@ periodics: spec: containers: - image: quay.io/kubevirtci/flakefinder:v20230112-ec14f598 - command: - - "/app/robots/cmd/flakefinder/app.binary" args: - --dry-run=false - --token=/etc/github/oauth diff --git a/github/ci/prow-deploy/files/jobs/kubevirt/kubevirt/kubevirt-periodics.yaml b/github/ci/prow-deploy/files/jobs/kubevirt/kubevirt/kubevirt-periodics.yaml index ad547246bc..b953d51739 100644 --- a/github/ci/prow-deploy/files/jobs/kubevirt/kubevirt/kubevirt-periodics.yaml +++ b/github/ci/prow-deploy/files/jobs/kubevirt/kubevirt/kubevirt-periodics.yaml @@ -18,8 +18,6 @@ periodics: - --report_output_child_path=kubevirt/kubevirt - --skip_results_before_start_of_report=false - --pr_base_branch=main - command: - - /app/robots/cmd/flakefinder/app.binary image: quay.io/kubevirtci/flakefinder:v20230112-ec14f598 name: "" resources: {} @@ -42,8 +40,6 @@ periodics: - --skip_results_before_start_of_report=false - --periodic_job_dir_regex=periodic-kubevirt-e2e-.* - --pr_base_branch=main - command: - - /app/robots/cmd/flakefinder/app.binary image: quay.io/kubevirtci/flakefinder:v20230112-ec14f598 name: "" resources: {} @@ -66,8 +62,6 @@ periodics: - --skip_results_before_start_of_report=false - --periodic_job_dir_regex=periodic-kubevirt-e2e-.* - --pr_base_branch=main - command: - - /app/robots/cmd/flakefinder/app.binary image: quay.io/kubevirtci/flakefinder:v20230112-ec14f598 name: "" resources: {} @@ -176,8 +170,6 @@ periodics: - --skip_results_before_start_of_report=false - --periodic_job_dir_regex=periodic-kubevirt-e2e-.* - --pr_base_branch=main - command: - - /app/robots/cmd/flakefinder/app.binary image: quay.io/kubevirtci/flakefinder:v20230112-ec14f598 name: "" resources: {} diff --git a/github/ci/prow-deploy/files/jobs/nmstate/kubernetes-nmstate/kubernetes-nmstate-periodics.yaml b/github/ci/prow-deploy/files/jobs/nmstate/kubernetes-nmstate/kubernetes-nmstate-periodics.yaml index 7080a12163..6d16379997 100644 --- a/github/ci/prow-deploy/files/jobs/nmstate/kubernetes-nmstate/kubernetes-nmstate-periodics.yaml +++ b/github/ci/prow-deploy/files/jobs/nmstate/kubernetes-nmstate/kubernetes-nmstate-periodics.yaml @@ -11,8 +11,6 @@ periodics: env: - name: GOOGLE_APPLICATION_CREDENTIALS value: /etc/gcs/service-account.json - command: - - "/app/robots/cmd/flakefinder/app.binary" args: - --dry-run=false - --token=/etc/github/oauth @@ -46,8 +44,6 @@ periodics: env: - name: GOOGLE_APPLICATION_CREDENTIALS value: /etc/gcs/service-account.json - command: - - "/app/robots/cmd/flakefinder/app.binary" args: - --dry-run=false - --token=/etc/github/oauth @@ -81,8 +77,6 @@ periodics: env: - name: GOOGLE_APPLICATION_CREDENTIALS value: /etc/gcs/service-account.json - command: - - "/app/robots/cmd/flakefinder/app.binary" args: - --dry-run=false - --token=/etc/github/oauth diff --git a/images/flakefinder/Containerfile b/images/flakefinder/Containerfile new file mode 100644 index 0000000000..a084ea3f7b --- /dev/null +++ b/images/flakefinder/Containerfile @@ -0,0 +1,19 @@ +FROM quay.io/kubevirtci/golang:v20241213-57bd934 as builder +ENV GOPROXY=https://proxy.golang.org|direct \ + GOFLAGS="-mod=vendor -ldflags=-extldflags=\"-static\"" \ + CGO_ENABLED=0 \ + GOOS=linux \ + GOARCH=amd64 +ENV GIMME_GO_VERSION=1.21.6 +RUN mkdir kubevirt && \ + cd kubevirt && \ + git clone https://github.com/kubevirt/project-infra.git && \ + cd project-infra && \ + /usr/local/bin/runner.sh /bin/sh -ce "go mod vendor" && \ + /usr/local/bin/runner.sh /bin/sh -ce "env GOPROXY=off go build -tags netgo -o /go/bin/flakefinder ./robots/cmd/flakefinder" && \ + /usr/local/bin/runner.sh /bin/sh -ce "go clean -cache -modcache" && \ + cd .. && rm -rf ./project-infra + +FROM gcr.io/k8s-prow/git:v20231107-c87e01249e +COPY --from=builder /go/bin/flakefinder /usr/bin/flakefinder +ENTRYPOINT ["/usr/bin/flakefinder"] diff --git a/robots/cmd/flakefinder/Makefile b/robots/cmd/flakefinder/Makefile index 81bbd069a5..d6c63731c2 100644 --- a/robots/cmd/flakefinder/Makefile +++ b/robots/cmd/flakefinder/Makefile @@ -1,3 +1,6 @@ +CONTAINER_IMAGE := flakefinder +CONTAINER_REPO := quay.io/kubevirtci/$(CONTAINER_IMAGE) + .PHONY: all clean verify format test push all: format verify test push @@ -5,13 +8,15 @@ format: gofmt -w . test: - bazel test //robots/cmd/flakefinder:* //robots/pkg/flakefinder/...:* + go test ./... ../../pkg/flakefinder/... verify: ../build-verify.sh push: - ../push.sh flakefinder + cd ../../../images && ./publish_image.sh $(CONTAINER_IMAGE) quay.io kubevirtci + bash -x "../../../hack/update-jobs-with-latest-image.sh" "$(CONTAINER_REPO)" + bash -x "../../../hack/update-scripts-with-latest-image.sh" "$(CONTAINER_REPO)" clean: bazel clean --expunge From 96ddea02a269aebdf2c079fd97435f2a81a373eb Mon Sep 17 00:00:00 2001 From: Daniel Hiller Date: Fri, 20 Dec 2024 16:14:47 +0100 Subject: [PATCH 08/10] indexpagecreator: use Containerfile for push Signed-off-by: Daniel Hiller --- .../project-infra-periodics.yaml | 2 -- images/indexpagecreator/Containerfile | 19 +++++++++++++++++++ robots/cmd/indexpagecreator/Makefile | 11 ++++++++--- 3 files changed, 27 insertions(+), 5 deletions(-) create mode 100644 images/indexpagecreator/Containerfile diff --git a/github/ci/prow-deploy/files/jobs/kubevirt/project-infra/project-infra-periodics.yaml b/github/ci/prow-deploy/files/jobs/kubevirt/project-infra/project-infra-periodics.yaml index 05298537bc..7e8bf0a361 100644 --- a/github/ci/prow-deploy/files/jobs/kubevirt/project-infra/project-infra-periodics.yaml +++ b/github/ci/prow-deploy/files/jobs/kubevirt/project-infra/project-infra-periodics.yaml @@ -242,8 +242,6 @@ periodics: spec: containers: - image: quay.io/kubevirtci/indexpagecreator:v20230102-5ed6f7d7 - command: - - "/app/robots/cmd/indexpagecreator/app.binary" args: - --dry-run=false - name: periodic-kubevirt-mirror-uploader diff --git a/images/indexpagecreator/Containerfile b/images/indexpagecreator/Containerfile new file mode 100644 index 0000000000..afcbdf21f6 --- /dev/null +++ b/images/indexpagecreator/Containerfile @@ -0,0 +1,19 @@ +FROM quay.io/kubevirtci/golang:v20241213-57bd934 as builder +ENV GOPROXY=https://proxy.golang.org|direct \ + GOFLAGS="-mod=vendor -ldflags=-extldflags=\"-static\"" \ + CGO_ENABLED=0 \ + GOOS=linux \ + GOARCH=amd64 +ENV GIMME_GO_VERSION=1.21.6 +RUN mkdir kubevirt && \ + cd kubevirt && \ + git clone https://github.com/kubevirt/project-infra.git && \ + cd project-infra && \ + /usr/local/bin/runner.sh /bin/sh -ce "go mod vendor" && \ + /usr/local/bin/runner.sh /bin/sh -ce "env GOPROXY=off go build -tags netgo -o /go/bin/indexpagecreator ./robots/cmd/indexpagecreator" && \ + /usr/local/bin/runner.sh /bin/sh -ce "go clean -cache -modcache" && \ + cd .. && rm -rf ./project-infra + +FROM gcr.io/k8s-prow/git:v20231107-c87e01249e +COPY --from=builder /go/bin/indexpagecreator /usr/bin/indexpagecreator +ENTRYPOINT ["/usr/bin/indexpagecreator"] diff --git a/robots/cmd/indexpagecreator/Makefile b/robots/cmd/indexpagecreator/Makefile index 09797dc1e6..4329731e07 100644 --- a/robots/cmd/indexpagecreator/Makefile +++ b/robots/cmd/indexpagecreator/Makefile @@ -1,3 +1,6 @@ +CONTAINER_IMAGE := indexpagecreator +CONTAINER_REPO := quay.io/kubevirtci/$(CONTAINER_IMAGE) + .PHONY: all clean verify format test push all: format verify test push @@ -5,13 +8,15 @@ format: gofmt -w . test: - bazel build //robots/cmd/indexpagecreator:* //robots/pkg/flakefinder:* + go test ./... ../../pkg/flakefinder/... verify: ../build-verify.sh push: - ../push.sh indexpagecreator + cd ../../../images && ./publish_image.sh $(CONTAINER_IMAGE) quay.io kubevirtci + bash -x "../../../hack/update-jobs-with-latest-image.sh" "$(CONTAINER_REPO)" + bash -x "../../../hack/update-scripts-with-latest-image.sh" "$(CONTAINER_REPO)" clean: - bazel clean --expunge + go clean -cache -modcache From bdcde6e60c4dc829b553a891acca65f5f7e78e29 Mon Sep 17 00:00:00 2001 From: Daniel Hiller Date: Fri, 20 Dec 2024 16:23:53 +0100 Subject: [PATCH 09/10] test-report: use Containerfile for push Also remove push.sh since it's not required any more Signed-off-by: Daniel Hiller --- images/test-report/Containerfile | 19 +++++++++++++++++++ robots/cmd/push.sh | 17 ----------------- robots/cmd/test-report/Makefile | 11 ++++++++--- 3 files changed, 27 insertions(+), 20 deletions(-) create mode 100644 images/test-report/Containerfile delete mode 100755 robots/cmd/push.sh diff --git a/images/test-report/Containerfile b/images/test-report/Containerfile new file mode 100644 index 0000000000..d128f7e39d --- /dev/null +++ b/images/test-report/Containerfile @@ -0,0 +1,19 @@ +FROM quay.io/kubevirtci/golang:v20241213-57bd934 as builder +ENV GOPROXY=https://proxy.golang.org|direct \ + GOFLAGS="-mod=vendor -ldflags=-extldflags=\"-static\"" \ + CGO_ENABLED=0 \ + GOOS=linux \ + GOARCH=amd64 +ENV GIMME_GO_VERSION=1.21.6 +RUN mkdir kubevirt && \ + cd kubevirt && \ + git clone https://github.com/kubevirt/project-infra.git && \ + cd project-infra && \ + /usr/local/bin/runner.sh /bin/sh -ce "go mod vendor" && \ + /usr/local/bin/runner.sh /bin/sh -ce "env GOPROXY=off go build -tags netgo -o /go/bin/test-report ./robots/cmd/test-report" && \ + /usr/local/bin/runner.sh /bin/sh -ce "go clean -cache -modcache" && \ + cd .. && rm -rf ./project-infra + +FROM gcr.io/k8s-prow/git:v20231107-c87e01249e +COPY --from=builder /go/bin/test-report /usr/bin/test-report +ENTRYPOINT ["/usr/bin/test-report"] diff --git a/robots/cmd/push.sh b/robots/cmd/push.sh deleted file mode 100755 index f22a5699f4..0000000000 --- a/robots/cmd/push.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -xeuo pipefail - -script_dirname=$(cd "$(dirname $0)" && pwd) -source "$script_dirname/../../hack/print-workspace-status.sh" - -image_name="$1" - -bazel run "//robots/cmd/${image_name}:push" -docker pull "quay.io/kubevirtci/${image_name}:${docker_tag}" -short_docker_tag="v$(date -u '+%Y%m%d')-$(git show -s --format=%h)" -docker tag "quay.io/kubevirtci/${image_name}:${docker_tag}" "quay.io/kubevirtci/${image_name}:${short_docker_tag}" -docker push "quay.io/kubevirtci/${image_name}:${short_docker_tag}" -docker tag "quay.io/kubevirtci/${image_name}:${docker_tag}" "quay.io/kubevirtci/${image_name}:latest" -docker push "quay.io/kubevirtci/${image_name}:latest" -bash -x "$script_dirname/../../hack/update-jobs-with-latest-image.sh" "quay.io/kubevirtci/${image_name}" -bash -x "$script_dirname/../../hack/update-scripts-with-latest-image.sh" "quay.io/kubevirtci/${image_name}" diff --git a/robots/cmd/test-report/Makefile b/robots/cmd/test-report/Makefile index 421a28c6a4..7d0e036a3b 100644 --- a/robots/cmd/test-report/Makefile +++ b/robots/cmd/test-report/Makefile @@ -1,3 +1,6 @@ +CONTAINER_IMAGE := test-report +CONTAINER_REPO := quay.io/kubevirtci/$(CONTAINER_IMAGE) + .PHONY: all clean verify format test all: format verify test push @@ -5,13 +8,15 @@ format: gofmt -w . test: - bazel test //robots/cmd/test-report/...:* //robots/pkg/test-report/...:* //robots/pkg/flakefinder/...:* //robots/pkg/jenkins/...:* + go test ./... ../../pkg/test-report/... ../../pkg/flakefinder/... ../../pkg/jenkins/... verify: ../build-verify.sh push: - ../push.sh test-report + cd ../../../images && ./publish_image.sh $(CONTAINER_IMAGE) quay.io kubevirtci + bash -x "../../../hack/update-jobs-with-latest-image.sh" "$(CONTAINER_REPO)" + bash -x "../../../hack/update-scripts-with-latest-image.sh" "$(CONTAINER_REPO)" clean: - bazel clean --expunge + go clean -cache -modcache From eeb2ce4b962d2b3edaaf8b322bf3b2224bfa247e Mon Sep 17 00:00:00 2001 From: Daniel Hiller Date: Fri, 20 Dec 2024 16:24:52 +0100 Subject: [PATCH 10/10] referee: align Containerfile, use quay.io Signed-off-by: Daniel Hiller --- images/referee/Containerfile | 21 ++++++++++++++------- 1 file changed, 14 insertions(+), 7 deletions(-) diff --git a/images/referee/Containerfile b/images/referee/Containerfile index be8c75e253..87bc8924da 100644 --- a/images/referee/Containerfile +++ b/images/referee/Containerfile @@ -1,11 +1,18 @@ -FROM docker.io/library/golang:1.21 as builder -WORKDIR /go/src/github.com/kubevirt/project-infra/ -RUN mkdir -p /go/src/kubevirt/ && \ - cd /go/src/kubevirt/ && \ +FROM quay.io/kubevirtci/golang:v20241213-57bd934 as builder +ENV GOPROXY=https://proxy.golang.org|direct \ + GOFLAGS="-mod=vendor -ldflags=-extldflags=\"-static\"" \ + CGO_ENABLED=0 \ + GOOS=linux \ + GOARCH=amd64 +ENV GIMME_GO_VERSION=1.21.6 +RUN mkdir kubevirt && \ + cd kubevirt && \ git clone https://github.com/kubevirt/project-infra.git && \ - cd project-infra/ && \ - go mod vendor && \ - env GOPROXY=off GOFLAGS=-mod=vendor CGO_ENABLED=0 GOOS=linux GOARCH=amd64 go build -o /go/bin/referee ./external-plugins/referee/main.go + cd project-infra && \ + /usr/local/bin/runner.sh /bin/sh -c "go mod vendor" && \ + /usr/local/bin/runner.sh /bin/sh -c "env GOPROXY=off go build -tags netgo -o /go/bin/referee ./external-plugins/referee/main.go" && \ + /usr/local/bin/runner.sh /bin/sh -ce "go clean -cache -modcache" && \ + cd .. && rm -rf ./project-infra FROM gcr.io/k8s-prow/git:v20231107-c87e01249e COPY --from=builder /go/bin/referee /usr/bin/referee