This repository has been archived by the owner on Jun 28, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 196
/
ci_job_flags.sh
executable file
·235 lines (229 loc) · 6.15 KB
/
ci_job_flags.sh
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
#!/bin/bash
#
# Copyright (c) 2018-2020 Intel Corporation
# Copyright (c) 2021 Red Hat, Inc.
#
# SPDX-License-Identifier: Apache-2.0
#
# This script should be sourced so that the environment gets exported variables
# used to control the setup and execution of tests.
#
# Export the CI_JOB environment variable if you need job-specific variables
# set apart from the defaults.
#
CI_JOB=${CI_JOB:-}
# List of all setup flags used by scripts
init_ci_flags() {
# Make jobs work like in CI
# CI disables non-working tests
export CI="true"
# Many checks assume this environment variable to be not set
# (e.g. [ -n $KATA_DEV_MODE ]). As a result, even its value is
# set to 'false', the check would think we are in "kata_dev_mode".
# export KATA_DEV_MODE="false"
# Install crio
export CRIO="no"
# Install cri-containerd
export CRI_CONTAINERD="no"
# Default cri runtime - used to setup k8s
export CRI_RUNTIME=""
# Ask runtime to only use cgroup at pod level
# Useful for pod overhead
export DEFSANDBOXCGROUPONLY="false"
# Build Kata for Confidential Containers
# Values: "yes|no"
export KATA_BUILD_CC="no"
# Hypervisor to use
export KATA_HYPERVISOR=""
# Install k8s
export KUBERNETES="no"
# Run a subset of k8s e2e test
# Will run quick to ensure e2e setup is OK
# - Use false for PRs
# - Use true for nightly testing
export MINIMAL_K8S_E2E="false"
# Test cgroup v2
export TEST_CGROUPSV2="false"
# Run crio functional test
export TEST_CRIO="false"
# Use experimental qemu
# Values: true|false
export experimental_qemu="false"
# Run the kata-check checks
export RUN_KATA_CHECK="true"
# Use devmapper snapshotter
# Only works with containerd
export USE_DEVMAPPER="false"
# METRICS_CI flags
# Request to run METRICS_CI
# Values: "true|false"
export METRICS_CI="false"
# Metrics check values depend in the env it run
# Define a profile to check on PRs
# Values: empty|string : String will be used to find a profile with defined values to check
export METRICS_CI_PROFILE=""
# Check values for a profile defined as CLOUD
# Deprecated use METRICS_CI_PROFILE will be replaced by METRICS_CI_PROFILE=cloud-metrics
export METRICS_CI_CLOUD=""
# Generate a report using a jenkins job data
# Name of the job to get data from
export METRICS_JOB_BASELINE=""
# Configure test to use Kata SHIM V2
export SHIMV2_TEST="true"
export CTR_RUNTIME="io.containerd.kata.v2"
}
# Setup Kata Containers Environment
#
# - If the repo is "tests", this will call the script living in that repo
# directly.
# - If the repo is not "tests", call the repo-specific script (which is
# expected to call the script of the same name in the "tests" repo).
case "${CI_JOB}" in
"BAREMETAL-PMEM"|"PMEM")
init_ci_flags
export CRI_CONTAINERD="yes"
export CRI_RUNTIME="containerd"
export KATA_HYPERVISOR="qemu"
export KUBERNETES="yes"
;;
"BAREMETAL-QAT"|"QAT")
init_ci_flags
export CRI_CONTAINERD="yes"
export CRI_RUNTIME="containerd"
export KATA_HYPERVISOR="qemu"
;;
"CRI_CONTAINERD"|"CRI_CONTAINERD_K8S"|"CC_CRI_CONTAINERD")
# This job only tests containerd + k8s
init_ci_flags
export CRI_CONTAINERD="yes"
export CRI_RUNTIME="containerd"
export KATA_HYPERVISOR="qemu"
case "${CI_JOB}" in
"CRI_CONTAINERD_K8S")
export KUBERNETES="yes"
;;
"CC_CRI_CONTAINERD")
# Export any CC specific environment variables
export KATA_BUILD_CC="yes"
;;
esac
;;
"CRI_CONTAINERD_K8S_DEVMAPPER")
init_ci_flags
export CRI_CONTAINERD="yes"
export CRI_RUNTIME="containerd"
export KATA_HYPERVISOR="qemu"
export KUBERNETES="yes"
export USE_DEVMAPPER="true"
;;
"CC_CRI_CONTAINERD_CLOUD_HYPERVISOR")
# This job only tests containerd + k8s
init_ci_flags
export CRI_CONTAINERD="yes"
export CRI_RUNTIME="containerd"
export KATA_HYPERVISOR="cloud-hypervisor"
# Export any CC specific environment variables
export KATA_BUILD_CC="yes"
;;
"CRIO_K8S")
init_ci_flags
export CRI_RUNTIME="crio"
export CRIO="yes"
export KATA_HYPERVISOR="qemu"
export KUBERNETES="yes"
# test images in cri-o repo are mostly x86_64 specific, so ignore cri-o intergration tests on aarch64, etc.
if [ "$arch" == "x86_64" ]; then
export TEST_CRIO="true"
fi
;;
"CRIO_K8S_COMPLETE")
init_ci_flags
export CRI_RUNTIME="crio"
export CRIO="yes"
export KUBERNETES="yes"
;;
"CRIO_K8S_MINIMAL")
init_ci_flags
export CRI_RUNTIME="crio"
export CRIO="yes"
export KUBERNETES="yes"
export MINIMAL_K8S_E2E="true"
;;
"CLOUD-HYPERVISOR-K8S-CRIO")
init_ci_flags
export CRI_RUNTIME="crio"
export CRIO="yes"
export KATA_HYPERVISOR="cloud-hypervisor"
export KUBERNETES="yes"
;;
"CLOUD-HYPERVISOR-K8S-CONTAINERD"|"CLOUD-HYPERVISOR-K8S-CONTAINERD-DEVMAPPER"|"EXTERNAL_CLOUD_HYPERVISOR")
init_ci_flags
export CRI_CONTAINERD="yes"
export CRI_RUNTIME="containerd"
export KATA_HYPERVISOR="cloud-hypervisor"
export KUBERNETES="yes"
case "${CI_JOB}" in
"CLOUD-HYPERVISOR-K8S-CONTAINERD-DEVMAPPER")
export USE_DEVMAPPER="true"
;;
"EXTERNAL_CLOUD_HYPERVISOR")
export KUBERNETES="no"
;;
esac
;;
"EXTERNAL_CRIO")
init_ci_flags
export CRIO="yes"
export CRI_RUNTIME="crio"
export KATA_HYPERVISOR="qemu"
export KUBERNETES="yes"
export TEST_CRIO="true"
export MINIMAL_K8S_E2E="true"
export MINIMAL_CONTAINERD_K8S_E2E="true"
;;
"FIRECRACKER")
init_ci_flags
export CRI_CONTAINERD="yes"
export CRI_RUNTIME="containerd"
export KATA_HYPERVISOR="firecracker"
export KUBERNETES="yes"
export USE_DEVMAPPER="true"
;;
"SGX")
init_ci_flags
export CRI_CONTAINERD="yes"
export CRI_RUNTIME="containerd"
export KATA_HYPERVISOR="cloud-hypervisor"
export INSTALL_KATA="no"
export KUBERNETES="yes"
;;
"VFIO"|"VFIO_AP")
init_ci_flags
export CRI_CONTAINERD="yes"
export CRI_RUNTIME="containerd"
export KATA_HYPERVISOR="qemu"
;;
"VIRTIOFS_EXPERIMENTAL")
init_ci_flags
export CRI_CONTAINERD="yes"
export CRI_RUNTIME="containerd"
export DEFVIRTIOFSCACHESIZE="1024"
export KUBERNETES="yes"
export experimental_qemu="true"
;;
"METRICS"|"METRICS_CLH")
init_ci_flags
export CRI_CONTAINERD="yes"
export CRI_RUNTIME="containerd"
export KATA_HYPERVISOR="qemu"
export KUBERNETES="yes"
export METRICS_CI=1
;;
"DRAGONBALL")
init_ci_flags
export CRI_CONTAINERD="yes"
export CRI_RUNTIME="containerd"
export KATA_HYPERVISOR="dragonball"
export KUBERNETES="yes"
;;
esac