Skip to content

feat(slurm): uv env prefetch + conda→uv for ephys jobs#97

Open
tabedzki wants to merge 1 commit into
masterfrom
feat/uv-prefetch-ephys-slurm
Open

feat(slurm): uv env prefetch + conda→uv for ephys jobs#97
tabedzki wants to merge 1 commit into
masterfrom
feat/uv-prefetch-ephys-slurm

Conversation

@tabedzki

Copy link
Copy Markdown
Contributor

🤖 AI text below 🤖

Summary

Wires DREDge/uv support into the orchestration layer. Companion to BrainCOGS/BrainCogsEphysSorters#5 (DREDge motion correction) and BrainCOGS/BrainCogsEphysSorters#4.

Compute nodes have no network, so all packages must be present before sbatch. The submitter already SSHes to the head node, so we sync the uv environment there first, then the job runs fully offline.

Changes (u19_pipeline/automatic_job/slurm_creator.py)

  • prefetch_uv_env() — on the head node (which has network), runs uv python install 3.14 && uv sync --locked before sbatch, reusing the existing ssh connection and mirroring the on-spock local-run branch. Raises so a dependency problem surfaces at submit time rather than minutes later on a compute node. Gated to the BrainCogsEphysSorters repo — imaging is untouched.
  • Dispatch ephys (process_repository == BrainCogsEphysSorters) to the previously-dead generate_slurm_spockmk2_ephys; imaging spock keeps generate_slurm_spock on conda.
  • generate_slurm_spockmk2_ephys — conda replaced with uv sync --frozen --offline + uv run --frozen --offline; module load matlab kept for the KS2/KS3 shell-outs; added --cpus-per-task=8 (DREDge peak detection is the CPU-parallel bottleneck) and --time=16:00:00.
  • Bug fix: source ~/.bashrc was concatenated onto the first #SBATCH line and silently swallowed it; moved into the script body after the directives.

Notes

UV_CACHE_DIR is intentionally left unset — uv defaults to ~/.cache/uv on the mounted \$HOME, and honors the env var if the account sets one later (e.g. /scratch).

Closes #94
Closes #54
Relates to #53 (uv migration — this covers the Automation Pipeline / ephys slice)
Relates to BrainCOGS/BrainCogsEphysSorters#5, BrainCOGS/BrainCogsEphysSorters#4

🤖 Generated with Claude Code

…ephys generator

Compute nodes have no network, so packages must be present before sbatch. The
submitter already SSHes to the head node, so sync the uv env there first:

- prefetch_uv_env(): on the head node (which has network), run
  `uv python install 3.14 && uv sync --locked` before sbatch, reusing the
  existing ssh connection and mirroring the on-spock local-run branch. Raises so
  a dependency problem surfaces at submit time, not minutes later on a node.
  Gated to the BrainCogsEphysSorters repo; imaging is untouched.

- Dispatch ephys (process_repository == BrainCogsEphysSorters) to the previously
  dead generate_slurm_spockmk2_ephys; imaging spock keeps generate_slurm_spock
  on conda.

- generate_slurm_spockmk2_ephys: replace conda with
  `uv sync --frozen --offline` + `uv run --frozen --offline`; keep
  `module load matlab` for the KS2/KS3 shell-outs; add --cpus-per-task=8 (DREDge
  peak detection is the CPU-parallel bottleneck) and --time=16:00:00. Also fix a
  pre-existing bug where `source ~/.bashrc` was concatenated onto the first
  #SBATCH line and swallowed it.

Companion to BrainCOGS/BrainCogsEphysSorters#5 (DREDge) and the uv migration.

Closes #94
Closes #54
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.

Enable DREDge preprocessing via DataJoint param inserts (no code change) switch to uv from conda

1 participant