forked from containers/conmon
-
Notifications
You must be signed in to change notification settings - Fork 0
/
.cirrus.yml
189 lines (158 loc) · 5.94 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
---
# Main collection of env. vars to set for all tasks and scripts.
env:
####
#### Global variables used for all tasks
####
GOPATH: "/var/tmp/go"
CONMON_SLUG: "github.com/containers/conmon"
# Overrides default location (/tmp/cirrus) for repo clone (will become $SRC)
CIRRUS_WORKING_DIR: "${GOPATH}/src/${CONMON_SLUG}"
# Required so $ENVLIB gets loaded and /bin/sh is not used
CIRRUS_SHELL: "/bin/bash"
# Save a little typing (path relative to $CIRRUS_WORKING_DIR)
SCRIPT_BASE: "./contrib/cirrus"
# Spoof self as travis, as cirrus has the same test issues as travis does
TRAVIS: "true"
# VM Image built in containers/automation_images
IMAGE_SUFFIX: "c20240513t140131z-f40f39d13"
FEDORA_CACHE_IMAGE_NAME: "fedora-${IMAGE_SUFFIX}"
# Container FQIN's
FEDORA_CONTAINER_FQIN: "quay.io/libpod/fedora_podman:${IMAGE_SUFFIX}"
PRIOR_FEDORA_CONTAINER_FQIN: "quay.io/libpod/prior-fedora_podman:${IMAGE_SUFFIX}"
# Only github users with write-access can define or use encrypted variables
# This credential represents a service account with access to manage both VMs
# and storage.
gcp_credentials: ENCRYPTED[13e51806369f650e6ccc326338deeb3c24052fc0a7be29beef2b96da551aed3200abbb6c6406a936bb4388fb2758405c]
# Default VM to use unless set or modified by task
gce_instance:
image_project: "libpod-218412"
zone: "us-central1-f" # Required by Cirrus for the time being
cpu: 2
memory: "4Gb"
disk: 200 # Required for performance reasons
image_name: "${FEDORA_CACHE_IMAGE_NAME}"
# Default timeout for each task
timeout_in: '120m'
# Verify conmon package can be built and installed on Fedora
fedora_packaging_task:
alias: fedora_packaging
# Runs within Cirrus's "community cluster"
container:
cpu: 1
memory: 4
matrix:
- name: "Packaging for Fedora"
container:
image: "${FEDORA_CONTAINER_FQIN}"
- name: "Packaging for Fedora N-1"
container:
image: "${PRIOR_FEDORA_CONTAINER_FQIN}"
script:
- dnf install -y rpm-build golang libseccomp-devel
- cd $CIRRUS_WORKING_DIR
- make
- make -f .rpmbuild/Makefile
- rpmbuild --rebuild conmon-*.src.rpm
- dnf erase -y conmon
- dnf -y install ~/rpmbuild/RPMS/x86_64/conmon*.x86_64.rpm
- ls -l /usr/bin/conmon
timeout_in: '20m'
# Verify calls to bin/config were saved
config_task:
# Runs within Cirrus's "community cluster"
container:
image: "${FEDORA_CONTAINER_FQIN}"
cpu: 1
memory: 4
script:
- dnf install -y make glib2-devel git gcc golang
- cd $CIRRUS_WORKING_DIR
- make config
- ./hack/tree_status.sh
# Verify code was fmt'ed properly
fmt_task:
# Runs within Cirrus's "community cluster"
container:
image: "${FEDORA_CONTAINER_FQIN}"
cpu: 1
memory: 4
script:
- dnf install -y clang clang-tools-extra golang
- cd $CIRRUS_WORKING_DIR
- make fmt
- ./hack/tree_status.sh
# Build the static binary
static_binary_task:
alias: static_binary
# Community-maintained task, may fail on occasion. If so, uncomment
# the next line and file an issue with details about the failure.
# allow_failures: true
timeout_in: '360m'
gce_instance:
image_name: "${FEDORA_CACHE_IMAGE_NAME}"
cpu: 8
memory: 12
disk: 200
env:
# Do not use 'latest', fixed-version tag for runtime stability.
CTR_FQIN: "docker.io/nixos/nix:2.15.0"
# Authentication token for pushing the build cache to cachix.
# This is critical, it helps to avoid a very lengthy process of
# statically building every dependency needed to build conmon.
# Assuming the pinned nix dependencies in nix/nixpkgs.json have not
# changed, this cache will ensure that only the static conmon binary is
# built.
CACHIX_AUTH_TOKEN: ENCRYPTED[4c3b8d82b0333abf048c56a71f2559ddb1c9ed38f0c28916eca13f79affa5904cf90c76a5bd8686680c89f41079ef341]
matrix:
- name: "Static amd64 binary"
env:
TARGET: default.nix
- name: "Static arm64 binary"
env:
TARGET: default-arm64.nix
- name: "Static ppc64le binary"
env:
TARGET: default-ppc64le.nix
- name: "Static riscv64 binary"
env:
TARGET: default-riscv64.nix
- name: "Static s390x binary"
env:
TARGET: default-s390x.nix
build_script: |
set -ex
podman run -i --rm \
-e CACHIX_AUTH_TOKEN \
-v $PWD:$PWD:Z \
-w $PWD \
$CTR_FQIN \
sh -c \
"nix-env -iA cachix -f https://cachix.org/api/v1/install && \
cachix use conmon && \
nix-build nix/$TARGET && \
nix-store -qR --include-outputs \$(nix-instantiate nix/$TARGET) | grep -v conmon | cachix push conmon && \
cp -R result/bin ."
binaries_artifacts:
path: "bin/conmon"
# 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:
name: "VM img. keepalive"
alias: meta
container:
cpu: 2
memory: 2
image: quay.io/libpod/imgts:latest
env:
# Space-separated list of images used by this repository state
IMGNAMES: >-
${FEDORA_CACHE_IMAGE_NAME}
BUILDID: "${CIRRUS_BUILD_ID}"
REPOREF: "${CIRRUS_REPO_NAME}"
GCPJSON: ENCRYPTED[08de2c74178470b1bc85a107e9962f06dbd11d33c7adf024d3e48ae4399ca5383f9d3ad0e2fd65c3ce12750dd6ef8803]
GCPNAME: ENCRYPTED[561ce33a9357e5b8e3fb54739c3af31730c0c3b736792f16a67026a8544379d83ff3c27d6fea1c7797a6ae49b6e58115]
GCPPROJECT: libpod-218412
clone_script: &noop mkdir -p $CIRRUS_WORKING_DIR
script: /usr/local/bin/entrypoint.sh