-
Notifications
You must be signed in to change notification settings - Fork 0
fix(ci): free more disk space and add nix fallback for cache mismatches #1929
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -67,7 +67,7 @@ | |
| ARG USER_UID=1001 | ||
| ARG USER_GID=$USER_UID | ||
| ARG COMMIT_SHA=main | ||
| ARG GITHUB_TOKEN | ||
|
Check warning on line 70 in Dockerfile
|
||
| ARG GITHUB_PR | ||
| ENV GITHUB_PR=${GITHUB_PR} | ||
|
|
||
|
|
@@ -102,6 +102,7 @@ | |
| echo "experimental-features = nix-command flakes" >> /etc/nix/nix.conf && \ | ||
| echo "filter-syscalls = false" >> /etc/nix/nix.conf && \ | ||
| echo "sandbox = true" >> /etc/nix/nix.conf && \ | ||
| echo "fallback = true" >> /etc/nix/nix.conf && \ | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Image-level fallback affects downstream consumers: Adding |
||
| if [ -n "$GITHUB_TOKEN" ]; then \ | ||
| echo "access-tokens = github.com=$GITHUB_TOKEN" >> /etc/nix/nix.conf ; \ | ||
| fi | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -78,7 +78,7 @@ NIX_USERNAME := $(shell \ | |
| echo "$(shell whoami)"; \ | ||
| fi) | ||
| NIX_ENV := $(shell . ~/.nix-profile/etc/profile.d/nix.sh 2>/dev/null || . /nix/var/nix/profiles/default/etc/profile.d/nix-daemon.sh 2>/dev/null || command -v nix >/dev/null 2>&1 || echo "not_found") | ||
| NIX_FLAGS := --extra-experimental-features 'flakes nix-command' --no-pure-eval --impure | ||
| NIX_FLAGS := --extra-experimental-features 'flakes nix-command' --no-pure-eval --impure --fallback | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Adding It is safer to enable
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
NIX_FLAGS := --extra-experimental-features 'flakes nix-command' --no-pure-eval --impure
ifneq ($(filter true,$(CI) $(IN_DOCKER)),)
NIX_FLAGS += --fallback
endifThis keeps the CI-resilience benefit while preserving fast-failure semantics locally. |
||
| # Only add cache options when user is trusted or on Darwin/CI (avoids "ignoring untrusted substituter" warnings) | ||
| ifeq ($(OS),Darwin) | ||
| NIX_FLAGS += --option substituters "$(NIX_SUBSTITUTERS)" --option trusted-public-keys "$(NIX_TRUSTED_KEYS)" | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Removing swap increases OOM risk under the new fallback behavior:
swap-storage: truedeletes the runner's swap file. Combined with the newfallback = true(ine2e.ymlextra_nix_config,Dockerfilenix.conf, and--fallbackin the Makefile), heavyweight derivations that would previously be fetched from a substituter may now build from source and spike RSS. Without swap, a memory spike turns directly into an OOM kill — especially on the arm64 builder (ubuntu-24.04-arm) which has less headroom thanubuntu-latest. Note this matches the previous default (swap-storagedefaults totruein this action), so the explicit value isn't a behavior change on its own — it's only worth surfacing because the fallback change makes from-source builds materially more common.