openjd-sessions 0.1.0

Open Job Description sessions — local job execution runtime
Documentation

openjd-sessions

crates.io docs.rs license

Local session runtime for Open Job Description (OpenJD) jobs — the Rust counterpart of the Python openjd-sessions library. Part of the openjd-rs workspace.

What this crate provides

  • Session lifecycle (Session, SessionConfig) — enter environments, run task actions, tear down in the correct order.
  • Subprocess management — async (tokio) process spawning, streaming I/O, signal handling (SIGTERM/SIGKILL), and whole-process-tree teardown.
  • Action-message filter — real-time parsing, redaction, and annotation of openjd_* messages emitted on stdout/stderr.
  • Cross-user execution — running subprocesses as a different OS user on Linux/macOS (via sudo) and on Windows (via a logon-based helper binary), with an embedded helper built by build.rs and baked into the library.
  • Embedded files — staging embeddedFiles entries to disk with the right permissions.
  • TempDir — per-session scratch space with safe cleanup on all platforms.

Platform support

  • Linux — primary target. Cross-user execution requires sudo.
  • macOS — supported; no cross-user support.
  • Windows — supported, including cross-user execution via the embedded helper (logon-token based, mirroring the Python reference implementation).

Minimum supported Rust version

Rust 1.92. Enforced in CI.

Quick example

Running a task action from a decoded job template:

use openjd_sessions::{Session, SessionConfig};
use std::sync::Arc;

# async fn run() -> Result<(), Box<dyn std::error::Error>> {
// Construct a SessionConfig (normally derived from a job template +
// task parameters via openjd-model — see the `openjd-rs` CLI for a full
// end-to-end example).
let config: SessionConfig = /* ... */ unimplemented!();

let session = Session::new(config).await?;
// Enter environments, run actions, collect results...
# Ok(()) }

The full end-to-end integration — parsing a template, instantiating a job, and running it locally — lives in the openjd-cli crate.

See the crate documentation on docs.rs for the session state machine, action lifecycle, and the embedded-files staging API.

Relationship to other crates

  • Depends on openjd-model for job-template types.
  • Depends on openjd-expr for expression evaluation and path mapping (re-exported at openjd_sessions::path_mapping).

Versioning

This crate follows Semantic Versioning. While the major version is 0.x, the public API may have breaking changes in minor version bumps, in keeping with Cargo's pre-1.0 semver rules. Each crate in the openjd-rs workspace is versioned independently.

License

Licensed under either of

at your option.

Contribution

Unless you explicitly state otherwise, any contribution intentionally submitted for inclusion in the work by you, as defined in the Apache-2.0 license, shall be dual licensed as above, without any additional terms or conditions.

Security

See https://aws.amazon.com/security/vulnerability-reporting/ or email AWS Security to report a potential security issue. Please do not create a public GitHub issue.