Skip to content

Commit e1f8272

Browse files
Update buildkite script to look for new logstash releases location (#358) (#362)
(cherry picked from commit febb207) Co-authored-by: Cas Donoghue <[email protected]>
1 parent b6bd9f6 commit e1f8272

File tree

4 files changed

+27
-17
lines changed

4 files changed

+27
-17
lines changed

.buildkite/scripts/build-pipeline/generate-steps.py

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66

77
from ruamel.yaml import YAML
88

9-
RELEASES_URL = "https://raw.githubusercontent.com/elastic/logstash/main/ci/logstash_releases.json"
9+
RELEASES_URL = "https://raw.githubusercontent.com/logstash-plugins/.ci/refs/heads/1.x/logstash-versions.yml"
1010
TEST_COMMAND: typing.final = ".buildkite/scripts/run_tests.sh"
1111

1212

@@ -63,13 +63,15 @@ def generate_steps_for_main_branch(versions) -> list:
6363
structure = {
6464
"agents": {
6565
"provider": "gcp",
66-
"machineType": "n1-standard-4",
67-
"image": "family/core-ubuntu-2204"
66+
"machineType": "n2-standard-4",
67+
"imageProject": "elastic-images-prod",
68+
"image": "family/platform-ingest-logstash-multi-jdk-ubuntu-2204"
6869
},
6970
"steps": []}
7071

7172
response = call_url_with_retry(RELEASES_URL)
72-
versions_json: typing.final = response.json()
73+
yaml = YAML(typ='safe')
74+
versions_yaml: typing.final = yaml.load(response.text)
7375

7476
# Use BUILDKITE_SOURCE to figure out PR merge or schedule.
7577
# If PR merge, no need to run builds on all branches, target branch will be good
@@ -79,8 +81,8 @@ def generate_steps_for_main_branch(versions) -> list:
7981
# - manual kick off will be on PR or entire main branch, can be decided with BUILDKITE_BRANCH
8082
bk_source = os.getenv("BUILDKITE_SOURCE")
8183
bk_branch = os.getenv("BUILDKITE_BRANCH")
82-
steps = generate_steps_for_scheduler(versions_json) if (bk_source == "schedule" or bk_branch == "main") \
83-
else generate_steps_for_main_branch(versions_json)
84+
steps = generate_steps_for_scheduler(versions_yaml) if (bk_source == "schedule" or bk_branch == "main") \
85+
else generate_steps_for_main_branch(versions_yaml)
8486

8587
group_desc = f"Build steps"
8688
key_desc = "build-steps"

.buildkite/scripts/e2e-pipeline/generate-steps.py

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
from requests.adapters import HTTPAdapter, Retry
66
from ruamel.yaml import YAML
77

8-
RELEASES_URL = "https://raw.githubusercontent.com/elastic/logstash/main/ci/logstash_releases.json"
8+
RELEASES_URL = "https://raw.githubusercontent.com/logstash-plugins/.ci/refs/heads/1.x/logstash-versions.yml"
99
TEST_COMMAND: typing.final = ".buildkite/scripts/run_e2e_tests.sh"
1010

1111

@@ -67,7 +67,8 @@ def generate_steps_for_main_branch(versions) -> list:
6767
"steps": []}
6868

6969
response = call_url_with_retry(RELEASES_URL)
70-
versions_json: typing.final = response.json()
70+
yaml = YAML(typ='safe')
71+
versions_yaml: typing.final = yaml.load(response.text)
7172

7273
# Use BUILDKITE_SOURCE to figure out PR merge or schedule.
7374
# If PR merge, no need to run builds on all branches, target branch will be good
@@ -77,8 +78,8 @@ def generate_steps_for_main_branch(versions) -> list:
7778
# - manual kick off will be on PR or entire main branch, can be decided with BUILDKITE_BRANCH
7879
bk_source = os.getenv("BUILDKITE_SOURCE")
7980
bk_branch = os.getenv("BUILDKITE_BRANCH")
80-
steps = generate_steps_for_scheduler(versions_json) if (bk_source == "schedule" or bk_branch == "main") \
81-
else generate_steps_for_main_branch(versions_json)
81+
steps = generate_steps_for_scheduler(versions_yaml) if (bk_source == "schedule" or bk_branch == "main") \
82+
else generate_steps_for_main_branch(versions_yaml)
8283

