Unified job queue for local execution and HPC schedulers
Project description
molq
Unified job queue for Python workloads that need the same submission API on a laptop, workstation, or HPC cluster.
Quick Start
pip install molcrafts-molq
from molq import Duration, JobResources, Memory, Submitor
local = Submitor("devbox", "local")
job = local.submit(
argv=["python", "train.py"],
resources=JobResources(
cpu_count=4,
memory=Memory.gb(8),
time_limit=Duration.hours(2),
),
)
record = job.wait()
assert record.state.value == "succeeded"
Features
- One
SubmitorAPI forlocal,slurm,pbs, andlsf - Typed submission inputs with
Memory,Duration,Script,JobResources,JobScheduling, andJobExecution - SQLite-backed persistence with WAL mode and UUID job identities
- Reconciliation and blocking waits through
JobReconcilerandJobMonitor - First-class retry lineage with persisted attempt history
- Molq job-id dependencies and inspectable dependency metadata
- Profiles from
~/.molq/config.tomlplus reusable defaults - Cleanup and lightweight daemon workflows for retention and reconciliation
- Event hooks through
EventBus - Rich CLI for
submit,list,status,watch,logs,history,inspect,cleanup,daemon,monitor, andcancel - Default stdout/stderr capture for every submitted job, stored under the submission working directory unless overridden
Retry and Dependency Example
from molq import RetryBackoff, RetryPolicy, Submitor
slurm = Submitor("hpc", "slurm")
train = slurm.submit(
argv=["python", "train.py"],
retry=RetryPolicy(
max_attempts=3,
backoff=RetryBackoff(initial_seconds=10, maximum_seconds=60),
),
)
eval_job = slurm.submit(
argv=["python", "eval.py"],
after_success=[train.job_id],
)
Profile Example
~/.molq/config.toml
[profiles.gpu]
scheduler = "slurm"
cluster_name = "hpc"
[profiles.gpu.defaults.resources]
cpu_count = 8
memory = "34359738368"
[profiles.gpu.defaults.scheduling]
queue = "gpu"
[profiles.gpu.retry]
max_attempts = 3
CLI usage:
molq submit slurm --profile gpu python train.py
molq daemon slurm --profile gpu --once
molq cleanup slurm --profile gpu --dry-run
By default, ~/.molq stores global state such as config.toml and jobs.db.
Per-job artifacts such as generated scripts, manifests, and default logs are
written under the submission working directory at .molq/jobs/<job-id>/ unless
you override jobs_dir or explicit output paths.
Documentation
- Getting Started for installation and first-job examples
- Scheduler Guide for backend capabilities and scheduler options
- Monitoring Guide for lifecycle, polling, and dashboards
- API Reference for the exported classes and functions
- CLI Reference for command-line usage
Built by MolCrafts with love.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file molcrafts_molq-0.4.0.tar.gz.
File metadata
- Download URL: molcrafts_molq-0.4.0.tar.gz
- Upload date:
- Size: 107.9 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
59624e43b7beca96674356acec8c452dabe1b8069bc84a0ff410a1fef51fce70
|
|
| MD5 |
8e1b5301a8ba81875d9380c3a525a6ff
|
|
| BLAKE2b-256 |
37bc9a3a6ca97aaf01dac9b845638c13b86664d48ea6cd9c5adad2c153d3dcfa
|
Provenance
The following attestation bundles were made for molcrafts_molq-0.4.0.tar.gz:
Publisher:
release.yml on MolCrafts/molq
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
molcrafts_molq-0.4.0.tar.gz -
Subject digest:
59624e43b7beca96674356acec8c452dabe1b8069bc84a0ff410a1fef51fce70 - Sigstore transparency entry: 1437606890
- Sigstore integration time:
-
Permalink:
MolCrafts/molq@76de3b88ab206e172d0a291b876b014c5f4a500a -
Branch / Tag:
refs/tags/v0.4.0 - Owner: https://github.com/MolCrafts
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yml@76de3b88ab206e172d0a291b876b014c5f4a500a -
Trigger Event:
push
-
Statement type:
File details
Details for the file molcrafts_molq-0.4.0-py3-none-any.whl.
File metadata
- Download URL: molcrafts_molq-0.4.0-py3-none-any.whl
- Upload date:
- Size: 72.8 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
eac6bd4252c1690b02faf74b722f0192bb4b28b08d9d090155571f4cd90c03f3
|
|
| MD5 |
d0ece29f4e633484acf31a89cce6184c
|
|
| BLAKE2b-256 |
70212a5bc8cfed76047266477a18074373b892a445982d506ffb007ccca441d4
|
Provenance
The following attestation bundles were made for molcrafts_molq-0.4.0-py3-none-any.whl:
Publisher:
release.yml on MolCrafts/molq
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
molcrafts_molq-0.4.0-py3-none-any.whl -
Subject digest:
eac6bd4252c1690b02faf74b722f0192bb4b28b08d9d090155571f4cd90c03f3 - Sigstore transparency entry: 1437607109
- Sigstore integration time:
-
Permalink:
MolCrafts/molq@76de3b88ab206e172d0a291b876b014c5f4a500a -
Branch / Tag:
refs/tags/v0.4.0 - Owner: https://github.com/MolCrafts
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yml@76de3b88ab206e172d0a291b876b014c5f4a500a -
Trigger Event:
push
-
Statement type: