Getting Started¶
Installation¶
The PyPI distribution name is molcrafts-molq; the import name is molq.
For local development:
First Submitor¶
Submitor is the single entry point for job submission and job management.
Start with the local backend so you can validate your workflow without a cluster.
The first argument is a cluster namespace. It scopes listings and reconciliation.
Submit a Job¶
Every job uses exactly one command form: argv, command, or script.
job = local.submit(argv=["echo", "hello from molq"])
print(job.job_id)
print(job.status()) # cached state, no scheduler I/O
Wait for Completion¶
JobHandle.wait() blocks until the job reaches a terminal state and returns an immutable JobRecord.
Add Typed Resources¶
from molq import Duration, JobResources, Memory, Submitor
local = Submitor("devbox", "local")
job = local.submit(
argv=["python", "experiment.py"],
resources=JobResources(
cpu_count=4,
memory=Memory.gb(8),
time_limit=Duration.hours(2),
),
)
Resource values are typed objects, not raw scheduler strings:
Use a Script¶
Inline scripts are useful for multi-step workflows:
from molq import Script
job = local.submit(
script=Script.inline("""
cd /workspace
python preprocess.py
python train.py
""")
)
You can also submit an existing file:
CLI Basics¶
molq submit local echo "hello"
molq list local
molq status <job-id> local
molq watch <job-id> local
molq logs <job-id> local --stream stdout
The monitor command opens a full-screen dashboard across all clusters:
Next Steps¶
- Schedulers for backend-specific details
- Monitoring for lifecycle and dashboard behavior
- API Reference for the exported surface
- CLI Reference for command syntax