From fca1fccb66ffa750a7d0a8c76a97ade62db8faff Mon Sep 17 00:00:00 2001 From: Dimitrios Liappis Date: Fri, 12 Jan 2024 09:02:45 +0200 Subject: [PATCH] Add Docker acceptance to exhaustive BK pipeline (#15748) This commit adds the Docker acceptance tests in the acceptance phase of the exhaustive tests pipeline. - Relates: https://github.com/elastic/ingest-dev/issues/1722 --- .../exhaustive-tests/generate-steps.py | 39 +++++++++++++++++++ 1 file changed, 39 insertions(+) diff --git a/.buildkite/scripts/exhaustive-tests/generate-steps.py b/.buildkite/scripts/exhaustive-tests/generate-steps.py index 03ad4ceb4ea..46a54a3cc58 100644 --- a/.buildkite/scripts/exhaustive-tests/generate-steps.py +++ b/.buildkite/scripts/exhaustive-tests/generate-steps.py @@ -81,6 +81,38 @@ def randomized_windows_os() -> str: return random.choice(all_oses["windows"]) +def aws_agent(vm_name: str, instance_type: str, image_prefix: str = "platform-ingest-logstash-multi-jdk", disk_size_gb: int = 200) -> dict[str, typing.Any]: + return { + "provider": "aws", + "imagePrefix": f"{image_prefix}-{vm_name}", + "instanceType": instance_type, + "diskSizeGb": disk_size_gb, + } + +def gcp_agent(vm_name: str, instance_type: str = "n2-standard-4", image_prefix: str = "family/platform-ingest-logstash-multi-jdk", disk_size_gb: int = 200) -> dict[str, typing.Any]: + return { + "provider": "gcp", + "imageProject": "elastic-images-prod", + "image": f"{image_prefix}-{vm_name}", + "machineType": instance_type, + "diskSizeGb": disk_size_gb, + "diskType": "pd-ssd", + } + +def acceptance_docker_steps()-> list[typing.Any]: + steps = [] + for flavor in ["full", "oss", "ubi8"]: + steps.append({ + "label": f":docker: {flavor} flavor acceptance", + "agents": gcp_agent(vm_name="ubuntu-2204", image_prefix="family/platform-ingest-logstash"), + "command": LiteralScalarString(f"""#!/usr/bin/env bash +set -euo pipefail +source .buildkite/scripts/common/vm-agent.sh +ci/docker_acceptance_tests.sh {flavor}"""), + }) + + return steps + if __name__ == "__main__": LINUX_OS_ENV_VAR_OVERRIDE = os.getenv("LINUX_OS") WINDOWS_OS_ENV_VAR_OVERRIDE = os.getenv("WINDOWS_OS") @@ -114,5 +146,12 @@ def randomized_windows_os() -> str: "steps": [compat_windows_step(imagesuffix=windows_test_os)], }) + structure["steps"].append({ + "group": "Acceptance / Docker", + "key": "acceptance-docker", + "depends_on": ["testing-phase"], + "steps": acceptance_docker_steps(), + }) + print('# yaml-language-server: $schema=https://raw.githubusercontent.com/buildkite/pipeline-schema/main/schema.json') YAML().dump(structure, sys.stdout)