Commit graph

85 commits

Author SHA1 Message Date
ccbf82d546 test data model thru VM (#505)
Some checks failed
deploy-infra / deploy (push) Successful in 2m13s
/ check-pre-commit (push) Failing after 14s
/ check-data-model (push) Successful in 32s
/ check-mastodon (push) Successful in 23s
/ check-peertube (push) Successful in 21s
/ check-panel (push) Successful in 1m31s
/ check-proxmox-basic (push) Successful in 36s
/ check-deployment-basic (push) Successful in 32s
/ check-deployment-cli (push) Successful in 45s
/ check-deployment-panel (push) Successful in 1m53s
/ check-deployment-model-ssh (push) Successful in 24s
/ check-deployment-model-nixops4 (push) Successful in 34s
/ check-resources (push) Successful in 4m12s
test deployments using data obtained through the data model in VMs.

caveats:

- SSH currently has a `run` abstraction that the nixops4 model still lacks
- the deployed (trivial) configuration on activation has not facilitated new ssh connections (for subsequent) updates, i.e. a more sophisticated configuration would be needed for real-life usage.

Reviewed-on: Fediversity/Fediversity#505
2025-09-03 14:13:13 +02:00
27f96b2504 fix data model issues introduced at #501 (#509)
Some checks are pending
deploy-infra / deploy (push) Waiting to run
/ check-pre-commit (push) Waiting to run
/ check-data-model (push) Waiting to run
/ check-mastodon (push) Waiting to run
/ check-peertube (push) Waiting to run
/ check-panel (push) Waiting to run
/ check-proxmox-basic (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
/ check-resources (push) Waiting to run
Signed-off-by: Kiara Grouwstra <kiara@procolix.eu>
Reviewed-on: Fediversity/Fediversity#509
2025-09-03 14:07:53 +02:00
09db4d6217 factor out function wrapper to module function (#503)
All checks were successful
deploy-infra / deploy (push) Successful in 2m11s
/ check-pre-commit (push) Successful in 12s
/ check-data-model (push) Successful in 31s
/ check-mastodon (push) Successful in 22s
/ check-peertube (push) Successful in 23s
/ check-panel (push) Successful in 1m29s
/ check-proxmox-basic (push) Successful in 35s
/ check-deployment-basic (push) Successful in 34s
/ check-deployment-cli (push) Successful in 44s
/ check-deployment-panel (push) Successful in 1m53s
/ check-resources (push) Successful in 4m6s
lifts the `{ input output }` function wrapper out of the user interface to `function.nix`, simplifying usage.

Reviewed-on: Fediversity/Fediversity#503
2025-09-03 13:06:04 +02:00
c3027eb7d1 move function submodule type (#501)
Some checks failed
/ check-pre-commit (push) Waiting to run
/ check-data-model (push) Waiting to run
/ check-mastodon (push) Waiting to run
/ check-peertube (push) Waiting to run
/ check-panel (push) Waiting to run
/ check-proxmox-basic (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
/ check-resources (push) Waiting to run
deploy-infra / deploy (push) Has been cancelled
Reviewed-on: Fediversity/Fediversity#501
2025-09-03 12:52:57 +02:00
4049ca8156 allow different deployment types (#498)
Some checks failed
deploy-infra / deploy (push) Successful in 2m20s
/ check-pre-commit (push) Successful in 14s
/ check-data-model (push) Successful in 32s
/ check-mastodon (push) Successful in 23s
/ check-peertube (push) Successful in 22s
/ check-panel (push) Successful in 1m32s
/ check-proxmox-basic (push) Successful in 36s
/ check-deployment-basic (push) Successful in 33s
/ check-deployment-cli (push) Successful in 45s
/ check-resources (push) Waiting to run
/ check-deployment-panel (push) Has been cancelled
Reviewed-on: Fediversity/Fediversity#498
2025-09-03 12:44:44 +02:00
f954ed5389 add proxmox repro test (#345)
All checks were successful
deploy-infra / deploy (push) Successful in 2m11s
/ check-pre-commit (push) Successful in 12s
/ check-data-model (push) Successful in 31s
/ check-mastodon (push) Successful in 22s
/ check-peertube (push) Successful in 21s
/ check-panel (push) Successful in 1m32s
/ check-proxmox-basic (push) Successful in 34s
/ check-deployment-basic (push) Successful in 33s
/ check-deployment-cli (push) Successful in 44s
/ check-deployment-panel (push) Successful in 1m49s
/ check-resources (push) Successful in 3m57s
closes #325

Reviewed-on: Fediversity/Fediversity#345
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-09-01 14:31:50 +02:00
9d903f3ef7 Complete the data model with a runtime environment and end-to-end test (#481)
All checks were successful
deploy-infra / deploy (push) Successful in 2m19s
/ check-pre-commit (push) Successful in 12s
/ check-data-model (push) Successful in 32s
/ check-mastodon (push) Successful in 22s
/ check-peertube (push) Successful in 23s
/ check-panel (push) Successful in 1m32s
/ check-deployment-basic (push) Successful in 34s
/ check-deployment-cli (push) Successful in 45s
/ check-deployment-panel (push) Successful in 1m55s
/ check-resources (push) Successful in 4m7s
Closes #103

At last, a fully fledged data model for what Fediversity really is and does. This comes with a test that exercises a very simple but functionally complete arrangement with all ingredients fo the business logic: a dummy resource (login shell), a dummy application (`hello`, which needs a shell to live in), a dummy environment (a single NixOS VM that allows for one, the operator's, login shell), and a deployment of that environment given a dummy configuration (that enables `hello`).

The next step will be to lift this purely evaluation-level test into a VM test which verifies that the resulting VM indeed has `hello` deployed to the operator's user account.

Caveats:
- The exact naming has a bit of room for improvement, and may have diverged from the design document
- The test is not as pedantically type safe as it could be, since we simply use `types.raw` for resources such as NixOS users settings which *could* be more finely delineated

Co-authored-by: Kiara Grouwstra <kiara@procolix.eu>
Co-authored-by: kiara Grouwstra <kiara@procolix.eu>
Reviewed-on: Fediversity/Fediversity#481
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-08-27 00:45:49 +02:00
be72b82875 Link to upstreaming PR for lib.types.fileset (#487)
Reviewed-on: Fediversity/Fediversity#487
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-30 13:25:22 +02:00
b4e1c5b5b3 Restrict fileset necessary for deployment tests (#450)
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
Now that we won't depend on the flake.nix anymore, we won't depend on all the flake-part.nix files (necessary to evaluate flake.nix) and all the files they depend on etc., so the Nix dependencies of the tests will be drastically reduced, and I will be able to leverage that by introducing a more subtle src. This will make the test not need to re-run if only things outside that reduced src changed (and the previous run is in the Nix store).

Reviewed-on: Fediversity/Fediversity#450
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-07-09 22:57:52 +02:00
de38611572 Unflakify deployment tests (#449)
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 1m29s
/ check-deployment-basic (push) Successful in 32s
/ check-deployment-cli (push) Successful in 43s
/ check-deployment-panel (push) Successful in 1m52s
This PR builds on top of #447 and #448. Since these might be rejected, there will be some changes needed for this PR as well. Let's see how the discussions go in #447.

In the meantime, @fricklerhandwerk, would you mind (in)validating the core idea of this PR? You only need to look at 7cf43c4041, really.

Reviewed-on: Fediversity/Fediversity#449
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-07-09 15:07:02 +02:00
1d40dcfc0e Grab git-hooks from npins (#448)
All checks were successful
/ check-pre-commit (push) Successful in 15s
/ check-data-model (push) Successful in 33s
/ check-peertube (push) Successful in 25s
/ check-panel (push) Successful in 1m32s
/ check-deployment-basic (push) Successful in 9s
/ check-deployment-cli (push) Successful in 38m39s
/ check-deployment-panel (push) Successful in 43m29s
This PR builds on top of #447 and will be subject to the same discussion. Let's discuss there whether it makes sense to get rid of the `flake-parts` and `git-hooks` flake inputs.

Reviewed-on: Fediversity/Fediversity#448
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 13:21:48 +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
5345860006 data model: add run-time configuration (#437)
Some checks failed
/ check-pre-commit (push) Has been cancelled
/ check-data-model (push) Has been cancelled
/ check-peertube (push) Has been cancelled
/ check-panel (push) Has been cancelled
/ check-deployment-basic (push) Has been cancelled
/ check-deployment-cli (push) Has been cancelled
/ check-deployment-panel (push) Has been cancelled
based on @fricklerhandwerk's work at https://git.fediversity.eu/fricklerhandwerk/Fediversity/compare/main...data-model-as-diagram part of #103.
supersedes #402.

on the application model, feedback on a [sample implementation](kiara/Fediversity#2) welcome as well.

Reviewed-on: Fediversity/Fediversity#437
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-06 21:42:25 +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
737aecaba6 set default value for nixops4Package (#412)
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
Co-authored-by: Valentin Gagarin <valentin.gagarin@tweag.io>
Reviewed-on: Fediversity/Fediversity#412
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-30 12:44:53 +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
bd1cfd7a7c Introduce test for deploying all services via FediPanel (#361)
All checks were successful
/ check-pre-commit (push) Successful in 11s
/ check-data-model (push) Successful in 20s
/ check-peertube (push) Successful in 20s
/ check-panel (push) Successful in 1m21s
/ check-deployment-basic (push) Successful in 31s
/ check-deployment-cli (push) Successful in 41s
/ check-deployment-panel (push) Successful in 1m40s
Closes #277

Same as #329 but where we run the FediPanel and interact with it via a browser
instead of running NixOps4 directly.

Reviewed-on: Fediversity/Fediversity#361
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-06-18 12:37:47 +02:00
939f9d961d add data model entity: application (#387)
All checks were successful
/ check-pre-commit (push) Successful in 11s
/ check-data-model (push) Successful in 13s
/ check-peertube (push) Successful in 16s
/ check-panel (push) Successful in 58s
/ check-deployment-basic (push) Successful in 10m59s
/ check-deployment-cli (push) Successful in 37m22s
part of #103.

Co-authored-by: Valentin Gagarin <valentin.gagarin@tweag.io>
Reviewed-on: Fediversity/Fediversity#387
Co-authored-by: Kiara Grouwstra <kiara@procolix.eu>
Co-committed-by: Kiara Grouwstra <kiara@procolix.eu>
2025-06-17 17:11:52 +02:00
4801433ae0 Get rid of the need for deployer.pub (#385)
All checks were successful
/ check-pre-commit (push) Successful in 10s
/ check-peertube (push) Successful in 18s
/ check-panel (push) Successful in 1m22s
/ check-deployment-basic (push) Successful in 43s
/ check-deployment-cli (push) Successful in 41s
The tests still work because we manually write the deployer's public key in `/root/.ssh/authorized_keys` on the target machines. In itself, however, the configuration that we push does not allow the deployer to push anything on the target machines.

Context: Fediversity/Fediversity#361 (comment)
Reviewed-on: Fediversity/Fediversity#385
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-06-17 16:34:29 +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
69b2e535fe Document nullable fields sanitation (#365)
All checks were successful
/ check-pre-commit (push) Successful in 8s
/ check-peertube (push) Successful in 16s
/ check-panel (push) Successful in 1m8s
/ check-deployment-basic (push) Successful in 41m32s
/ check-deployment-cli (push) Successful in 41m30s
Reviewed-on: Fediversity/Fediversity#365
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-06-10 11:57:01 +02:00
09119803e8 Deployment: handle nullable config fields
All checks were successful
/ check-pre-commit (push) Successful in 12s
/ check-peertube (push) Successful in 18s
/ check-panel (push) Successful in 1m6s
/ check-deployment-basic (push) Successful in 36m58s
/ check-deployment-cli (push) Successful in 43m42s
This is quite frustrating. In the meantime, it does get the deployment
working again.
2025-06-06 11:50:48 +02:00
56b953526b Deployment tests: Check status of services before deploying
All checks were successful
/ check-pre-commit (push) Successful in 12s
/ check-peertube (push) Successful in 18s
/ check-panel (push) Successful in 1m7s
/ check-deployment-basic (push) Successful in 12m6s
/ check-deployment-cli (push) Successful in 40m4s
2025-06-06 10:54:06 +02:00
2fae356d0a Deployment tests: also make acmeNodeIP available in NixOS test
All checks were successful
/ check-pre-commit (push) Successful in 11s
/ check-peertube (push) Successful in 18s
/ check-panel (push) Successful in 1m23s
/ check-deployment-basic (push) Successful in 12m26s
/ check-deployment-cli (push) Successful in 39m52s
2025-06-06 10:52:49 +02:00
046f7c5998 Deployment tests: comment on Pebble's certificate
All checks were successful
/ check-pre-commit (push) Successful in 10s
/ check-peertube (push) Successful in 18s
/ check-panel (push) Successful in 1m22s
/ check-deployment-basic (push) Successful in 33s
/ check-deployment-cli (push) Successful in 40s
2025-06-06 10:52:18 +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
5f66a034f3 actually use the typed configuration in deployment
All checks were successful
/ check-pre-commit (pull_request) Successful in 11s
/ check-peertube (pull_request) Successful in 17s
/ check-panel (pull_request) Successful in 1m18s
/ check-deployment-basic (pull_request) Successful in 12m15s
/ check-pre-commit (push) Successful in 10s
/ check-peertube (push) Successful in 20s
/ check-panel (push) Successful in 1m19s
/ check-deployment-basic (push) Successful in 5s
that change somehow slipped through the cracks previously
2025-05-09 12:46:11 +02:00
6100b278b6 generate Python data models from module options (#285)
All checks were successful
/ check-pre-commit (push) Successful in 31s
/ check-peertube (push) Successful in 18s
/ check-panel (push) Successful in 1m26s
/ check-deployment-basic (push) Successful in 25s
this shows a proof of concept for generating Django forms from NixOS modules

note that the form behavior is still rather clumsy and doesn't exactly map to the module semantics:
- since forms can only be sent wholesale, empty form fields will show up as empty strings
  and break validation without additional cleanup (not done here)
- it's not possible to faithfully translate `type = submodule { /* ... */}; default = {};`, since the default
  is translated to an empty dict `{}`. this is because the JSON schema converter does not preserve type information.
  this can be added by making it use `$defs` [1], but that would likely amount to half a rewrite
- there's a glitch in enum default values that needs to be fixed in `datamodel-code-generator` [0]

[0]: dd44480359/src/datamodel_code_generator/parser/base.py (L1015)
[1]: https://json-schema.org/understanding-json-schema/structuring#defs

a generated file will be placed into the source (by the development shell and the package respectively)
that declares Pydantic types from which to render the form. it looks something like this:

```python
from __future__ import annotations

from enum import Enum
from typing import Optional

from pydantic import BaseModel, Extra, Field
from drf_pydantic import BaseModel

class Domain(Enum):
    fediversity_net = 'fediversity.net'

# ...

class Model(BaseModel):
    class Config:
        extra = Extra.forbid

    domain: Optional[Domain] = Field(
        'fediversity.net',
        description='Apex domain under which the services will be deployed.\n',
    )

  # ...
```
2025-05-01 01:26:52 +02:00
f5db62e053 Add a basic integration test (#323)
All checks were successful
/ check-pre-commit (push) Successful in 31s
/ check-peertube (push) Successful in 18s
/ check-panel (push) Successful in 1m23s
/ check-deployment-basic (push) Successful in 25s
This PR adds a basic deployment test to the repository. This test will, in a NixOS test, run a deployer VM and a target VM, and check that we manage to run `nixops4 apply` on the deployer VM to change things on the target VM. The ideas are all @roberth's and this test has been extremely heavily inspired by https://github.com/nixops4/nixops4-nixos/blob/main/test/default/nixosTest.nix.

Reviewed-on: Fediversity/Fediversity#323
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-04-30 15:03:36 +02:00
b645660118 deployment module: set configuration explicitly (#315)
All checks were successful
/ check-pre-commit (push) Successful in 20s
/ check-peertube (push) Successful in 19s
/ check-panel (push) Successful in 1m19s
this change is a no-op (it merely indents the option definitions by one,
by setting `config` explicitly) and prepares an addition of option
declarations that would otherwise be lost in the huge diff.

Reviewed-on: Fediversity/Fediversity#315
Reviewed-by: kiara Grouwstra <kiara@procolix.eu>
2025-04-22 11:30:33 +02:00
af3b2a62fd
Create a configuration resource even if the service is disabled 2025-04-02 15:06:17 +02:00
4db91bd0b7
Transmit initial user from JSON to services
All checks were successful
/ check-pre-commit (pull_request) Successful in 24s
/ check-website (pull_request) Successful in 9s
/ check-peertube (pull_request) Successful in 20s
/ check-pre-commit (push) Successful in 6s
/ check-website (push) Successful in 11s
/ check-peertube (push) Successful in 21s
2025-02-28 10:57:31 +01:00
f34f2e45ab
Get panel config as a block - use eg. mastodon.enable
All checks were successful
/ check-pre-commit (pull_request) Successful in 23s
/ check-website (pull_request) Successful in 9s
/ check-peertube (pull_request) Successful in 19s
/ check-pre-commit (push) Successful in 6s
/ check-website (push) Successful in 12s
/ check-peertube (push) Successful in 22s
2025-02-27 11:43:44 +01:00
07b3cd90d7
Make clearer what nixos.module is 2025-02-27 11:39:07 +01:00
ea98ccebfc
Very vague and minimalistic description of deployment/ 2025-02-27 11:35:55 +01:00
c66889f58f
Better naming of makeMakeDeployment arguments 2025-02-27 11:35:55 +01:00
e27cc6e96a
Generalise test deployment; get config from JSON 2025-02-27 11:35:54 +01:00
3f9c174d97
Get rid of the deployment/ directory 2025-02-25 11:57:20 +01:00
fb5bed9042
Remove other host keys 2025-02-25 11:57:20 +01:00
636e4636f7
Add test machines 2025-02-25 11:57:20 +01:00
0bea2d0bb1
Mark deployment/ as deprecated
All checks were successful
/ check-pre-commit (pull_request) Successful in 25s
/ check-website (pull_request) Successful in 10s
/ check-peertube (pull_request) Successful in 21s
2025-02-21 20:24:41 +01:00
398dc05ad5
Rename provisioning host keys to match nixosConfiguration entries 2025-02-21 20:24:40 +01:00
57e6127a7a
Move provision.sh and remove.sh to infra/ 2025-02-21 20:24:40 +01:00
f8ec8e7d93
Decouple id and name 2025-02-21 20:24:40 +01:00
d77b04ec18
Apply makeInstallerIso to conf in provision.sh 2025-02-21 20:24:40 +01:00
bf0a35de6c
makeInstaller -> makeInstallerIso 2025-02-21 20:24:40 +01:00
9e95287715
Make API URL an argument of the provisioning script 2025-02-21 20:24:40 +01:00
cd83536e2f
Allow Garage and services to run on different machines 2025-02-21 17:52:50 +01:00
1eeaa04df6
Introduce fediversity.garage.enable 2025-02-21 17:52:50 +01:00