diff --git a/.buildkite/pipeline.trigger.integration.tests.sh b/.buildkite/pipeline.trigger.integration.tests.sh index 6cc396c901..3dd8f559f9 100755 --- a/.buildkite/pipeline.trigger.integration.tests.sh +++ b/.buildkite/pipeline.trigger.integration.tests.sh @@ -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\"" @@ -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\"" \ No newline at end of file +echo " memory: \"4G\"" diff --git a/.buildkite/pipeline.yml b/.buildkite/pipeline.yml index 888ed00588..3a379cc05b 100644 --- a/.buildkite/pipeline.yml +++ b/.buildkite/pipeline.yml @@ -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}" diff --git a/.buildkite/scripts/install_deps.sh b/.buildkite/scripts/install_deps.sh index 0c10ceacba..3abdb77741 100755 --- a/.buildkite/scripts/install_deps.sh +++ b/.buildkite/scripts/install_deps.sh @@ -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 diff --git a/.buildkite/scripts/integration_tests.sh b/.buildkite/scripts/integration_tests.sh index 101a48a10d..c29fbcfd86 100755 --- a/.buildkite/scripts/integration_tests.sh +++ b/.buildkite/scripts/integration_tests.sh @@ -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