forked from oracle/graalpython
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathci.jsonnet
More file actions
279 lines (244 loc) · 8.17 KB
/
ci.jsonnet
File metadata and controls
279 lines (244 loc) · 8.17 KB
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
268
269
270
271
272
273
274
275
276
277
278
279
{
overlay: "e08ca6c848943a04c5e46d54272ff927ff3d51f7",
// ======================================================================================================
//
// help:
// 1) to get the json out of the jsonnet configuration make sure the `jsonnet` executable is in path
// 2) execute the following command: jsonnet ci.jsonnet > ci.json
// 3) a helper script which does just that is located in: ./scripts/jsonnet_json.sh
//
// ======================================================================================================
// ======================================================================================================
//
// locals (will not appear in the generated json)
//
// ======================================================================================================
// timelimit
local TIME_LIMIT = {
"30m": "00:30:00",
"1h": "1:00:00",
"2h": "2:00:00",
"3h": "3:00:00",
"4h": "4:00:00",
"8h": "8:00:00",
"10h": "10:00:00",
"16h": "16:00:00",
"20h": "20:00:00",
},
TIME_LIMIT: TIME_LIMIT,
// targets
local TARGET = {
onDemand: ["bench"],
postMerge: ["post-merge"],
weekly: ["weekly"],
gate: ["gate"],
},
TARGET: TARGET,
// ------------------------------------------------------------------------------------------------------
//
// utility funcs
//
// ------------------------------------------------------------------------------------------------------
local utils = {
download: function(name, version, platformSpecific = true)
{name: name, version: version, platformspecific: platformSpecific},
getValue: function(object, field)
if (!std.objectHas(object, field)) then
error "unknown field: "+field+" in "+object+", valid choices are: "+std.objectFields(object)
else
object[field],
graalOption: function(name, value)
["--Ja", "@-Dgraal."+name+"="+value],
},
// ------------------------------------------------------------------------------------------------------
//
// platform mixins
//
// ------------------------------------------------------------------------------------------------------
local linuxMixin = {
capabilities +: ["linux", "amd64"],
packages +: {
"maven": "==3.3.9",
"git": ">=1.8.3",
"mercurial": ">=3.2.4",
"gcc": "==4.9.1",
"llvm": "==4.0.1",
"python": "==3.4.1",
"libffi": ">=3.2.1",
"bzip2": ">=1.0.6",
},
downloads +: {
LIBGMP: utils.download("libgmp", "6.1.0"),
},
},
linuxMixin: linuxMixin,
local linuxBenchMixin = linuxMixin + {
capabilities +: ["no_frequency_scaling", "tmpfs25g", "x52"],
},
linuxBenchMixin: linuxBenchMixin,
local darwinMixin = {
capabilities +: ["darwin_sierra", "amd64"],
timelimit: TIME_LIMIT["1h"],
packages +: {
"pip:astroid": "==1.1.0",
"pip:pylint": "==1.1.0",
"llvm": "==4.0.1",
},
},
local getPlatform = function(platform)
local PLATFORMS = {
"linux": linuxMixin,
"linuxBench": linuxBenchMixin,
"darwin": darwinMixin,
};
utils.getValue(PLATFORMS, platform),
// ------------------------------------------------------------------------------------------------------
//
// mixins
//
// ------------------------------------------------------------------------------------------------------
local pypyMixin = {
downloads +: {
PYPY_HOME: utils.download("pypy3", "5.8.0-minimal"),
},
},
pypyMixin: pypyMixin,
local eclipseMixin = {
downloads +: {
ECLIPSE: utils.download("eclipse", "4.5.2.1"),
JDT: utils.download("ecj", "4.6.1", false),
},
environment +: {
ECLIPSE_EXE: "$ECLIPSE/eclipse",
},
},
local labsjdk8Mixin = {
downloads +: {
JAVA_HOME: utils.download("labsjdk", "8u192-jvmci-0.54"),
EXTRA_JAVA_HOMES : { pathlist: [utils.download("oraclejdk", "11+20")] },
},
environment +: {
CI: "true",
PATH: "$JAVA_HOME/bin:$PATH",
},
},
labsjdk8Mixin: labsjdk8Mixin,
local graalMixin = labsjdk8Mixin + {
environment +: {
HOST_VM: "server",
},
},
local graalCoreMixin = graalMixin + {
environment +: {
HOST_VM_CONFIG: "graal-core",
},
},
graalCoreMixin: graalCoreMixin,
local sulongMixin = labsjdk8Mixin + {
environment +: {
CPPFLAGS: "-I$LIBGMP/include",
LD_LIBRARY_PATH: "$LIBGMP/lib:$LLVM/lib:$LD_LIBRARY_PATH",
}
},
sulongMixin: sulongMixin,
// ------------------------------------------------------------------------------------------------------
//
// the build templates
//
// ------------------------------------------------------------------------------------------------------
local baseBuilder = {
downloads: {},
environment: {},
setup: [],
logs: ["dumps/*/*"],
timelimit: TIME_LIMIT["30m"],
packages: {},
capabilities: [],
name: null,
targets: [],
run: [],
},
local commonBuilder = baseBuilder + labsjdk8Mixin + {
dynamicImports:: "sulong,/compiler",
setup +: [
["mx", "sforceimports"],
["mx", "--dynamicimports", self.dynamicImports, "build"],
]
},
commonBuilder: commonBuilder,
// ------------------------------------------------------------------------------------------------------
//
// the gate templates
//
// ------------------------------------------------------------------------------------------------------
local baseGate = commonBuilder + {
tags: "tags must be defined",
// local truffleDebugFlags = utils.graalOption("TraceTruffleCompilation", "true"),
// local truffleDebugFlags = utils.graalOption("TraceTruffleCompilationDetails", "true"),
local truffleDebugFlags = [],
targets: TARGET.gate,
run +: [
["mx"] + truffleDebugFlags + ["--strict-compliance", "--dynamicimports", super.dynamicImports, "--primary", "gate", "--tags", self.tags, "-B=--force-deprecation-as-warning-for-dependencies"],
]
},
local baseGraalGate = baseGate + sulongMixin + graalCoreMixin,
baseGraalGate: baseGraalGate,
// specific gates
local testGate = function(type, platform)
baseGraalGate + {tags:: "python-"+type} + getPlatform(platform) + {name: "python-"+ type +"-"+platform},
local styleGate = baseGraalGate + eclipseMixin + linuxMixin + {
tags:: "style,fullbuild,python-license",
name: "python-style",
timelimit: TIME_LIMIT["1h"],
},
local graalVmGate = baseGraalGate + linuxMixin {
tags:: "python-graalvm",
name: "python-graalvm",
timelimit: TIME_LIMIT["1h"],
},
// ------------------------------------------------------------------------------------------------------
//
// the deploy templates
//
// ------------------------------------------------------------------------------------------------------
local deployGate = function(platform)
baseBuilder + graalCoreMixin + sulongMixin + getPlatform(platform) + {
targets: TARGET.postMerge,
setup +: [
["mx", "sversions"],
["mx", "build", "--force-javac"],
],
run +: [
["mx", "deploy-binary-if-master", "python-public-snapshots"],
],
name: "deploy-binaries-"+platform,
},
// ------------------------------------------------------------------------------------------------------
//
// the gates
//
// ------------------------------------------------------------------------------------------------------
local gates = [
// unittests
testGate(type="unittest", platform="linux"),
testGate(type="unittest", platform="darwin"),
testGate(type="svm-unittest", platform="linux"),
testGate(type="svm-unittest", platform="darwin"),
// junit
testGate(type="junit", platform="linux"),
testGate(type="junit", platform="darwin"),
// style
styleGate,
// graalvm gates
graalVmGate,
// deploy binaries
deployGate(platform="linux"),
deployGate(platform="darwin"),
],
// ======================================================================================================
//
// the builds (the public section)
//
// ======================================================================================================
builds: gates,
}