Architecture for Contributors
The CLI is intentionally thin. Most behavior lives in the library crate so the binary, integration tests, and generated rustdoc all describe the same pipeline.
Module map
spec: parse, interpolate, and validate the supported Compose subsetplanner: normalize the parsed spec into a deterministic planpreflight: check login-node prerequisites and cluster policy issuesprepare: import base images and rebuild prepared runtime artifactsrender: generate the finalsbatchscript and service launch commandsjob: track submissions, logs, metrics, status, and artifact exportcache: persist cache manifests for imported and prepared imagesinit: expose the shipped example templates forhpc-compose init
Execution flow
ComposeSpec::loadparses YAML, validates supported keys, interpolates variables, and applies semantic validation.planner::build_planresolves paths, command shapes, dependencies, and prepare blocks into a normalized plan.prepare::build_runtime_plancomputes concrete cache artifact locations.preflight::runchecks cluster prerequisites before submission.prepare::prepare_runtime_planimports or rebuilds artifacts when needed.render::render_scriptemits the batch script consumed bysbatch.jobpersists tracked metadata under.hpc-compose/and powersstatus,stats,logs,cancel, and artifact export.
Contributor commands
cargo test
cargo test --test cli
cargo doc --no-deps
mdbook build docs
Documentation split
- Use this mdBook for user-facing workflows, examples, and reference material.
- Use rustdoc for contributor-facing internals and the library module map.
- Keep README short and point readers into the book instead of duplicating long-form guidance.