|
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
|
@@ -149,7 +163,7 @@ jobs:
|
149 | 163 | runs-on: [self-hosted, Linux]
|
150 | 164 | container:
|
151 | 165 | image: lampepfl/dotty:2020-11-19
|
152 |
| - options: --cpus=4 |
| 166 | + options: --cpu-shares 4096 |
153 | 167 | volumes:
|
154 | 168 | - ${{ github.workspace }}/../../cache/sbt:/root/.sbt
|
155 | 169 | - ${{ github.workspace }}/../../cache/ivy:/root/.ivy2/cache
|
@@ -185,7 +199,7 @@ jobs:
|
185 | 199 | runs-on: [self-hosted, Linux]
|
186 | 200 | container:
|
187 | 201 | image: lampepfl/dotty:2020-11-19
|
188 |
| - options: --cpus=4 |
| 202 | + options: --cpu-shares 4096 |
189 | 203 | volumes:
|
190 | 204 | - ${{ github.workspace }}/../../cache/sbt:/root/.sbt
|
191 | 205 | - ${{ github.workspace }}/../../cache/ivy:/root/.ivy2/cache
|
@@ -221,7 +235,7 @@ jobs:
|
221 | 235 | runs-on: [self-hosted, Linux]
|
222 | 236 | container:
|
223 | 237 | image: lampepfl/dotty:2020-11-19
|
224 |
| - options: --cpus=4 |
| 238 | + options: --cpu-shares 4096 |
225 | 239 | volumes:
|
226 | 240 | - ${{ github.workspace }}/../../cache/sbt:/root/.sbt
|
227 | 241 | - ${{ github.workspace }}/../../cache/ivy:/root/.ivy2/cache
|
@@ -257,7 +271,7 @@ jobs:
|
257 | 271 | runs-on: [self-hosted, Linux]
|
258 | 272 | container:
|
259 | 273 | image: lampepfl/dotty:2020-11-19
|
260 |
| - options: --cpus=4 |
| 274 | + options: --cpu-shares 4096 |
261 | 275 | volumes:
|
262 | 276 | - ${{ github.workspace }}/../../cache/sbt:/root/.sbt
|
263 | 277 | - ${{ github.workspace }}/../../cache/ivy:/root/.ivy2/cache
|
@@ -300,7 +314,7 @@ jobs:
|
300 | 314 | runs-on: [self-hosted, Linux]
|
301 | 315 | container:
|
302 | 316 | image: lampepfl/dotty:2020-11-19
|
303 |
| - options: --cpus=4 |
| 317 | + options: --cpu-shares 4096 |
304 | 318 | volumes:
|
305 | 319 | - ${{ github.workspace }}/../../cache/sbt:/root/.sbt
|
306 | 320 | - ${{ github.workspace }}/../../cache/ivy:/root/.ivy2/cache
|
@@ -335,7 +349,7 @@ jobs:
|
335 | 349 | runs-on: [self-hosted, Linux]
|
336 | 350 | container:
|
337 | 351 | image: lampepfl/dotty:2020-11-19
|
338 |
| - options: --cpus=4 |
| 352 | + options: --cpu-shares 4096 |
339 | 353 | volumes:
|
340 | 354 | - ${{ github.workspace }}/../../cache/sbt:/root/.sbt
|
341 | 355 | - ${{ github.workspace }}/../../cache/ivy:/root/.ivy2/cache
|
@@ -377,7 +391,7 @@ jobs:
|
377 | 391 | runs-on: [self-hosted, Linux]
|
378 | 392 | container:
|
379 | 393 | image: lampepfl/dotty:2020-11-19
|
380 |
| - options: --cpus=4 |
| 394 | + options: --cpu-shares 4096 |
381 | 395 | volumes:
|
382 | 396 | - ${{ github.workspace }}/../../cache/sbt:/root/.sbt
|
383 | 397 | - ${{ github.workspace }}/../../cache/ivy:/root/.ivy2/cache
|
@@ -460,7 +474,7 @@ jobs:
|
460 | 474 | runs-on: [self-hosted, Linux]
|
461 | 475 | container:
|
462 | 476 | image: lampepfl/dotty:2020-11-19
|
463 |
| - options: --cpus=4 |
| 477 | + options: --cpu-shares 4096 |
464 | 478 | volumes:
|
465 | 479 | - ${{ github.workspace }}/../../cache/sbt:/root/.sbt
|
466 | 480 | - ${{ github.workspace }}/../../cache/ivy:/root/.ivy2/cache
|
@@ -505,6 +519,7 @@ jobs:
|
505 | 519 | runs-on: [self-hosted, Linux]
|
506 | 520 | container:
|
507 | 521 | image: lampepfl/dotty:2020-11-19
|
| 522 | + options: --cpu-shares 4096 |
508 | 523 | volumes:
|
509 | 524 | - ${{ github.workspace }}/../../cache/sbt:/root/.sbt
|
510 | 525 | - ${{ github.workspace }}/../../cache/ivy:/root/.ivy2/cache
|
|
0 commit comments