12
12
# permissions and limitations under the License.
13
13
env :
14
14
PATH : " /usr/lib/go-1.13/bin:/usr/bin"
15
+ FC_TEST_DATA_PATH : " /tmp/buildkite_build_${BUILDKITE_BUILD_NUMBER}_testdata"
15
16
16
17
steps :
17
- - label : ' :ec2: environment'
18
+ - label : ' :ec2: prepare environment'
18
19
command :
19
20
- uname -a
20
21
- go version
22
+ - " mkdir -p ${FC_TEST_DATA_PATH}"
21
23
agents :
22
24
queue : " ${BUILDKITE_AGENT_META_DATA_QUEUE:-default}"
23
25
distro : " ${BUILDKITE_AGENT_META_DATA_DISTRO}"
@@ -40,18 +42,17 @@ steps:
40
42
distro : " ${BUILDKITE_AGENT_META_DATA_DISTRO}"
41
43
hostname : " ${BUILDKITE_AGENT_META_DATA_HOSTNAME}"
42
44
45
+ # Since make test-images mutates the source directory, it cannot be run with other steps.
46
+ - wait
47
+
43
48
- label : ' :linux: build docker images'
44
49
commands :
45
- - ' make test-images'
46
- - ' buildkite-agent artifact upload testdata/firecracker-master'
47
- - ' buildkite-agent artifact upload testdata/jailer-master'
50
+ - make test-images
48
51
agents :
49
52
queue : " ${BUILDKITE_AGENT_META_DATA_QUEUE:-default}"
50
53
distro : " ${BUILDKITE_AGENT_META_DATA_DISTRO}"
51
54
hostname : " ${BUILDKITE_AGENT_META_DATA_HOSTNAME}"
52
55
53
- # We use a "wait" step here, because Go's module logic freaks out when
54
- # multiple go builds are downloading to the same cache.
55
56
- wait
56
57
57
58
- label : gofmt -s
@@ -68,19 +69,29 @@ steps:
68
69
agents :
69
70
queue : " ${BUILDKITE_AGENT_META_DATA_QUEUE:-default}"
70
71
72
+ - wait
73
+
71
74
- label : ' :package: install'
75
+ env :
76
+ GOBIN : " $FC_TEST_DATA_PATH/bin"
72
77
commands :
78
+ # To use ${FC_TEST_DATA_PATH} as testdata/, all files in the original directory must be
79
+ # copied to the new directory.
80
+ - cp -r testdata/* ${FC_TEST_DATA_PATH}
73
81
# Install tc-redirect-tap.
74
- - ' mkdir -p testdata/bin'
75
- - ' GOBIN=$(pwd)/testdata/bin go get github.com/awslabs/tc-redirect-tap/cmd/tc-redirect-tap'
82
+ - ' go get github.com/awslabs/tc-redirect-tap/cmd/tc-redirect-tap'
76
83
# Copy vmlinux and root-drive.img.
77
- - ' ln -s /var/lib/fc-ci/vmlinux.bin testdata/vmlinux'
78
- - ' ln -s /var/lib/fc-ci/rootfs.ext4 testdata/root-drive.img'
84
+ - ln -s /var/lib/fc-ci/vmlinux.bin ${FC_TEST_DATA_PATH}/vmlinux
85
+ - ln -s /var/lib/fc-ci/rootfs.ext4 ${FC_TEST_DATA_PATH}/root-drive.img
86
+ # Download Firecracker and its jailer.
87
+ - make deps
79
88
agents :
80
89
queue : " ${BUILDKITE_AGENT_META_DATA_QUEUE:-default}"
81
90
distro : " ${BUILDKITE_AGENT_META_DATA_DISTRO}"
82
91
hostname : " ${BUILDKITE_AGENT_META_DATA_HOSTNAME}"
83
92
93
+ - wait
94
+
84
95
- label : ' build'
85
96
commands :
86
97
- ' make'
@@ -89,11 +100,8 @@ steps:
89
100
distro : " ${BUILDKITE_AGENT_META_DATA_DISTRO}"
90
101
hostname : " ${BUILDKITE_AGENT_META_DATA_HOSTNAME}"
91
102
92
-
93
103
- label : ' :hammer: tests'
94
104
commands :
95
- - ' ln -s /var/lib/fc-ci/vmlinux.bin testdata/vmlinux'
96
- - ' ln -s /var/lib/fc-ci/rootfs.ext4 testdata/root-drive.img'
97
105
- " FC_TEST_TAP=fc-test-tap${BUILDKITE_BUILD_NUMBER} make test EXTRAGOARGS='-v -count=1 -race' DISABLE_ROOT_TESTS=true"
98
106
agents :
99
107
queue : " ${BUILDKITE_AGENT_META_DATA_QUEUE:-default}"
@@ -102,31 +110,18 @@ steps:
102
110
103
111
- label : ' :hammer: root tests'
104
112
commands :
105
- - ' ln -s /var/lib/fc-ci/vmlinux.bin testdata/vmlinux'
106
- - ' ln -s /var/lib/fc-ci/rootfs.ext4 testdata/root-drive.img'
107
- - ' mkdir -p $(pwd)/testdata/bin'
108
- - ' GOBIN=$(pwd)/testdata/bin go get github.com/awslabs/tc-redirect-tap/cmd/tc-redirect-tap'
109
- - " sudo PATH=$PATH FC_TEST_TAP=fc-root-tap${BUILDKITE_BUILD_NUMBER} make test EXTRAGOARGS='-v -count=1 -race' DISABLE_ROOT_TESTS="
113
+ - " sudo PATH=$PATH FC_TEST_TAP=fc-root-tap${BUILDKITE_BUILD_NUMBER} FC_TEST_DATA_PATH=${FC_TEST_DATA_PATH} make test EXTRAGOARGS='-v -count=1 -race' DISABLE_ROOT_TESTS="
110
114
agents :
111
115
queue : " ${BUILDKITE_AGENT_META_DATA_QUEUE:-default}"
112
116
distro : " ${BUILDKITE_AGENT_META_DATA_DISTRO}"
113
117
hostname : " ${BUILDKITE_AGENT_META_DATA_HOSTNAME}"
114
118
115
119
- label : ' :hammer: test against firecracker master'
116
120
env :
117
- FC_TEST_BIN : " testdata/firecracker-master"
121
+ FC_TEST_BIN : " ${FC_TEST_DATA_PATH}/firecracker-master"
122
+ FC_TEST_JAILER_BIN : " ${FC_TEST_DATA_PATH}/jailer-master"
118
123
DOCKER_IMAGE_TAG : " $BUILDKITE_BUILD_NUMBER"
119
- FC_TEST_JAILER_BIN : " testdata/jailer-master"
120
124
commands :
121
- - ' ln -s /var/lib/fc-ci/vmlinux.bin testdata/vmlinux'
122
- - ' ln -s /var/lib/fc-ci/rootfs.ext4 testdata/root-drive.img'
123
- - ' buildkite-agent artifact download testdata/firecracker-master .'
124
- - ' chmod +x testdata/firecracker-master'
125
- - ' buildkite-agent artifact download testdata/jailer-master .'
126
- - ' chmod +x testdata/jailer-master'
127
- # Install tc-redirect-tap.
128
- - ' mkdir -p testdata/bin'
129
- - ' GOBIN=$(pwd)/testdata/bin go get github.com/awslabs/tc-redirect-tap/cmd/tc-redirect-tap'
130
125
- " sudo -E PATH=$PATH FC_TEST_TAP=fc-mst-tap${BUILDKITE_BUILD_NUMBER} make test EXTRAGOARGS='-v -count=1 -race' DISABLE_ROOT_TESTS="
131
126
agents :
132
127
queue : " ${BUILDKITE_AGENT_META_DATA_QUEUE:-default}"
@@ -148,11 +143,12 @@ steps:
148
143
- wait : ~
149
144
continue_on_failure : true
150
145
151
- - label : ' :linux: cleanup taps '
146
+ - label : ' :linux: cleanup'
152
147
commands :
153
148
- ' sudo ip tuntap del fc-test-tap${BUILDKITE_BUILD_NUMBER} mode tap'
154
149
- ' sudo ip tuntap del fc-root-tap${BUILDKITE_BUILD_NUMBER} mode tap'
155
150
- ' sudo ip tuntap del fc-mst-tap${BUILDKITE_BUILD_NUMBER} mode tap'
151
+ - ' sudo rm -fr ${FC_TEST_DATA_PATH}'
156
152
agents :
157
153
queue : " ${BUILDKITE_AGENT_META_DATA_QUEUE:-default}"
158
154
distro : " ${BUILDKITE_AGENT_META_DATA_DISTRO}"
0 commit comments