Closed Longchuanzheng closed 3 weeks ago
IMO, it means golang haven't installed in base image. How can I do?
@Longchuanzheng - what did you change GIMME_GO_VERSION
to ?
@brianmcarey Hi, thanks for your attention. I just refer your pr (https://github.com/kubevirt/kubevirt/pull/10914) and change GIMME_GO_VERSION
to 1.21.5
I changed the following against the release-0.59
branch and make builder-build
completed successfully for me.
--- a/hack/builder/Dockerfile
+++ b/hack/builder/Dockerfile
@@ -4,7 +4,7 @@ ARG SONOBUOY_ARCH
ARG BAZEL_ARCH
ENV BAZEL_VERSION=5.3.1
-ENV GIMME_GO_VERSION=1.19.12
+ENV GIMME_GO_VERSION=1.21.5
ENV GRADLE_VERSION=6.6
ENV OPERATOR_COURIER_VERSION=2.1.11
ENV SONOBUOY_VERSION=0.56.9
Hi, thanks for your assertion. I suspect it is a problem with the base image. I didn't find process in Dockerfile to install golang. While there dosen't have golang in the base image.
# docker run -i quay.io/centos/centos:stream9 /bin/bash
go version
/bin/bash: line 1: go: command not found
So it is reasonable to build image failed.
Can you share me which base image dose you use? just like sha256 or tag.
The installation of go is handled by /etc/profile.d/gimme.sh
which is from here - https://github.com/kubevirt/kubevirt/blob/b3a75fa2d670c540ad2b93f037cc3a71977a2b79/hack/builder/Dockerfile#L71C5-L71C66
Please double check you have the GIMME_GO_VERSION
variable correctly set - as in no spaces etc.
Thanks, I set GIMME_GO_VERSION
like this:
diff --git a/hack/builder/Dockerfile b/hack/builder/Dockerfile
index aaf6dcdd8..af07e8226 100644
--- a/hack/builder/Dockerfile
+++ b/hack/builder/Dockerfile
@@ -4,7 +4,7 @@ ARG SONOBUOY_ARCH
ARG BAZEL_ARCH
ENV BAZEL_VERSION=5.3.1
-ENV GIMME_GO_VERSION=1.19.2
+ENV GIMME_GO_VERSION=1.21.5
ENV GRADLE_VERSION=6.6
ENV OPERATOR_COURIER_VERSION=2.1.11
ENV SONOBUOY_VERSION=0.56.9
Ok then I would check the contents of /etc/profile.d/gimme.sh
during your image build. It may not have downloaded the script correctly.
Yes, you are right. I delete left build file and build an image just use:
...
# reference to master is for an external repo and can't yet be changed
RUN mkdir -p /gimme && curl -sL \
https://raw.githubusercontent.com/travis-ci/gimme/master/gimme | \
HOME=/gimme bash >> /etc/profile.d/gimme.sh
ENV GOPATH="/go" GOBIN="/usr/bin" GO111MODULE="on"
When I run this image and find /etc/profile.d/gimme.sh is 0mb.
ls -ll /etc/profile.d/gimme.sh
-rw-r--r-- 1 root root 0 Mar 1 07:24 /etc/profile.d/gimme.sh
Also I find I can't get any data from https://raw.githubusercontent.com/travis-ci/gimme/master/gimme, although if I just open the url in chrome I can get the script. show nothing here:
curl -sL https://raw.githubusercontent.com/travis-ci/gimme/master/gimme > log
cat log
We can just download https://raw.githubusercontent.com/travis-ci/gimme/master/gimme and save it at hack/builder. And use
COPY gimme /etc/gimme
RUN set -x && \
bash /etc/gimme >> /etc/profile.d/gimme.sh
Instead use crul in Dockerfile.
@brianmcarey Hi, what should I do when I generate the builder image? I follow the https://github.com/kubevirt/kubevirt/blob/main/docs/update-go-version.md. I use go rules for bazel in https://github.com/kubevirt/kubevirt/pull/8622
http_archive(
name = "io_bazel_rules_go",
sha256 = "099a9fb96a376ccbbb7d291ed4ecbdfd42f6bc822ab77ae6f1b5cb9e914e94fa",
urls = [
"https://mirror.bazel.build/github.com/bazelbuild/rules_go/releases/download/v0.35.0/rules_go-v0.35.0.zip",
"https://github.com/bazelbuild/rules_go/releases/download/v0.35.0/rules_go-v0.35.0.zip",
"https://storage.googleapis.com/builddeps/099a9fb96a376ccbbb7d291ed4ecbdfd42f6bc822ab77ae6f1b5cb9e914e94fa",
],
)
After above, I try to make deps-update
but get err.
@brianmcarey Hi, what should I do when I generate the builder image? I follow the https://github.com/kubevirt/kubevirt/blob/main/docs/update-go-version.md. I use go rules for bazel in #8622
http_archive( name = "io_bazel_rules_go", sha256 = "099a9fb96a376ccbbb7d291ed4ecbdfd42f6bc822ab77ae6f1b5cb9e914e94fa", urls = [ "https://mirror.bazel.build/github.com/bazelbuild/rules_go/releases/download/v0.35.0/rules_go-v0.35.0.zip", "https://github.com/bazelbuild/rules_go/releases/download/v0.35.0/rules_go-v0.35.0.zip", "https://storage.googleapis.com/builddeps/099a9fb96a376ccbbb7d291ed4ecbdfd42f6bc822ab77ae6f1b5cb9e914e94fa", ], )
After above, I try to
make deps-update
but get err.
You will probably need to backport changes from the following PRs to get this working: https://github.com/kubevirt/kubevirt/pull/10879 https://github.com/kubevirt/kubevirt/pull/10914
@brianmcarey thanks, I build image and make deps-update
succeeded. While I do make generate
failed.
err is:
You introduced new API rule violation
I think this err is in hack/generate.sh
if cmp ${KUBEVIRT_DIR}/api/api-rule-violations.list ${KUBEVIRT_DIR}/api/api-rule-violations-known.list; then
echo "openapi generated"
else
diff -u ${KUBEVIRT_DIR}/api/api-rule-violations-known.list ${KUBEVIRT_DIR}/api/api-rule-violations.list || true
echo "You introduced new API rule violation"
diff ${KUBEVIRT_DIR}/api/api-rule-violations.list ${KUBEVIRT_DIR}/api/api-rule-violations-known.list
exit 2
fi
I try to
rm api/api-rule-violations-known.list
cp api/api-rule-violations.list api/api-rule-violations-known.list
and exec diff -u api/api-rule-violations-known.list api/api-rule-violations.list
locally without diff.
While I still make generate
failed with You introduced new API rule violation
.
I think this may related to https://github.com/kubevirt/kubevirt/issues/9780
@lyarwood , Hi, can you help me?
@Longchuanzheng I am not sure what may be causing this. Just so you know since the release v1.2 - KubeVirt is no longer supporting v0.59. https://github.com/kubevirt/sig-release/blob/main/releases/k8s-support-matrix.md
Issues go stale after 90d of inactivity.
Mark the issue as fresh with /remove-lifecycle stale
.
Stale issues rot after an additional 30d of inactivity and eventually close.
If this issue is safe to close now please do so with /close
.
/lifecycle stale
Stale issues rot after 30d of inactivity.
Mark the issue as fresh with /remove-lifecycle rotten
.
Rotten issues close after an additional 30d of inactivity.
If this issue is safe to close now please do so with /close
.
/lifecycle rotten
/close
@brianmcarey: Closing this issue.
What happened: When I try to bump golang version refer to this doc: https://github.com/kubevirt/kubevirt/blob/main/docs/update-go-version.md I change GIMME_GO_VERSION in hack/builder/Dockerfile and exec
make builder-build
. It returnWhat you expected to happen:
make builder-build
run without errHow to reproduce it (as minimally and precisely as possible): Steps to reproduce the behavior.
Additional context: Add any other context about the problem here.
Environment:
virtctl version
): 0.59kubectl version
): N/Auname -a
): N/A