-
Notifications
You must be signed in to change notification settings - Fork 113
ci: install docker 19.03 for arm64 to let build image go #862
Conversation
/test |
Codecov Report
@@ Coverage Diff @@
## master #862 +/- ##
==========================================
+ Coverage 57.72% 57.80% +0.08%
==========================================
Files 17 17
Lines 2370 2370
==========================================
+ Hits 1368 1370 +2
+ Misses 840 839 -1
+ Partials 162 161 -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.
thanks @jongwu - I have some questions
.ci/run.sh
Outdated
@@ -9,10 +9,27 @@ set -e | |||
cidir=$(dirname "$0") | |||
source "${cidir}/lib.sh" | |||
|
|||
install_docker() { | |||
docker_version=${docker_version:-19.03} |
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 this version of docker required only in this repo? why don't change in the tests 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.
yeah, I find this is necessary only in agent, also change in tests repo won't work the version is available for 18.06 for now.
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 might work today, but what about when Docker 19.03 is no longer available? It would be much safer to check the installed version of docker and if it is "< 19.03", upgrade it.
But we store these sorts of version details in the versions database:
And if it is architecture-specific, add an aarch64
block like here:
.ci/run.sh
Outdated
if [ $arch == "arm64" ]; then | ||
command -v docker >/dev/null 2>&1 && "${testcidir}/../cmd/container-manager/manage_ctr_mgr.sh" docker remove | ||
echo "reinstall docker 19.03 for arm64" | ||
install_docker 19.03 |
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 install_docker
is distro specific, I think you should rename it to install_docker_ubuntu
or something else that contains the ubuntu
word
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.
ok. thanks
.ci/run.sh
Outdated
install_docker() { | ||
docker_version=${docker_version:-19.03} | ||
pkg_name="docker-ce" | ||
repo_url="https://download.docker.com/linux/ubuntu" |
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.
before installing docker, could you please check that you are running on ubuntu?
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.
ok
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.
Looks good to me, but I only checked there was no impact on x86.
/test |
/test |
/test-arm |
/test |
/test-arm |
/test-arm |
/test |
.ci/run.sh
Outdated
@@ -9,10 +9,27 @@ set -e | |||
cidir=$(dirname "$0") | |||
source "${cidir}/lib.sh" | |||
|
|||
install_docker() { | |||
docker_version=${docker_version:-19.03} |
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 might work today, but what about when Docker 19.03 is no longer available? It would be much safer to check the installed version of docker and if it is "< 19.03", upgrade it.
But we store these sorts of version details in the versions database:
And if it is architecture-specific, add an aarch64
block like here:
.ci/run.sh
Outdated
echo "reinstall docker 19.03 for arm64" | ||
install_docker_ubuntu 19.03 |
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.
Please don't hard code version numbers in strings - use variables to make the scripts easier to maintain.
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, thanks
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.
@jodh-intel - any comments?
89e2ef2
to
09b4f33
Compare
/test |
/test |
15516c3
to
05872f3
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.
Thanks @jongwu. But imho these changes look confusing: they are architecture, distro and container manager specific. Further, there are no comments in the code explaining what is happening. Plus, they make the script overly complex for the non-ARM case.
It would be much cleaner I think if you created something like .ci/run-aarch64.sh
and called it a function in it conditionally.
.ci/run.sh
Outdated
install_docker_ubuntu() { | ||
pkg_name="docker-ce" | ||
repo_url="https://download.docker.com/linux/ubuntu" | ||
curl -fsSL "${repo_url}/gpg" | sudo apt-key add - |
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 options look inconsistent to me:
-f, --fail Fail silently (no output at all) on HTTP errors
-S, --show-error Show error even when -s is used
-s, --silent Silent mode
Why are you suppressing errors anyway as that will make debugging a remote CI very hard?
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 @jodh-intel -, I fold the change into a new file, also tweak this curl command.
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 @jongwu. That's much clearer imho.
lgtm
# docker version may need to be upgraded to let make proto go on arm64 | ||
arch=$(go env GOARCH) | ||
if [ "$arch" == "arm64" ]; then | ||
"../agent/.ci/run_arm64.sh" |
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 path looks odd - shouldn't it be something like the following?:
cidir=$(dirname "$0")
"${cidir}/run_arm64.sh"
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.
but it won't work as the current dir is .../tests. run_arm64.sh is not found in the path of ".ci/run_arm64.sh"
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.
Ack! I was only looking at that line in isolation ;)
/test-ubuntu |
/test-arm |
/test-ubuntu |
"make proto" will fail on arm64 using docker 18.06. This bug will be gone if using docker 19.03. so upgrade docker before "make proto" for arm64. Depends-on: github.com/kata-containers/runtime#3057 Fixes: kata-containers#861 Signed-off-by: Jianyong Wu <[email protected]>
/test-arm |
hello @jodh-intel @devimc -, should this be merged? |
/test-vfio |
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 @jongwu
"make proto" will fail on arm64 using docker 18.06. This bug will be
gone if using docker 19.03. so upgrade docker before "make proto"
for arm64.
Fixes: #861
Signed-off-by: Jianyong Wu [email protected]
@jodh-intel @devimc