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

Commit 23bd1c7

Browse files
committed
ci: install docker 19.03 for arm64 to let build image go
"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/#3057 Fixes: #861 Signed-off-by: Jianyong Wu <[email protected]>
1 parent 5cfb8ec commit 23bd1c7

File tree

2 files changed

+47
-0
lines changed

2 files changed

+47
-0
lines changed

.ci/run.sh

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,12 @@ pushd "${tests_repo_dir}"
1313
.ci/run.sh
1414
testcidir=$(dirname "$0")
1515

16+
# docker version may need to be upgraded to let make proto go on arm64
17+
arch=$(go env GOARCH)
18+
if [ "$arch" == "arm64" ]; then
19+
"../agent/.ci/run_arm64.sh"
20+
fi
21+
1622
echo "Starting docker service before making proto"
1723
sudo systemctl start docker
1824

.ci/run_arm64.sh

Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
#!/bin/bash
2+
#
3+
# Copyright (c) 2020 Arm Ltd Corporation
4+
#
5+
# SPDX-License-Identifier: Apache-2.0
6+
7+
source "${tests_repo_dir}/.ci/lib.sh"
8+
9+
arch=$(go env GOARCH)
10+
install_docker_ubuntu() {
11+
pkg_name="docker-ce"
12+
repo_url="https://download.docker.com/linux/ubuntu"
13+
curl -L "${repo_url}/gpg" | sudo apt-key add -
14+
sudo -E add-apt-repository "deb [arch=${arch}] ${repo_url} $(lsb_release -cs) stable"
15+
sudo -E apt-get update
16+
docker_version_full=$(apt-cache madison $pkg_name | grep "$docker_version" | awk '{print $3}' | head -1)
17+
sudo -E apt-get -y install "${pkg_name}=${docker_version_full}"
18+
}
19+
20+
# make proto will fail on arm64 when use docker 18.06 and using docker 19.03
21+
# can avoid this failure. For now this change is only for ubuntu as we know little
22+
# about the other cases.
23+
main() {
24+
ID=$(cat /etc/os-release | grep "^ID=" | cut -f 2 -d "=")
25+
if [ "$ID" != "ubuntu" ]; then
26+
echo "docker upgrade is only done for ubuntu"
27+
exit 0
28+
fi
29+
current_docker_version=$(docker version | awk '/Engine/{getline; print $2 }')
30+
current_docker_version=${current_docker_version%.*}
31+
docker_version=$(get_version "externals.docker.architecture.aarch64.agent.version")
32+
docker_version=${docker_version/v}
33+
docker_version=${docker_version/-*}
34+
if [[ `echo "$current_docker_version < $docker_version" | bc` -eq 1 ]]; then
35+
command -v docker >/dev/null 2>&1 && "./cmd/container-manager/manage_ctr_mgr.sh" docker remove
36+
echo "reinstall docker $docker_version for arm64"
37+
install_docker_ubuntu $docker_version
38+
fi
39+
}
40+
41+
main

0 commit comments

Comments
 (0)