Skip to content

Commit a10bfd6

Browse files
mergify[bot]moukoublenorestisfl
authored
[9.0](backport #3347) DRA: separate arm64 (#3350)
DRA: separate arm64 (#3347) * DRA: separate arm64 * more logs * more logs * fix artifact download * linter fix * cleanup * Update .buildkite/scripts/publish.sh --------- (cherry picked from commit db161e1) Co-authored-by: Kostas Stamatakis <[email protected]> Co-authored-by: Orestis Floros <[email protected]>
1 parent 6789411 commit a10bfd6

File tree

3 files changed

+90
-19
lines changed

3 files changed

+90
-19
lines changed

.buildkite/pipeline.yml

Lines changed: 65 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,36 +1,88 @@
11
env:
22
BRANCH: "${BUILDKITE_BRANCH}"
3-
agents:
4-
provider: "gcp" # needed for running docker commands
5-
image: "family/platform-ingest-beats-ubuntu-2204"
3+
4+
GCP_DEFAULT_MACHINE_TYPE: "c2d-standard-8"
5+
GCP_IMAGE_UBUNTU_X86_64: "family/platform-ingest-beats-ubuntu-2204"
6+
AWS_ARM_INSTANCE_TYPE: "m6g.xlarge"
7+
AWS_IMAGE_UBUNTU_ARM_64: "platform-ingest-beats-ubuntu-2204-aarch64"
8+
9+
PLATFORMS_AMD64: "linux/amd64"
10+
PLATFORMS_ARM64: "linux/arm64"
11+
12+
DEV: false
613

714
steps:
8-
- label: ":package: Package Cloudbeat - Snapshot"
15+
16+
- group: "Package Snapshot"
917
if: build.branch == 'main' || build.branch =~ /^[0-9]+\.[0-9x]+\$/ || build.env("RUN_RELEASE") == "true"
10-
env:
11-
WORKFLOW: "snapshot"
1218
key: "package-snapshot"
13-
command: "./.buildkite/scripts/package.sh"
14-
artifact_paths: "build/distributions/*"
19+
steps:
20+
- label: ":package: Package Cloudbeat linux/amd64 - Snapshot"
21+
env:
22+
PLATFORMS: "${PLATFORMS_AMD64}"
23+
WORKFLOW: "snapshot"
24+
command: "./.buildkite/scripts/package.sh"
25+
artifact_paths: "build/distributions/*"
26+
agents:
27+
provider: gcp
28+
image: "${GCP_IMAGE_UBUNTU_X86_64}"
29+
machineType: "${GCP_DEFAULT_MACHINE_TYPE}"
30+
31+
- label: ":package: Package Cloudbeat linux/arm64 - Snapshot"
32+
env:
33+
PLATFORMS: "${PLATFORMS_ARM64}"
34+
WORKFLOW: "snapshot"
35+
command: "./.buildkite/scripts/package.sh"
36+
artifact_paths: "build/distributions/*"
37+
agents:
38+
provider: "aws"
39+
imagePrefix: "${AWS_IMAGE_UBUNTU_ARM_64}"
40+
instanceType: "${AWS_ARM_INSTANCE_TYPE}"
1541

1642
- label: ":rocket: Publishing Snapshot DRA artifacts"
1743
if: build.branch == 'main' || build.branch =~ /^[0-9]+\.[0-9x]+\$/ || build.env("RUN_RELEASE") == "true"
1844
depends_on: "package-snapshot"
45+
agents:
46+
provider: gcp
47+
image: "${GCP_IMAGE_UBUNTU_X86_64}"
48+
machineType: "${GCP_DEFAULT_MACHINE_TYPE}"
1949
command: "./.buildkite/scripts/publish.sh"
2050
env:
2151
WORKFLOW: "snapshot"
2252

23-
- label: ":package: Package Cloudbeat - Staging"
53+
- group: "Package Staging"
2454
if: build.branch =~ /^[0-9]+\.[0-9]+\$/ || build.env("RUN_RELEASE") == "true"
25-
env:
26-
WORKFLOW: "staging"
2755
key: "package-staging"
28-
command: "./.buildkite/scripts/package.sh"
29-
artifact_paths: "build/distributions/*"
56+
steps:
57+
- label: ":package: Package Cloudbeat linux/amd64 - Staging"
58+
env:
59+
PLATFORMS: "${PLATFORMS_AMD64}"
60+
WORKFLOW: "staging"
61+
command: "./.buildkite/scripts/package.sh"
62+
artifact_paths: "build/distributions/*"
63+
agents:
64+
provider: gcp
65+
image: "${GCP_IMAGE_UBUNTU_X86_64}"
66+
machineType: "${GCP_DEFAULT_MACHINE_TYPE}"
67+
68+
- label: ":package: Package Cloudbeat linux/arm64 - Staging"
69+
env:
70+
PLATFORMS: "${PLATFORMS_ARM64}"
71+
WORKFLOW: "staging"
72+
command: "./.buildkite/scripts/package.sh"
73+
artifact_paths: "build/distributions/*"
74+
agents:
75+
provider: "aws"
76+
imagePrefix: "${AWS_IMAGE_UBUNTU_ARM_64}"
77+
instanceType: "${AWS_ARM_INSTANCE_TYPE}"
3078

3179
- label: ":rocket: Publishing Staging DRA artifacts"
3280
if: build.branch =~ /^[0-9]+\.[0-9]+\$/ || build.env("RUN_RELEASE") == "true"
3381
depends_on: "package-staging"
82+
agents:
83+
provider: gcp
84+
image: "${GCP_IMAGE_UBUNTU_X86_64}"
85+
machineType: "${GCP_DEFAULT_MACHINE_TYPE}"
3486
command: "./.buildkite/scripts/publish.sh"
3587
env:
3688
WORKFLOW: "staging"

.buildkite/scripts/package.sh

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
#!/usr/bin/env bash
22
set -uox pipefail
33

4-
export PLATFORMS="linux/amd64,linux/arm64"
54
export TYPES="tar.gz"
65
source ./bin/activate-hermit
76

@@ -17,9 +16,6 @@ if [ "$WORKFLOW" = "snapshot" ]; then
1716
export SNAPSHOT="true"
1817
fi
1918

20-
# debug command to verify
21-
ls -lah /proc/sys/fs/binfmt_misc/ || true
22-
2319
mage pythonEnv
2420
mage package
2521

@@ -32,3 +28,6 @@ fi
3228
echo "Generating $CSV_FILE.csv"
3329
$PYTHON ./.buildkite/scripts/generate_notice.py --csv "$CSV_FILE.csv"
3430
cp build/dependencies-*.csv build/distributions/.
31+
32+
echo "Produced artifacts:"
33+
ls -lahR build/distributions/

.buildkite/scripts/publish.sh

Lines changed: 22 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,13 @@
11
#!/usr/bin/env bash
22

3+
if [[ "${DRY_RUN}" == "true" ]]; then
4+
echo "~~~ Running in dry-run mode -- will NOT publish artifacts"
5+
DRY_RUN="--dry-run"
6+
else
7+
echo "~~~ Running in publish mode"
8+
DRY_RUN=""
9+
fi
10+
311
# Allow other users write access to create checksum files
412

513
# The "branch" here selects which "$BRANCH.gradle" file of release manager is used
@@ -19,9 +27,12 @@ echo "VERSION_QUALIFIER: ${VERSION_QUALIFIER}"
1927

2028
# Download artifacts from other stages
2129
echo "Downloading artifacts..."
22-
buildkite-agent artifact download "build/distributions/*" "." --step package-"${WORKFLOW}"
30+
buildkite-agent artifact download "build/distributions/*" "."
2331
chmod -R 777 build/distributions
2432

33+
echo "Downloaded artifacts:"
34+
ls -lahR build/distributions/
35+
2536
# Shared secret path containing the dra creds for project teams
2637
DRA_CREDS=$(vault kv get -field=data -format=json kv/ci-shared/release/dra-role)
2738

@@ -42,4 +53,13 @@ docker run --rm \
4253
--workflow "${WORKFLOW}" \
4354
--version "${VERSION}" \
4455
--artifact-set main \
45-
--qualifier "${VERSION_QUALIFIER}"
56+
--qualifier "${VERSION_QUALIFIER}" ${DRY_RUN} | tee rm-output.txt
57+
58+
if [[ "$DRY_RUN" != "--dry-run" ]]; then
59+
# extract the summary URL from a release manager output line like:
60+
SUMMARY_URL=$(grep -E '^Report summary-.* can be found at ' rm-output.txt | grep -oP 'https://\S+' | awk '{print $1}')
61+
# builkite annotation
62+
printf "**${WORKFLOW} summary link:** [${SUMMARY_URL}](${SUMMARY_URL})\n" | buildkite-agent annotate --style=success --append
63+
fi
64+
65+
rm -f rm-output.txt

0 commit comments

Comments
 (0)