8384
group_desc = f"E2E steps"
8485
key_desc = "e2e-steps"

.buildkite/scripts/pull-request-pipeline/generate-steps.py

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66

77
from ruamel.yaml import YAML
88

9-
RELEASES_URL = "https://raw.githubusercontent.com/elastic/logstash/main/ci/logstash_releases.json"
9+
RELEASES_URL = "https://raw.githubusercontent.com/logstash-plugins/.ci/refs/heads/1.x/logstash-versions.yml"
1010
TEST_MATRIX_URL = "https://raw.githubusercontent.com/elastic/logstash-filter-elastic_integration/main/.buildkite/pull" \
1111
"-request-test-matrix.yml"
1212
TEST_COMMAND: typing.final = ".buildkite/scripts/run_tests.sh"
@@ -61,14 +61,16 @@ def make_matrix_version_key(branch: str) -> str:
6161
structure = {
6262
"agents": {
6363
"provider": "gcp",
64-
"machineType": "n1-standard-4",
65-
"image": "family/core-ubuntu-2204"
64+
"machineType": "n2-standard-4",
65+
"imageProject": "elastic-images-prod",
66+
"image": "family/platform-ingest-logstash-multi-jdk-ubuntu-2204"
6667
},
6768
"steps": []}
6869

6970
steps = []
7071
response = call_url_with_retry(RELEASES_URL)
71-
versions_json = response.json()
72+
yaml = YAML(typ='safe')
73+
versions_yaml: typing.final = yaml.load(response.text)
7274

7375
matrix_map = call_url_with_retry(TEST_MATRIX_URL)
7476
matrix_map_yaml = YAML().load(matrix_map.text)
@@ -88,13 +90,13 @@ def make_matrix_version_key(branch: str) -> str:
8890
print(f"matrix_releases: {matrix_releases}")
8991
print(f"matrix_snapshots: {matrix_snapshots}")
9092
for matrix_release in matrix_releases:
91-
full_stack_version: typing.final = versions_json["releases"].get(matrix_release)
93+
full_stack_version: typing.final = versions_yaml["releases"].get(matrix_release)
9294
# noop, if they are declared in the matrix but not in the release
9395
if full_stack_version is not None:
9496
steps += generate_unit_and_integration_test_steps(full_stack_version, "false")
9597

9698
for matrix_snapshot in matrix_snapshots:
97-
full_stack_version: typing.final = versions_json["snapshots"].get(matrix_snapshot)
99+
full_stack_version: typing.final = versions_yaml["snapshots"].get(matrix_snapshot)
98100
# noop, if they are declared in the matrix but not in the snapshot
99101
if full_stack_version is not None:
100102
steps += generate_unit_and_integration_test_steps(full_stack_version, "true")

.buildkite/scripts/run_tests.sh

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,8 @@
1+
#!/usr/bin/env bash
2+
3+
export JAVA_HOME="/opt/buildkite-agent/.java/adoptiumjdk_21"
4+
export PATH="/opt/buildkite-agent/.rbenv/bin:/opt/buildkite-agent/.pyenv/bin:/opt/buildkite-agent/.java/bin:$JAVA_HOME:$PATH"
5+
eval "$(rbenv init -)"
16

27
if [ -z "$TARGET_BRANCH" ]; then
38
echo "Target branch is not specified, using default branch: main or BK defined"
@@ -6,4 +11,4 @@ else
611
git checkout "$TARGET_BRANCH"
712
fi
813

9-
mkdir -p .ci && curl -sL --retry 5 --retry-delay 5 https://github.com/logstash-plugins/.ci/archive/1.x.tar.gz | tar zxvf - --skip-old-files --strip-components=1 -C .ci --wildcards '*Dockerfile*' '*docker*' '*.sh' && .ci/docker-setup.sh && .ci/docker-run.sh
14+
mkdir -p .ci && curl -sL --retry 5 --retry-delay 5 https://github.com/logstash-plugins/.ci/archive/1.x.tar.gz | tar zxvf - --skip-old-files --strip-components=1 -C .ci --wildcards '*Dockerfile*' '*docker*' '*.sh' '*logstash-versions*' && .ci/docker-setup.sh && .ci/docker-run.sh

0 commit comments

Comments
 (0)