|
9 | 9 | env:
|
10 | 10 | DOTTY_CI_RUN: true
|
11 | 11 |
|
| 12 | +# In this file, we set `--cpu-shares 4096` on every job. This might seem useless |
| 13 | +# since it means that every container has the same weight which should be |
| 14 | +# equivalent to doing nothing, but it turns out that OpenJDK computes |
| 15 | +# `Runtime.getRuntime.availableProcessors` by dividing the cpu-shares value if |
| 16 | +# it exists by 1024 (cf |
| 17 | +# http://mail.openjdk.java.net/pipermail/hotspot-dev/2019-January/036087.html), |
| 18 | +# so this means that we effectively run every job with 4 cores. This is much |
| 19 | +# nicer than setting `--cpus 4` because the latter enforces CPU quotas and ends |
| 20 | +# up slowing our jobs more than needed. It's equivalent to running the JVM with |
| 21 | +# `-XX:ActiveProcessorCount=4`, but since our tests can spawn new JVM in many |
| 22 | +# places, it would be very hard to ensure that this option is always passed to |
| 23 | +# `java` (we could use the `_JAVA_OPTIONS` environment variable, but this prints |
| 24 | +# text on stderr and so can break tests which check the output of a program). |
| 25 | + |
12 | 26 | jobs:
|
13 | 27 | test_non_bootstrapped:
|
14 | 28 | runs-on: [self-hosted, Linux]
|
15 | 29 | container:
|
16 | 30 | image: lampepfl/dotty:2020-11-19
|
17 |
| - options: --cpus=4 |
| 31 | + options: --cpu-shares 4096 |
18 | 32 | volumes:
|
19 | 33 | - ${{ github.workspace }}/../../cache/sbt:/root/.sbt
|
20 | 34 | - ${{ github.workspace }}/../../cache/ivy:/root/.ivy2/cache
|
|
54 | 68 | runs-on: [self-hosted, Linux]
|
55 | 69 | container:
|
56 | 70 | image: lampepfl/dotty:2020-11-19
|
57 |
| - options: --cpus=4 |
| 71 | + options: --cpu-shares 4096 |
58 | 72 | volumes:
|
59 | 73 | - ${{ github.workspace }}/../../cache/sbt:/root/.sbt
|
60 | 74 | - ${{ github.workspace }}/../../cache/ivy:/root/.ivy2/cache
|
@@ -139,7 +153,7 @@ jobs:
|
139 | 153 | runs-on: [self-hosted, Linux]
|
140 | 154 | container:
|
141 | 155 | image: lampepfl/dotty:2020-11-19
|
142 |
| - options: --cpus=4 |
| 156 | + options: --cpu-shares 4096 |
143 | 157 | volumes:
|
144 | 158 | - ${{ github.workspace }}/../../cache/sbt:/root/.sbt
|
145 | 159 | - ${{ github.workspace }}/../../cache/ivy:/root/.ivy2/cache
|
@@ -175,7 +189,7 @@ jobs:
|
175 | 189 | runs-on: [self-hosted, Linux]
|
176 | 190 | container:
|
177 | 191 | image: lampepfl/dotty:2020-11-19
|
178 |
| - options: --cpus=4 |
| 192 | + options: --cpu-shares 4096 |
179 | 193 | volumes:
|
180 | 194 | - ${{ github.workspace }}/../../cache/sbt:/root/.sbt
|
181 | 195 | - ${{ github.workspace }}/../../cache/ivy:/root/.ivy2/cache
|
@@ -211,7 +225,7 @@ jobs:
|
211 | 225 | runs-on: [self-hosted, Linux]
|
212 | 226 | container:
|
213 | 227 | image: lampepfl/dotty:2020-11-19
|
214 |
| - options: --cpus=4 |
| 228 | + options: --cpu-shares 4096 |
215 | 229 | volumes:
|
216 | 230 | - ${{ github.workspace }}/../../cache/sbt:/root/.sbt
|
217 | 231 | - ${{ github.workspace }}/../../cache/ivy:/root/.ivy2/cache
|
@@ -247,7 +261,7 @@ jobs:
|
247 | 261 | runs-on: [self-hosted, Linux]
|
248 | 262 | container:
|
249 | 263 | image: lampepfl/dotty:2020-11-19
|
250 |
| - options: --cpus=4 |
| 264 | + options: --cpu-shares 4096 |
251 | 265 | volumes:
|
252 | 266 | - ${{ github.workspace }}/../../cache/sbt:/root/.sbt
|
253 | 267 | - ${{ github.workspace }}/../../cache/ivy:/root/.ivy2/cache
|
@@ -290,7 +304,7 @@ jobs:
|
290 | 304 | runs-on: [self-hosted, Linux]
|
291 | 305 | container:
|
292 | 306 | image: lampepfl/dotty:2020-11-19
|
293 |
| - options: --cpus=4 |
| 307 | + options: --cpu-shares 4096 |
294 | 308 | volumes:
|
295 | 309 | - ${{ github.workspace }}/../../cache/sbt:/root/.sbt
|
296 | 310 | - ${{ github.workspace }}/../../cache/ivy:/root/.ivy2/cache
|
@@ -325,7 +339,7 @@ jobs:
|
325 | 339 | runs-on: [self-hosted, Linux]
|
326 | 340 | container:
|
327 | 341 | image: lampepfl/dotty:2020-11-19
|
328 |
| - options: --cpus=4 |
| 342 | + options: --cpu-shares 4096 |
329 | 343 | volumes:
|
330 | 344 | - ${{ github.workspace }}/../../cache/sbt:/root/.sbt
|
331 | 345 | - ${{ github.workspace }}/../../cache/ivy:/root/.ivy2/cache
|
@@ -367,7 +381,7 @@ jobs:
|
367 | 381 | runs-on: [self-hosted, Linux]
|
368 | 382 | container:
|
369 | 383 | image: lampepfl/dotty:2020-11-19
|
370 |
| - options: --cpus=4 |
| 384 | + options: --cpu-shares 4096 |
371 | 385 | volumes:
|
372 | 386 | - ${{ github.workspace }}/../../cache/sbt:/root/.sbt
|
373 | 387 | - ${{ github.workspace }}/../../cache/ivy:/root/.ivy2/cache
|
@@ -450,7 +464,7 @@ jobs:
|
450 | 464 | runs-on: [self-hosted, Linux]
|
451 | 465 | container:
|
452 | 466 | image: lampepfl/dotty:2020-11-19
|
453 |
| - options: --cpus=4 |
| 467 | + options: --cpu-shares 4096 |
454 | 468 | volumes:
|
455 | 469 | - ${{ github.workspace }}/../../cache/sbt:/root/.sbt
|
456 | 470 | - ${{ github.workspace }}/../../cache/ivy:/root/.ivy2/cache
|
@@ -495,6 +509,7 @@ jobs:
|
495 | 509 | runs-on: [self-hosted, Linux]
|
496 | 510 | container:
|
497 | 511 | image: lampepfl/dotty:2020-11-19
|
| 512 | + options: --cpu-shares 4096 |
498 | 513 | volumes:
|
499 | 514 | - ${{ github.workspace }}/../../cache/sbt:/root/.sbt
|
500 | 515 | - ${{ github.workspace }}/../../cache/ivy:/root/.ivy2/cache
|
|
0 commit comments