Skip to content

feat(slurm): local-disk tiering for salloc targets; retire the all-on-/local layout - #11

Merged
ligon merged 1 commit into
mainfrom
feat/local-tier-unconfined
Sep 9, 2026
Merged

feat(slurm): local-disk tiering for salloc targets; retire the all-on-/local layout#11
ligon merged 1 commit into
mainfrom
feat/local-tier-unconfined

Conversation

@ligon

@ligon ligon commented Sep 9, 2026

Copy link
Copy Markdown
Owner

Second half of step (2) in docs/local-disk-tiering.org (PR B). slurm.local_disk / --local-disk / --local-disk-root now mean the same on salloc targets as on confined ones: mirror root stays shared, the agent works in <root>/job<ID>/mirrors/<name> on the node, published by the post-commit hook and snapshotted by the timer.

Changes. _build_executor resolves local disk before allocation and hands the root to _ensure_slurm_node_start_slurm_timer (snapshot dir = the clone's literal path). remote_mirror_root is always the shared root; the /local/mirrors branch, node-changed stale-root logic, and compute-node scaffolding routing are removed. launch_agent (remote, unconfined) stages and runs the same prepare script the confined batch body uses (_prepare_local_tier), then starts tmux with cwd = the clone and the cache exports prepended. No more dead-job --nodelist affinity (explicit --node still works). Timer is per-mirror (slurm-timer-<name>.sh) and retires its predecessor with pkill -f '[s]lurm-timer-<name>.sh' — every attach/pull/status restarted it and they piled up. A session still recording a /local/mirrors root from the retired layout gets one warning naming that node (commits there were never published).

Not verified here: a real salloc launch — this session runs inside a confined job. The prepare script and timer are the files already smoke-tested on n0036.savio4 under PR #10. First real run: sucoder --local-disk -T savio-node collaborate <mirror>, then check ~/.cache/sucoder/ on the node for local-tier-<name>.sh and slurm-deadline-<name>.warn, and git -C ~/mirrors/<name> show-ref refs/sucoder/wip/<name> after ten minutes of dirty work.

Known gap (step 3): _maybe_run_poetry_auto_install / _maybe_suggest_mcp_servers still act on the shared mirror path, not the clone.

Tests. 716 passed CI-style; mypy unchanged. The two test_remote tests that reimplemented the node-changed discard logic inline are removed with it.

🤖 Generated with Claude Code

https://claude.ai/code/session_01StcQgXQDE4F6eJer1sEXRb

…-/local layout

Second half of step (2) in docs/local-disk-tiering.org.  slurm.local_disk
(and --local-disk / --local-disk-root) now mean the same thing on an
unconfined (salloc) target as on a confined one: the mirror root stays on
the shared filesystem and the agent works in a clone under
<root>/job<ID>/mirrors/<token> on the compute node, published back by the
post-commit hook and snapshotted by the deadline timer.

- cli._build_executor resolves local disk BEFORE _ensure_slurm_node and
  passes the root down so _start_slurm_timer renders the clone's literal
  path as the timer's snapshot dir (snapshot_wip skips it until the clone
  exists).  remote_mirror_root is always the shared root; the
  /local/mirrors branch, the node-changed stale-root logic, and the
  compute-node scaffolding routing are gone.  local_disk_root goes on the
  executor for both modes.
- mirror.launch_agent (remote, unconfined) stages and runs the same
  prepare script the confined batch body uses, via a new
  _prepare_local_tier helper, then starts tmux with cwd = the clone and
  the cache exports prepended to the window command.  A non-zero prepare
  exit raises MirrorError carrying the script's SUCODER: lines.
- _ensure_slurm_node no longer carries a dead job's node as --nodelist
  affinity (the only reason was data on that node's /local); explicit
  --node still works.  The "unpulled work may be orphaned" fallback
  message is gone with it.
- _start_slurm_timer writes a per-mirror slurm-timer-<token>.sh and
  pkill -f '[s]lurm-timer-<token>.sh' before nohup, so the timer that
  every attach/pull/status restarts no longer piles up.
- A session that still records a /local/mirrors root from the retired
  layout gets one warning naming the root and node: commits made there
  were never published to the shared mirror, so push them from that node
  before trusting `sucoder pull`.  The session then records the shared
  root.
- _forget_allocation drops its /local special case; --local-disk help,
  session.py, and stale comments updated.  README, config.example.yaml,
  connection-faq.org, and the design note's status updated.

Not verified here: a real salloc launch (this session is inside a
confined job).  The prepare script and timer are the files the confined
smoke test already ran on n0036.savio4.

Tests: unconfined launch clones then launches in the clone (staged file,
`bash <path>` before tmux, cwd, exports, exec bash -l kept); prepare
failure raises; launch without tiering unchanged; _build_executor
unconfined tiering kwargs and allocation kwargs; retired-layout warning
once with the old node; _start_slurm_timer snapshot dir + per-mirror
file + pkill.  The two test_remote tests that reimplemented the
node-changed discard logic inline are removed with that logic.  716
passed CI-style; mypy unchanged.

Impact analysis by hand (gitnexus cannot load here, libssl.so.3):
_ensure_slurm_node <- _build_executor (+ test spy); _start_slurm_timer <-
_ensure_slurm_node (+ guard tests); _forget_allocation local to release;
launch_agent's remote branch <- cli collaborate/renew via _build_manager.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01StcQgXQDE4F6eJer1sEXRb
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant