Skip to content

Add JobABC for submitting batch jobs#294

Open
TimothyWillard wants to merge 1 commit into
mainfrom
job-abc
Open

Add JobABC for submitting batch jobs#294
TimothyWillard wants to merge 1 commit into
mainfrom
job-abc

Conversation

@TimothyWillard
Copy link
Copy Markdown
Collaborator

Description

Added the JobABC module type that consumes CliCommands and then runs them in a seperate environment, with future use cases including HPC environments like on slurm. Also added jobs top level configuration key to correspond to this new module type and the ShellJob class that just launches the command in a subprocess as an example/simple way to introduce users to jobs.

Related issues

Closes #276. Closes #277. Closes #278.

Checklist

  • I have read through and understand the pull request process.
  • I ran successfully ran CI local via just ci.
  • I have updated the CHANGELOG.md or noted "no major changes" in my commit if the PR is small.

Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR introduces a new “job” module namespace to allow submitting CliCommands for execution via pluggable backends, adds a top-level jobs section to the configuration model, and includes a built-in ShellJob implementation plus tests.

Changes:

  • Added JobABC + JobHandle abstractions and module builder for the new job module namespace.
  • Added ShellJob backend to execute CLI commands via subprocess (detached or synchronous).
  • Extended ConfigurationModel with a new top-level jobs section and updated module loader namespace typing; added changelog + tests.

Reviewed changes

Copilot reviewed 7 out of 7 changed files in this pull request and generated 5 comments.

Show a summary per file
File Description
src/flepimop2/job/abc/__init__.py Introduces JobABC and JobHandle plus a build() helper for job backends.
src/flepimop2/job/shell/__init__.py Adds ShellJob backend that runs flepimop2 commands via subprocess.
src/flepimop2/configuration/_configuration.py Adds jobs as a top-level configuration section and integrates it into patching/ordering.
src/flepimop2/_utils/_module.py Extends the module namespace literal type to include "job".
tests/job/abc/test_job_handle.py Adds unit tests for JobHandle string formatting and metadata defaults.
tests/job/shell/test_shell_job.py Adds unit tests for ShellJob validation and submission behavior in detached/sync modes.
CHANGELOG.md Documents the addition of jobs infrastructure and ShellJob.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread tests/job/shell/test_shell_job.py Outdated
Comment thread tests/job/shell/test_shell_job.py Outdated
Comment on lines +198 to +200
def test_submit_synchronous_returns_single_handle() -> None:
"""Submit in synchronous mode should also return a one-element list."""
job = ShellJob.model_validate({"module": "flepimop2.job.shell", "detach": False})
Comment on lines 34 to 40
"engines",
"systems",
"backends",
"jobs",
"process",
"parameters",
"scenarios",
Comment thread CHANGELOG.md Outdated
Added the `JobABC` module type that consumes `CliCommand`s and then runs
them in a seperate environment, with future use cases including HPC
environments like on slurm. Also added `jobs` top level configuration
key to correspond to this new module type and the `ShellJob` class that
just launches the command in a subprocess as an example/simple way to
introduce users to jobs.

Closes #276. Closes #277. Closes #278.
@TimothyWillard
Copy link
Copy Markdown
Collaborator Author

TimothyWillard commented May 21, 2026

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

2 participants