Sync uv env on head node before sbatch, verify offline on compute node - #107
Open
tabedzki wants to merge 1 commit into
Open
Sync uv env on head node before sbatch, verify offline on compute node#107tabedzki wants to merge 1 commit into
tabedzki wants to merge 1 commit into
Conversation
…te node Compute nodes on spock have no network access, so `uv sync` cannot run there. Add `prefetch_uv_env` to activate the U19-pipeline_python_env3 conda env and run `uv sync` for the processing repo on the head node before sbatch is invoked, and add a `uv sync --frozen --offline` check in the generated SLURM script (generate_slurm_spock) that fails the job immediately if the compute-node environment doesn't match what was just synced. Assisted-by: ClaudeCode:claude-sonnet-5
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
🤖 AI text below 🤖
Summary
uv syncfor the ephys processing repo (BrainCogsEphysSorters) must happen on the head/login node beforesbatchsubmits the job.prefetch_uv_env()inslurm_creator.py, called fromrecording_process_handler.pyright beforegenerate_slurm_file/queue_slurm_file: activates theU19-pipeline_python_env3conda env,cds to the processing repo, and runs plainuv sync(no--frozen/--upgrade— it's allowed to update the env/lockfile to matchpyproject.toml, but won't force unrelated upgrades). Runs via the same SSH-vs-local branching (is_this_spock()) already used byqueue_slurm_file. On failure, the recording process is markedERROR_STATUSand returns beforesbatchis ever invoked.uv sync --frozen --offlineverification step togenerate_slurm_spock()(the SLURM template actually used for spock jobs — confirmedgenerate_slurm_spockmk2_ephysis dead code, never called), right afterconda activateand before the job'spythoncall. Since compute nodes have no network, this only succeeds if the head-node sync already matched; on any mismatch it exits non-zero immediately so the job shows FAILED rather than silently running with a stale/incomplete environment.conda activateis deliberately kept on both the head node and compute node (not replaced by uv) since conda can install GPU/binary dependencies uv/pip can't provide.Test plan
python3 -m py_compileon both changed filesgenerate_slurm_spock()emitsuv sync --frozen --offlinebetweenconda activateandpython -u ${process_script_path}prefetch_uv_envbuilds the expectedssh ...command and the localbash -c ...fallback when already on spocksbatch, and the compute-node log shows no mismatchpyproject.tomlwithout a head-node sync) and confirm the SLURM job fails fast with the mismatch message in its log🤖 Generated with Claude Code