-
Notifications
You must be signed in to change notification settings - Fork 1
/
common.jsonnet
170 lines (152 loc) · 5.45 KB
/
common.jsonnet
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
local composable = (import "common-utils.libsonnet").composable;
local mx_version = (import "graal-common.json").mx_version;
local common_json = composable(import "common.json");
local repo_config = import 'repo-configuration.libsonnet';
local jdks = common_json.jdks;
local deps = common_json.deps;
local downloads = common_json.downloads;
# Finds the first integer in a string and returns it as an integer.
local find_first_integer(versionString) =
local charToInt(c) =
std.codepoint(c) - std.codepoint("0");
local firstNum(s, i) =
assert std.length(s) > i : "No number found in string " + s;
local n = charToInt(s[i]);
if n >=0 && n < 10 then i else firstNum(s, i + 1);
local lastNum(s, i) =
if i >= std.length(s) then
i
else
local n = charToInt(s[i]);
if n < 0 || n > 9 then i else lastNum(s, i + 1);
local versionIndexStart = firstNum(versionString, 0);
local versionIndexEnd = lastNum(versionString, versionIndexStart);
std.parseInt(versionString[versionIndexStart:versionIndexEnd])
;
# jdk_version is an hidden field that can be used to generate job names
local add_jdk_version(name) =
local jdk = jdks[name];
// this assumes that the version is the first number in the jdk.version string
local version = find_first_integer(jdk.version);
// santity check that the parsed version is also included in the name
assert std.length(std.findSubstr(std.toString(version), name)) == 1 : "Cannot find version %d in name %s" % [version, name];
{ jdk_version:: version}
;
{
mx:: {
packages+: {
mx: mx_version
}
},
eclipse:: downloads.eclipse,
jdt:: downloads.jdt,
devkits:: common_json.devkits,
svm_deps:: common_json.svm.deps + repo_config.native_image.extra_deps,
build_base:: {
// holds location of CI resources that can easily be overwritten in an overlay
ci_resources:: (import "ci-resources.libsonnet"),
},
// Job frequencies
// ***************
on_demand:: {
targets+: ["ondemand"],
},
post_merge:: {
targets+: ["post-merge"],
},
daily:: {
targets+: ["daily"],
},
weekly:: {
targets+: ["weekly"],
},
monthly:: {
targets+: ["monthly"],
},
// Heap settings
// *************
local small_heap = "1G",
local default_heap = "8G",
local large_heap = "31G", // strictly smaller than 32G to keep compressed oops enabled
local large_young_gen_heap = "27G", // tuned to reduce latency of large apps like SpecJBB2015
heap:: {
small:: {
environment+: {
XMX: small_heap
}
},
default:: {
environment+: {
XMX: default_heap
}
},
large:: {
environment+: {
XMX: large_heap
}
},
large_with_large_young_gen:: {
environment+: {
XMS: large_heap,
XMX: large_heap,
XMN: large_young_gen_heap
}
}
},
} + {
// JDK definitions
// ***************
// this adds all jdks from common.json
[name]: add_jdk_version(name) + { downloads+: { [if std.endsWith(name, "llvm") then "LLVM_JAVA_HOME" else "JAVA_HOME"] : jdks[name] }},
for name in std.objectFieldsAll(jdks)
} + {
# Aliases to edition specific labsjdks
labsjdk11:: self["labsjdk-" + repo_config.graalvm_edition + "-11"],
labsjdk17:: self["labsjdk-" + repo_config.graalvm_edition + "-17"],
labsjdk19:: self["labsjdk-" + repo_config.graalvm_edition + "-19"],
labsjdk17Debug:: self["labsjdk-" + repo_config.graalvm_edition + "-17Debug"],
labsjdk11LLVM:: self["labsjdk-" + repo_config.graalvm_edition + "-11-llvm"],
labsjdk17LLVM:: self["labsjdk-" + repo_config.graalvm_edition + "-17-llvm"],
// Hardware definitions
// ********************
common:: deps.common + self.mx + {
local where = if std.objectHas(self, "name") then " in " + self.name else "",
# enforce self.os (useful for generating job names)
os:: error "self.os not set" + where,
# enforce self.arch (useful for generating job names)
arch:: error "self.arch not set" + where,
capabilities +: [],
catch_files +: common_json.catch_files,
logs +: [
"*.bgv",
"./" + repo_config.compiler.compiler_suite + "/graal_dumps/*/*"
]
},
ol7:: self.build_base + {
local ol7_image = self.ci_resources.infra.docker_image_ol7,
docker+: {
image: ol7_image,
mount_modules: true,
},
},
linux:: deps.linux + self.common + {os::"linux", capabilities+: [self.os]},
darwin:: deps.darwin + self.common + {os::"darwin", capabilities+: [self.os]},
windows:: deps.windows + self.common + {os::"windows", capabilities+: [self.os]},
windows_server_2016:: self.windows + {capabilities+: ["windows_server_2016"]},
amd64:: { arch::"amd64", capabilities+: [self.arch]},
aarch64:: { arch::"aarch64", capabilities+: [self.arch]},
linux_amd64:: self.linux + self.amd64,
darwin_amd64:: self.darwin + self.amd64,
darwin_aarch64:: self.darwin + self.aarch64 + {
# only needed until GR-22580 is resolved?
python_version: 3,
},
windows_amd64:: self.windows + self.amd64,
windows_server_2016_amd64:: self.windows_server_2016 + self.amd64,
linux_aarch64:: self.linux + self.aarch64,
mach5_target:: {targets+: ["mach5"]},
// Utils
disable_proxies:: {
setup+: [["unset", "HTTP_PROXY", "HTTPS_PROXY", "FTP_PROXY", "NO_PROXY", "http_proxy", "https_proxy", "ftp_proxy", "no_proxy"]],
},
}