Skip to content

Commit e9e5e66

Browse files
committed
[GR-15900] share overlay between graalpython projects
PullRequest: graalpython/525
2 parents 09f206b + d55a7ca commit e9e5e66

File tree

7 files changed

+373
-306
lines changed

7 files changed

+373
-306
lines changed

ci.jsonnet

Lines changed: 53 additions & 298 deletions
Original file line numberDiff line numberDiff line change
@@ -1,300 +1,55 @@
1-
{
2-
overlay: "bf72da98b99c9f367e7d749e12d189e3405c6853",
3-
4-
// ======================================================================================================
5-
//
6-
// help:
7-
// 1) to get the json out of the jsonnet configuration make sure the `jsonnet` executable is in path
8-
// 2) execute the following command: jsonnet ci.jsonnet > ci.json
9-
// 3) a helper script which does just that is located in: ./scripts/jsonnet_json.sh
10-
//
11-
// ======================================================================================================
12-
13-
// ======================================================================================================
14-
//
15-
// locals (will not appear in the generated json)
16-
//
17-
// ======================================================================================================
18-
19-
// timelimit
20-
local TIME_LIMIT = {
21-
"30m": "00:30:00",
22-
"1h": "1:00:00",
23-
"2h": "2:00:00",
24-
"3h": "3:00:00",
25-
"4h": "4:00:00",
26-
"8h": "8:00:00",
27-
"10h": "10:00:00",
28-
"16h": "16:00:00",
29-
"20h": "20:00:00",
30-
},
31-
TIME_LIMIT: TIME_LIMIT,
32-
33-
// targets
34-
local TARGET = {
35-
onDemand: ["bench"],
36-
postMerge: ["post-merge"],
37-
weekly: ["weekly"],
38-
gate: ["gate"],
39-
},
40-
TARGET: TARGET,
41-
42-
// ------------------------------------------------------------------------------------------------------
43-
//
44-
// utility funcs
45-
//
46-
// ------------------------------------------------------------------------------------------------------
47-
local utils = {
48-
download: function(name, version, platformSpecific = true)
49-
{name: name, version: version, platformspecific: platformSpecific},
50-
51-
getValue: function(object, field)
52-
if (!std.objectHas(object, field)) then
53-
error "unknown field: "+field+" in "+object+", valid choices are: "+std.objectFields(object)
54-
else
55-
object[field],
56-
57-
graalOption: function(name, value)
58-
["--Ja", "@-Dgraal."+name+"="+value],
59-
},
60-
61-
// ------------------------------------------------------------------------------------------------------
62-
//
63-
// platform mixins
64-
//
65-
// ------------------------------------------------------------------------------------------------------
66-
local linuxMixin = {
67-
capabilities +: ["linux", "amd64"],
68-
packages +: {
69-
"maven": "==3.3.9",
70-
"git": ">=1.8.3",
71-
"mercurial": ">=3.2.4",
72-
"gcc": "==4.9.1",
73-
"llvm": "==4.0.1",
74-
"python": "==3.6.5",
75-
"libffi": ">=3.2.1",
76-
"bzip2": ">=1.0.6",
77-
},
78-
downloads +: {
79-
LIBGMP: utils.download("libgmp", "6.1.0"),
80-
},
81-
},
82-
linuxMixin: linuxMixin,
83-
84-
local linuxBenchMixin = linuxMixin + {
85-
capabilities +: ["no_frequency_scaling", "tmpfs25g", "x52"],
86-
},
87-
linuxBenchMixin: linuxBenchMixin,
88-
89-
local darwinMixin = {
90-
capabilities +: ["darwin_sierra", "amd64"],
91-
timelimit: TIME_LIMIT["1h"],
92-
packages +: {
93-
"pip:astroid": "==1.1.0",
94-
"pip:pylint": "==1.1.0",
95-
"llvm": "==4.0.1",
96-
},
97-
},
98-
99-
local getPlatform = function(platform)
100-
local PLATFORMS = {
101-
"linux": linuxMixin,
102-
"linuxBench": linuxBenchMixin,
103-
"darwin": darwinMixin,
104-
};
105-
utils.getValue(PLATFORMS, platform),
106-
107-
// ------------------------------------------------------------------------------------------------------
108-
//
109-
// mixins
110-
//
111-
// ------------------------------------------------------------------------------------------------------
112-
local pypyMixin = {
113-
downloads +: {
114-
PYPY_HOME: utils.download("pypy3", "7.1.0.beta"),
115-
},
116-
},
117-
pypyMixin: pypyMixin,
118-
119-
local eclipseMixin = {
120-
downloads +: {
121-
ECLIPSE: utils.download("eclipse", "4.5.2.1"),
122-
JDT: utils.download("ecj", "4.6.1", false),
123-
},
124-
environment +: {
125-
ECLIPSE_EXE: "$ECLIPSE/eclipse",
126-
},
127-
},
128-
129-
local labsjdk8Mixin = {
130-
downloads +: {
131-
JAVA_HOME: utils.download("oraclejdk", "8u212-jvmci-20-b01"),
132-
EXTRA_JAVA_HOMES : { pathlist: [utils.download("oraclejdk", "11+28")] },
133-
},
134-
environment +: {
135-
CI: "true",
136-
GRAALVM_CHECK_EXPERIMENTAL_OPTIONS: "true",
137-
PATH: "$JAVA_HOME/bin:$PATH",
138-
},
139-
},
140-
labsjdk8Mixin: labsjdk8Mixin,
141-
142-
local graalMixin = labsjdk8Mixin + {
143-
environment +: {
144-
HOST_VM: "server",
145-
},
146-
},
147-
148-
local graalCoreMixin = graalMixin + {
149-
environment +: {
150-
HOST_VM_CONFIG: "graal-core",
151-
},
152-
},
153-
graalCoreMixin: graalCoreMixin,
154-
155-
local sulongMixin = labsjdk8Mixin + {
156-
environment +: {
157-
CPPFLAGS: "-I$LIBGMP/include",
158-
LD_LIBRARY_PATH: "$LIBGMP/lib:$LLVM/lib:$LD_LIBRARY_PATH",
159-
}
160-
},
161-
sulongMixin: sulongMixin,
162-
163-
// ------------------------------------------------------------------------------------------------------
164-
//
165-
// the build templates
166-
//
167-
// ------------------------------------------------------------------------------------------------------
168-
local baseBuilder = {
169-
downloads: {},
170-
environment: {},
171-
setup: [],
172-
logs: ["dumps/*/*"],
173-
timelimit: TIME_LIMIT["30m"],
174-
packages: {},
175-
capabilities: [],
176-
name: null,
177-
targets: [],
178-
run: [],
179-
},
1+
local utils = import 'ci_common/utils.libsonnet';
2+
local const = import 'ci_common/constants.libsonnet';
3+
local builder = import 'ci_common/builder.libsonnet';
1804

181-
local commonBuilder = baseBuilder + labsjdk8Mixin + {
182-
dynamicImports:: "sulong,/compiler",
183-
184-
setup +: [
185-
["mx", "sforceimports"],
186-
["mx", "--dynamicimports", self.dynamicImports, "build"],
187-
]
188-
},
189-
commonBuilder: commonBuilder,
190-
191-
// ------------------------------------------------------------------------------------------------------
192-
//
193-
// the gate templates
194-
//
195-
// ------------------------------------------------------------------------------------------------------
196-
local baseGate = commonBuilder + {
197-
tags: "tags must be defined",
198-
199-
// local truffleDebugFlags = utils.graalOption("TraceTruffleCompilation", "true"),
200-
// local truffleDebugFlags = utils.graalOption("TraceTruffleCompilationDetails", "true"),
201-
local truffleDebugFlags = [],
202-
targets: TARGET.gate,
203-
run +: [
204-
["mx"] + truffleDebugFlags + ["--strict-compliance", "--dynamicimports", super.dynamicImports, "--primary", "gate", "--tags", self.tags, "-B=--force-deprecation-as-warning-for-dependencies"],
205-
]
206-
},
207-
208-
local baseGraalGate = baseGate + sulongMixin + graalCoreMixin,
209-
baseGraalGate: baseGraalGate,
210-
211-
// specific gates
212-
local testGate = function(type, platform)
213-
baseGraalGate + {tags:: "python-"+type} + getPlatform(platform) + {name: "python-"+ type +"-"+platform},
214-
215-
local testGateTime = function(type, platform, timelimit)
216-
baseGraalGate + {tags:: "python-"+type} + getPlatform(platform) + {name: "python-"+ type +"-"+platform} + {timelimit: timelimit},
217-
218-
local styleGate = baseGraalGate + eclipseMixin + linuxMixin + {
219-
tags:: "style,fullbuild,python-license",
220-
name: "python-style",
221-
222-
timelimit: TIME_LIMIT["1h"],
223-
},
224-
225-
local graalVmGate = baseGraalGate + linuxMixin {
226-
tags:: "python-graalvm",
227-
name: "python-graalvm",
228-
229-
timelimit: TIME_LIMIT["1h"],
230-
},
231-
232-
// ------------------------------------------------------------------------------------------------------
233-
//
234-
// the deploy templates
235-
//
236-
// ------------------------------------------------------------------------------------------------------
237-
local deployGate = function(platform)
238-
baseBuilder + graalCoreMixin + sulongMixin + getPlatform(platform) + {
239-
targets: TARGET.postMerge,
240-
setup +: [
241-
["mx", "sversions"],
242-
["mx", "build", "--force-javac"],
243-
],
244-
run +: [
245-
["mx", "deploy-binary-if-master", "python-public-snapshots"],
246-
],
247-
name: "deploy-binaries-"+platform,
248-
},
249-
250-
local coverageGate = commonBuilder + {
251-
targets: TARGET.weekly,
252-
timelimit: TIME_LIMIT["4h"],
253-
run +: [
254-
// cannot run with excluded "GeneratedBy" since that would lead to "command line too long"
255-
// ['mx', '--jacoco-whitelist-package', 'com.oracle.graal.python', '--jacoco-exclude-annotation', '@GeneratedBy', '--strict-compliance', "--dynamicimports", super.dynamicImports, "--primary", 'gate', '-B=--force-deprecation-as-warning-for-dependencies', '--strict-mode', '--tags', "python-junit", '--jacocout', 'html'],
256-
// ['mx', '--jacoco-whitelist-package', 'com.oracle.graal.python', '--jacoco-exclude-annotation', '@GeneratedBy', 'sonarqube-upload', "-Dsonar.host.url=$SONAR_HOST_URL", "-Dsonar.projectKey=com.oracle.graalvm.python", "-Dsonar.projectName=GraalVM - Python", '--exclude-generated'],
257-
['mx', '--jacoco-whitelist-package', 'com.oracle.graal.python', '--strict-compliance', "--dynamicimports", super.dynamicImports, "--primary", 'gate', '-B=--force-deprecation-as-warning-for-dependencies', '--strict-mode', '--tags', "python-unittest,python-tagged-unittest,python-junit", '--jacocout', 'html'],
258-
['mx', '--jacoco-whitelist-package', 'com.oracle.graal.python', 'sonarqube-upload', "-Dsonar.host.url=$SONAR_HOST_URL", "-Dsonar.projectKey=com.oracle.graalvm.python", "-Dsonar.projectName=GraalVM - Python", '--exclude-generated'],
259-
],
260-
name: "python-coverage"
261-
} + getPlatform(platform="linux"),
262-
// ------------------------------------------------------------------------------------------------------
263-
//
264-
// the gates
265-
//
266-
// ------------------------------------------------------------------------------------------------------
267-
local gates = [
268-
// unittests
269-
testGate(type="unittest", platform="linux"),
270-
testGate(type="unittest", platform="darwin"),
271-
testGateTime(type="tagged-unittest", platform="linux", timelimit=TIME_LIMIT["2h"]),
272-
testGateTime(type="tagged-unittest", platform="darwin", timelimit=TIME_LIMIT["2h"]),
273-
testGate(type="svm-unittest", platform="linux"),
274-
testGate(type="svm-unittest", platform="darwin"),
275-
276-
// junit
277-
testGate(type="junit", platform="linux"),
278-
testGate(type="junit", platform="darwin"),
279-
280-
// style
281-
styleGate,
282-
283-
// coverage
284-
coverageGate,
285-
286-
// graalvm gates
287-
graalVmGate,
288-
289-
// deploy binaries
290-
deployGate(platform="linux"),
291-
deployGate(platform="darwin"),
292-
],
293-
294-
// ======================================================================================================
295-
//
296-
// the builds (the public section)
297-
//
298-
// ======================================================================================================
299-
builds: gates,
5+
{
6+
overlay: "e53f9686acc713d79098a608a00101733e26ba39",
7+
8+
// ======================================================================================================
9+
//
10+
// help:
11+
// 1) to get the json out of the jsonnet configuration make sure the `jsonnet` executable is in path
12+
// 2) execute the following command: jsonnet ci.jsonnet > ci.json
13+
// 3) a helper script which does just that is located in: ./scripts/jsonnet_json.sh
14+
//
15+
// ======================================================================================================
16+
17+
// ------------------------------------------------------------------------------------------------------
18+
//
19+
// the gates
20+
//
21+
// ------------------------------------------------------------------------------------------------------
22+
local gates = [
23+
// unittests
24+
builder.testGate(type="unittest", platform="linux"),
25+
builder.testGate(type="unittest", platform="darwin"),
26+
builder.testGateTime(type="tagged-unittest", platform="linux", timelimit=const.TIME_LIMIT["2h"]),
27+
builder.testGateTime(type="tagged-unittest", platform="darwin", timelimit=const.TIME_LIMIT["2h"]),
28+
builder.testGate(type="svm-unittest", platform="linux"),
29+
builder.testGate(type="svm-unittest", platform="darwin"),
30+
31+
// junit
32+
builder.testGate(type="junit", platform="linux"),
33+
builder.testGate(type="junit", platform="darwin"),
34+
35+
// style
36+
builder.styleGate,
37+
38+
// coverage
39+
builder.coverageGate,
40+
41+
// graalvm gates
42+
builder.graalVmGate,
43+
44+
// deploy binaries
45+
builder.deployGate(platform="linux"),
46+
builder.deployGate(platform="darwin"),
47+
],
48+
49+
// ======================================================================================================
50+
//
51+
// the builds (the public section)
52+
//
53+
// ======================================================================================================
54+
builds: gates,
30055
}

0 commit comments

Comments
 (0)