Skip to content
This repository has been archived by the owner on May 12, 2021. It is now read-only.

ci: install docker 19.03 for arm64 to let build image go #862

Merged
merged 1 commit into from
Nov 18, 2020

Conversation

jongwu
Copy link
Contributor

@jongwu jongwu commented Oct 29, 2020

"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

@jongwu
Copy link
Contributor Author

jongwu commented Oct 29, 2020

/test

@codecov
Copy link

codecov bot commented Oct 29, 2020

Codecov Report

Merging #862 (23bd1c7) into master (5cfb8ec) will increase coverage by 0.08%.
The diff coverage is n/a.

@@            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     

Copy link

@devimc devimc left a 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}
Copy link

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?

Copy link
Contributor Author

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.

Copy link
Contributor

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
Copy link

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

Copy link
Contributor Author

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"
Copy link

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?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ok

Copy link
Member

@c3d c3d left a 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.

@jongwu
Copy link
Contributor Author

jongwu commented Oct 30, 2020

/test

@jongwu
Copy link
Contributor Author

jongwu commented Oct 30, 2020

/test

@jongwu
Copy link
Contributor Author

jongwu commented Oct 30, 2020

/test-arm

@jongwu
Copy link
Contributor Author

jongwu commented Oct 30, 2020

/test

@jongwu
Copy link
Contributor Author

jongwu commented Nov 2, 2020

/test-arm

@jongwu
Copy link
Contributor Author

jongwu commented Nov 2, 2020

/test-arm

@jongwu
Copy link
Contributor Author

jongwu commented Nov 2, 2020

/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}
Copy link
Contributor

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
Comment on lines 30 to 31
echo "reinstall docker 19.03 for arm64"
install_docker_ubuntu 19.03
Copy link
Contributor

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.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yeah, thanks

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@jodh-intel - any comments?

@jongwu jongwu force-pushed the docker branch 2 times, most recently from 89e2ef2 to 09b4f33 Compare November 3, 2020 02:23
@jongwu
Copy link
Contributor Author

jongwu commented Nov 5, 2020

/test

@jongwu
Copy link
Contributor Author

jongwu commented Nov 6, 2020

/test

@jongwu jongwu force-pushed the docker branch 3 times, most recently from 15516c3 to 05872f3 Compare November 11, 2020 09:19
Copy link
Contributor

@jodh-intel jodh-intel left a 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 -
Copy link
Contributor

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?

Copy link
Contributor Author

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.

Copy link
Contributor

@jodh-intel jodh-intel left a 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"
Copy link
Contributor

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"

Copy link
Contributor Author

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"

Copy link
Contributor

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 ;)

@jodh-intel
Copy link
Contributor

/test-ubuntu

@jongwu
Copy link
Contributor Author

jongwu commented Nov 17, 2020

/test-arm

@jongwu
Copy link
Contributor Author

jongwu commented Nov 17, 2020

/test-ubuntu
/test-arm

"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]>
@jongwu
Copy link
Contributor Author

jongwu commented Nov 17, 2020

/test-arm
/test-ubuntu

@jongwu
Copy link
Contributor Author

jongwu commented Nov 18, 2020

hello @jodh-intel @devimc -, should this be merged?

@jodh-intel
Copy link
Contributor

/test-vfio

Copy link

@devimc devimc left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

thanks @jongwu

@devimc devimc merged commit 8c85bb5 into kata-containers:master Nov 18, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

make proto fail using docker 18.06 on arm64
4 participants