Give CI a realistic timeout and real local parallelism
The cold pipeline hit GitLab's default 1h wall while still vendoring, so raise it to 3h. max-jobs goes from 2 to nproc: crane emits a per-crate derivation for each of ~800 crates, and trickling those through two slots (or dispatching them, at a serial ~1.5s ssh round trip each) is most of the wall clock. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
33a5195 parent: 8c5607c modified
.gitlab-ci.yml +11 -7 | @@ -14,18 +14,22 @@ stages: [check] | ||
| 14 | 14 | check: |
| 15 | 15 | stage: check |
| 16 | 16 | image: nixos/nix:latest |
| 17 | + # A cold run has to vendor ~800 crates and compile the workspace; the default | |
| 18 | + # hour is not enough for that even with the builder doing the compiling. | |
| 19 | + timeout: 3h | |
| 17 | 20 | variables: |
| 18 | 21 | # The flake is fetched from the checkout, so the runner needs the git tree |
| 19 | 22 | # rather than a shallow single commit. |
| 20 | 23 | GIT_DEPTH: "0" |
| 21 | 24 | before_script: |
| 22 | 25 | # Compilation is offloaded to nixbuild.net; the runner evaluates, fetches |
| 23 | - # and uploads. max-jobs stays small but NOT zero: at zero the runner refuses | |
| 24 | - # to build anything at all, which sends the fixed-output fetches (the rust | |
| 25 | - # toolchain tarballs) to nixbuild, where the sandbox has no network and they | |
| 26 | - # fail. Two local slots keep those fetches -- and the hundreds of trivial | |
| 27 | - # cargo-src/cargo-package derivations, each otherwise a 1.5s ssh round trip | |
| 28 | - # -- on the runner, and everything expensive still lands on the builder. | |
| 26 | + # and uploads. max-jobs must not be zero: at zero the runner refuses to | |
| 27 | + # build anything at all, which sends the fixed-output fetches (the rust | |
| 28 | + # toolchain tarballs, every crate source) to nixbuild, where the build | |
| 29 | + # sandbox has no network and they can only fail. Giving it nproc keeps | |
| 30 | + # those fetches and crane's hundreds of trivial cargo-src/cargo-package | |
| 31 | + # derivations local and parallel -- each one costs a serial ~1.5s ssh | |
| 32 | + # round trip if dispatched -- while the expensive builds still go remote. | |
| 29 | 33 | - | |
| 30 | 34 | set -eu |
| 31 | 35 | mkdir -p ~/.ssh |
| @@ -38,7 +42,7 @@ check: | ||
| 38 | 42 | 'experimental-features = nix-command flakes' \ |
| 39 | 43 | 'builders = ssh-ng://eu.nixbuild.net x86_64-linux - 16 1 big-parallel,benchmark' \ |
| 40 | 44 | 'builders-use-substitutes = true' \ |
| 41 | - 'max-jobs = 2' >> /etc/nix/nix.conf | |
| 45 | + "max-jobs = $(nproc)" >> /etc/nix/nix.conf | |
| 42 | 46 | script: |
| 43 | 47 | - nix flake check -L |
| 44 | 48 | # The store paths are read-only symlink farms; the runner uploads plain |
| @@ -14,18 +14,22 @@ stages: [check] | |||
| 14 | check: | 14 | check: |
| 15 | stage: check | 15 | stage: check |
| 16 | image: nixos/nix:latest | 16 | image: nixos/nix:latest |
| 17 | + # A cold run has to vendor ~800 crates and compile the workspace; the default | ||
| 18 | + # hour is not enough for that even with the builder doing the compiling. | ||
| 19 | + timeout: 3h | ||
| 17 | variables: | 20 | variables: |
| 18 | # The flake is fetched from the checkout, so the runner needs the git tree | 21 | # The flake is fetched from the checkout, so the runner needs the git tree |
| 19 | # rather than a shallow single commit. | 22 | # rather than a shallow single commit. |
| 20 | GIT_DEPTH: "0" | 23 | GIT_DEPTH: "0" |
| 21 | before_script: | 24 | before_script: |
| 22 | # Compilation is offloaded to nixbuild.net; the runner evaluates, fetches | 25 | # Compilation is offloaded to nixbuild.net; the runner evaluates, fetches |
| 23 | - # and uploads. max-jobs stays small but NOT zero: at zero the runner refuses | 26 | + # and uploads. max-jobs must not be zero: at zero the runner refuses to |
| 24 | - # to build anything at all, which sends the fixed-output fetches (the rust | 27 | + # build anything at all, which sends the fixed-output fetches (the rust |
| 25 | - # toolchain tarballs) to nixbuild, where the sandbox has no network and they | 28 | + # toolchain tarballs, every crate source) to nixbuild, where the build |
| 26 | - # fail. Two local slots keep those fetches -- and the hundreds of trivial | 29 | + # sandbox has no network and they can only fail. Giving it nproc keeps |
| 27 | - # cargo-src/cargo-package derivations, each otherwise a 1.5s ssh round trip | 30 | + # those fetches and crane's hundreds of trivial cargo-src/cargo-package |
| 28 | - # -- on the runner, and everything expensive still lands on the builder. | 31 | + # derivations local and parallel -- each one costs a serial ~1.5s ssh |
| 32 | + # round trip if dispatched -- while the expensive builds still go remote. | ||
| 29 | - | | 33 | - | |
| 30 | set -eu | 34 | set -eu |
| 31 | mkdir -p ~/.ssh | 35 | mkdir -p ~/.ssh |
| @@ -38,7 +42,7 @@ check: | |||
| 38 | 'experimental-features = nix-command flakes' \ | 42 | 'experimental-features = nix-command flakes' \ |
| 39 | 'builders = ssh-ng://eu.nixbuild.net x86_64-linux - 16 1 big-parallel,benchmark' \ | 43 | 'builders = ssh-ng://eu.nixbuild.net x86_64-linux - 16 1 big-parallel,benchmark' \ |
| 40 | 'builders-use-substitutes = true' \ | 44 | 'builders-use-substitutes = true' \ |
| 41 | - 'max-jobs = 2' >> /etc/nix/nix.conf | 45 | + "max-jobs = $(nproc)" >> /etc/nix/nix.conf |
| 42 | script: | 46 | script: |
| 43 | - nix flake check -L | 47 | - nix flake check -L |
| 44 | # The store paths are read-only symlink farms; the runner uploads plain | 48 | # The store paths are read-only symlink farms; the runner uploads plain |