forked from containers/conmon
-
Notifications
You must be signed in to change notification settings - Fork 0
/
.cirrus.yml
165 lines (134 loc) · 5.91 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
---
# Main collection of env. vars to set for all tasks and scripts.
env:
####
#### Global variables used for all tasks
####
# File to update in home-dir with task-specific env. var values
ENVLIB: ".bash_profile"
# Overrides default location (/tmp/cirrus) for repo clone (will become $SRC)
CIRRUS_WORKING_DIR: "/tmp/conmon"
# 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"
PACKER_BASE: "./contrib/cirrus/packer"
CRIO_REPO: "https://github.com/cri-o/cri-o.git"
CRIO_SLUG: "github.com/cri-o/cri-o"
# Spoof self as travis, as cirrus has the same test issues as travis does
TRAVIS: "true"
####
#### Cache-image names to test with
###
FEDORA_CACHE_IMAGE_NAME: 'fedora-29-conmon-75ea13be'
####
#### Variables for composing new cache-images (used in PR testing) from
#### base-images (pre-existing in GCE)
####
# CSV of cache-image names to build (see $PACKER_BASE/libpod_images.json)
PACKER_BUILDS: "fedora-29"
# Version of packer to use
PACKER_VER: "1.3.5"
# Manually produced base-image names (see $SCRIPT_BASE/README.md)
FEDORA_BASE_IMAGE: "fedora-cloud-base-29-1-2-1547237869"
# Special image w/ nested-libvirt + tools for creating new cache and base images
IMAGE_BUILDER_CACHE_IMAGE_NAME: "image-builder-image-1547237869"
####
#### Credentials and other secret-sauces, decrypted at runtime when authorized.
####
# Needed to build GCE images, within a GCE VM
SERVICE_ACCOUNT: ENCRYPTED[0aad0b5961402c8b8e4abd48fc4d4ac762f608f32e9169381b911d19699990df1a1441897ffa94def46ff73a19ba7577]
# User ID for cirrus to ssh into VMs
GCE_SSH_USERNAME: ENCRYPTED[be60deec03db4cc5ef121397e465c6cd4f043f3c31787b2a46661e09909f2675e339e051dd89d13775d9473504432ad0]
# Name where this repositories cloud resources are located
GCP_PROJECT_ID: ENCRYPTED[bcc747708a4e2e2e493e4c479efd9cb7b38caf39c7120d849dd859250303b64cbb4d016779e128b6e2e5c5f732d54726]
# 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 compute settings unless overriden within tasks (below)
gce_instance: {"image_project": "conmon-222014", "zone": "us-central1-f", "cpu": 4, "memory": "16Gb", "disk": 200, "image_name": "no-image-specified-in-task"}
# Default timeout for each task
timeout_in: '120m'
# Every *_task runs in parallel in separate VMs. The name prefix only for reference
# in WebUI, and will be followed by matrix details. This task runs the integration
# testing for every platform
integration_task:
gce_instance:
# Generate multiple parallel tasks, covering all possible
# 'matrix' combinations.
matrix:
# Images are generated separetly, from build_images_task (below)
image_name: "${FEDORA_CACHE_IMAGE_NAME}"
env:
matrix:
TEST_USERNS: 0
TEST_USERNS: 1
setup_environment_script: '$SCRIPT_BASE/setup_environment.sh'
integration_test_script: '$SCRIPT_BASE/integration_test.sh'
# Verify conmon package can be built and installed on Fedora
fedora_packaging_task:
# Runs within Cirrus's "community cluster"
container:
matrix:
image: "registry.fedoraproject.org/fedora:28"
image: "registry.fedoraproject.org/fedora:29"
cpu: 4
memory: 12
script:
- dnf install -y make glib2-devel git gcc rpm-build
- cd $CIRRUS_WORKING_DIR
- make
- make -f .rpmbuild/Makefile
- rpmbuild --rebuild conmon-*.src.rpm
- dnf -y install ~/rpmbuild/RPMS/x86_64/conmon*.x86_64.rpm
- ls -l /usr/libexec/crio/conmon
timeout_in: '20m'
# Test building of new cache-images for future PR testing, in this PR.
# Output images will be stored only for a very short time, then automaticly deleted.
test_cache_images_task:
only_if: >-
$CIRRUS_BRANCH != 'master' &&
$CIRRUS_CHANGE_MESSAGE =~ '.*\*\*\*\s*CIRRUS:\s*TEST\s*IMAGES\s*\*\*\*.*'
# VMs created by packer are not cleaned up by cirrus, must allow task to complete
auto_cancellation: $CI != "true"
gce_instance:
image_name: "${IMAGE_BUILDER_CACHE_IMAGE_NAME}"
cpu: 4
memory: "4Gb"
disk: 200
# Additional permissions for building GCE images, within a GCE VM
scopes:
- 'compute'
- 'devstorage.full_control'
env:
IMAGE_BUILD: 1
setup_environment_script: '$SCRIPT_BASE/setup_environment.sh'
cache_images_script: '$SCRIPT_BASE/build_vm_images.sh'
# Build new cache-images for future PR testing, but only after a PR merge.
# The cache-images save install/setup time needed test every PR. The 'active'
# images are selected manually by updating the 'image_name' values above.
cache_images_task:
# Only produce new cache-images after a PR merge, and if a magic string
# is present in the most recent commit-message.
only_if: >-
$CIRRUS_BRANCH == 'master' &&
$CIRRUS_CHANGE_MESSAGE =~ '.*\*\*\*\s*CIRRUS:\s*REBUILD\s*IMAGES\s*\*\*\*.*'
# Require tests to pass first.
depends_on:
- "integration"
# VMs created by packer are not cleaned up by cirrus
auto_cancellation: $CI != "true"
gce_instance:
image_name: "${IMAGE_BUILDER_CACHE_IMAGE_NAME}"
cpu: 4
memory: "4Gb"
disk: 200
# Additional permissions for building GCE images, within a GCE VM
scopes:
- 'compute'
- 'devstorage.full_control'
env:
IMAGE_BUILD: 1
setup_environment_script: '$SCRIPT_BASE/setup_environment.sh'
cache_images_script: '$SCRIPT_BASE/build_vm_images.sh'