From 59771f91c4dfb92ea155693b6e19cf3070b00b9b Mon Sep 17 00:00:00 2001 From: mwiegand Date: Sat, 9 May 2026 13:11:19 +0200 Subject: [PATCH] fix(deploy): drop deleted l4d2host.fs from pyproject + use nproc --all MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Two bugs surfaced by the previous deploy attempt: 1. l4d2host/pyproject.toml still listed `l4d2host.fs` in the explicit packages= list. After deleting the fs/ package, pip install -e fails with "package directory './fs' does not exist". 2. The CPU-isolation deploy step uses `nproc` to detect host core count, but `nproc` honors Cpus_allowed of the calling shell. On a host that already has the cpuset drop-ins applied (system.slice/user.slice → AllowedCPUs=0), the SSH login lands constrained to one core and `nproc` returns 1 — making subsequent deploys think they're on a single-core box and skip the cpuset writes entirely. `nproc --all` reports installed processors regardless of affinity, which is what the deploy actually wants. Co-Authored-By: Claude Opus 4.7 (1M context) --- deploy/deploy-test-server.sh | 8 +++++++- l4d2host/pyproject.toml | 2 +- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/deploy/deploy-test-server.sh b/deploy/deploy-test-server.sh index ca80751..ff92dca 100755 --- a/deploy/deploy-test-server.sh +++ b/deploy/deploy-test-server.sh @@ -142,7 +142,13 @@ $sudo_cmd cp /opt/left4me/deploy/files/usr/local/lib/systemd/system/l4d2-build.s # CPU isolation via cgroup-v2 AllowedCPUs= drop-ins. Pin everything that # isn't a live game server to core 0; give game servers cores 1..N-1. # See docs/superpowers/specs/2026-05-09-l4d2-cpu-isolation-design.md. -NPROC=$(nproc) +# `nproc --all` reports installed processors regardless of the calling +# shell's CPU affinity. Plain `nproc` honors Cpus_allowed of the calling +# process, so on a host that already has the cpuset drop-ins applied +# (system.slice → AllowedCPUs=0), the SSH login lands in user.slice with +# AllowedCPUs=0 and `nproc` would return 1 — making subsequent deploys +# wrongly think they're on a single-core box and skip CPU isolation. +NPROC=$(nproc --all) SYSTEM_CPUS=${LEFT4ME_SYSTEM_CPUS:-0} if [ "${LEFT4ME_GAME_CPUS+x}" = x ]; then GAME_CPUS=$LEFT4ME_GAME_CPUS diff --git a/l4d2host/pyproject.toml b/l4d2host/pyproject.toml index c12b4a0..574cbea 100644 --- a/l4d2host/pyproject.toml +++ b/l4d2host/pyproject.toml @@ -17,7 +17,7 @@ dependencies = [ l4d2ctl = "l4d2host.cli:app" [tool.setuptools] -packages = ["l4d2host", "l4d2host.fs"] +packages = ["l4d2host"] [tool.setuptools.package-dir] l4d2host = "."