-
Notifications
You must be signed in to change notification settings - Fork 140
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
create Containerfiles for pushing images #3851
Changes from all commits
d17cd38
2f1a00c
16a1cbc
6d9aabf
da9745a
ce10c35
5ca2040
c5fd73d
ce2a285
3411528
c01a2da
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
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 "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:v20240729-4f255edb07 | ||
COPY --from=builder /go/bin/phased /usr/bin/phased | ||
ENTRYPOINT ["/usr/bin/phased"] |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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) |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
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 "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 | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Is this step needed? As this is just the builder container I don't think we need to worry about cleaning up too much. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Agree - we can also remove the There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. But technically doing this or not doesn't matter at all. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Yes just less steps in the build should reduce build time. Again its just a nit. |
||
|
||
FROM gcr.io/k8s-prow/git:v20240729-4f255edb07 | ||
COPY --from=builder /go/bin/rehearse /usr/bin/rehearse | ||
ENTRYPOINT ["/usr/bin/rehearse"] |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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) |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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) |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
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 "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:v20240729-4f255edb07 | ||
COPY --from=builder /go/bin/ci-usage-exporter /usr/bin/ci-usage-exporter | ||
ENTRYPOINT ["/usr/bin/ci-usage-exporter"] |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
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 "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:v20240729-4f255edb07 | ||
COPY --from=builder /go/bin/flake-report-creator /usr/bin/flake-report-creator | ||
ENTRYPOINT ["/usr/bin/flake-report-creator"] |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
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 "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:v20240729-4f255edb07 | ||
COPY --from=builder /go/bin/flakefinder /usr/bin/flakefinder | ||
ENTRYPOINT ["/usr/bin/flakefinder"] |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
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 "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:v20240729-4f255edb07 | ||
COPY --from=builder /go/bin/indexpagecreator /usr/bin/indexpagecreator | ||
ENTRYPOINT ["/usr/bin/indexpagecreator"] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why can't we use the local copy of project-infra that should be available in the postsubmit pod?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I didn't do it like that because it was more easily testable locally.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah ideally the build would work locally and for the publish postsubmit - this approach will not include any local changes but we can take that as a follow on PR.