Commit graph

7 commits

Author SHA1 Message Date
7fe48a28ca
Grab git-hooks from npins
All checks were successful
/ check-pre-commit (pull_request) Successful in 13s
/ check-data-model (pull_request) Successful in 34s
/ check-peertube (pull_request) Successful in 21s
/ check-panel (pull_request) Successful in 1m28s
/ check-deployment-basic (pull_request) Successful in 11m41s
/ check-deployment-cli (pull_request) Successful in 39m39s
/ check-deployment-panel (pull_request) Successful in 42m52s
2025-07-09 11:43:13 +02:00
48c6a1f22b Extract mkFlake to own file - get flake-parts from npins (#447)
All checks were successful
/ check-pre-commit (push) Successful in 11s
/ check-data-model (push) Successful in 30s
/ check-peertube (push) Successful in 20s
/ check-panel (push) Successful in 1m26s
/ check-deployment-basic (push) Successful in 32s
/ check-deployment-cli (push) Successful in 44s
/ check-deployment-panel (push) Successful in 1m51s
The goal is to contain the “`mkFlake` hack” to a file that we can heavily document but otherwise ignore. This also will allow me to reuse it in the “flake under test” of the deployment tests.

Reviewed-on: Fediversity/Fediversity#447
Reviewed-by: Valentin Gagarin <valentin.gagarin@tweag.io>
Reviewed-by: kiara Grouwstra <kiara@procolix.eu>
Co-authored-by: Nicolas “Niols” Jeannerod <nicolas.jeannerod@moduscreate.com>
Co-committed-by: Nicolas “Niols” Jeannerod <nicolas.jeannerod@moduscreate.com>
2025-07-09 10:12:47 +02:00
05572ff69e remove string interpolation from imports (#429)
Some checks are pending
/ check-pre-commit (push) Waiting to run
/ check-data-model (push) Waiting to run
/ check-peertube (push) Waiting to run
/ check-panel (push) Waiting to run
/ check-deployment-basic (push) Waiting to run
/ check-deployment-cli (push) Waiting to run
/ check-deployment-panel (push) Waiting to run
Reviewed-on: Fediversity/Fediversity#429
Reviewed-by: Nicolas Jeannerod <nicolas.jeannerod@moduscreate.com>
Co-authored-by: Kiara Grouwstra <kiara@procolix.eu>
Co-committed-by: Kiara Grouwstra <kiara@procolix.eu>
2025-07-03 15:55:39 +02:00
a791ad41ec Inject sources, secrets and keys via module system - avoid import ../ (#421)
All checks were successful
/ check-pre-commit (push) Successful in 11s
/ check-data-model (push) Successful in 29s
/ check-peertube (push) Successful in 19s
/ check-panel (push) Successful in 1m29s
/ check-deployment-basic (push) Successful in 31s
/ check-deployment-cli (push) Successful in 41s
/ check-deployment-panel (push) Successful in 1m46s
Co-authored-by: Nicolas “Niols” Jeannerod <nicolas.jeannerod@moduscreate.com>
Reviewed-on: Fediversity/Fediversity#421
Reviewed-by: Nicolas Jeannerod <nicolas.jeannerod@moduscreate.com>
Reviewed-by: Valentin Gagarin <valentin.gagarin@tweag.io>
Co-authored-by: Kiara Grouwstra <kiara@procolix.eu>
Co-committed-by: Kiara Grouwstra <kiara@procolix.eu>
2025-07-01 21:08:15 +02:00
9a25a04bfa specify _class module attributes to explicitly declare module types (#398)
All checks were successful
/ check-pre-commit (push) Successful in 11s
/ check-data-model (push) Successful in 17s
/ check-peertube (push) Successful in 19s
/ check-panel (push) Successful in 1m22s
/ check-deployment-basic (push) Successful in 11m20s
/ check-deployment-cli (push) Successful in 37m12s
/ check-deployment-panel (push) Successful in 41m32s
closes #93.

note that this includes classes:

- `nixos`
- `nixosTest`
- `nixops4Resource`
- `nixops4Deployment`

.. and my (made-up, as per the [docs](https://ryantm.github.io/nixpkgs/module-system/module-system/#module-system-lib-evalModules-param-class)):

- `nix-unit`
- `package`

.. while i did not manage to cover:

- service tests, given `pkgs.nixosTest` seemed to not actually like `_class = "nixosTest"` (?!)

... nor #93's mentioned destructured arguments for that matter, as per Fediversity/Fediversity#93 (comment) - let me know if that is still desired as well.

Reviewed-on: Fediversity/Fediversity#398
Reviewed-by: Valentin Gagarin <valentin.gagarin@tweag.io>
Co-authored-by: Kiara Grouwstra <kiara@procolix.eu>
Co-committed-by: Kiara Grouwstra <kiara@procolix.eu>
2025-06-23 17:24:54 +02:00
1b832c1f5b bypass native flake input for Nixpkgs (#374)
All checks were successful
/ check-pre-commit (push) Successful in 11s
/ check-peertube (push) Successful in 21s
/ check-panel (push) Successful in 1m24s
/ check-deployment-basic (push) Successful in 45s
/ check-deployment-cli (push) Successful in 43s
@Niols the sheer amount of hassle and noise indicates that it may be better to first split out a `flake.nix` just for the tests. And all this clutter doesn't even explain yet *why* we thought it needs to be there.

closes #279.

Co-authored-by: Nicolas “Niols” Jeannerod <nicolas.jeannerod@moduscreate.com>
Reviewed-on: Fediversity/Fediversity#374
Reviewed-by: kiara Grouwstra <kiara@procolix.eu>
Co-authored-by: Valentin Gagarin <valentin.gagarin@tweag.io>
Co-committed-by: Valentin Gagarin <valentin.gagarin@tweag.io>
2025-06-12 13:05:11 +02:00
ee5c2b90b7 Introduce test for deploying all services with nixops4 apply (#329)
All checks were successful
/ check-pre-commit (push) Successful in 9s
/ check-peertube (push) Successful in 17s
/ check-panel (push) Successful in 1m19s
/ check-deployment-basic (push) Successful in 41s
/ check-deployment-cli (push) Successful in 39s
Closes Fediversity/Fediversity#276

This PR adds a CLI deployment test. It builds on top of Fediversity/Fediversity#323. This test features a deployer node and four target nodes. The deployer node runs `nixops4 apply` on a deployment built with our actual code in `deployment/default.nix`, which pushes onto the four target machines combinations of Garage/Mastodon/Peertube/Pixelfed depending on a JSON payload. We check that the expected services are indeed deployed on the machines. Getting there involved reworking the existing basic test to extract common patterns, and adding support for ACME certificates negotiation inside the NixOS test.

What works:
- deployer successfully runs `nixops4 apply` with various payloads
- target machines indeed get the right services pushed onto them and removed
- services on target machines successfully negotiate ACME certificates

What does not work: the services themselves depend a lot on DNS and that is not taken care of at all, so they are probably very broken. Still, this is a good milestone.

Test it yourself by running `nix build .#checks.x86_64-linux.deployment-basic -vL` and `nix build .#checks.x86_64-linux.deployment-cli -vL`. On the very beefy machine that I am using, the basic test runs in ~4 minutes and the CLI test in ~17 minutes. We know from Fediversity/Fediversity#323 that the basic test runs in ~12 minutes on the CI runner, so maybe about an hour for the CLI test?

Co-authored-by: Valentin Gagarin <valentin.gagarin@tweag.io>
Reviewed-on: Fediversity/Fediversity#329
Reviewed-by: kiara Grouwstra <kiara@procolix.eu>
Reviewed-by: Valentin Gagarin <valentin.gagarin@tweag.io>
Co-authored-by: Nicolas “Niols” Jeannerod <nicolas.jeannerod@moduscreate.com>
Co-committed-by: Nicolas “Niols” Jeannerod <nicolas.jeannerod@moduscreate.com>
2025-05-19 02:18:54 +02:00