Skip to content

Commit e16a3c0

Browse files
committed
.buildkite: ensure consistent distro and host
This change should ensure that all critical steps in the pipeline run on the same Linux distribution (since we want to test multiple distributions) and on the same host (since we mutate state on that host), but continue to allow steps to run in parallel on that host (using multiple Buildkite agents). Signed-off-by: Samuel Karp <[email protected]>
1 parent 5166432 commit e16a3c0

File tree

1 file changed

+28
-0
lines changed

1 file changed

+28
-0
lines changed

.buildkite/pipeline.yml

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,35 +16,54 @@ steps:
1616
command:
1717
- uname -a
1818
- go version
19+
agents:
20+
queue: "${BUILDKITE_AGENT_META_DATA_QUEUE:-default}"
21+
distro: "${BUILDKITE_AGENT_META_DATA_DISTRO}"
22+
hostname: "${BUILDKITE_AGENT_META_DATA_HOSTNAME}"
1923

2024
- label: ':go: go mod download'
2125
command: 'go mod download'
2226
agents:
2327
queue: "${BUILDKITE_AGENT_META_DATA_QUEUE:-default}"
28+
distro: "${BUILDKITE_AGENT_META_DATA_DISTRO}"
29+
hostname: "${BUILDKITE_AGENT_META_DATA_HOSTNAME}"
2430

2531
- label: ':linux: setup taps'
2632
commands:
2733
- 'sudo ip tuntap add fc-test-tap${BUILDKITE_BUILD_NUMBER} mode tap user $(sudo id -u buildkite-agent)'
2834
- 'sudo ip tuntap add fc-root-tap${BUILDKITE_BUILD_NUMBER} mode tap user $(sudo id -u buildkite-agent)'
2935
agents:
3036
queue: "${BUILDKITE_AGENT_META_DATA_QUEUE:-default}"
37+
distro: "${BUILDKITE_AGENT_META_DATA_DISTRO}"
38+
hostname: "${BUILDKITE_AGENT_META_DATA_HOSTNAME}"
3139

3240
# We use a "wait" step here, because Go's module logic freaks out when
3341
# multiple go builds are downloading to the same cache.
3442
- wait
3543

3644
- label: gofmt -s
3745
command: test -z $(gofmt -s -l .)
46+
# This should run in the same queue, but we don't care whether it runs on
47+
# the same host.
48+
agents:
49+
queue: "${BUILDKITE_AGENT_META_DATA_QUEUE:-default}"
3850

3951
- label: 'git log validation'
4052
command: './.buildkite/logcheck.sh'
53+
# This should run in the same queue, but we don't care whether it runs on
54+
# the same host.
55+
agents:
56+
queue: "${BUILDKITE_AGENT_META_DATA_QUEUE:-default}"
4157

4258
- label: 'build'
4359
commands:
4460
- 'make'
4561
- 'make -C cni'
4662
agents:
4763
queue: "${BUILDKITE_AGENT_META_DATA_QUEUE:-default}"
64+
distro: "${BUILDKITE_AGENT_META_DATA_DISTRO}"
65+
hostname: "${BUILDKITE_AGENT_META_DATA_HOSTNAME}"
66+
4867

4968
- label: ':hammer: tests'
5069
commands:
@@ -55,6 +74,9 @@ steps:
5574
- "FC_TEST_TAP=fc-test-tap${BUILDKITE_BUILD_NUMBER} make test EXTRAGOARGS='-v -count=1 -race' DISABLE_ROOT_TESTS=true"
5675
agents:
5776
queue: "${BUILDKITE_AGENT_META_DATA_QUEUE:-default}"
77+
distro: "${BUILDKITE_AGENT_META_DATA_DISTRO}"
78+
hostname: "${BUILDKITE_AGENT_META_DATA_HOSTNAME}"
79+
5880

5981
- label: ':hammer: root tests'
6082
commands:
@@ -66,6 +88,9 @@ steps:
6688
- "sudo FC_TEST_TAP=fc-root-tap${BUILDKITE_BUILD_NUMBER} make test EXTRAGOARGS='-v -count=1 -race' DISABLE_ROOT_TESTS="
6789
agents:
6890
queue: "${BUILDKITE_AGENT_META_DATA_QUEUE:-default}"
91+
distro: "${BUILDKITE_AGENT_META_DATA_DISTRO}"
92+
hostname: "${BUILDKITE_AGENT_META_DATA_HOSTNAME}"
93+
6994

7095
# This allows the cleanup step to always run, regardless of test failure
7196
- wait: ~
@@ -77,4 +102,7 @@ steps:
77102
- 'sudo ip tuntap del fc-root-tap${BUILDKITE_BUILD_NUMBER} mode tap'
78103
agents:
79104
queue: "${BUILDKITE_AGENT_META_DATA_QUEUE:-default}"
105+
distro: "${BUILDKITE_AGENT_META_DATA_DISTRO}"
106+
hostname: "${BUILDKITE_AGENT_META_DATA_HOSTNAME}"
107+
80108

0 commit comments

Comments
 (0)