This repository has been archived by the owner on May 12, 2021. It is now read-only.
-
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
Merged
Merged
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
#!/bin/bash | ||
# | ||
# Copyright (c) 2020 Arm Ltd Corporation | ||
# | ||
# SPDX-License-Identifier: Apache-2.0 | ||
|
||
source "${tests_repo_dir}/.ci/lib.sh" | ||
|
||
arch=$(go env GOARCH) | ||
install_docker_ubuntu() { | ||
pkg_name="docker-ce" | ||
repo_url="https://download.docker.com/linux/ubuntu" | ||
curl -L "${repo_url}/gpg" | sudo apt-key add - | ||
sudo -E add-apt-repository "deb [arch=${arch}] ${repo_url} $(lsb_release -cs) stable" | ||
sudo -E apt-get update | ||
docker_version_full=$(apt-cache madison $pkg_name | grep "$docker_version" | awk '{print $3}' | head -1) | ||
sudo -E apt-get -y install "${pkg_name}=${docker_version_full}" | ||
} | ||
|
||
# make proto will fail on arm64 when use docker 18.06 and using docker 19.03 | ||
# can avoid this failure. For now this change is only for ubuntu as we know little | ||
# about the other cases. | ||
main() { | ||
ID=$(cat /etc/os-release | grep "^ID=" | cut -f 2 -d "=") | ||
if [ "$ID" != "ubuntu" ]; then | ||
echo "docker upgrade is only done for ubuntu" | ||
exit 0 | ||
fi | ||
current_docker_version=$(docker version | awk '/Engine/{getline; print $2 }') | ||
current_docker_version=${current_docker_version%.*} | ||
docker_version=$(get_version "externals.docker.architecture.aarch64.agent.version") | ||
docker_version=${docker_version/v} | ||
docker_version=${docker_version/-*} | ||
if [[ `echo "$current_docker_version < $docker_version" | bc` -eq 1 ]]; then | ||
command -v docker >/dev/null 2>&1 && "./cmd/container-manager/manage_ctr_mgr.sh" docker remove | ||
echo "reinstall docker $docker_version for arm64" | ||
install_docker_ubuntu $docker_version | ||
fi | ||
} | ||
|
||
main |
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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?:
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 ;)