[PR #1952] [MERGED] CI: Linux runners for the parity job (desktop), working only while nobody is at it #3887

Closed
opened 2026-11-03 04:13:01 +07:00 by bsakaguchi · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/horizon-rust/horizon/pull/1952
Author: @ludovic111
Created: 10/25/2026
Status: ✅ Merged
Merged: 10/26/2026
Merged by: @ludovic111

Base: main ← Head: ci/linux-runner


📝 Commits (7)

  • 8463325 CI: Linux runners for the parity job (desktop, ThinkPad), paused while a game runs
  • d81aa97 CI: the desktop runner works only while nobody is at the screen; desktop as a parity host
  • 0baf6cb CI: the desktop runner works while its screen is locked or untouched for 15 min
  • 4c78d1b Merge origin/main into ci/linux-runner
  • 9db6a0e CI: parity-main stays on the Mac; heat check on a median, boot as the first sign; nix roots fixed
  • 49bbdf8 CI: the desktop's CI slice gets half the threads
  • d782e45 docs: the desktop's CI slice gets half the threads

📊 Changes

10 files changed (+648 additions, -13 deletions)

View changed files

📝 .github/workflows/nightly.yml (+2 -1)
📝 .github/workflows/parity-main.yml (+3 -1)
📝 docs/parity-workflow.md (+1 -1)
📝 docs/release-flow.md (+27 -4)
➕ tests/test_runner_pause.py (+93 -0)
➕ tools/ci/linux-runner.sh (+213 -0)
📝 tools/ci/runner-env.sh (+29 -3)
➕ tools/ci/runner_pause.py (+266 -0)
📝 tools/ci/vanilla-data.sh (+5 -3)
📝 tools/parity_hosts.json (+9 -0)

📄 Description

🤖 Opened by Ludovic's AI agent (Claude), not by Ludovic himself.

What

This adds a second kind of machine for the parity job: Linux (NixOS) runners, starting with the desktop. They work only while nobody uses the machine: its screen is locked or untouched for 15 minutes. That is Ludovic's rule from 2026-10-26, now the default.

  • tools/ci/runner-env.sh, tools/ci/vanilla-data.sh: Linux paths.

    • They find Python 3.13, the JDK that research-lock.json pins (the runner's own, the one on PATH, or nixpkgs' jdk<major>_headless) and sccache.
    • The prepare key falls back to sha256sum when shasum is missing.
  • tools/ci/linux-runner.sh install|status|uninstall: registers a runner (the gh token is piped, never printed) and installs it as a systemd user service in ~/.actions-runners/horizon, outside ~/code. The runner gets:

    • its own rustup and cargo homes, and nice 19;
    • horizon-ci.slice: CPU and I/O weight 20, half the threads (on all of them the CPU package reached 92–96 °C), memory capped at two thirds of the RAM;
    • CARGO_BUILD_JOBS and the harness slots capped at 8, because the desktop froze under ~7 cold builds on 2026-10-14;
    • the JDK, sccache and the ALSA/udev headers from nixpkgs, kept by GC roots;
    • its own screen (vscreen ci-horizon, or Xvfb plus Mesa where vscreen is missing), so nothing it starts reaches his screen;
    • NixOS fixes: the #!/bin/bash lines are rewritten and the runner is pointed at the nix-ld libraries.
  • tools/ci/runner_pause.py (service horizon-runner-pause) is the only thing that starts the runner. It pauses the CI when any of these holds:

    • keyboard, mouse or gamepad input in the last 60 s, read from /dev/input (only whether bytes came, never what);
    • an unlocked session with input in the last 15 min;
    • the CPU package at 90 °C or more (median of 5 readings);
    • a game running: Steam, gamescope, Wine, Proton or Minecraft processes, fleet-load's own detection, or a process outside the slice using 50 % or more of the GPU;
    • the file ~/.actions-runners/horizon/pause exists.

    It starts the runner again 5 minutes after the last such sign. A job already under way is throttled (2 threads, weight 1) and the runner stops after it; the sharding workers stop at once. Freezing the job instead would stop the runner's heartbeat, so GitHub would drop the job as lost.

  • tools/parity_hosts.json: a desktop host for sharding (--hosts desktop). It uses the runner's environment and data, refuses work while paused, and its harnesses go back to the calling machine when a pause starts. CI keeps PARITY_HOSTS=''.

  • nightly.yml and parity-main.yml are pinned to [self-hosted, horizon-game, macOS]. The audit compares with the previous night on one platform. A parity-main run (up to 240 min) slowed down on the desktop could time out, and its failures bisect and comment on merges.

  • Docs: release-flow "The desktop's runner", and the hosts section of parity-workflow.

State

  • The runner ludodesktop-horizon is installed. Until the trial is clean it has only the label ludodesktop-staging, so no PR job goes there. horizon-game gets added on the runner itself after a clean, identical trial: that is a runner setting, nothing in this PR.
  • Trial 2 (full run on the desktop, 343 harnesses, 8 at a time): 51.2 min of harness time, against ~80 min on the Mac.
    • The run was invalid: 114 failures came from a build-environment bug. PKG_CONFIG_PATH pointed at missing -dev links, so libudev was not found.
    • Fixed: nix_out now uses the store path that nix-build prints.
  • Trial 3 (full run, then PRs #1916, #1901 and #1900 compared with their Mac runs) is under way. Numbers will follow in a comment.
  • The ThinkPad gets no runner: 4 threads shared with the AI pool. It stays a 2-job parity host.

Tests

  • python3 -m unittest tests.test_runner_pause: 4 tests OK, all on a fake clock:
    • the runner starts 300 s after the last sign;
    • a game stops an idle runner;
    • a job under way is throttled and the runner stops when the job ends;
    • lock and idle cases.
  • shellcheck -S warning is clean. The public-tree check passed.
  • Live on the desktop:
    • A fake game (a process named wine64-preloader … fakegame.exe outside the slice) paused the runner at once; fleet-load saw it within 5 s.
    • The pause file throttled a running job at once.
    • Heat pauses: the median of 5 readings keeps 92–96 °C spikes at a median of 68 °C from pausing. With the slice at half the threads the median is 80 °C and the maximum 88 °C.
    • A restart of the watcher no longer throttles a running job.

Diff of .github/ and the changed CI scripts

diff --git a/.github/workflows/nightly.yml b/.github/workflows/nightly.yml
index 51f9e89cd..60bbbf057 100644
--- a/.github/workflows/nightly.yml
+++ b/.github/workflows/nightly.yml
@@ -29,7 +29,8 @@ env:
 
 jobs:
   audit:
-    runs-on: [self-hosted, horizon-game]
+    # The Mac mini's runners only: the audit compares with the previous one, so it stays on one platform.
+    runs-on: [self-hosted, horizon-game, macOS]
     timeout-minutes: 150
     steps:
       - name: 03:00 in Paris
diff --git a/.github/workflows/parity-main.yml b/.github/workflows/parity-main.yml
index 1ddfb24bb..1debcc694 100644
--- a/.github/workflows/parity-main.yml
+++ b/.github/workflows/parity-main.yml
@@ -23,7 +23,9 @@ env:
 
 jobs:
   parity-main:
-    runs-on: [self-hosted, horizon-game]
+    # The Mac mini's runners only: a desktop job slowed down because the maintainer came back could time out, and a
+    # failure here bisects and comments on merges.
+    runs-on: [self-hosted, horizon-game, macOS]
     timeout-minutes: 240  # a core-crate batch reruns ~300 harnesses (~60-90 min), a bisect a few rounds of the failures
     steps:
       - uses: actions/checkout@v4
diff --git a/tools/ci/runner-env.sh b/tools/ci/runner-env.sh
index 49158ac91..39828b7d7 100755
--- a/tools/ci/runner-env.sh
+++ b/tools/ci/runner-env.sh
@@ -1,7 +1,8 @@
 #!/usr/bin/env bash
-# The tools the vanilla harnesses need, on the self-hosted Mac mini runner (label horizon-game): its service
-# starts with a bare PATH. Python 3.13 and the JDK pinned by research-lock.json come from the machine, never
-# from a download. Writes them to $GITHUB_PATH and $GITHUB_ENV for the next steps.
+# The tools the vanilla harnesses need, on a self-hosted runner (label horizon-game): the Mac mini's, whose service
+# starts with a bare PATH, and the Linux ones (tools/ci/linux-runner.sh, NixOS). Python 3.13 and the JDK pinned by
+# research-lock.json come from the machine, never from a download. Writes them to $GITHUB_PATH and $GITHUB_ENV for
+# the next steps.
 set -euo pipefail
 java_major=$(sed -n 's/.*"java_major": *\([0-9]*\).*/\1/p' research-lock.json | head -1)
 bin="$RUNNER_TEMP/horizon-bin"
@@ -17,5 +18,30 @@ if [ "$(uname)" = Darwin ]; then
   if [ -x /opt/homebrew/bin/sccache ]; then
     { echo "RUSTC_WRAPPER=/opt/homebrew/bin/sccache"; echo "CARGO_INCREMENTAL=0"; } >> "$GITHUB_ENV"
   fi
+else
+  python=$(command -v python3.13 || true)
+  [ -n "$python" ] || { echo "::error::no python3.13 on this runner"; exit 1; }
+  ln -sfn "$python" "$bin/python3"
+  ln -sfn "$python" "$bin/python"
+  # The JDK: the runner's JAVA_HOME (linux-runner.sh pins one), else the java on PATH, else nixpkgs' jdk<major>.
+  major_of() { "$1/bin/java" -version 2>&1 | sed -n 's/.*version "\([0-9]*\).*/\1/p' | head -1; }
+  java_home=${JAVA_HOME:-}
+  if [ -z "$java_home" ] || [ "$(major_of "$java_home")" != "$java_major" ]; then
+    java_home=""
+    if command -v java > /dev/null; then
+      candidate=$(dirname "$(dirname "$(readlink -f "$(command -v java)")")")
+      [ "$(major_of "$candidate")" = "$java_major" ] && java_home=$candidate
+    fi
+  fi
+  if [ -z "$java_home" ] && command -v nix-build > /dev/null; then
+    out=$(nix-build '<nixpkgs>' --no-out-link -A "jdk${java_major}_headless" 2>/dev/null || true)
+    [ -n "$out" ] && java_home=$out/lib/openjdk
+  fi
+  [ -n "$java_home" ] || { echo "::error::no JDK $java_major on this runner"; exit 1; }
+  { echo "$bin"; echo "$java_home/bin"; } >> "$GITHUB_PATH"
+  echo "JAVA_HOME=$java_home" >> "$GITHUB_ENV"
+  if sccache=$(command -v sccache); then
+    { echo "RUSTC_WRAPPER=$sccache"; echo "CARGO_INCREMENTAL=0"; } >> "$GITHUB_ENV"
+  fi
 fi
 echo "HORIZON_NO_AUDIO=1" >> "$GITHUB_ENV"
diff --git a/tools/ci/vanilla-data.sh b/tools/ci/vanilla-data.sh
index 5276c54e9..a7bd4a407 100755
--- a/tools/ci/vanilla-data.sh
+++ b/tools/ci/vanilla-data.sh
@@ -1,8 +1,9 @@
 #!/usr/bin/env bash
 # The vanilla data for this checkout on the self-hosted runner. Horizon never downloads the game: the runner
 # holds the maintainer's own copy, imported and decompiled once (HORIZON_SHARED_SOURCE, default
-# ~/code/horizon-parity/shared-local). It is cloned once into the runner's work folder ($RUNNER_WORKSPACE/
-# shared-local; APFS clones, so no second copy of the bytes), and .local/ links to it as in a parity worktree.
+# ~/code/horizon-parity/shared-local; tools/ci/linux-runner.sh sets it on Linux). It is cloned once into the runner's
+# work folder ($RUNNER_WORKSPACE/shared-local; APFS clones, or reflinks where the file system has them, so no second
+# copy of the bytes), and .local/ links to it as in a parity worktree.
 # .local/horizon-client and the exporter outputs beside it, what horizon-prepare makes, are prepared by this
 # checkout's own preparer once per preparer version (its sources, the exporters and research-lock.json), so a
 # change to the preparer is checked with what it prepares; the four newest preparations are kept.
@@ -31,7 +32,8 @@ for entry in "$shared"/*; do
 done
 
 # HORIZON_PREPARE_KEY: the same key, computed where the Git history is (tools/pr_ready.py on another machine).
-key=${HORIZON_PREPARE_KEY:-$(git ls-files -s crates/horizon-prepare mods/horizon/src/test/java research-lock.json | shasum -a 256 | cut -c1-16)}
+sha256() { if command -v shasum > /dev/null; then shasum -a 256; else sha256sum; fi; }
+key=${HORIZON_PREPARE_KEY:-$(git ls-files -s crates/horizon-prepare mods/horizon/src/test/java research-lock.json | sha256 | cut -c1-16)}
 prepared="$shared/prepared/$key"
 # Two runners share the vanilla data (~/.actions-runners/horizon-2/_work/horizon/shared-local links to the first
 # one's): one preparation at a time. A lock older than 30 minutes belongs to a job that died.
diff --git a/tools/parity_hosts.json b/tools/parity_hosts.json
index 0aa013a5b..f2ba65c68 100644
--- a/tools/parity_hosts.json
+++ b/tools/parity_hosts.json
@@ -11,6 +11,15 @@
    "jobs": 14,
    "exclude": {}
   },
+  "desktop": {
+   "ssh": "desktop",
+   "root": ".actions-runners/horizon/parity-host",
+   "shell": "systemd-run --user --scope --quiet --slice=horizon-ci.slice --unit=horizon-parity-worker-$$ bash -c",
+   "setup": "test ! -e ~/.actions-runners/horizon/paused && set -a && . ~/.actions-runners/horizon/.env && set +a && export PATH=$(cat ~/.actions-runners/horizon/.path) && eval \"$(vscreen env)\"",
+   "jobs": 8,
+   "nice": 19,
+   "note": "ludodesktop, the maintainer's own machine: only while nobody uses it (tools/ci/runner_pause.py: screen locked or untouched for 15 min, no game; a paused desktop refuses workers and stops the running ones, whose harnesses then run here); 8 jobs at most, in the CI runner's environment and slice"
+  },
   "thinkpad": {
    "ssh": "thinkpad",
    "root": "code/horizon-parity",

🤖 Generated with Claude Code


🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/horizon-rust/horizon/pull/1952 **Author:** [@ludovic111](https://github.com/ludovic111) **Created:** 10/25/2026 **Status:** ✅ Merged **Merged:** 10/26/2026 **Merged by:** [@ludovic111](https://github.com/ludovic111) **Base:** `main` ← **Head:** `ci/linux-runner` --- ### 📝 Commits (7) - [`8463325`](https://github.com/horizon-rust/horizon/commit/8463325648f90045f83808dd201c07bfad2a264f) CI: Linux runners for the parity job (desktop, ThinkPad), paused while a game runs - [`d81aa97`](https://github.com/horizon-rust/horizon/commit/d81aa97e842a753e231ae34b181bc1bd2654c589) CI: the desktop runner works only while nobody is at the screen; desktop as a parity host - [`0baf6cb`](https://github.com/horizon-rust/horizon/commit/0baf6cbd62e5dc053732354b5ebd356aae3ffd83) CI: the desktop runner works while its screen is locked or untouched for 15 min - [`4c78d1b`](https://github.com/horizon-rust/horizon/commit/4c78d1b4f8087c4051eeecbedefedbeb9f28bda5) Merge origin/main into ci/linux-runner - [`9db6a0e`](https://github.com/horizon-rust/horizon/commit/9db6a0ee48a6862df8e27fe0e5cb587a61c67e0f) CI: parity-main stays on the Mac; heat check on a median, boot as the first sign; nix roots fixed - [`49bbdf8`](https://github.com/horizon-rust/horizon/commit/49bbdf8954bdc8958bc6f8a2e7917bb8035f710c) CI: the desktop's CI slice gets half the threads - [`d782e45`](https://github.com/horizon-rust/horizon/commit/d782e455a41f21e79675347c4314c9e8e2bdb535) docs: the desktop's CI slice gets half the threads ### 📊 Changes **10 files changed** (+648 additions, -13 deletions) <details> <summary>View changed files</summary> 📝 `.github/workflows/nightly.yml` (+2 -1) 📝 `.github/workflows/parity-main.yml` (+3 -1) 📝 `docs/parity-workflow.md` (+1 -1) 📝 `docs/release-flow.md` (+27 -4) ➕ `tests/test_runner_pause.py` (+93 -0) ➕ `tools/ci/linux-runner.sh` (+213 -0) 📝 `tools/ci/runner-env.sh` (+29 -3) ➕ `tools/ci/runner_pause.py` (+266 -0) 📝 `tools/ci/vanilla-data.sh` (+5 -3) 📝 `tools/parity_hosts.json` (+9 -0) </details> ### 📄 Description > 🤖 Opened by Ludovic's AI agent (Claude), not by Ludovic himself. ## What This adds a second kind of machine for the `parity` job: Linux (NixOS) runners, starting with the desktop. They work only while nobody uses the machine: its screen is locked or untouched for 15 minutes. That is Ludovic's rule from 2026-10-26, now the default. - `tools/ci/runner-env.sh`, `tools/ci/vanilla-data.sh`: Linux paths. - They find Python 3.13, the JDK that `research-lock.json` pins (the runner's own, the one on PATH, or nixpkgs' `jdk<major>_headless`) and sccache. - The prepare key falls back to `sha256sum` when `shasum` is missing. - `tools/ci/linux-runner.sh install|status|uninstall`: registers a runner (the `gh` token is piped, never printed) and installs it as a systemd **user** service in `~/.actions-runners/horizon`, outside `~/code`. The runner gets: - its own rustup and cargo homes, and nice 19; - `horizon-ci.slice`: CPU and I/O weight 20, half the threads (on all of them the CPU package reached 92–96 °C), memory capped at two thirds of the RAM; - `CARGO_BUILD_JOBS` and the harness slots capped at 8, because the desktop froze under ~7 cold builds on 2026-10-14; - the JDK, sccache and the ALSA/udev headers from nixpkgs, kept by GC roots; - its own screen (`vscreen ci-horizon`, or Xvfb plus Mesa where vscreen is missing), so nothing it starts reaches his screen; - NixOS fixes: the `#!/bin/bash` lines are rewritten and the runner is pointed at the nix-ld libraries. - `tools/ci/runner_pause.py` (service `horizon-runner-pause`) is the only thing that starts the runner. It pauses the CI when any of these holds: - keyboard, mouse or gamepad input in the last 60 s, read from `/dev/input` (only whether bytes came, never what); - an unlocked session with input in the last 15 min; - the CPU package at 90 °C or more (median of 5 readings); - a game running: Steam, gamescope, Wine, Proton or Minecraft processes, fleet-load's own detection, or a process outside the slice using 50 % or more of the GPU; - the file `~/.actions-runners/horizon/pause` exists. It starts the runner again 5 minutes after the last such sign. A job already under way is throttled (2 threads, weight 1) and the runner stops after it; the sharding workers stop at once. Freezing the job instead would stop the runner's heartbeat, so GitHub would drop the job as lost. - `tools/parity_hosts.json`: a `desktop` host for sharding (`--hosts desktop`). It uses the runner's environment and data, refuses work while paused, and its harnesses go back to the calling machine when a pause starts. CI keeps `PARITY_HOSTS=''`. - `nightly.yml` and `parity-main.yml` are pinned to `[self-hosted, horizon-game, macOS]`. The audit compares with the previous night on one platform. A parity-main run (up to 240 min) slowed down on the desktop could time out, and its failures bisect and comment on merges. - Docs: release-flow "The desktop's runner", and the hosts section of parity-workflow. ## State - The runner `ludodesktop-horizon` is installed. Until the trial is clean it has only the label `ludodesktop-staging`, so no PR job goes there. `horizon-game` gets added on the runner itself after a clean, identical trial: that is a runner setting, nothing in this PR. - Trial 2 (full run on the desktop, 343 harnesses, 8 at a time): 51.2 min of harness time, against ~80 min on the Mac. - The run was invalid: 114 failures came from a build-environment bug. `PKG_CONFIG_PATH` pointed at missing `-dev` links, so libudev was not found. - Fixed: `nix_out` now uses the store path that nix-build prints. - Trial 3 (full run, then PRs #1916, #1901 and #1900 compared with their Mac runs) is under way. Numbers will follow in a comment. - The ThinkPad gets no runner: 4 threads shared with the AI pool. It stays a 2-job parity host. ## Tests - `python3 -m unittest tests.test_runner_pause`: 4 tests OK, all on a fake clock: - the runner starts 300 s after the last sign; - a game stops an idle runner; - a job under way is throttled and the runner stops when the job ends; - lock and idle cases. - `shellcheck -S warning` is clean. The public-tree check passed. - Live on the desktop: - A fake game (a process named `wine64-preloader … fakegame.exe` outside the slice) paused the runner at once; fleet-load saw it within 5 s. - The pause file throttled a running job at once. - Heat pauses: the median of 5 readings keeps 92–96 °C spikes at a median of 68 °C from pausing. With the slice at half the threads the median is 80 °C and the maximum 88 °C. - A restart of the watcher no longer throttles a running job. ## Diff of `.github/` and the changed CI scripts ```diff diff --git a/.github/workflows/nightly.yml b/.github/workflows/nightly.yml index 51f9e89cd..60bbbf057 100644 --- a/.github/workflows/nightly.yml +++ b/.github/workflows/nightly.yml @@ -29,7 +29,8 @@ env: jobs: audit: - runs-on: [self-hosted, horizon-game] + # The Mac mini's runners only: the audit compares with the previous one, so it stays on one platform. + runs-on: [self-hosted, horizon-game, macOS] timeout-minutes: 150 steps: - name: 03:00 in Paris diff --git a/.github/workflows/parity-main.yml b/.github/workflows/parity-main.yml index 1ddfb24bb..1debcc694 100644 --- a/.github/workflows/parity-main.yml +++ b/.github/workflows/parity-main.yml @@ -23,7 +23,9 @@ env: jobs: parity-main: - runs-on: [self-hosted, horizon-game] + # The Mac mini's runners only: a desktop job slowed down because the maintainer came back could time out, and a + # failure here bisects and comments on merges. + runs-on: [self-hosted, horizon-game, macOS] timeout-minutes: 240 # a core-crate batch reruns ~300 harnesses (~60-90 min), a bisect a few rounds of the failures steps: - uses: actions/checkout@v4 diff --git a/tools/ci/runner-env.sh b/tools/ci/runner-env.sh index 49158ac91..39828b7d7 100755 --- a/tools/ci/runner-env.sh +++ b/tools/ci/runner-env.sh @@ -1,7 +1,8 @@ #!/usr/bin/env bash -# The tools the vanilla harnesses need, on the self-hosted Mac mini runner (label horizon-game): its service -# starts with a bare PATH. Python 3.13 and the JDK pinned by research-lock.json come from the machine, never -# from a download. Writes them to $GITHUB_PATH and $GITHUB_ENV for the next steps. +# The tools the vanilla harnesses need, on a self-hosted runner (label horizon-game): the Mac mini's, whose service +# starts with a bare PATH, and the Linux ones (tools/ci/linux-runner.sh, NixOS). Python 3.13 and the JDK pinned by +# research-lock.json come from the machine, never from a download. Writes them to $GITHUB_PATH and $GITHUB_ENV for +# the next steps. set -euo pipefail java_major=$(sed -n 's/.*"java_major": *\([0-9]*\).*/\1/p' research-lock.json | head -1) bin="$RUNNER_TEMP/horizon-bin" @@ -17,5 +18,30 @@ if [ "$(uname)" = Darwin ]; then if [ -x /opt/homebrew/bin/sccache ]; then { echo "RUSTC_WRAPPER=/opt/homebrew/bin/sccache"; echo "CARGO_INCREMENTAL=0"; } >> "$GITHUB_ENV" fi +else + python=$(command -v python3.13 || true) + [ -n "$python" ] || { echo "::error::no python3.13 on this runner"; exit 1; } + ln -sfn "$python" "$bin/python3" + ln -sfn "$python" "$bin/python" + # The JDK: the runner's JAVA_HOME (linux-runner.sh pins one), else the java on PATH, else nixpkgs' jdk<major>. + major_of() { "$1/bin/java" -version 2>&1 | sed -n 's/.*version "\([0-9]*\).*/\1/p' | head -1; } + java_home=${JAVA_HOME:-} + if [ -z "$java_home" ] || [ "$(major_of "$java_home")" != "$java_major" ]; then + java_home="" + if command -v java > /dev/null; then + candidate=$(dirname "$(dirname "$(readlink -f "$(command -v java)")")") + [ "$(major_of "$candidate")" = "$java_major" ] && java_home=$candidate + fi + fi + if [ -z "$java_home" ] && command -v nix-build > /dev/null; then + out=$(nix-build '<nixpkgs>' --no-out-link -A "jdk${java_major}_headless" 2>/dev/null || true) + [ -n "$out" ] && java_home=$out/lib/openjdk + fi + [ -n "$java_home" ] || { echo "::error::no JDK $java_major on this runner"; exit 1; } + { echo "$bin"; echo "$java_home/bin"; } >> "$GITHUB_PATH" + echo "JAVA_HOME=$java_home" >> "$GITHUB_ENV" + if sccache=$(command -v sccache); then + { echo "RUSTC_WRAPPER=$sccache"; echo "CARGO_INCREMENTAL=0"; } >> "$GITHUB_ENV" + fi fi echo "HORIZON_NO_AUDIO=1" >> "$GITHUB_ENV" diff --git a/tools/ci/vanilla-data.sh b/tools/ci/vanilla-data.sh index 5276c54e9..a7bd4a407 100755 --- a/tools/ci/vanilla-data.sh +++ b/tools/ci/vanilla-data.sh @@ -1,8 +1,9 @@ #!/usr/bin/env bash # The vanilla data for this checkout on the self-hosted runner. Horizon never downloads the game: the runner # holds the maintainer's own copy, imported and decompiled once (HORIZON_SHARED_SOURCE, default -# ~/code/horizon-parity/shared-local). It is cloned once into the runner's work folder ($RUNNER_WORKSPACE/ -# shared-local; APFS clones, so no second copy of the bytes), and .local/ links to it as in a parity worktree. +# ~/code/horizon-parity/shared-local; tools/ci/linux-runner.sh sets it on Linux). It is cloned once into the runner's +# work folder ($RUNNER_WORKSPACE/shared-local; APFS clones, or reflinks where the file system has them, so no second +# copy of the bytes), and .local/ links to it as in a parity worktree. # .local/horizon-client and the exporter outputs beside it, what horizon-prepare makes, are prepared by this # checkout's own preparer once per preparer version (its sources, the exporters and research-lock.json), so a # change to the preparer is checked with what it prepares; the four newest preparations are kept. @@ -31,7 +32,8 @@ for entry in "$shared"/*; do done # HORIZON_PREPARE_KEY: the same key, computed where the Git history is (tools/pr_ready.py on another machine). -key=${HORIZON_PREPARE_KEY:-$(git ls-files -s crates/horizon-prepare mods/horizon/src/test/java research-lock.json | shasum -a 256 | cut -c1-16)} +sha256() { if command -v shasum > /dev/null; then shasum -a 256; else sha256sum; fi; } +key=${HORIZON_PREPARE_KEY:-$(git ls-files -s crates/horizon-prepare mods/horizon/src/test/java research-lock.json | sha256 | cut -c1-16)} prepared="$shared/prepared/$key" # Two runners share the vanilla data (~/.actions-runners/horizon-2/_work/horizon/shared-local links to the first # one's): one preparation at a time. A lock older than 30 minutes belongs to a job that died. diff --git a/tools/parity_hosts.json b/tools/parity_hosts.json index 0aa013a5b..f2ba65c68 100644 --- a/tools/parity_hosts.json +++ b/tools/parity_hosts.json @@ -11,6 +11,15 @@ "jobs": 14, "exclude": {} }, + "desktop": { + "ssh": "desktop", + "root": ".actions-runners/horizon/parity-host", + "shell": "systemd-run --user --scope --quiet --slice=horizon-ci.slice --unit=horizon-parity-worker-$$ bash -c", + "setup": "test ! -e ~/.actions-runners/horizon/paused && set -a && . ~/.actions-runners/horizon/.env && set +a && export PATH=$(cat ~/.actions-runners/horizon/.path) && eval \"$(vscreen env)\"", + "jobs": 8, + "nice": 19, + "note": "ludodesktop, the maintainer's own machine: only while nobody uses it (tools/ci/runner_pause.py: screen locked or untouched for 15 min, no game; a paused desktop refuses workers and stops the running ones, whose harnesses then run here); 8 jobs at most, in the CI runner's environment and slice" + }, "thinkpad": { "ssh": "thinkpad", "root": "code/horizon-parity", ``` 🤖 Generated with [Claude Code](https://claude.com/claude-code) --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
bsakaguchi 2026-11-03 04:13:01 +07:00
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
horizon-rust/horizon#3887
No description provided.