summaryrefslogtreecommitdiffhomepage
path: root/.buildkite/hooks/pre-command
diff options
context:
space:
mode:
authorAdin Scannell <ascannell@google.com>2020-12-11 11:50:08 -0800
committergVisor bot <gvisor-bot@google.com>2020-12-11 11:52:43 -0800
commit76c2f21cecf6c690aaf3aba8eccbc593eb3a6305 (patch)
treecc90159eeeb7cbe3e96c3188702a3566b9616c61 /.buildkite/hooks/pre-command
parent3c673caf86c83070786a6baec0e92e109bfcbb54 (diff)
Add local hooks for BuildKite.
PiperOrigin-RevId: 347044353
Diffstat (limited to '.buildkite/hooks/pre-command')
-rw-r--r--.buildkite/hooks/pre-command10
1 files changed, 10 insertions, 0 deletions
diff --git a/.buildkite/hooks/pre-command b/.buildkite/hooks/pre-command
new file mode 100644
index 000000000..1994287e8
--- /dev/null
+++ b/.buildkite/hooks/pre-command
@@ -0,0 +1,10 @@
+# Setup for parallelization with PARTITION and TOTAL_PARTITIONS.
+export PARTITION=${BUILDKITE_PARALLEL_JOB:-0}
+PARTITION=$((${PARTITION}+1)) # 1-indexed, but PARALLEL_JOB is 0-indexed.
+export TOTAL_PARTITIONS=${BUILDKITE_PARALLEL_JOB_COUNT:-1}
+
+# Ensure Docker has experimental enabled.
+if ! grep experimental /etc/docker/daemon.json >/dev/null; then
+ make sudo TARGETS=//runsc:runsc ARGS="install --experimental=true"
+ sudo systemctl reload docker
+fi