fix(deploy): drop deleted l4d2host.fs from pyproject + use nproc --all

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) <noreply@anthropic.com>
This commit is contained in:
mwiegand 2026-05-09 13:11:19 +02:00
parent ff6ce7b091
commit 59771f91c4
No known key found for this signature in database
2 changed files with 8 additions and 2 deletions

View file

@ -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 # 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. # 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. # 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} SYSTEM_CPUS=${LEFT4ME_SYSTEM_CPUS:-0}
if [ "${LEFT4ME_GAME_CPUS+x}" = x ]; then if [ "${LEFT4ME_GAME_CPUS+x}" = x ]; then
GAME_CPUS=$LEFT4ME_GAME_CPUS GAME_CPUS=$LEFT4ME_GAME_CPUS

View file

@ -17,7 +17,7 @@ dependencies = [
l4d2ctl = "l4d2host.cli:app" l4d2ctl = "l4d2host.cli:app"
[tool.setuptools] [tool.setuptools]
packages = ["l4d2host", "l4d2host.fs"] packages = ["l4d2host"]
[tool.setuptools.package-dir] [tool.setuptools.package-dir]
l4d2host = "." l4d2host = "."