Skip to content

Commit 6d111e8

Browse files
authored
ci(bk): use specialised VMs (#3555)
1 parent 72a74e5 commit 6d111e8

File tree

4 files changed

+26
-10
lines changed

4 files changed

+26
-10
lines changed

.buildkite/README.md

Lines changed: 14 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ This is the Buildkite pipeline for releasing the APM Agent Java.
99
### Pipeline Configuration
1010

1111
To view the pipeline and its configuration, click [here](https://buildkite.com/elastic/apm-agent-java-release) or
12-
go to the definition in the `elastic/ci` repository.
12+
go to the definition in `release.yml`.
1313

1414
### Credentials
1515

@@ -25,7 +25,7 @@ This is the Buildkite pipeline for the APM Agent Java in charge of the snapshots
2525
### Pipeline Configuration
2626

2727
To view the pipeline and its configuration, click [here](https://buildkite.com/elastic/apm-agent-java-snapshot) or
28-
go to the definition in the `elastic/ci` repository.
28+
go to the definition in `snapshot.yml`.
2929

3030
## opentelemetry-benchmark pipeline
3131

@@ -35,3 +35,15 @@ This is the Buildkite pipeline for the Opentelemetry Benchmark.
3535

3636
To view the pipeline and its configuration, click [here](https://buildkite.com/elastic/apm-agent-java-opentelemetry-benchmark) or
3737
go to the definition in `opentelemetry-benchmark.yml`.
38+
39+
## Buildkite VM runners
40+
41+
A set of Buildkite VM runners has been created for this repository. The VM runners contain
42+
the required software:
43+
* JDK
44+
* GPG
45+
* Maven dependencies
46+
47+
If a new version of Java is required, update the `.java-version` file with the latest major. When the changes are merged onto `main,` wait for the following day; that's when the automation will be responsible for recreating the VM with the new Java version.
48+
49+
If you would like to know more about how it works, please go to https://github.com/elastic/ci-agent-images/tree/main/vm-images/apm-agent-java (**NOTE**: only available for Elastic employees)

.buildkite/hooks/prepare-common.sh

Lines changed: 10 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -5,19 +5,23 @@ set -euo pipefail
55
JAVA_VERSION=$(cat .java-version | xargs | tr -dc '[:print:]')
66
JAVA_HOME="${HOME}/.java/openjdk${JAVA_VERSION}"
77
export JAVA_HOME
8-
PATH="${JAVA_HOME}/bin:$PATH"
8+
PATH="${JAVA_HOME}/bin:${PATH}"
99
export PATH
1010

11-
# Fallback to install at runtime
12-
if [ ! -d "${JAVA_HOME}" ] ; then
11+
if [ -d "${JAVA_HOME}" ] ; then
12+
echo "--- Skip installing JDK${JAVA_VERSION} :java:"
13+
echo "already available in the Buildkite runner"
14+
else
15+
# Fallback to install at runtime
1316
# This should not be the case normally untless the .java-version file has been changed
1417
# and the VM Image is not yet available with the latest version.
1518
echo "--- Install JDK${JAVA_VERSION} :java:"
1619
JAVA_URL=https://jvm-catalog.elastic.co/jdk
1720
JAVA_PKG="${JAVA_URL}/latest_openjdk_${JAVA_VERSION}_linux.tar.gz"
18-
curl -L --output /tmp/jdk.tar.gz "$JAVA_PKG"
19-
mkdir -p "$JAVA_HOME"
20-
tar --extract --file /tmp/jdk.tar.gz --directory "$JAVA_HOME" --strip-components 1
21+
curl -L --output /tmp/jdk.tar.gz "${JAVA_PKG}"
22+
mkdir -p "${JAVA_HOME}"
23+
tar --extract --file /tmp/jdk.tar.gz --directory "${JAVA_HOME}" --strip-components 1
2124
fi
2225

26+
# Validate java is available in the runner.
2327
java -version

.buildkite/release.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
agents:
22
provider: "gcp"
3-
#image: "family/apm-agent-java-ubuntu-2204"
3+
image: "family/apm-agent-java-ubuntu-2204"
44

55
steps:
66
- label: "Run the release"

.buildkite/snapshot.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
agents:
22
provider: "gcp"
3-
#image: "family/apm-agent-java-ubuntu-2204"
3+
image: "family/apm-agent-java-ubuntu-2204"
44

55
steps:
66
- label: "Run the snapshot"

0 commit comments

Comments
 (0)