Skip to content

Commit 765be8e

Browse files
authored
Merge pull request #10 from planetscale/joem/ephemeral-container-name
ephemeral container name
2 parents a8e3149 + 1b49b12 commit 765be8e

File tree

4 files changed

+5
-2
lines changed

4 files changed

+5
-2
lines changed

.buildkite/pipeline.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ steps:
99

1010
- name: lint-plugin
1111
plugins:
12+
- planetscale/telemetry#${BUILDKITE_COMMIT}: {}
1213
- docker-compose#v5.3.0:
1314
run: lint-plugin
1415

hooks/environment

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,8 @@
22

33
BUILDKITE_TELEMETRY_PLUGIN_TMPDIR=$(mktemp -d)
44
BUILDKITE_TELEMETRY_PLUGIN_OUTFILE="${BUILDKITE_TELEMETRY_PLUGIN_TMPDIR}/out.txt"
5+
BUILDKITE_TELEMETRY_PLUGIN_CONTAINER_NAME="telemetry-plugin-$RANDOM"
56

67
export BUILDKITE_TELEMETRY_PLUGIN_TMPDIR
78
export BUILDKITE_TELEMETRY_PLUGIN_OUTFILE
9+
export BUILDKITE_TELEMETRY_PLUGIN_CONTAINER_NAME

hooks/post-command

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
set -eou pipefail
44
#set -x
55

6-
docker stop -t1 telemetry-plugin
6+
docker stop -t1 "$BUILDKITE_TELEMETRY_PLUGIN_CONTAINER_NAME" || true
77

88
vcpus=$(lscpu | awk -F ":" '/Thread/ { t=$2; }; /Core/ { c=$2; }; /Socket/ { s=$2; }; END { print s*c*t }')
99
phys_cpus=$(lscpu | awk -F ":" '/Core/ { c=$2; }; /Socket/ { s=$2; }; END { print s*c }')

hooks/pre-command

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ docker run \
99
--rm \
1010
--init \
1111
--detach \
12-
--name telemetry-plugin \
12+
--name "$BUILDKITE_TELEMETRY_PLUGIN_CONTAINER_NAME" \
1313
--pid host \
1414
--net host \
1515
--userns host \

0 commit comments

Comments
 (0)