forked from containers/netavark-dhcp-proxy-deprecated
-
Notifications
You must be signed in to change notification settings - Fork 0
/
.cirrus.yml
267 lines (239 loc) · 8.15 KB
/
.cirrus.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
---
# Format Ref: https://cirrus-ci.org/guide/writing-tasks/
# Main collection of env. vars to set for all tasks and scripts.
env:
# Actual|intended branch for this run
DEST_BRANCH: "main"
# The default is 'sh' if unspecified
CIRRUS_SHELL: "/bin/bash"
# Location where source repo. will be cloned
CIRRUS_WORKING_DIR: "/var/tmp/netavark-dhcp-proxy"
# Rust package cache also lives here
CARGO_HOME: "/var/cache/cargo"
# Rust compiler output lives here (see Makefile)
CARGO_TARGET_DIR: "$CIRRUS_WORKING_DIR/targets"
# Testing depends on the latest netavark binary from upstream CI
NETAVARK_BRANCH: "main"
NETAVARK_URL: "https://api.cirrus-ci.com/v1/artifact/github/containers/netavark-dhcp-proxy/success/binary.zip?branch=${NETAVARK_BRANCH}"
# Save a little typing (path relative to $CIRRUS_WORKING_DIR)
SCRIPT_BASE: "./contrib/cirrus"
IMAGE_SUFFIX: "c6300530360713216"
FEDORA_NETAVARK_IMAGE: "fedora-netavark-${IMAGE_SUFFIX}"
gcp_credentials: ENCRYPTED[c28756318ed3356962096afdb5f69268d8ecd07a974f2c31004a83144124ae9653d66beb8e896e4034c6dac43775958a]
build_task:
alias: "build"
# Compiling is very CPU intensive, make it chooch quicker for this task only
gce_instance: &standard_build_gce_x86_64
image_project: "libpod-218412"
zone: "us-central1-c"
disk: 200 # GB, do not set <200 per gcloud warning re: I/O performance
cpu: 8
memory: "8Gb"
image_name: "${FEDORA_NETAVARK_IMAGE}"
cargo_cache: &cargo_cache
folder: "$CARGO_HOME"
fingerprint_key: "cargo_v1_${DEST_BRANCH}" # Cache for branch + PRs
reupload_on_changes: true
targets_cache: &targets_cache
folder: "$CARGO_TARGET_DIR"
fingerprint_key: "targets_v1_${CIRRUS_BUILD_ID}" # Cache only within same build
reupload_on_changes: true
bin_cache: &bin_cache
# This simply prevents rebuilding bin/aardvark-dns* or every subsequent task.
folder: "$CIRRUS_WORKING_DIR/bin"
fingerprint_key: "bin_v1_${CIRRUS_BUILD_ID}" # Cache only within same build
reupload_on_changes: true
setup_script: &setup "$SCRIPT_BASE/setup.sh $CIRRUS_TASK_NAME"
main_script: &main "$SCRIPT_BASE/runner.sh $CIRRUS_TASK_NAME"
upload_caches: [ "cargo", "targets", "bin" ]
#build_aarch64_task:
# alias: "build_aarch64"
# # Compiling is very CPU intensive, make it chooch quicker for this task only
# ec2_instance: &standard_build_ec2_aarch64
# image: ami-0f89dfa699fe590b0
# type: t4g.xlarge
# region: us-east-1
# architecture: arm64 # CAUTION: This has to be "arm64", not aarch64.
# cargo_cache: &cargo_cache_aarch64
# <<: *cargo_cache
# fingerprint_key: "cargo_v1_${DEST_BRANCH}_aarch64"
# targets_cache: &targets_cache_aarch64
# <<: *targets_cache
# fingerprint_key: "cargo_v1_${DEST_BRANCH}_aarch64"
# bin_cache: &bin_cache_aarch64
# <<: *bin_cache
# fingerprint_key: "cargo_v1_${DEST_BRANCH}_aarch64"
# setup_script: *setup
# main_script: *main
# upload_caches: [ "cargo", "targets", "bin" ]
validate_task:
alias: "validate"
depends_on:
- "build"
gce_instance: &standard_gce_x86_64
<<: *standard_build_gce_x86_64
cpu: 2
memory: "4Gb"
# From this point forward, all cache's become read-only for this run.
cargo_cache: &ro_cargo_cache
<<: *cargo_cache
reupload_on_changes: false
targets_cache: &ro_targets_cache
<<: *targets_cache
reupload_on_changes: false
bin_cache: &ro_bin_cache
<<: *bin_cache
reupload_on_changes: false
setup_script: *setup
main_script: *main
#validate_aarch64_task:
# alias: "validate_aarch64"
# depends_on:
# - "build_aarch64"
# ec2_instance: *standard_build_ec2_aarch64
# # From this point forward, all cache's become read-only for this run.
# cargo_cache: &ro_cargo_cache_aarch64
# <<: *cargo_cache_aarch64
# reupload_on_changes: false
# targets_cache: &ro_targets_cache_aarch64
# <<: *targets_cache_aarch64
# reupload_on_changes: false
# bin_cache: &ro_bin_cache_aarch64
# <<: *bin_cache_aarch64
# reupload_on_changes: false
# setup_script: *setup
# main_script: *main
verify_vendor_task:
alias: "verify_vendor"
depends_on:
- "build"
gce_instance: *standard_gce_x86_64
udo argo_cache: *ro_cargo_cache
targets_cache: *ro_targets_cache
bin_cache: *ro_bin_cache
setup_script: *setup
main_script: *main
#verify_vendor_aarch64_task:
# alias: "verify_vendor_aarch64"
# depends_on:
# - "build_aarch64"
# ec2_instance: *standard_build_ec2_aarch64
# cargo_cache: *ro_cargo_cache_aarch64
# targets_cache: *ro_targets_cache_aarch64
# bin_cache: *ro_bin_cache_aarch64
# setup_script: *setup
# main_script: *main
unit_task:
alias: "unit"
depends_on:
- "build" # Run in parallel with validate to save some time
gce_instance: *standard_gce_x86_64
cargo_cache: *ro_cargo_cache
targets_cache: *ro_targets_cache
bin_cache: *ro_bin_cache
setup_script: *setup
main_script: *main
#unit_aarch64_task:
# alias: "unit_aarch64"
# depends_on:
# - "build_aarch64" # Run in parallel with validate to save some time
# ec2_instance: *standard_build_ec2_aarch64
# cargo_cache: *ro_cargo_cache_aarch64
# targets_cache: *ro_targets_cache_aarch64
# bin_cache: *ro_bin_cache_aarch64
# setup_script: *setup
# main_script: *main
integration_task:
alias: "integration"
depends_on:
- "unit"
gce_instance: *standard_gce_x86_64
cargo_cache: *ro_cargo_cache
targets_cache: *ro_targets_cache
bin_cache: *ro_bin_cache
setup_script: *setup
main_script: *main
#
#integration_aarch64_task:
# alias: "integration_aarch64"
# depends_on:
# - "unit_aarch64"
# ec2_instance: *standard_build_ec2_aarch64
# cargo_cache: *ro_cargo_cache_aarch64
# targets_cache: *ro_targets_cache_aarch64
# bin_cache: *ro_bin_cache_aarch64
# setup_script: *setup
# main_script: *main
# This task is critical. It updates the "last-used by" timestamp stored
# in metadata for all VM images. This mechanism functions in tandem with
# an out-of-band pruning operation to remove disused VM images.
meta_task:
alias: meta
name: "VM img. keepalive"
container:
cpu: 2
memory: 2
image: quay.io/libpod/imgts:$IMAGE_SUFFIX
env:
# Space-separated list of images used by this repository state
IMGNAMES: "${FEDORA_NETAVARK_IMAGE}"
BUILDID: "${CIRRUS_BUILD_ID}"
REPOREF: "${CIRRUS_REPO_NAME}"
GCPJSON: ENCRYPTED[c89506273e54e772a7899b9611e38ec72460855c4d1ad590cf0322b5d15bcb851859dfa0e39f962f991d5ddbdcf39ae0]
GCPNAME: ENCRYPTED[986d32112058ebe9c3052b55830413549d99c543e4ed056602ae3543fe5e8a4641ff24069915489b9bb422919648c739]
GCPPROJECT: libpod-218412
clone_script: &noop mkdir -p $CIRRUS_WORKING_DIR # source not needed
script: /usr/local/bin/entrypoint.sh
#
# disabled due to old rust version availability
#
#ubuntu20_build_task:
# alias: ubuntu20_build
# depends_on:
# - "build"
# gce_instance: *standard_gce_x86_64
# container:
# cpu: 2
# memory: 2
# image: quay.io/libpod/ubuntu20rust
# script:
# - cargo build
centos9_build_task:
alias: centos9_build
depends_on:
- "build"
gce_instance: *standard_gce_x86_64
container:
cpu: 2
memory: 2
image: quay.io/libpod/centos9rust
script:
- cargo build
success_task:
alias: "success"
gce_instance: *standard_gce_x86_64
name: "Total success"
depends_on:
- "build"
#- "build_aarch64"
- "validate"
#- "validate_aarch64"
- "verify_vendor"
#- "verify_vendor_aarch64"
- "unit"
#- "unit_aarch64"
- "integration"
#- "integration_aarch64"
- "meta"
# - "ubuntu20_build"
- "centos9_build"
bin_cache: *ro_bin_cache
clone_script: *noop
# The paths used for uploaded artifacts are relative here and in Cirrus
artifacts_prep_script:
- mv bin/* ./
- rm -rf bin
# Upload tested binary for consumption downstream
# https://cirrus-ci.org/guide/writing-tasks/#artifacts-instruction
binary_artifacts:
path: ./aardvark-dns*