Skip to content

Allow SLURM runs from an installed released distribution - #23

Merged
florian6973 merged 1 commit into
mainfrom
slurm-installed-release
Nov 25, 2026
Merged

florian6973 merged 1 commit into
mainfrom
slurm-installed-release

Conversation

@florian6973

Copy link
Copy Markdown
Collaborator

Why

curiosity-meds run execution=slurm … (or any algorithm's runner) refuses an algorithm installed from PyPI: "SLURM requires an unchanged, clean committed algorithm checkout". Core identifies the code that runs by its Git commit, and an installed wheel has no .git. So users had to clone the algorithm instead of uv pip install meds-algorithm-<name>==<version>, or write their own sbatch around execution=local.

What

  • Planning: the plan's provenance also records the installed distribution providing the algorithm's package (distribution_provenance): {"name", "version", "editable"}, from importlib.metadata, or None when nothing installed provides it.
  • SLURM accepts either:
    • a clean committed checkout, as before, with the same checks, including the requirement that outputs be outside the checkout or Git-ignored;
    • a released, non-editable installed distribution.
  • Workers check before running their stage:
    • for a checkout, that the commit is unchanged and the tree clean, as before;
    • for an installed release, that the same distribution name and version are still installed in the interpreter that runs the job (which Submitit makes the submitting interpreter).
  • Still refused: an editable install outside a Git checkout (its source can change after submission), and code from no installed distribution.
  • ORCHESTRATION.md documents both options.

Tests

  • New: test_slurm_submits_an_installed_release_and_workers_check_its_version checks that
    • a plan with no checkout records the release, submits, and the stage runs;
    • a changed installed version makes the worker refuse;
    • an editable install is refused before any file is written.
  • test_slurm_refuses_dirty_or_unknown_checkout now pins "no installed distribution", so it can't depend on what is installed on the test machine.
  • WSL Ubuntu, Python 3.12: ruff check, ruff format --check and pytest -q (161 passed) are clean.
  • Real install: with meds-algorithm-curiosity[orchestration]==0.1.2 from PyPI and this branch, distribution_provenance("curiosity_meds.config") gives {'name': 'meds-algorithm-curiosity', 'version': '0.1.2', 'editable': False}. No actual SLURM cluster was used; Submitit submission is mocked as in the existing tests.

🤖 Generated with Claude Code

https://claude.ai/code/session_01NJQdbHt5icm1CgFVHsHTNx

execution=slurm required a clean committed Git checkout of the
algorithm, so an algorithm installed from PyPI (pip/uv install) could
only run locally. The plan now also records the installed distribution
providing the algorithm (name, version, editable). SLURM accepts either
a clean committed checkout (unchanged checks) or a released,
non-editable installed distribution; each worker checks that the same
name and version are still installed before running its stage. An
editable install outside a Git checkout is still refused, as its source
can change.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01NJQdbHt5icm1CgFVHsHTNx
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