Commit graph

70 commits

Author SHA1 Message Date
6a4eb90658
in-source tf deployment logic 2025-04-13 21:14:33 +02:00
385c811a39
limit parallelism for testing to prevent out-of-memory errors 2025-04-13 21:09:20 +02:00
2cc96eb530
configure debug printing 2025-04-12 16:45:52 +02:00
45c53ec150
Revert "switch subprocess output to logger"
This reverts commit d4860c8aed.
2025-04-12 14:36:25 +02:00
60093212d7
Revert "Reapply "log to file""
This reverts commit 1983508fb1.
2025-04-12 14:36:21 +02:00
1983508fb1
Reapply "log to file"
This reverts commit b0942bd174.
2025-04-12 14:10:55 +02:00
d4860c8aed
switch subprocess output to logger 2025-04-12 14:08:55 +02:00
9c53abfb4c
fix logging levels so info gets shown too, not just warn 2025-04-12 13:38:19 +02:00
a41405775e
get ssh socket in prod 2025-04-12 12:31:36 +02:00
b0942bd174
Revert "log to file"
This reverts commit 1a8d940a90.
2025-04-12 11:36:18 +02:00
553753218e
pass vars separately 2025-04-12 11:33:59 +02:00
265d79aeef
local vars 2025-04-12 10:27:11 +02:00
1a8d940a90
log to file 2025-04-12 09:56:00 +02:00
f87275e384
use proper logger 2025-04-12 09:33:18 +02:00
8f785d7582
point deployed TF to panel ssh key 2025-04-10 11:12:39 +02:00
79e58e21f4
nixos-anywhere -> terraform-nixos
intended to swap out nixos-anywhere for terraform-nixos, over:

