-
Notifications
You must be signed in to change notification settings - Fork 196
ci: make crictl install faster and independent of CRI-O #1778
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@chavafg -do we only test on x86 - or do we need to make this arch independent/tolerant ?
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.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
seems that this needs to be sudo tar ...
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.
Makes sense, I change it.
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.
thanks
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
-
I see you are updating already existing code but I think we need a check in here to test for
KATA_DEV_MODE
as devs probably don't want their/usr/bin/
stamped on (but/usr/local/
would be "fair game" I think). -
We avoid
wget
where possible so please could you convert this to usecurl
.
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 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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We already encode openshift in the main versions database, so should these details go there?:
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.
Okay, I will add it there.
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.
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 ;-) |
.ci/install_crio.sh
Outdated
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This variable still contains v$crictl_version
...?
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.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think you might need to re-push as this is still showing as wget
.
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.
Thanks for the hint, you're right. :) Re-pushed my changes.
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.
Thanks @saschagrunert.
lgtm
/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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
can you please add sudo
here?
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.
Yes, added it. I thought it was already there 🤔
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.
yep, don't worry, I think this should be fine now 😄
/test
Fixes: kata-containers#1777 Signed-off-by: Sascha Grunert <[email protected]>
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