Repository navigation
Commit ae3e604
[batch] support multiple spark versions for jvm jobs (#15675)
## Change Description
JVM jobs may now declare which spark version their jar was built against
via an optional 'spark_version' field in the job spec. The front end and
worker default it to 3.5.3, the version every released client is
compatible
with, so existing clients are unaffected and need no changes.
- The worker no longer bakes pyspark into its image. It downloads an
archive
of the requested version's spark jars from cloud storage
(SPARK_ARCHIVE_URL_PREFIX, plumbed from the new
HAIL_QUERY_SPARK_ARCHIVE_SUBFOLDER env var) and extracts it to
/spark/\<version>, reusing the query-jar download mechanism via a
generic
download_artifact.
- scripts/upload-spark-jars.sh builds the archive from the pyspark sdist
and uploads it to the namespace's jar prefix; the new upload_spark_jars
CI step uploads the archive for env/SPARK_VERSION.
- The front end validates at job creation that an archive exists for the
requested spark version, making a missing archive a 400 at submission
rather than a worker-side failure.
- JVMEntryway keeps one shared spark classloader per `(spark classpath,
jar classpath)`
and is now plain java to avoid dependence on scala; the worker image
runs jre 21. Other images that never run hail code (tls,
infra bootstrap) use jre 25.
- Bump INSTANCE_VERSION: the entryway wire protocol now includes the
spark
classpath.
## Security Assessment
- This change potentially impacts the Hail Batch instance as deployed by
Broad Institute in GCP
### Impact Rating
- This change has a low security impact
### Impact Description
This change adds one new user-controllable input: the optional
`spark_version`
field on JVM job specs, which the front end interpolates into a
cloud-storage
URL and the worker uses as a path component under `/spark/`. It is
validated
with `re.fullmatch(r'\d+\.\d+\.\d+')` at job creation (before any use),
so no
path traversal or URL manipulation is possible, and it can only select
among
spark-jar archives that batch's own CI uploaded to the batch-owned
storage
prefix — the same trust model as the existing
ACCEPTABLE_QUERY_JAR_URL_PREFIX
check for query jars.
The worker now fetches spark jars from that batch-owned prefix instead
of
shipping them in the worker image; the provenance of code executed by
JVM jobs
is unchanged (CI-built artifacts in batch-controlled storage).
The JRE 11→25 upgrade and the JVMEntryway Scala→Java conversion do not
change
authentication, authorization, or secret handling.
### Appsec Review
- [ ] Required: The impact has been assessed and approved by appsec
Co-authored-by: Claude Fable 5 <noreply@anthropic.com>1 parent ebd7a2d commit ae3e604
26 files changed
Lines changed: 537 additions & 342 deletions
File tree
- batch
- batch
- cloud
- azure/driver
- gcp/driver
- terra/azure/driver
- front_end
- worker
- jvm-entryway
- src/is/hail
- terra-chart/templates
- hail
- scripts
- infra
- tls
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
62 | 62 | | |
63 | 63 | | |
64 | 64 | | |
65 | | - | |
| 65 | + | |
66 | 66 | | |
67 | 67 | | |
68 | 68 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
6 | 6 | | |
7 | 7 | | |
8 | 8 | | |
9 | | - | |
| 9 | + | |
10 | 10 | | |
11 | 11 | | |
12 | 12 | | |
| |||
45 | 45 | | |
46 | 46 | | |
47 | 47 | | |
48 | | - | |
49 | | - | |
| 48 | + | |
50 | 49 | | |
51 | 50 | | |
52 | 51 | | |
53 | 52 | | |
54 | 53 | | |
55 | | - | |
56 | | - | |
57 | | - | |
58 | | - | |
59 | | - | |
| 54 | + | |
60 | 55 | | |
61 | 56 | | |
62 | 57 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
12 | 12 | | |
13 | 13 | | |
14 | 14 | | |
15 | | - | |
| 15 | + | |
16 | 16 | | |
17 | 17 | | |
18 | 18 | | |
| |||
135 | 135 | | |
136 | 136 | | |
137 | 137 | | |
| 138 | + | |
138 | 139 | | |
139 | 140 | | |
140 | 141 | | |
| |||
273 | 274 | | |
274 | 275 | | |
275 | 276 | | |
| 277 | + | |
276 | 278 | | |
277 | 279 | | |
278 | 280 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
12 | 12 | | |
13 | 13 | | |
14 | 14 | | |
15 | | - | |
| 15 | + | |
16 | 16 | | |
17 | 17 | | |
18 | 18 | | |
| |||
185 | 185 | | |
186 | 186 | | |
187 | 187 | | |
| 188 | + | |
188 | 189 | | |
189 | 190 | | |
190 | 191 | | |
| |||
356 | 357 | | |
357 | 358 | | |
358 | 359 | | |
| 360 | + | |
359 | 361 | | |
360 | 362 | | |
361 | 363 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
41 | 41 | | |
42 | 42 | | |
43 | 43 | | |
44 | | - | |
| 44 | + | |
45 | 45 | | |
46 | 46 | | |
47 | 47 | | |
| |||
160 | 160 | | |
161 | 161 | | |
162 | 162 | | |
| 163 | + | |
163 | 164 | | |
164 | 165 | | |
165 | 166 | | |
| |||
236 | 237 | | |
237 | 238 | | |
238 | 239 | | |
| 240 | + | |
239 | 241 | | |
240 | 242 | | |
241 | 243 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
30 | 30 | | |
31 | 31 | | |
32 | 32 | | |
33 | | - | |
| 33 | + | |
34 | 34 | | |
35 | 35 | | |
36 | | - | |
37 | | - | |
| 36 | + | |
| 37 | + | |
38 | 38 | | |
39 | | - | |
40 | | - | |
| 39 | + | |
| 40 | + | |
41 | 41 | | |
42 | 42 | | |
43 | | - | |
| 43 | + | |
44 | 44 | | |
45 | 45 | | |
46 | | - | |
| 46 | + | |
47 | 47 | | |
48 | | - | |
| 48 | + | |
49 | 49 | | |
50 | 50 | | |
51 | | - | |
| 51 | + | |
| 52 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
96 | 96 | | |
97 | 97 | | |
98 | 98 | | |
99 | | - | |
| 99 | + | |
100 | 100 | | |
101 | 101 | | |
102 | 102 | | |
| |||
110 | 110 | | |
111 | 111 | | |
112 | 112 | | |
| 113 | + | |
113 | 114 | | |
114 | 115 | | |
115 | 116 | | |
| |||
1312 | 1313 | | |
1313 | 1314 | | |
1314 | 1315 | | |
| 1316 | + | |
| 1317 | + | |
| 1318 | + | |
| 1319 | + | |
1315 | 1320 | | |
1316 | 1321 | | |
1317 | 1322 | | |
| |||
3835 | 3840 | | |
3836 | 3841 | | |
3837 | 3842 | | |
| 3843 | + | |
3838 | 3844 | | |
3839 | 3845 | | |
3840 | 3846 | | |
| |||
3923 | 3929 | | |
3924 | 3930 | | |
3925 | 3931 | | |
| 3932 | + | |
| 3933 | + | |
| 3934 | + | |
| 3935 | + | |
| 3936 | + | |
| 3937 | + | |
| 3938 | + | |
3926 | 3939 | | |
3927 | 3940 | | |
3928 | 3941 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
82 | 82 | | |
83 | 83 | | |
84 | 84 | | |
| 85 | + | |
| 86 | + | |
85 | 87 | | |
86 | 88 | | |
87 | 89 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
23 | 23 | | |
24 | 24 | | |
25 | 25 | | |
26 | | - | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
27 | 30 | | |
28 | 31 | | |
29 | 32 | | |
0 commit comments