ci: make crictl install faster and independent of CRI-O#1778
ci: make crictl install faster and independent of CRI-O#1778chavafg merged 1 commit intokata-containers:masterfrom
Conversation
|
oh cool! Thanks. |
Yes, sure :) |
.ci/install_crio.sh
Outdated
| sudo install "${GOPATH}/bin/crictl" /usr/bin | ||
| popd | ||
| crictl_version=v1.14.0 | ||
| wget -qO- https://github.com/kubernetes-sigs/cri-tools/releases/download/$crictl_version/crictl-$crictl_version-linux-amd64.tar.gz \ |
There was a problem hiding this comment.
@chavafg -do we only test on x86 - or do we need to make this arch independent/tolerant ?
There was a problem hiding this comment.
oh, you are right... We currently test only x86, but I know that @Pennyzct is adding support for arm, so I think it would be good to add support for different architectures.
@saschagrunert do you think you can make the change?
I think you can use .ci/kata-arch.sh -g to get the correct arch name.
There was a problem hiding this comment.
Alright, I will do it like this.
.ci/install_crio.sh
Outdated
| go install ./cmd/crictl | ||
| sudo install "${GOPATH}/bin/crictl" /usr/bin | ||
| popd | ||
| crictl_version=v1.14.0 |
There was a problem hiding this comment.
also, can you please move this to https://github.com/kata-containers/tests/blob/master/versions.yaml and then get the value here using something like: crictl_version=$(get_test_version "external.crictl.version")
There was a problem hiding this comment.
Yes, I will add that.
6b8f0df to
4bd9b07
Compare
|
/test-ubuntu |
.ci/install_crio.sh
Outdated
| go install ./cmd/crictl | ||
| sudo install "${GOPATH}/bin/crictl" /usr/bin | ||
| popd | ||
| crictl_version=$(get_test_version "externals.critools.version") |
There was a problem hiding this comment.
I went through the failure on the ubuntu job and see that it cannot find the versions.yaml file:
10:15:41 ERROR: cannot find .ci/../versions.yaml
10:15:41 Failed at 67: crictl_version=$(get_test_version "externals.critools.version")
@saschagrunert can you please move these lines before we pushd into the cri-o directory (L42)?, so that we are still on our CI working directory and can find the versions.yaml file.
There was a problem hiding this comment.
Yes, thanks for pointing me to the issue 🙏
|
/test |
.ci/install_crio.sh
Outdated
| echo "Get CRI Tools" | ||
| crictl_version=$(get_test_version "externals.critools.version") | ||
| wget -qO- https://github.com/kubernetes-sigs/cri-tools/releases/download/$crictl_version/crictl-$crictl_version-linux-"$(${cidir}/kata-arch.sh -g)".tar.gz \ | ||
| | tar xfz - -C /usr/bin |
There was a problem hiding this comment.
seems that this needs to be sudo tar ...
There was a problem hiding this comment.
Makes sense, I change it.
8bd6bc1 to
2ccfe5e
Compare
|
/test |
|
@saschagrunert I went trough the issues on the CI: Taking a look at the tests, the test fails making an I see here that they changed the behavior of the test in this commit: So maybe the The second issue is that we an older version of cri-o (branch release-1.10) on the Fedora job as we run openshift (3.10) there and the v1.14 version of |
Yeah might be. I opened up an issue in the runtime repository to bump the version. |
|
/test |
|
@chavafg I changed the cri tools implementation accordingly to your suggestions, do we want to go for an additional test again? :) |
.ci/install_crio.sh
Outdated
| sudo install "${GOPATH}/bin/crictl" /usr/bin | ||
| popd | ||
| echo "Installing CRI Tools" | ||
| wget -qO- "$crictl_url" | tar xfz - -C /usr/bin |
There was a problem hiding this comment.
-
I see you are updating already existing code but I think we need a check in here to test for
KATA_DEV_MODEas devs probably don't want their/usr/bin/stamped on (but/usr/local/would be "fair game" I think). -
We avoid
wgetwhere possible so please could you convert this to usecurl.
There was a problem hiding this comment.
I think we could generally use /usr/local, then an additional check would not be needed right?
I changed the command to use curl instead of wget
.ci/install_crio.sh
Outdated
| else | ||
| crio_version=$(get_version "externals.crio.version") | ||
| crictl_version=$(get_test_version "externals.critools.version") | ||
| crictl_url=https://github.com/kubernetes-sigs/cri-tools/releases/download/$crictl_version/crictl-$crictl_version-linux-"$(${cidir}/kata-arch.sh -g)".tar.gz |
There was a problem hiding this comment.
These two crictl_url variables look identical but on closer inspection one contains a v as a version prefix and the other doesn't. Is that really correct?
If it is, please could you make this clearer by reworking the code to something like:
version_prefix=""
if [ ... ]; then
version_prefix="v"
# ...
else
# ...
fi
cri_tools_site=https://github.com/kubernetes-sigs/cri-tools
cri_tools_file="crictl-${crictl_version}-linux-$(${cidir}/kata-arch.sh -g).tar.gz"
crictl_url="${cri_tools_site}/releases/download/${version_prefix}${crictl_version}/${cri_tools_file}There was a problem hiding this comment.
Yes, I adapt it as suggested.
versions.yaml
Outdated
|
|
||
| critools: | ||
| version: v1.14.0 | ||
| openShift3Version: 1.0.0-beta.2 |
There was a problem hiding this comment.
We already encode openshift in the main versions database, so should these details go there?:
There was a problem hiding this comment.
Okay, I will add it there.
There was a problem hiding this comment.
Created another PR to address this issue: kata-containers/runtime#1873
|
@saschagrunert - CI resets when you push changes, so we would need to test again - but, I'll leave triggering that until you assess the feedback from @jodh-intel ;-) |
| sudo install "${GOPATH}/bin/crictl" /usr/bin | ||
| popd | ||
| echo "Installing CRI Tools" | ||
| crictl_url=https://github.com/kubernetes-sigs/cri-tools/releases/download/v$crictl_version/crictl-$crictl_tag_prefix$crictl_version-linux-"$(${cidir}/kata-arch.sh -g)".tar.gz |
There was a problem hiding this comment.
This variable still contains v$crictl_version ...?
There was a problem hiding this comment.
Yes, this is a little skew (tag vs file name) in cri-tools but it should work fine.
There was a problem hiding this comment.
So in the end we have both urls, which are working:
https://github.com/kubernetes-sigs/cri-tools/releases/download/v1.14.0/crictl-v1.14.0-linux-amd64.tar.gz
https://github.com/kubernetes-sigs/cri-tools/releases/download/v1.0.0-beta.2/crictl-1.0.0-beta.2-linux-amd64.tar.gz
There was a problem hiding this comment.
@saschagrunert can you move the Installing CRI tools section before we pushd into the cri-o repo?
10:58:02 .ci/install_crio.sh: line 70: .ci/kata-arch.sh: No such file or directory
10:58:02 Failed at 70: crictl_url=https://github.com/kubernetes-sigs/cri-tools/releases/download/v$crictl_version/crictl-$crictl_tag_prefix$crictl_version-linux-"$(${cidir}/kata-arch.sh -g)".tar.gz
There was a problem hiding this comment.
Hm, alright I moved it above.
.ci/install_crio.sh
Outdated
| popd | ||
| echo "Installing CRI Tools" | ||
| crictl_url=https://github.com/kubernetes-sigs/cri-tools/releases/download/v$crictl_version/crictl-$crictl_tag_prefix$crictl_version-linux-"$(${cidir}/kata-arch.sh -g)".tar.gz | ||
| wget -Ls "$crictl_url" | tar xfz - -C /usr/local/bin |
There was a problem hiding this comment.
I think you might need to re-push as this is still showing as wget.
There was a problem hiding this comment.
Thanks for the hint, you're right. :) Re-pushed my changes.
|
/test |
I think we need to move the |
Yes, I moved it below. |
|
@chavafg may I ask you to trigger a /test ? :) |
|
/test |
|
/test |
|
/test |
.ci/install_crio.sh
Outdated
| popd | ||
| echo "Installing CRI Tools" | ||
| crictl_url=https://github.com/kubernetes-sigs/cri-tools/releases/download/v$crictl_version/crictl-$crictl_tag_prefix$crictl_version-linux-"$(${cidir}/kata-arch.sh -g)".tar.gz | ||
| curl -Ls "$crictl_url" | tar xfz - -C /usr/local/bin |
There was a problem hiding this comment.
can you please add sudo here?
There was a problem hiding this comment.
Yes, added it. I thought it was already there 🤔
There was a problem hiding this comment.
yep, don't worry, I think this should be fine now 😄
/test
Fixes: kata-containers#1777 Signed-off-by: Sascha Grunert <sgrunert@suse.com>
|
I guess we have to drop another /test here. 😇 |
|
ha, the trigger phrase didn't work on the review comment. Thanks for noticing it. Should work now: |
|
Hm, the Kernel Build seems to fail: |
|
Awesome, it works. Thanks for all the support guys! :) |
|
thanks @saschagrunert |
Fixes #1777