{"id":15067623,"url":"https://github.com/azriel91/peace","last_synced_at":"2025-04-07T07:11:40.758Z","repository":{"id":38420056,"uuid":"479582213","full_name":"azriel91/peace","owner":"azriel91","description":"Zero Stress Automation","archived":false,"fork":false,"pushed_at":"2025-04-05T06:44:26.000Z","size":8749,"stargazers_count":119,"open_issues_count":24,"forks_count":3,"subscribers_count":6,"default_branch":"main","last_synced_at":"2025-04-05T07:18:34.378Z","etag":null,"topics":["automation","hacktoberfest","rust"],"latest_commit_sha":null,"homepage":"https://peace.mk","language":"Rust","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/azriel91.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":".github/FUNDING.yml","license":"LICENSE-APACHE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null},"funding":{"github":["azriel91"],"patreon":null,"open_collective":null,"ko_fi":null,"tidelift":null,"community_bridge":null,"liberapay":null,"issuehunt":null,"otechie":null,"lfx_crowdfunding":null,"custom":null}},"created_at":"2022-04-09T01:06:33.000Z","updated_at":"2025-03-30T00:49:13.000Z","dependencies_parsed_at":"2023-07-14T09:05:25.762Z","dependency_job_id":"dffd470c-2993-49d4-a14e-becc9c27e151","html_url":"https://github.com/azriel91/peace","commit_stats":{"total_commits":1030,"total_committers":2,"mean_commits":515.0,"dds":0.002912621359223322,"last_synced_commit":"96ad55cc81828207a1713284376109f64a171195"},"previous_names":["azriel91/zzzz"],"tags_count":15,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/azriel91%2Fpeace","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/azriel91%2Fpeace/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/azriel91%2Fpeace/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/azriel91%2Fpeace/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/azriel91","download_url":"https://codeload.github.com/azriel91/peace/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247299978,"owners_count":20916225,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["automation","hacktoberfest","rust"],"created_at":"2024-09-25T01:25:17.535Z","updated_at":"2025-04-07T07:11:40.736Z","avatar_url":"https://github.com/azriel91.png","language":"Rust","funding_links":["https://github.com/sponsors/azriel91"],"categories":[],"sub_categories":[],"readme":"# 🕊️ peace \u0026ndash; zero stress automation\n\n[![Crates.io](https://img.shields.io/crates/v/peace.svg)](https://crates.io/crates/peace)\n[![docs.rs](https://img.shields.io/docsrs/peace)](https://docs.rs/peace)\n[![CI](https://github.com/azriel91/peace/workflows/CI/badge.svg)](https://github.com/azriel91/peace/actions/workflows/ci.yml)\n[![Coverage Status](https://codecov.io/gh/azriel91/peace/branch/main/graph/badge.svg)](https://codecov.io/gh/azriel91/peace)\n\n`peace` is a framework to build empathetic and forgiving software automation.\n\nSee:\n\n* [peace.mk](https://peace.mk) for the project vision.\n* [Background](https://peace.mk/book/background.html) for the motivation to create this framework.\n* [Operations UX](https://azriel.im/ops_ux/) for a book about the dimensions considered during `peace`'s design and development.\n\n\n## Guiding Principles\n\n* A joy to use.\n* Ergonomic API and guidance to do the right thing.\n* Understandable output.\n\n\n## Features\n\n| Symbol | Meaning              |\n|:------:|:---------------------|\n|   🟢   | Works well           |\n|   🟡   | Partial support      |\n|   ⚫   | Planned              |\n|   🔵   | Compatible by design |\n|   🟣   | Works, \"fun idea\"    |\n\n* 🟢 **Idempotent:** Multiple invocations result in the goal outcome.\n* 🟢 **Clean:** Every item creation is paired with how it is cleaned up.\n* 🟢 **Understandable:** Progress is shown at an understandable level of detail.\n* 🔵 **Understandable:** Error reporting is compatible with [`miette`].\n* 🟢 **Interruptible:** Execution can be interrupted.\n* 🟢 **Resumable:** Automation resumes where it was interrupted.\n* 🟢 **Diffable:** States and diffs are serialized as YAML.\n* 🟢 **Efficient:** Tasks are concurrently executed via [`fn_graph`].\n* 🟢 **Namespaced:** Profile directories isolate environments from each other.\n* 🟢 **Type Safe:** Items and parameters are defined in code, not configuration.\n\n[`fn_graph`]: https://github.com/azriel91/fn_graph\n[`miette`]: https://github.com/zkat/miette\n\n\n### Roadmap\n\n* 🟢 Define items to manage with automation.\n* 🟢 Define dependencies between items.\n* 🟢 Define \"apply\" logic.\n* 🟢 Define \"clean up\" logic.\n* 🟢 Discover current and goal states.\n* 🟢 Define diff calculation between states.\n* 🟢 Store and recall parameters across commands.\n* 🟢 Diff states between multiple profiles.\n* 🟢 Type-safe referential parameters -- specify usage of values generated during automation as parameters to subsequent items.\n* 🟢 Cancel-safe interruption.\n* 🟡 Feature-gated incremental functionality.\n* 🟡 Off-the-shelf support for common items.\n* 🟡 Dry run.\n* 🟣 WASM support.\n* 🟡 Web based UI with interactive graph.\n* ⚫ Run command with subset of items.\n* ⚫ Params specification: Read values from other flows.\n* ⚫ Flow versions: Support migrating environment deployed using previous flow version.\n* ⚫ Secure-by-design Support: Encrypted value storage, decrypted per execution / time based agent.\n* ⚫ Tutorial for writing a software lifecycle management tool.\n* ⚫ Built-in application execution methods -- CLI, web service.\n* ⚫ `peace` binary for configuration based workflows.\n* ⚫ Agent mode to run `peace` on servers (Web API invocation).\n\nFurther ideas:\n\n* Back up current state.\n* Restore previous state.\n* Telemetry / metrics logging for analysis.\n\n[`tokio-graceful-shutdown`]: https://docs.rs/tokio-graceful-shutdown/latest/tokio_graceful_shutdown/\n\n\n## Examples\n\nExamples are run using `--package` instead of `--example`, as each example is organized as its own crate.\n\n\u003cdetails\u003e\u003csummary\u003e\u003ccode\u003edownload\u003c/code\u003e example\u003c/summary\u003e\n\n```bash\ncargo run --package $example_name --all-features\n\n# e.g.\ncargo build --package download --all-features\ncargo run -q --package download --all-features -- init https://ifconfig.me ip.json\n\nfor cmd in status goal diff ensure ensure diff clean clean diff\ndo\n    printf \"=== ${cmd} ===\\n\"\n    cargo run -q --package download --all-features -- --format text $cmd\n    printf '\\n'\ndone\n\n# Look at metadata that Peace has saved\nfind .peace -type f -exec bash -c 'echo \\# {}; cat {}; echo' \\;\n\n# Clean up the metadata directory\nrm -rf .peace\n```\n\n### WASM\n\nThe `download` example can be built as a web assembly application using [`wasm-pack`]:\n\n```bash\ncd examples/download\nwasm-pack build --target web\n```\n\nIn the `examples/download` directory, start an [HTTP server], and open \u003chttp://localhost:8000/\u003e:\n\n```bash\npython3 -m http.server 8000 # or\nsimple-http-server --nocache --port 8000 -i\n```\n\n[`wasm-pack`]: https://rustwasm.github.io/\n[HTTP server]: https://crates.io/crates/simple-http-server\n\n\u003c/details\u003e\n\n\u003cdetails\u003e\u003csummary\u003e\u003ccode\u003eenvman\u003c/code\u003e example\u003c/summary\u003e\n\n1. Install [`cargo-leptos`](https://github.com/leptos-rs/cargo-leptos).\n\n    ```bash\n    cargo install --locked cargo-leptos\n    ```\n\n2. Build the `envman` example:\n\n    ```bash\n    # defined in .cargo/config.toml\n    cargo envman_build_debug\n    ```\n\n3. Copy artifacts to a temporary directory:\n\n    ```bash\n    demo_dir=/tmp/demo/envman\n    test -d \"${demo_dir}\" || mkdir -p \"${demo_dir}\"\n    cp ./target/debug/envman \"${demo_dir}\"\n    cp ./target/web/envman/pkg \"${demo_dir}\"\n    ```\n\n4. Switch to the demo directory:\n\n    ```bash\n    demo_dir=/tmp/demo/envman\n    cd \"${demo_dir}\"\n    ```\n\n5. Make sure you have AWS credentials set up in `~/.aws/credentials`.\n\n6. Run the appropriate `envman` commands:\n\n    1. Initialize a project:\n\n        ```bash\n        # initialize a project to download from `azriel91/web_app`\n        ./envman init \\\n          --type development \\\n          --flow deploy \\\n          demo_1 azriel91/web_app 0.1.1\n        ```\n\n    2. Status / Goal / Diff:\n\n        ```bash\n        ./envman status\n        ./envman goal\n        ./envman diff\n        ```\n\n    3. Deploy / Clean\n\n        ```bash\n        ./envman deploy\n        ./envman deploy --format json\n        ./envman deploy --format none\n\n        ./envman clean\n        ./envman clean --format json\n        ./envman clean --format none\n        ```\n\n    4. You can also interrupt the deploy/clean process.\n\n7. Run the web interface:\n\n    ```bash\n    ./envman web\n    ```\n\n\n\u003c/details\u003e\n\n\n## License\n\nLicensed under either of\n\n* Apache License, Version 2.0, ([LICENSE-APACHE](LICENSE-APACHE) or https://www.apache.org/licenses/LICENSE-2.0)\n* MIT license ([LICENSE-MIT](LICENSE-MIT) or https://opensource.org/licenses/MIT)\n\nat your option.\n\n\n### Contribution\n\nUnless 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.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fazriel91%2Fpeace","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fazriel91%2Fpeace","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fazriel91%2Fpeace/lists"}