Skip to content

feat(hpc): hpc/sync submit passes --time, --no-requeue and env vars, logged - #72

Merged
Jammy2211 merged 2 commits into
mainfrom
feature/hpc-sync-submit-pass-through
Nov 20, 2026
Merged

Jammy2211 merged 2 commits into
mainfrom
feature/hpc-sync-submit-pass-through

Conversation

@Jammy2211

Copy link
Copy Markdown
Contributor

Summary

hpc/sync submit can now carry what a likelihood-lifecycle phase-4 timing resubmit needs, so it no longer has to go through a raw sbatch under PYAUTO_SKIP_SCHEDULER_GUARD=1 (414362, 414392, 414639–414641 all did):

  • allow-listed sbatch overrides --time, --no-requeue, --mem, --array (beside the existing --dependency), each checked against SLURM's own format, in --flag value or --flag=value form;
  • repeatable --env NAME=VALUE, exported (shell-quoted) in the login-node shell before sbatch, so sbatch's default --export=ALL carries it into the job;
  • --env refuses names that sbatch or the shell reads itself (SBATCH_*, SLURM_*, SALLOC_*, SRUN_*, LD_*, PATH, BASH_ENV, ENV, IFS), so the partition cannot be changed that way;
  • unknown options are refused instead of being read as the script name; the script name must be a plain file name;
  • every submit and cancel appends the AUTONOMY.md "Scheduler actions" JSON line {utc, user, campaign, action, args, exit} to campaign/<name>/actions.log on RAL (--campaign, else $CAMPAIGN, else adhoc) and prints it; if the log cannot be written nothing is done; exit is sbatch's own code;
  • --dry-run prints the exact remote command and touches nothing.
hpc/sync submit --cpu --campaign p4_validation --time 24:00:00 --no-requeue \
    --env XLA_FLAGS=--xla_cpu_multi_thread_eigen=false \
    submit_p4_validation_mge_hst_jax_cpu_dense

Closes #71. Mind prompt: active/hpc_sync_submit_pass_time_requeue_env.md (epic likelihood-lifecycle, phase 4).

effective level: supervised; merge mode: human /prm

Decision taken (decide-and-flag)

  • Generator untouched. The prompt says consider a default --no-requeue for p4_validation/timing submits and a generator-side eigen flag in scripts/misc/campaigns/validation_p4.py. This PR leaves the generator alone and makes both flags per-submit choices; a generator default changes every generated submit_p4_* file and its --check test, which belongs in its own task. Say if you want it folded in here instead.
  • Witness by stubs, not a live RAL submit. No real job was submitted from the shift (a run needs the human's go). The pytest drives the real script through a stub ssh (runs the remote line in local bash) and stub sbatch.

Validation

  • Tests (S1): python -m pytest -q -n 4 scripts/misc/test/test_hpc_sync_submit.py → 30 passed. ruff check . / ruff format --check . clean.
  • Witness: the phase-4 resubmit through the stub harness reaches sbatch as argv == ["--time=24:00:00", "--no-requeue", "submit_p4_validation_mge_hst_jax_cpu_dense"], XLA_FLAGS == "--xla_cpu_multi_thread_eigen=false", run from hpc/batch_cpu/, with one p4_validation actions.log line, exit: 0. scheduler_action_guard.check_command on the hpc/sync submit … line: ALLOWED with no skip variable; on the old raw ssh … sbatch … form: refused.
  • Targeted smoke (leg 2): pyauto-heart smoke --targeted — "no curated script references the change and no own workspace to import-check"; nothing to run.
  • Review (leg 3): independent Opus 5.5 review. The first pass returned FINDINGS: --env SBATCH_PARTITION=gpu got round the allow-list; a log append that failed after the pre-check went unreported; a failed log-line build slipped past set -e. All three are fixed in ec96d96, each with a test. The re-review returned CLEAN.
  • Heart (leg 4): GREEN at the door; the launch's YELLOW manifest-drift acknowledgement is the shift brief's.

🤖 Generated with Claude Code

Jammy2211 and others added 2 commits November 19, 2026 21:36
…logged

`hpc/sync submit` now takes allow-listed sbatch overrides (--time, --no-requeue,
--mem, --array, alongside --dependency) and repeatable --env NAME=VALUE, which
is exported in the login-node shell before sbatch so the job sees it. Every
submit and cancel appends the AUTONOMY.md "Scheduler actions" JSON line to
campaign/<name>/actions.log on RAL (--campaign, $CAMPAIGN, else adhoc),
refusing to act if the log cannot be written. --dry-run prints the remote
command. Unknown options are refused instead of being read as the script name.

A phase-4 timing resubmit (24 h, no requeue, XLA eigen workaround) is now one
hpc/sync command, with no PYAUTO_SKIP_SCHEDULER_GUARD exception.

Closes #71

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…d and log-line build

Review findings on #71: --env SBATCH_PARTITION=gpu would get round the
allow-list; an append failing after the pre-check left the submit unrecorded
with exit 0; a failed json_list inside the argument list escaped set -e.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@Jammy2211 Jammy2211 added the decision-taken Unattended worker took a decision the plan did not settle label Nov 19, 2026
@Jammy2211
Jammy2211 merged commit 22b2395 into main Nov 20, 2026
1 check passed
@Jammy2211
Jammy2211 deleted the feature/hpc-sync-submit-pass-through branch November 20, 2026 08:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

decision-taken Unattended worker took a decision the plan did not settle

Projects

None yet

Development

Successfully merging this pull request may close these issues.

feat(hpc): hpc/sync submit passes --time, --no-requeue and env vars, logged

1 participant