Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/norfairking/declops
Declarative, applicative, idempotent, self-tested infrastructure
https://github.com/norfairking/declops
Last synced: about 2 months ago
JSON representation
Declarative, applicative, idempotent, self-tested infrastructure
- Host: GitHub
- URL: https://github.com/norfairking/declops
- Owner: NorfairKing
- Created: 2022-05-17T22:44:22.000Z (over 2 years ago)
- Default Branch: master
- Last Pushed: 2022-06-24T11:26:25.000Z (over 2 years ago)
- Last Synced: 2024-05-01T12:37:40.208Z (8 months ago)
- Language: Haskell
- Homepage:
- Size: 222 KB
- Stars: 11
- Watchers: 4
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Funding: .github/FUNDING.yml
Awesome Lists containing this project
README
# Declops
Declarative ops
## Current state
Able to deploy local resources statelessly with good testing.
Next steps:
1. Get a local virtualbox deployment with a given nixos configuration set up and passing the current tests.
2. Implement a `--build-only` dry-run that already builds the nixos configs.
3. Try to implement remote providers like AWS EC2 instances.Please come talk to me if you or your company would like to help out with this project.
Without extra support, this could take ages to get into working shape.## Goals
* Declarative infrastructure, no commands; only results
* Applicative infrastructure: Infrastructure can depend on previously set up infrastructure
* Self-healing deployment: All successful operations must be idempotent (because they can be retried).
* Success as the exception: Many things can go wrong. Errors must be first-class, explicit, clear, and diagnosable.
* Completely debuggable: Ops is difficult, any attempt at hiding that will end in more confusion rather than less.
* Built-in infrastructure testing.
* Stateless: No local stateWould be nice too:
* Monadic infrastructure: Which infrastructure to set up next can depend on previously set up infrastructure.
## Comparison
| | Declops | [Nixops](https://github.com/NixOS/nixops) | [Terraform](https://www.terraform.io/) | [Nixinate](https://github.com/MatthewCroughan/nixinate) | Ansible | Puppet |
|--------------------------------------------|---------|---------|-----------|-----------|-------|-----|
| Declarative | ✔ | ✔ | ✔ | ✔ | ✖️ | ✖️ |
| Stateless | ✔ | ✖️ | ✖️ | ✔️ | ✔️ | ✔️ |
| Set up new infrastructure | ✔ | ✔ | ✔ | ✖️ | ✔️ | ✔️ |
| Nix for configuration | ✔ | ✔ | ✖️ | ✔️ | ✖️ | ✖️ |
| Exists | ✖️ | ✔ | ✔️ | ✔️ | ✔️ | ✔️ |## Hacking
Declops has been the most challenging testing project I have made so far.
We many different tests with many different requirements, so they are tested as automatically as possible and with the least privileges possible.
The following table is an overview of which tests are run, where you can find them, and where they are run.| Tests | Location | Stack test | Package build | NixOS test | GitHub Actions CI | Manual Nix Script |
|--------------------------------------------|---------------------------------------|------------|---------------|------------|-------------------|-------------------|
| Unit tests | `declops-provider-gen/test` | ✔ | ✔️ | | ✔️ | |
| Local provider integration tests | `declops-provider-local/test` | ✔ | ✔️ | | ✔️ | |
| Nix tests (require the `nix` command) | `nix/nix-test.nix` | ✔️ | ✖️ | ✔️ | ✖️ | |
| Deployment integration tests | `integration-tests/local` | ✖ | ✖️ | ✔️ | ✖️ | |
| VirtualBox tests (require virtiualisation) | `declops-provider-virtualbox-test` | ✔ | ✖️ | ✖️ | ✖️ | ✔ |
| VirtualBox integration tests | `integration-tests/virtualisation` | ✖ | ✖️ | ✖️ | ✖️ | ✔ |