#automation

peace_resources

Runtime resources for the peace automation framework

9 releases

new 0.0.10 Jun 3, 2023
0.0.9 Apr 12, 2023
0.0.8 Mar 25, 2023
0.0.6 Jan 20, 2023
0.0.2 Aug 3, 2022

#19 in #automation

Download history 45/week @ 2023-02-09 88/week @ 2023-02-16 65/week @ 2023-02-23 92/week @ 2023-03-02 16/week @ 2023-03-09 48/week @ 2023-03-16 63/week @ 2023-03-23 42/week @ 2023-03-30 34/week @ 2023-04-06 49/week @ 2023-04-13 7/week @ 2023-04-20 46/week @ 2023-04-27 39/week @ 2023-05-04 11/week @ 2023-05-11 22/week @ 2023-05-18 57/week @ 2023-05-25

133 downloads per month
Used in 22 crates (9 directly)

MIT/Apache

120KB
1.5K SLoC

πŸ•ŠοΈ peace – zero stress automation

Crates.io docs.rs CI Coverage Status

peace is a framework to build empathetic and forgiving software automation.

See:

  • peace.mk for the project vision.
  • Background for the motivation to create this framework.
  • Operations UX for a book about the dimensions considered during peace's design and development.

Guiding Principles

  • A joy to use.
  • Ergonomic API and guidance to do the right thing.
  • Understandable output.

Features

Symbol Meaning
🟒 Works well
🟑 Partial support
⚫ Planned
πŸ”΅ Compatible by design
🟣 Works, "fun idea"
  • 🟒 Idempotent: Multiple invocations result in the desired outcome.
  • 🟒 Clean: Every item creation is paired with how it is cleaned up.
  • 🟒 Understandable: Progress is shown at an understandable level of detail.
  • πŸ”΅ Understandable: Error reporting is compatible with miette.
  • 🟑 Interruptible: Execution can be interrupted.
  • 🟒 Resumable: Automation resumes where it was interrupted.
  • 🟒 Diffable: States and diffs are serialized as YAML.
  • 🟒 Efficient: Tasks are concurrently executed via fn_graph.
  • 🟒 Namespaced: Profile directories isolate environments from each other.
  • 🟒 Type Safe: Items and parameters are defined in code, not configuration.

Roadmap

  • 🟒 Define items to manage with automation.
  • 🟒 Define dependencies between items.
  • 🟒 Define "apply" logic.
  • 🟒 Define "clean up" logic.
  • 🟒 Discover current and desired states.
  • 🟒 Define diff calculation between states.
  • 🟒 Store and recall parameters across commands.
  • 🟒 Diff states between multiple profiles.
  • 🟒 Type-safe referential parameters (#94, [#119]) -- ability to specify usage of values generated during automation as parameters to subsequent items.
  • 🟑 Feature-gated incremental functionality.
  • 🟑 Off-the-shelf support for common items.
  • 🟑 Dry run.
  • 🟣 WASM support.
  • ⚫ Cancel-safe interruption via tokio-graceful-shutdown.
  • ⚫ Secure-by-design Support: Encrypted value storage, decrypted per execution / time based agent.
  • ⚫ Tutorial for writing a software lifecycle management tool.
  • ⚫ Built-in application execution methods -- CLI, web service.
  • ⚫ peace binary for configuration based workflows.
  • ⚫ Web based UI with interactive graph.
  • ⚫ Agent mode to run peace on servers (Web API invocation).

Further ideas:

  • Back up current state.
  • Restore previous state.
  • Telemetry / metrics logging for analysis.

Examples

Examples are run using --package instead of --example, as each example is organized as its own crate.

cargo run --package $example_name --all-features

# e.g.
cargo build --package download --all-features
cargo run -q --package download --all-features -- init https://ifconfig.me ip.json

for cmd in status desired diff ensure ensure diff clean clean diff
do
    printf "=== ${cmd} ===\n"
    cargo run -q --package download --all-features -- --format text $cmd
    printf '\n'
done

# Look at metadata that Peace has saved
find .peace -type f -exec bash -c 'echo \# {}; cat {}; echo' \;

# Clean up the metadata directory
rm -rf .peace

WASM

The download example can be built as a web assembly application using wasm-pack:

cd examples/download
wasm-pack build --target web

In the examples/download directory, start an HTTP server, and open http://localhost:8000/:

python3 -m http.server 8000 # or
simple-http-server --nocache --port 8000 -i

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.

Dependencies

~6–37MB
~622K SLoC