Skip to content

Commit

Permalink
Add Docker acceptance to exhaustive BK pipeline (#15748)
Browse files Browse the repository at this point in the history
This commit adds the Docker acceptance tests in the acceptance phase
of the exhaustive tests pipeline.

- Relates: elastic/ingest-dev#1722
  • Loading branch information
dliappis authored Jan 12, 2024
1 parent 968fb24 commit fca1fcc
Showing 1 changed file with 39 additions and 0 deletions.
39 changes: 39 additions & 0 deletions .buildkite/scripts/exhaustive-tests/generate-steps.py
Original file line number Diff line number Diff line change
Expand Up @@ -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")
Expand Down Expand Up @@ -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)

0 comments on commit fca1fcc

Please sign in to comment.