-
Notifications
You must be signed in to change notification settings - Fork 18
ci: install image from github releases #839
Conversation
kubernetes qa-failed 👎 |
On the k8s execution, got this error:
|
@chavafg added python as installation dependency. |
.ci/install_clear_image.sh
Outdated
@@ -16,34 +16,31 @@ | |||
|
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 should rename the script to install_clearcontainers_image.sh
.ci/install_clear_image.sh
Outdated
repo_name="osbuilder" | ||
cc_image_releases_url="https://github.com/${repo_owner}/${repo_name}/releases" | ||
|
||
function download_image() { |
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 that this function has a lot in common with this one:
https://github.com/clearcontainers/tests/blob/master/.ci/install_clearcontainers_kernel.sh#L34
Do you think it would be possible to have a common function called download_component()
(or something similar) and add it to the .ci/lib.sh
and then just call it 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.
Yep, agree with that .
kubernetes qa-passed 👍 |
01ee007
to
50486d0
Compare
kubernetes qa-passed 👍 |
1 similar comment
kubernetes qa-passed 👍 |
.ci/install_asset.sh
Outdated
if [ "${version}" == "latest" ]; then | ||
echo "latest_release_info_url $latest_release_info_url" >&2 | ||
release_json="$(curl -s ${latest_release_info_url})" | ||
parse_py=' |
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.
Reminder to myself, dont use github api to avoid require a token.
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.
:-) Just to clarify - you can use the ABI without a token, but it is then rate limited, and if a user has burnt up their allowed allocation (as one of my CI systems had), then the call will fail :-)
This PR looks like it has indeed fixed the issue on my CI - so, thanks!
ff5c393
to
1b6b39e
Compare
kubernetes qa-failed 👎 |
1b6b39e
to
b95dfcb
Compare
kubernetes qa-passed 👍 |
@chavafg ci is passing with latest image published in osbuilder, please take a look. @erick0z @jodh-intel could you take a look to this PR? |
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.
Just a few comments.
@klynnrif - could you take a look at the doc changes please?
.ci/README.md
Outdated
|
||
## Clear Containers Image for CI ## | ||
|
||
The CI environment is configured download the guest OS image from the |
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.
"is configured to".
.ci/install_asset.sh
Outdated
|
||
repo_owner="clearcontainers" | ||
#fake repository dir to query kernel and image version from remote | ||
fake_repo_dir=$(mktemp -t -d cc-kernel.XXXX) |
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.
Nit: cc-asset.XXXX
(or maybe just assets.XXXX
to make it more portable)?
.ci/install_asset.sh
Outdated
exit 1 | ||
} | ||
|
||
asset=$1 |
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.
"$1"
.ci/install_asset.sh
Outdated
version="$2" | ||
[ -z "${asset}" ] && usage | ||
[ -z "${version}" ] && usage | ||
readonly runtime_versions_url="https://raw.githubusercontent.com/clearcontainers/runtime/master/versions.txt" |
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.
How about specifying the URL as:
repo=runtime
:
readonly runtime_versions_url="https://raw.githubusercontent.com/${repo_owner}/${repo}/master/versions.txt"
.ci/install_asset.sh
Outdated
|
||
resolve_version() { | ||
local repo=$1 | ||
local version=$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.
Nit: Safest to double-quote all params (here and in functions below).
.ci/install_asset.sh
Outdated
[ -n "${repo}" ] || die "repo not provided" | ||
|
||
if [ "${version}" == "latest" ]; then | ||
version=$(get_latest_version "${repo}") |
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.
You could simplify this to:
[ "${version}" == "latest" ] && version=$(get_latest_version "${repo}")
.ci/install_asset.sh
Outdated
binaries_dir_fmt='image-%s-binaries' | ||
;; | ||
*) | ||
die "unknown asset" |
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.
Could you add $asset
to the error message.
"${cidir}/install_asset.sh" "image" "latest" | ||
|
||
echo "Install Clear Containers Kernel" | ||
"${cidir}/install_asset.sh" "kernel" "latest" |
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.
Sweet! 😄
b95dfcb
to
d2cf7ab
Compare
kubernetes qa-passed 👍 |
d2cf7ab
to
70ffaa8
Compare
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.
lgtm
@iphutch @klynnrif @rcaballeromx, please take a look to doc changes. |
kubernetes qa-passed 👍 |
1 similar comment
70ffaa8
to
bc00bd4
Compare
kubernetes qa-failed 👎 |
bc00bd4
to
c11957b
Compare
kubernetes qa-passed 👍 |
Python is tests depedency make sure is installed. Signed-off-by: Jose Carlos Venegas Munoz <jose.carlos.venegas.munoz@intel.com>
427cfc1
to
c11957b
Compare
kubernetes qa-failed 👎 |
1 similar comment
kubernetes qa-failed 👎 |
c11957b
to
bad5d79
Compare
kubernetes qa-failed 👎 |
bad5d79
to
b6378f8
Compare
kubernetes qa-failed 👎 |
Both assets kernel and image installation is similar merge it in only one script. Add documentation about ./install_asset.sh. - Install github image. - Install github kernel. Fixes: clearcontainers#838 Signed-off-by: Jose Carlos Venegas Munoz <jose.carlos.venegas.munoz@intel.com>
remove not needed scirpts. Signed-off-by: Jose Carlos Venegas Munoz <jose.carlos.venegas.munoz@intel.com>
b6378f8
to
5426b0e
Compare
kubernetes qa-failed 👎 |
@klynnrif @rcaballeromx ping , could you check this PR, it is ready to merge only need your +1. |
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.
lgtm
5426b0e
to
f92e2e1
Compare
kubernetes qa-failed 👎 |
Also remove installation from fedora and ubuntu scripts and refactor in setup.sh Signed-off-by: Jose Carlos Venegas Munoz <jose.carlos.venegas.munoz@intel.com>
@@ -38,6 +38,12 @@ if [ -n "$PULL_REQUEST_NUMBER" ] || [ -n "$LOCALCI_PR_NUMBER" ]; then | |||
bash -f "${cidir}/run_fetch_branches_tool.sh" | |||
fi | |||
|
|||
echo "Install Clear containers image" | |||
"${cidir}/install_asset.sh" "image" "latest" |
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.
Hi @jcvenegas
Sorry for posting a post-merge follow up. I think this has broken the metrics Jenkins CI instance.
The root problem I think is that on the metrics CI, which is a bare metal system (as opposed to the VM Azure systems we use QA CI) - so we have clear containers installed into docker as the default runtime from the previous PR test (we don't clean/reset the whole system like we effectively do with Azure - where we get a new clean VM machine for each PR).
This results in the known build failure for osbuilder (like clearcontainers/osbuilder#8), like:
17:26:17 Step 2/9 : RUN dnf install -y qemu-img parted gdisk make gcc bc git e2fsprogs libudev-devel pkgconfig
17:26:17 ---> Running in 6220fc9fd574
17:26:25 �[91mBDB0126 mmap: Invalid argument
17:26:25 �[0m�[91mhandle_proxy_response:616:Error response received from proxy at /run/virtcontainers/pods/6220fc9fd574d56d747fe5bcd635ae18ab67dc190fca8e4b97b6a9dda0e08d2f/proxy.sock: {"msg":"vm: unknown token 7yumQLpbAES-kAnPNgsZZswCu_WH7hkFBnhpKa-bMqg="}
17:26:25
17:26:25 /usr/libexec/clear-containers/cc-shim: Shim received an error in responseto ConnectShim command, exiting�[0mThe command '/bin/sh -c dnf install -y qemu-img parted gdisk make gcc bc git e2fsprogs libudev-devel pkgconfig' returned a non-zero code: 1
17:26:25 Makefile:114: recipe for target 'docker-build' failed
from https://clearlinux.org/cc-ci/job/clear-containers-runtime-16.04-PR/66/console
As the metrics CI system runs Ubuntu right now, I suspect we suffer from a combination of clearcontainers/osbuilder#8 and clearcontainers/osbuilder#22.
I can't think of a workaround or solution right now. The only thing that comes to mind is maybe for a system that has CC as the default runtime we will need to use the latest pre-built image or kernel from the repos rather than trying to build the latest from source.
Thoughts?
CI: Fix xurls URL
This PR install a kernel an image from github.
Kernel:
https://github.com/clearcontainers/linux/releases
Image:
https://github.com/clearcontainers/osbuilder/releases
Both are installed using a new script
install_asset.sh
Fixes: #838
Signed-off-by: Jose Carlos Venegas Munoz jose.carlos.venegas.munoz@intel.com