-
Notifications
You must be signed in to change notification settings - Fork 55
/
kola-aws.Jenkinsfile
146 lines (134 loc) · 5.94 KB
/
kola-aws.Jenkinsfile
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
node {
checkout scm
// these are script global vars
pipeutils = load("utils.groovy")
pipecfg = pipeutils.load_pipecfg()
}
properties([
pipelineTriggers([]),
parameters([
choice(name: 'STREAM',
choices: pipeutils.get_streams_choices(pipecfg),
description: 'CoreOS stream to test'),
string(name: 'VERSION',
description: 'CoreOS Build ID to test',
defaultValue: '',
trim: true),
string(name: 'ARCH',
description: 'Target architecture',
defaultValue: 'x86_64',
trim: true),
string(name: 'KOLA_TESTS',
description: 'Override tests to run',
defaultValue: "",
trim: true),
string(name: 'COREOS_ASSEMBLER_IMAGE',
description: 'Override the coreos-assembler image to use',
defaultValue: "quay.io/coreos-assembler/coreos-assembler:main",
trim: true),
string(name: 'SRC_CONFIG_COMMIT',
description: 'The exact config repo git commit to run tests against',
defaultValue: '',
trim: true),
]),
buildDiscarder(logRotator(
numToKeepStr: '100',
artifactNumToKeepStr: '100'
)),
durabilityHint('PERFORMANCE_OPTIMIZED')
])
currentBuild.description = "[${params.STREAM}][${params.ARCH}] - ${params.VERSION}"
def s3_stream_dir = pipeutils.get_s3_streams_dir(pipecfg, params.STREAM)
def stream_info = pipecfg.streams[params.STREAM]
cosaPod(memory: "512Mi", kvm: false,
image: params.COREOS_ASSEMBLER_IMAGE,
serviceAccount: "jenkins") {
timeout(time: 90, unit: 'MINUTES') {
try {
stage('Fetch Metadata') {
def commitopt = ''
if (params.SRC_CONFIG_COMMIT != '') {
commitopt = "--commit=${params.SRC_CONFIG_COMMIT}"
}
withCredentials([file(variable: 'AWS_CONFIG_FILE',
credentialsId: 'aws-build-upload-config')]) {
def ref = pipeutils.get_source_config_ref_for_stream(pipecfg, params.STREAM)
def variant = stream_info.variant ? "--variant ${stream_info.variant}" : ""
shwrap("""
cosa init --branch ${ref} ${commitopt} ${variant} ${pipecfg.source_config.url}
time -v cosa buildfetch --artifact=ostree --build=${params.VERSION} \
--arch=${params.ARCH} --url=s3://${s3_stream_dir}/builds
""")
}
}
withCredentials([file(variable: 'AWS_CONFIG_FILE',
credentialsId: 'aws-kola-tests-config')]) {
// A few independent tasks that can be run in parallel
def parallelruns = [:]
parallelruns['Kola:Full'] = {
kola(cosaDir: env.WORKSPACE, parallel: 5,
build: params.VERSION, arch: params.ARCH,
extraArgs: params.KOLA_TESTS,
skipBasicScenarios: true,
platformArgs: '-p=aws --aws-region=us-east-1')
}
if (params.ARCH == "x86_64") {
def tests = params.KOLA_TESTS
if (tests == "") {
tests = "basic"
}
parallelruns['Kola:Xen'] = {
// https://github.com/coreos/fedora-coreos-tracker/issues/997
// Run this test on i3.large so we can also run ext.config.platforms.aws.nvme
// to verify access to instance storage nvme disks works
// https://github.com/coreos/fedora-coreos-tracker/issues/1306
// Also add in the ext.config.platforms.aws.assert-xen test just
// to sanity check we are on a Xen instance.
def xen_tests = tests
if (xen_tests == "basic") {
xen_tests = "basic ext.config.platforms.aws.nvme ext.config.platforms.aws.assert-xen"
}
kola(cosaDir: env.WORKSPACE,
build: params.VERSION, arch: params.ARCH,
extraArgs: xen_tests,
skipUpgrade: true,
marker: "xen",
platformArgs: '-p=aws --aws-region=us-east-1 --aws-type=i3.large')
}
parallelruns['Kola:Intel-Ice-Lake'] = {
// https://github.com/coreos/fedora-coreos-tracker/issues/1004
kola(cosaDir: env.WORKSPACE,
build: params.VERSION, arch: params.ARCH,
extraArgs: tests,
skipUpgrade: true,
marker: "intel-ice-lake",
platformArgs: '-p=aws --aws-region=us-east-1 --aws-type=m6i.large')
}
} else if (params.ARCH == "aarch64") {
def tests = params.KOLA_TESTS
if (tests == "") {
tests = "basic"
}
parallelruns['Kola:Graviton3'] = {
// https://aws.amazon.com/ec2/instance-types/c7g/
kola(cosaDir: env.WORKSPACE,
build: params.VERSION, arch: params.ARCH,
extraArgs: tests,
skipUpgrade: true,
marker: "graviton3",
platformArgs: '-p=aws --aws-region=us-east-1 --aws-type=c7g.xlarge')
}
}
// process this batch
parallel parallelruns
}
currentBuild.result = 'SUCCESS'
} catch (e) {
currentBuild.result = 'FAILURE'
throw e
} finally {
if (currentBuild.result != 'SUCCESS') {
pipeutils.trySlackSend(message: ":aws: kola-aws <${env.BUILD_URL}|#${env.BUILD_NUMBER}> [${params.STREAM}][${params.ARCH}] (${params.VERSION})")
}
}
}} // cosaPod and timeout finish here