- don't need nixos-anywhere to install nixos; we preload nixos to VMs
- [awkward non-flake
usage](https://nix-community.github.io/nixos-anywhere/howtos/use-without-flakes.html#3-set-nixos-version-to-use)
-  seemed not to pick up on config changes, as observed by test VMs
losing their panel keys after TF sync

however, it seems that terraform-nixos has its own flaws:

- its output using a random id, i.e. forcing to push even on no changes
- so far did not get ssh authentication to work
2025-04-09 17:05:00 +02:00
eb3b1425d0
leave subprocess user implicit 2025-04-09 17:04:53 +02:00
551e860b5b
use root user as in #301 - given #297 seems to actually deploy! 2025-04-09 17:04:53 +02:00
e02e399a02
use a mutable HOME in TF for nixos-anywhere to make a .ssh dir in - will this not backfire? 2025-04-09 17:04:33 +02:00
de27ec1fb2
rm comment 2025-04-09 17:04:15 +02:00
c841c4e9fd
specify XDG_CACHE_HOME, workaround to error writing to /var/empty/.cache 2025-04-09 17:03:43 +02:00
225f2a5be6
skip tf lock in views.py over read-only nix env 2025-04-09 17:03:43 +02:00
b3e783d4a5
move tf init out of python over read-only nix env 2025-04-09 17:03:43 +02:00
c1aa71e319
properly pass repo dir for prod, be it with hard-coded TF init 2025-04-09 17:03:43 +02:00
3eb6d93216
tf 2025-04-09 17:00:20 +02:00
c69f1f52e0 allow accessing test vms from fedi201, closes #286 (#297)
Reviewed-on: Fediversity/Fediversity#297
Co-authored-by: Kiara Grouwstra <kiara@procolix.eu>
Co-committed-by: Kiara Grouwstra <kiara@procolix.eu>
2025-04-09 16:58:50 +02:00
535da821fd Display url after deployment (#287)
closes #264
Added a clickable link to the services that deployed.

Reviewed-on: Fediversity/Fediversity#287
Reviewed-by: kiara Grouwstra <kiara@procolix.eu>
Co-authored-by: lois <lois@procolix.eu>
Co-committed-by: lois <lois@procolix.eu>
2025-04-02 08:48:59 +02:00
88674c8efc Show if deployment succeeded (#283)
Show which services deployed and if so, the urls

Co-authored-by: kevin <kevin@procolix.com>
Reviewed-on: Fediversity/Fediversity#283
Reviewed-by: kiara Grouwstra <kiara@procolix.eu>
Co-authored-by: lois <lois@procolix.eu>
Co-committed-by: lois <lois@procolix.eu>
2025-03-28 13:36:02 +01:00
59f2ef1171 Remove print statements 2025-03-26 12:59:49 +01:00
7cfacc3306 Save before deployment 2025-03-26 12:56:52 +01:00
b4fbc457a6 Progress Indicator (#259)
closes #74
Show progress indicator to track deployment

- Disable deploy button when deployment is in progress.

Co-authored-by: kevin <kevin@procolix.com>
Reviewed-on: Fediversity/Fediversity#259
Reviewed-by: kiara Grouwstra <kiara@procolix.eu>
2025-03-26 10:14:06 +01:00
d78995b34c
make re-exports explicit again
Fediversity/Fediversity#269 (comment)
2025-03-25 08:43:45 +01:00
a5c310ad03 refactor variables (#269)
Reviewed-on: Fediversity/Fediversity#269
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-03-24 10:04:43 +01:00
f8ac63853c source htmx by nix (#268)
Reviewed-on: Fediversity/Fediversity#268
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-03-24 08:41:16 +01:00
af18b39b63 clean up shebang of manage.py (#271)
Reviewed-on: Fediversity/Fediversity#271
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-03-24 08:38:13 +01:00
de33e888c7 fix typo 2025-03-20 13:11:18 +01:00
658fa7ff60 add TODO, reformat 2025-03-20 13:09:46 +01:00
ee70a0026d
restore env vars in dev shell 2025-03-20 13:06:39 +01:00
1caf95dde1
fix CI 2025-03-20 12:56:25 +01:00
e13f24eba0
panel service: set NIX_BIN 2025-03-20 11:14:11 +01:00
c98663ae71
pass nix binary explicitly rather than thru PATH 2025-03-20 09:44:24 +01:00
3700b6e383 remove option fediversity.eu (#257)
removing fediversity.eu from form options as its subdomains are running live services

Reviewed-on: Fediversity/Fediversity#257
Reviewed-by: Kevin Muller <kevin@procolix.com>
Co-authored-by: Kiara Grouwstra <kiara@procolix.eu>
Co-committed-by: Kiara Grouwstra <kiara@procolix.eu>
2025-03-19 16:01:03 +01:00
e3b816d85e
revert change on USER_SETTINGS_FILE, fixing dev shell 2025-03-19 10:22:52 +01:00
afbbcbc22d simplify configuration via environment 2025-03-19 10:06:38 +01:00
c5fe0157b0
factor reading env vars out to settings.py 2025-03-19 09:51:23 +01:00
53d3791eaa
move NIX_DIR to env, making its use more explicit 2025-03-19 09:51:23 +01:00
53658e9880
trigger nixops from panel
adds a deploy button to the panel form - covers the local part of #76.

As a workaround to pass info (from our user form) into nixops4 uses
environment variable `DEPLOYMENT` thru nix's
`--extra-experimental-features configurable-impure-env`.
2025-03-19 09:51:23 +01:00
3364d6c972 fix: NixOS deployment code
- simplify the configuration module

  the `package` attribute makes little sense to be user-configurable,
  since it will always need to be the derivation defined in this very
  repository. for debugging one may as well change the original code itself.

- unbreak deployment

  setting `CREDENTIALS_DIRECTORY` disabled the systemd mechanism set up
  in the configuration module.

- remove unneeded configuration for deployment

- unbreak integration tests

  before that missed waiting for the service to create some
  state before running the application-level tests.
2025-03-19 09:48:41 +01:00
8f0bcc35f0 fix: run manage in service directory
for everything else it will error on CHDIR, even if $PWD has the right owner and permissions.
2025-03-18 09:52:14 +01:00
4d748c91d7
remove paragraph: Configuration schema version, following #247 2025-03-17 14:11:58 +01:00