Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Buildkite] Downgrade docker daemon #1639

Merged
merged 19 commits into from
Jan 23, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 10 additions & 2 deletions .buildkite/pipeline.trigger.integration.tests.sh
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
# exit immediately on failure, or if an undefined variable is used
set -eu


# begin the pipeline.yml file
echo "steps:"
echo " - group: \":terminal: Integration test suite\""
Expand Down Expand Up @@ -110,14 +111,21 @@ echo " - build/elastic-stack-dump/install-zip-shellinit/logs/*.log"

echo " - label: \":go: Running integration test: test-profiles-command\""
echo " command: ./.buildkite/scripts/integration_tests.sh -t test-profiles-command"
echo " env:"
echo " DOCKER_COMPOSE_VERSION: \"false\""
echo " DOCKER_VERSION: \"false\""
echo " agents:"
echo " provider: \"gcp\""
echo " image: \"${LINUX_AGENT_IMAGE}\""
echo " cpu: \"8\""
echo " memory: \"4G\""

echo " - label: \":go: Running integration test: test-check-update-version\""
echo " command: ./.buildkite/scripts/integration_tests.sh -t test-check-update-version"
echo " env:"
echo " DEFAULT_VERSION_TAG: v0.80.0"
echo " DOCKER_COMPOSE_VERSION: \"false\""
echo " DOCKER_VERSION: \"false\""
echo " agents:"
echo " image: \"${LINUX_AGENT_IMAGE}\""
echo " cpu: \"8\""
echo " memory: \"4G\""
echo " memory: \"4G\""
2 changes: 2 additions & 0 deletions .buildkite/pipeline.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@ env:
SETUP_GVM_VERSION: 'v0.5.1' # https://github.com/andrewkroh/gvm/issues/44#issuecomment-1013231151
ELASTIC_PACKAGE_COMPOSE_DISABLE_ANSI: "true"
ELASTIC_PACKAGE_COMPOSE_DISABLE_PULL_PROGRESS_INFORMATION: "true"
DOCKER_COMPOSE_VERSION: "v2.24.1"
DOCKER_VERSION: "24.0.7"
KIND_VERSION: 'v0.20.0'
K8S_VERSION: 'v1.29.0'
LINUX_AGENT_IMAGE: "golang:${GO_VERSION}"
Expand Down
38 changes: 38 additions & 0 deletions .buildkite/scripts/install_deps.sh
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,44 @@ add_bin_path(){
export PATH="${WORKSPACE}/bin:${PATH}"
}

with_docker() {
if [[ "${DOCKER_VERSION:-"false"}" == "false" ]]; then
echo "Skip docker installation"
return
fi
local ubuntu_version
local ubuntu_codename
local architecture
ubuntu_version="$(lsb_release -rs)" # 20.04
ubuntu_codename="$(lsb_release -sc)" # focal
architecture=$(dpkg --print-architecture)
local debian_version="5:${DOCKER_VERSION}-1~ubuntu.${ubuntu_version}~${ubuntu_codename}"

sudo sudo mkdir -p /etc/apt/keyrings
curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo gpg --dearmor -o /etc/apt/keyrings/docker.gpg
echo "deb [arch=${architecture} signed-by=/etc/apt/keyrings/docker.gpg] https://download.docker.com/linux/ubuntu ${ubuntu_codename} stable" | sudo tee /etc/apt/sources.list.d/docker.list > /dev/null
sudo apt-get update
sudo DEBIAN_FRONTEND=noninteractive apt-get install --allow-downgrades -y "docker-ce=${debian_version}"
sudo DEBIAN_FRONTEND=noninteractive apt-get install --allow-downgrades -y "docker-ce-cli=${debian_version}"
sudo systemctl start docker
}

with_docker_compose_plugin() {
if [[ "${DOCKER_COMPOSE_VERSION:-"false"}" == "false" ]]; then
echo "Skip docker compose installation (plugin)"
return
fi
create_bin_folder
check_platform_architecture

local DOCKER_CONFIG="$HOME/.docker/cli-plugins"
mkdir -p "$DOCKER_CONFIG"

retry 5 curl -SL -o ${DOCKER_CONFIG}/docker-compose "https://github.com/docker/compose/releases/download/${DOCKER_COMPOSE_VERSION}/docker-compose-${platform_type_lowercase}-${hw_type}"
chmod +x ${DOCKER_CONFIG}/docker-compose
docker compose version
}

with_kubernetes() {
create_bin_folder
check_platform_architecture
Expand Down
6 changes: 6 additions & 0 deletions .buildkite/scripts/integration_tests.sh
Original file line number Diff line number Diff line change
Expand Up @@ -109,6 +109,12 @@ add_bin_path
echo "--- install go"
with_go

echo "--- install docker"
with_docker

echo "--- install docker-compose plugin"
with_docker_compose_plugin

if [[ "${TARGET}" == "${KIND_TARGET}" ]]; then
echo "--- install kubectl & kind"
with_kubernetes
Expand Down