deploy fedipanel #201

Merged
kiara merged 4 commits from kiara/fediversity:deploy-panel into main 2025-02-27 22:06:26 +01:00
Owner

Closes #101

Closes #101
kiara changed title from deploy fedipanel to WIP: deploy fedipanel 2025-02-25 10:07:37 +01:00
Niols approved these changes 2025-02-25 11:11:07 +01:00
Dismissed
Niols left a comment

I haven't looked at whether it was a good configuration of the panel service, but the use of infra/ looks good to me!

I haven't looked at whether it was a good configuration of the panel service, but the use of `infra/` looks good to me!
@ -2,2 +2,4 @@
fediversityVm = {
# domain = "demo.fediversity.eu";
domain = "abundos.eu";
# domain = "fedi201.abundos.eu";
Owner

This is supposed to be the root domain of the group of machines. I think abundos.eu is correct, making the FQDN fedi201.abundos.eu. This doesn't mean that it cannot server demo.fediversity.eu afterwards.

Tbf I feel a bit weird using abundos.eu for that, but maybe that's normal. I'd be curious to know how exactly things are done at Procolix; I know there are domains vm02186.procolix.com or something like that, and then the actual semantic domains point to that?

This is supposed to be the root domain of the group of machines. I think `abundos.eu` is correct, making the FQDN `fedi201.abundos.eu`. This doesn't mean that it cannot server `demo.fediversity.eu` afterwards. Tbf I feel a bit weird using `abundos.eu` for that, but maybe that's normal. I'd be curious to know how exactly things are done at Procolix; I know there are domains `vm02186.procolix.com` or something like that, and then the actual semantic domains point to that?
Author
Owner

maybe @koen has an opinion on what domains we might use internally for the VMs? should we use e.g. fediversity.net both for internal VM sub-domains as well as public-facing demo deployments? or would it be preferable to separate these?

maybe @koen has an opinion on what domains we might use internally for the VMs? should we use e.g. `fediversity.net` both for internal VM sub-domains as well as public-facing demo deployments? or would it be preferable to separate these?
Owner

Yeah, the semantics of fediversity.eu, fediversity.net and abundos.eu is unclear to me too. My understanding:

  • fediversity.eu: production machines, mostly hosted on the Procolix Proxmox
  • fediversity.net: ??????
  • abundos.eu: playground for @Niols

So I have for now been giving a subdomain to all VMs under abundos.eu because it feels I can do whatever I want there. But maybe we should have:

  • fediversity.eu for user-facing stuff
  • fediversity.net for our internal infra (that's where we'd put subdomains for each VM)
  • abundos.eu for playing with deployments, and in particular soon playing with updating the DNS fields and everything
Yeah, the semantics of `fediversity.eu`, `fediversity.net` and `abundos.eu` is unclear to me too. My understanding: - `fediversity.eu`: production machines, mostly hosted on the Procolix Proxmox - `fediversity.net`: ?????? - `abundos.eu`: playground for @Niols So I have for now been giving a subdomain to all VMs under abundos.eu because it feels I can do whatever I want there. But maybe we should have: - `fediversity.eu` for user-facing stuff - `fediversity.net` for our internal infra (that's where we'd put subdomains for each VM) - `abundos.eu` for playing with deployments, and in particular soon playing with updating the DNS fields and everything
Owner
Moved to https://git.fediversity.eu/Fediversity/Fediversity/issues/210.
kiara marked this conversation as resolved
@ -0,0 +8,4 @@
panel = (import ../../panel/default.nix { }).package;
in
# panel = (import ../../panel/default.nix { inherit pkgs; }).package;
# pkgs' = pkgs.extend (_final: _prev: { panel = package; });
Owner

I guess the difference between those two options is where pkgs comes from? The pkgs at the beginning of this file is injected by NixOps4 and comes from the flake. I suppose ../../panel.default.nix grabs nixpkgs from the npins/ directory? Doesn't really matter, though, and I think the currently uncommented version is just fine!

I guess the difference between those two options is where `pkgs` comes from? The `pkgs` at the beginning of this file is injected by NixOps4 and comes from the flake. I suppose `../../panel.default.nix` grabs nixpkgs from the `npins/` directory? Doesn't really matter, though, and I think the currently uncommented version is just fine!
kiara marked this conversation as resolved
@ -0,0 +29,4 @@
production = true;
# domain = "demo.fediversity.eu";
domain = "abundos.eu";
# domain = "fedi201.abundos.eu";
Owner

I'm not sure what services.panel.domain is for, but if it has to do with reverse proxying or things like that, then I suppose you want demo.fediversity.eu here?

I'm not sure what `services.panel.domain` is for, but if it has to do with reverse proxying or things like that, then I suppose you want `demo.fediversity.eu` here?
kiara marked this conversation as resolved
kiara force-pushed deploy-panel from e4fb5f289c
All checks were successful
/ check-pre-commit (pull_request) Successful in 26s
/ check-website (pull_request) Successful in 10s
/ check-peertube (pull_request) Successful in 22s
to 0cf3ffdd2e
All checks were successful
/ check-pre-commit (pull_request) Successful in 28s
/ check-website (pull_request) Successful in 10s
/ check-peertube (pull_request) Successful in 24s
2025-02-25 12:37:24 +01:00
Compare
kiara force-pushed deploy-panel from 0cf3ffdd2e
All checks were successful
/ check-pre-commit (pull_request) Successful in 28s
/ check-website (pull_request) Successful in 10s
/ check-peertube (pull_request) Successful in 24s
to 0665a70b7c
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-25 12:38:09 +01:00
Compare
Author
Owner
status: error on read-only file system i'm tryna trace
Feb 25 12:37:52 fedi201 systemd[1]: Starting panel ASGI server...
Feb 25 12:37:53 fedi201 panel-pre-start[12146]: Operations to perform:
Feb 25 12:37:53 fedi201 panel-pre-start[12146]:   Apply all migrations: admin, auth, contenttypes, sessions
Feb 25 12:37:53 fedi201 panel-pre-start[12146]: Running migrations:
Feb 25 12:37:53 fedi201 panel-pre-start[12146]:   No migrations to apply.
Feb 25 12:37:54 fedi201 panel-pre-start[12149]: Traceback (most recent call last):
Feb 25 12:37:54 fedi201 panel-pre-start[12149]:   File "/nix/store/v62sgdhr3jn5n4zjwmcl44cxd4bwr8vq-python3.12-panel-0.0.0/bin/..manage.py-wrapped-wrapped", line 23, in <module>
Feb 25 12:37:54 fedi201 panel-pre-start[12149]:     main()
Feb 25 12:37:54 fedi201 panel-pre-start[12149]:   File "/nix/store/v62sgdhr3jn5n4zjwmcl44cxd4bwr8vq-python3.12-panel-0.0.0/bin/..manage.py-wrapped-wrapped", line 19, in main
Feb 25 12:37:54 fedi201 panel-pre-start[12149]:     execute_from_command_line(sys.argv)
Feb 25 12:37:54 fedi201 panel-pre-start[12149]:   File "/nix/store/hqls57j8xl2h76fqgwg5c0kxj2x77akr-python3.12-django-4.2.16/lib/python3.12/site-packages/django/core/management/__init__.py", line 442, in execute_from_command_line
Feb 25 12:37:54 fedi201 panel-pre-start[12149]:     utility.execute()
Feb 25 12:37:54 fedi201 panel-pre-start[12149]:   File "/nix/store/hqls57j8xl2h76fqgwg5c0kxj2x77akr-python3.12-django-4.2.16/lib/python3.12/site-packages/django/core/management/__init__.py", line 436, in execute
Feb 25 12:37:54 fedi201 panel-pre-start[12149]:     self.fetch_command(subcommand).run_from_argv(self.argv)
Feb 25 12:37:54 fedi201 panel-pre-start[12149]:   File "/nix/store/hqls57j8xl2h76fqgwg5c0kxj2x77akr-python3.12-django-4.2.16/lib/python3.12/site-packages/django/core/management/base.py", line 412, in run_from_argv
Feb 25 12:37:54 fedi201 panel-pre-start[12149]:     self.execute(*args, **cmd_options)
Feb 25 12:37:54 fedi201 panel-pre-start[12149]:   File "/nix/store/hqls57j8xl2h76fqgwg5c0kxj2x77akr-python3.12-django-4.2.16/lib/python3.12/site-packages/django/core/management/base.py", line 458, in execute
Feb 25 12:37:54 fedi201 panel-pre-start[12149]:     output = self.handle(*args, **options)
Feb 25 12:37:54 fedi201 panel-pre-start[12149]:              ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
Feb 25 12:37:54 fedi201 panel-pre-start[12149]:   File "/nix/store/hqls57j8xl2h76fqgwg5c0kxj2x77akr-python3.12-django-4.2.16/lib/python3.12/site-packages/django/contrib/staticfiles/management/commands/collectstatic.py", line 209, in handle
Feb 25 12:37:54 fedi201 panel-pre-start[12149]:     collected = self.collect()
Feb 25 12:37:54 fedi201 panel-pre-start[12149]:                 ^^^^^^^^^^^^^^
Feb 25 12:37:54 fedi201 panel-pre-start[12149]:   File "/nix/store/hqls57j8xl2h76fqgwg5c0kxj2x77akr-python3.12-django-4.2.16/lib/python3.12/site-packages/django/contrib/staticfiles/management/commands/collectstatic.py", line 135, in collect
Feb 25 12:37:54 fedi201 panel-pre-start[12149]:     handler(path, prefixed_path, storage)
Feb 25 12:37:54 fedi201 panel-pre-start[12149]:   File "/nix/store/hqls57j8xl2h76fqgwg5c0kxj2x77akr-python3.12-django-4.2.16/lib/python3.12/site-packages/django/contrib/staticfiles/management/commands/collectstatic.py", line 378, in copy_file
Feb 25 12:37:54 fedi201 panel-pre-start[12149]:     self.storage.save(prefixed_path, source_file)
Feb 25 12:37:54 fedi201 panel-pre-start[12149]:   File "/nix/store/hqls57j8xl2h76fqgwg5c0kxj2x77akr-python3.12-django-4.2.16/lib/python3.12/site-packages/django/core/files/storage/base.py", line 49, in save
Feb 25 12:37:54 fedi201 panel-pre-start[12149]:     name = self._save(name, content)
Feb 25 12:37:54 fedi201 panel-pre-start[12149]:            ^^^^^^^^^^^^^^^^^^^^^^^^^
Feb 25 12:37:54 fedi201 panel-pre-start[12149]:   File "/nix/store/hqls57j8xl2h76fqgwg5c0kxj2x77akr-python3.12-django-4.2.16/lib/python3.12/site-packages/django/core/files/storage/filesystem.py", line 87, in _save
Feb 25 12:37:54 fedi201 panel-pre-start[12149]:     os.makedirs(directory, exist_ok=True)
Feb 25 12:37:54 fedi201 panel-pre-start[12149]:   File "<frozen os>", line 225, in makedirs
Feb 25 12:37:54 fedi201 panel-pre-start[12149]: OSError: [Errno 30] Read-only file system: '/nix/store/v62sgdhr3jn5n4zjwmcl44cxd4bwr8vq-python3.12-panel-0.0.0/lib/python3.12/site-packages/static'
Feb 25 12:37:54 fedi201 systemd[1]: panel.service: Control process exited, code=exited, status=1/FAILURE
Feb 25 12:37:54 fedi201 systemd[1]: panel.service: Failed with result 'exit-code'.
Feb 25 12:37:54 fedi201 systemd[1]: Failed to start panel ASGI server.

the trace seems unclear as to what it tried to write and why; will investigate.

/cc @fricklerhandwerk

<details> <summary> status: error on read-only file system i'm tryna trace </summary> ``` Feb 25 12:37:52 fedi201 systemd[1]: Starting panel ASGI server... Feb 25 12:37:53 fedi201 panel-pre-start[12146]: Operations to perform: Feb 25 12:37:53 fedi201 panel-pre-start[12146]: Apply all migrations: admin, auth, contenttypes, sessions Feb 25 12:37:53 fedi201 panel-pre-start[12146]: Running migrations: Feb 25 12:37:53 fedi201 panel-pre-start[12146]: No migrations to apply. Feb 25 12:37:54 fedi201 panel-pre-start[12149]: Traceback (most recent call last): Feb 25 12:37:54 fedi201 panel-pre-start[12149]: File "/nix/store/v62sgdhr3jn5n4zjwmcl44cxd4bwr8vq-python3.12-panel-0.0.0/bin/..manage.py-wrapped-wrapped", line 23, in <module> Feb 25 12:37:54 fedi201 panel-pre-start[12149]: main() Feb 25 12:37:54 fedi201 panel-pre-start[12149]: File "/nix/store/v62sgdhr3jn5n4zjwmcl44cxd4bwr8vq-python3.12-panel-0.0.0/bin/..manage.py-wrapped-wrapped", line 19, in main Feb 25 12:37:54 fedi201 panel-pre-start[12149]: execute_from_command_line(sys.argv) Feb 25 12:37:54 fedi201 panel-pre-start[12149]: File "/nix/store/hqls57j8xl2h76fqgwg5c0kxj2x77akr-python3.12-django-4.2.16/lib/python3.12/site-packages/django/core/management/__init__.py", line 442, in execute_from_command_line Feb 25 12:37:54 fedi201 panel-pre-start[12149]: utility.execute() Feb 25 12:37:54 fedi201 panel-pre-start[12149]: File "/nix/store/hqls57j8xl2h76fqgwg5c0kxj2x77akr-python3.12-django-4.2.16/lib/python3.12/site-packages/django/core/management/__init__.py", line 436, in execute Feb 25 12:37:54 fedi201 panel-pre-start[12149]: self.fetch_command(subcommand).run_from_argv(self.argv) Feb 25 12:37:54 fedi201 panel-pre-start[12149]: File "/nix/store/hqls57j8xl2h76fqgwg5c0kxj2x77akr-python3.12-django-4.2.16/lib/python3.12/site-packages/django/core/management/base.py", line 412, in run_from_argv Feb 25 12:37:54 fedi201 panel-pre-start[12149]: self.execute(*args, **cmd_options) Feb 25 12:37:54 fedi201 panel-pre-start[12149]: File "/nix/store/hqls57j8xl2h76fqgwg5c0kxj2x77akr-python3.12-django-4.2.16/lib/python3.12/site-packages/django/core/management/base.py", line 458, in execute Feb 25 12:37:54 fedi201 panel-pre-start[12149]: output = self.handle(*args, **options) Feb 25 12:37:54 fedi201 panel-pre-start[12149]: ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ Feb 25 12:37:54 fedi201 panel-pre-start[12149]: File "/nix/store/hqls57j8xl2h76fqgwg5c0kxj2x77akr-python3.12-django-4.2.16/lib/python3.12/site-packages/django/contrib/staticfiles/management/commands/collectstatic.py", line 209, in handle Feb 25 12:37:54 fedi201 panel-pre-start[12149]: collected = self.collect() Feb 25 12:37:54 fedi201 panel-pre-start[12149]: ^^^^^^^^^^^^^^ Feb 25 12:37:54 fedi201 panel-pre-start[12149]: File "/nix/store/hqls57j8xl2h76fqgwg5c0kxj2x77akr-python3.12-django-4.2.16/lib/python3.12/site-packages/django/contrib/staticfiles/management/commands/collectstatic.py", line 135, in collect Feb 25 12:37:54 fedi201 panel-pre-start[12149]: handler(path, prefixed_path, storage) Feb 25 12:37:54 fedi201 panel-pre-start[12149]: File "/nix/store/hqls57j8xl2h76fqgwg5c0kxj2x77akr-python3.12-django-4.2.16/lib/python3.12/site-packages/django/contrib/staticfiles/management/commands/collectstatic.py", line 378, in copy_file Feb 25 12:37:54 fedi201 panel-pre-start[12149]: self.storage.save(prefixed_path, source_file) Feb 25 12:37:54 fedi201 panel-pre-start[12149]: File "/nix/store/hqls57j8xl2h76fqgwg5c0kxj2x77akr-python3.12-django-4.2.16/lib/python3.12/site-packages/django/core/files/storage/base.py", line 49, in save Feb 25 12:37:54 fedi201 panel-pre-start[12149]: name = self._save(name, content) Feb 25 12:37:54 fedi201 panel-pre-start[12149]: ^^^^^^^^^^^^^^^^^^^^^^^^^ Feb 25 12:37:54 fedi201 panel-pre-start[12149]: File "/nix/store/hqls57j8xl2h76fqgwg5c0kxj2x77akr-python3.12-django-4.2.16/lib/python3.12/site-packages/django/core/files/storage/filesystem.py", line 87, in _save Feb 25 12:37:54 fedi201 panel-pre-start[12149]: os.makedirs(directory, exist_ok=True) Feb 25 12:37:54 fedi201 panel-pre-start[12149]: File "<frozen os>", line 225, in makedirs Feb 25 12:37:54 fedi201 panel-pre-start[12149]: OSError: [Errno 30] Read-only file system: '/nix/store/v62sgdhr3jn5n4zjwmcl44cxd4bwr8vq-python3.12-panel-0.0.0/lib/python3.12/site-packages/static' Feb 25 12:37:54 fedi201 systemd[1]: panel.service: Control process exited, code=exited, status=1/FAILURE Feb 25 12:37:54 fedi201 systemd[1]: panel.service: Failed with result 'exit-code'. Feb 25 12:37:54 fedi201 systemd[1]: Failed to start panel ASGI server. ``` </details> the trace seems unclear as to what it tried to write and why; will investigate. /cc @fricklerhandwerk
Owner

I know nothing about Django, but it is a classic of recent frameworks (eg. Laravel) to have one or a few subdirectories in the project that they write their state to, generate thumbnails, etc. It's always a PITA to package properly, and often the solution that I've seen is that the package takes a stateDir as argument and makes a symlink to that stateDir. The downside of this is that there is a not-necessarily-live symlink in the Nix store, and that there is one version of the package per stateDir. Cleaner would be to have the package accept a configuration of where to find this directory, such that the service could set it up accordingly.

I know nothing about Django, but it is a classic of recent frameworks (eg. Laravel) to have one or a few subdirectories in the project that they write their state to, generate thumbnails, etc. It's always a PITA to package properly, and often the solution that I've seen is that the package takes a `stateDir` as argument and makes a symlink to that `stateDir`. The downside of this is that there is a not-necessarily-live symlink in the Nix store, and that there is one version of the package per `stateDir`. Cleaner would be to have the package accept a configuration of where to find this directory, such that the service could set it up accordingly.
Author
Owner

thanks, think i got that one now.

the reported offending dir above is /nix/store/...-python3.12-panel-0.0.0/lib/python3.12/site-packages/static, which matches our settings.py's STATIC_ROOT = os.path.join(BASE_DIR, "static/"), which our nix module only overrode by mkDefault, presumably to facilitate overrides.

new issue: `ModuleNotFoundError: No module named 'panel'`
Feb 25 14:49:40 fedi201 systemd[1]: panel.service: Scheduled restart job, restart counter is at 4.
Feb 25 14:49:40 fedi201 systemd[1]: Starting panel ASGI server...
Feb 25 14:49:40 fedi201 systemd[1]: Started panel ASGI server.
Feb 25 14:49:40 fedi201 panel-start[15232]: Traceback (most recent call last):
Feb 25 14:49:40 fedi201 panel-start[15232]:   File "/nix/store/nf2igc60zal4lyknzkbhrpqipaqsafd7-python3.12-uvicorn-0.32.0/bin/.uvicorn-wrapped", line 9, in <module>
Feb 25 14:49:40 fedi201 panel-start[15232]:     sys.exit(main())
Feb 25 14:49:40 fedi201 panel-start[15232]:              ^^^^^^
Feb 25 14:49:40 fedi201 panel-start[15232]:   File "/nix/store/04wwlaj0av1cqnlyghnj8mkvp82gdg7q-python3-3.12.8-env/lib/python3.12/site-packages/click/core.py", line 1157, in __call__
Feb 25 14:49:40 fedi201 panel-start[15232]:     return self.main(*args, **kwargs)
Feb 25 14:49:40 fedi201 panel-start[15232]:            ^^^^^^^^^^^^^^^^^^^^^^^^^^
Feb 25 14:49:40 fedi201 panel-start[15232]:   File "/nix/store/04wwlaj0av1cqnlyghnj8mkvp82gdg7q-python3-3.12.8-env/lib/python3.12/site-packages/click/core.py", line 1078, in main
Feb 25 14:49:40 fedi201 panel-start[15232]:     rv = self.invoke(ctx)
Feb 25 14:49:40 fedi201 panel-start[15232]:          ^^^^^^^^^^^^^^^^
Feb 25 14:49:40 fedi201 panel-start[15232]:   File "/nix/store/04wwlaj0av1cqnlyghnj8mkvp82gdg7q-python3-3.12.8-env/lib/python3.12/site-packages/click/core.py", line 1434, in invoke
Feb 25 14:49:40 fedi201 panel-start[15232]:     return ctx.invoke(self.callback, **ctx.params)
Feb 25 14:49:40 fedi201 panel-start[15232]:            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
Feb 25 14:49:40 fedi201 panel-start[15232]:   File "/nix/store/04wwlaj0av1cqnlyghnj8mkvp82gdg7q-python3-3.12.8-env/lib/python3.12/site-packages/click/core.py", line 783, in invoke
Feb 25 14:49:40 fedi201 panel-start[15232]:     return __callback(*args, **kwargs)
Feb 25 14:49:40 fedi201 panel-start[15232]:            ^^^^^^^^^^^^^^^^^^^^^^^^^^^
Feb 25 14:49:40 fedi201 panel-start[15232]:   File "/nix/store/04wwlaj0av1cqnlyghnj8mkvp82gdg7q-python3-3.12.8-env/lib/python3.12/site-packages/uvicorn/main.py", line 412, in main
Feb 25 14:49:40 fedi201 panel-start[15232]:     run(
Feb 25 14:49:40 fedi201 panel-start[15232]:   File "/nix/store/04wwlaj0av1cqnlyghnj8mkvp82gdg7q-python3-3.12.8-env/lib/python3.12/site-packages/uvicorn/main.py", line 579, in run
Feb 25 14:49:40 fedi201 panel-start[15232]:     server.run()
Feb 25 14:49:40 fedi201 panel-start[15232]:   File "/nix/store/04wwlaj0av1cqnlyghnj8mkvp82gdg7q-python3-3.12.8-env/lib/python3.12/site-packages/uvicorn/server.py", line 65, in run
Feb 25 14:49:40 fedi201 panel-start[15232]:     return asyncio.run(self.serve(sockets=sockets))
Feb 25 14:49:40 fedi201 panel-start[15232]:            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
Feb 25 14:49:40 fedi201 panel-start[15232]:   File "/nix/store/kjgslpdqchx1sm7a5h9xibi5rrqcqfnl-python3-3.12.8/lib/python3.12/asyncio/runners.py", line 194, in run
Feb 25 14:49:40 fedi201 panel-start[15232]:     return runner.run(main)
Feb 25 14:49:40 fedi201 panel-start[15232]:            ^^^^^^^^^^^^^^^^
Feb 25 14:49:40 fedi201 panel-start[15232]:   File "/nix/store/kjgslpdqchx1sm7a5h9xibi5rrqcqfnl-python3-3.12.8/lib/python3.12/asyncio/runners.py", line 118, in run
Feb 25 14:49:40 fedi201 panel-start[15232]:     return self._loop.run_until_complete(task)
Feb 25 14:49:40 fedi201 panel-start[15232]:            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
Feb 25 14:49:40 fedi201 panel-start[15232]:   File "/nix/store/kjgslpdqchx1sm7a5h9xibi5rrqcqfnl-python3-3.12.8/lib/python3.12/asyncio/base_events.py", line 686, in run_until_complete
Feb 25 14:49:40 fedi201 panel-start[15232]:     return future.result()
Feb 25 14:49:40 fedi201 panel-start[15232]:            ^^^^^^^^^^^^^^^
Feb 25 14:49:40 fedi201 panel-start[15232]:   File "/nix/store/04wwlaj0av1cqnlyghnj8mkvp82gdg7q-python3-3.12.8-env/lib/python3.12/site-packages/uvicorn/server.py", line 69, in serve
Feb 25 14:49:40 fedi201 panel-start[15232]:     await self._serve(sockets)
Feb 25 14:49:40 fedi201 panel-start[15232]:   File "/nix/store/04wwlaj0av1cqnlyghnj8mkvp82gdg7q-python3-3.12.8-env/lib/python3.12/site-packages/uvicorn/server.py", line 76, in _serve
Feb 25 14:49:40 fedi201 panel-start[15232]:     config.load()
Feb 25 14:49:40 fedi201 panel-start[15232]:   File "/nix/store/04wwlaj0av1cqnlyghnj8mkvp82gdg7q-python3-3.12.8-env/lib/python3.12/site-packages/uvicorn/config.py", line 434, in load
Feb 25 14:49:40 fedi201 panel-start[15232]:     self.loaded_app = import_from_string(self.app)
Feb 25 14:49:40 fedi201 panel-start[15232]:                       ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
Feb 25 14:49:40 fedi201 panel-start[15232]:   File "/nix/store/04wwlaj0av1cqnlyghnj8mkvp82gdg7q-python3-3.12.8-env/lib/python3.12/site-packages/uvicorn/importer.py", line 22, in import_from_string
Feb 25 14:49:40 fedi201 panel-start[15232]:     raise exc from None
Feb 25 14:49:40 fedi201 panel-start[15232]:   File "/nix/store/04wwlaj0av1cqnlyghnj8mkvp82gdg7q-python3-3.12.8-env/lib/python3.12/site-packages/uvicorn/importer.py", line 19, in import_from_string
Feb 25 14:49:40 fedi201 panel-start[15232]:     module = importlib.import_module(module_str)
Feb 25 14:49:40 fedi201 panel-start[15232]:              ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
Feb 25 14:49:40 fedi201 panel-start[15232]:   File "/nix/store/kjgslpdqchx1sm7a5h9xibi5rrqcqfnl-python3-3.12.8/lib/python3.12/importlib/__init__.py", line 90, in import_module
Feb 25 14:49:40 fedi201 panel-start[15232]:     return _bootstrap._gcd_import(name[level:], package, level)
Feb 25 14:49:40 fedi201 panel-start[15232]:            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
Feb 25 14:49:40 fedi201 panel-start[15232]:   File "<frozen importlib._bootstrap>", line 1387, in _gcd_import
Feb 25 14:49:40 fedi201 panel-start[15232]:   File "<frozen importlib._bootstrap>", line 1360, in _find_and_load
Feb 25 14:49:40 fedi201 panel-start[15232]:   File "<frozen importlib._bootstrap>", line 1310, in _find_and_load_unlocked
Feb 25 14:49:40 fedi201 panel-start[15232]:   File "<frozen importlib._bootstrap>", line 488, in _call_with_frames_removed
Feb 25 14:49:40 fedi201 panel-start[15232]:   File "<frozen importlib._bootstrap>", line 1387, in _gcd_import
Feb 25 14:49:40 fedi201 panel-start[15232]:   File "<frozen importlib._bootstrap>", line 1360, in _find_and_load
Feb 25 14:49:40 fedi201 panel-start[15232]:   File "<frozen importlib._bootstrap>", line 1324, in _find_and_load_unlocked
Feb 25 14:49:40 fedi201 panel-start[15232]: ModuleNotFoundError: No module named 'panel'
Feb 25 14:49:40 fedi201 systemd[1]: panel.service: Main process exited, code=exited, status=1/FAILURE
Feb 25 14:49:40 fedi201 systemd[1]: panel.service: Failed with result 'exit-code'.
Feb 25 14:49:41 fedi201 systemd[1]: panel.service: Scheduled restart job, restart counter is at 5.
Feb 25 14:49:41 fedi201 systemd[1]: panel.service: Start request repeated too quickly.
Feb 25 14:49:41 fedi201 systemd[1]: panel.service: Failed with result 'exit-code'.
Feb 25 14:49:41 fedi201 systemd[1]: Failed to start panel ASGI server.

/cc @fricklerhandwerk

edit: WSGI_APPLICATION = 'panel.wsgi.application' seems related?

thanks, think i got that one now. the reported offending dir above is `/nix/store/...-python3.12-panel-0.0.0/lib/python3.12/site-packages/static`, which matches our [`settings.py`'s `STATIC_ROOT = os.path.join(BASE_DIR, "static/")`](https://git.fediversity.eu/Fediversity/Fediversity/src/commit/1677c9f8d770c57c12ab3487c94530bada8b777d/panel/src/panel/settings.py#L152), which our nix module only overrode by `mkDefault`, presumably to facilitate overrides. <details> <summary> new issue: `ModuleNotFoundError: No module named 'panel'` </summary> ``` Feb 25 14:49:40 fedi201 systemd[1]: panel.service: Scheduled restart job, restart counter is at 4. Feb 25 14:49:40 fedi201 systemd[1]: Starting panel ASGI server... Feb 25 14:49:40 fedi201 systemd[1]: Started panel ASGI server. Feb 25 14:49:40 fedi201 panel-start[15232]: Traceback (most recent call last): Feb 25 14:49:40 fedi201 panel-start[15232]: File "/nix/store/nf2igc60zal4lyknzkbhrpqipaqsafd7-python3.12-uvicorn-0.32.0/bin/.uvicorn-wrapped", line 9, in <module> Feb 25 14:49:40 fedi201 panel-start[15232]: sys.exit(main()) Feb 25 14:49:40 fedi201 panel-start[15232]: ^^^^^^ Feb 25 14:49:40 fedi201 panel-start[15232]: File "/nix/store/04wwlaj0av1cqnlyghnj8mkvp82gdg7q-python3-3.12.8-env/lib/python3.12/site-packages/click/core.py", line 1157, in __call__ Feb 25 14:49:40 fedi201 panel-start[15232]: return self.main(*args, **kwargs) Feb 25 14:49:40 fedi201 panel-start[15232]: ^^^^^^^^^^^^^^^^^^^^^^^^^^ Feb 25 14:49:40 fedi201 panel-start[15232]: File "/nix/store/04wwlaj0av1cqnlyghnj8mkvp82gdg7q-python3-3.12.8-env/lib/python3.12/site-packages/click/core.py", line 1078, in main Feb 25 14:49:40 fedi201 panel-start[15232]: rv = self.invoke(ctx) Feb 25 14:49:40 fedi201 panel-start[15232]: ^^^^^^^^^^^^^^^^ Feb 25 14:49:40 fedi201 panel-start[15232]: File "/nix/store/04wwlaj0av1cqnlyghnj8mkvp82gdg7q-python3-3.12.8-env/lib/python3.12/site-packages/click/core.py", line 1434, in invoke Feb 25 14:49:40 fedi201 panel-start[15232]: return ctx.invoke(self.callback, **ctx.params) Feb 25 14:49:40 fedi201 panel-start[15232]: ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ Feb 25 14:49:40 fedi201 panel-start[15232]: File "/nix/store/04wwlaj0av1cqnlyghnj8mkvp82gdg7q-python3-3.12.8-env/lib/python3.12/site-packages/click/core.py", line 783, in invoke Feb 25 14:49:40 fedi201 panel-start[15232]: return __callback(*args, **kwargs) Feb 25 14:49:40 fedi201 panel-start[15232]: ^^^^^^^^^^^^^^^^^^^^^^^^^^^ Feb 25 14:49:40 fedi201 panel-start[15232]: File "/nix/store/04wwlaj0av1cqnlyghnj8mkvp82gdg7q-python3-3.12.8-env/lib/python3.12/site-packages/uvicorn/main.py", line 412, in main Feb 25 14:49:40 fedi201 panel-start[15232]: run( Feb 25 14:49:40 fedi201 panel-start[15232]: File "/nix/store/04wwlaj0av1cqnlyghnj8mkvp82gdg7q-python3-3.12.8-env/lib/python3.12/site-packages/uvicorn/main.py", line 579, in run Feb 25 14:49:40 fedi201 panel-start[15232]: server.run() Feb 25 14:49:40 fedi201 panel-start[15232]: File "/nix/store/04wwlaj0av1cqnlyghnj8mkvp82gdg7q-python3-3.12.8-env/lib/python3.12/site-packages/uvicorn/server.py", line 65, in run Feb 25 14:49:40 fedi201 panel-start[15232]: return asyncio.run(self.serve(sockets=sockets)) Feb 25 14:49:40 fedi201 panel-start[15232]: ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ Feb 25 14:49:40 fedi201 panel-start[15232]: File "/nix/store/kjgslpdqchx1sm7a5h9xibi5rrqcqfnl-python3-3.12.8/lib/python3.12/asyncio/runners.py", line 194, in run Feb 25 14:49:40 fedi201 panel-start[15232]: return runner.run(main) Feb 25 14:49:40 fedi201 panel-start[15232]: ^^^^^^^^^^^^^^^^ Feb 25 14:49:40 fedi201 panel-start[15232]: File "/nix/store/kjgslpdqchx1sm7a5h9xibi5rrqcqfnl-python3-3.12.8/lib/python3.12/asyncio/runners.py", line 118, in run Feb 25 14:49:40 fedi201 panel-start[15232]: return self._loop.run_until_complete(task) Feb 25 14:49:40 fedi201 panel-start[15232]: ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ Feb 25 14:49:40 fedi201 panel-start[15232]: File "/nix/store/kjgslpdqchx1sm7a5h9xibi5rrqcqfnl-python3-3.12.8/lib/python3.12/asyncio/base_events.py", line 686, in run_until_complete Feb 25 14:49:40 fedi201 panel-start[15232]: return future.result() Feb 25 14:49:40 fedi201 panel-start[15232]: ^^^^^^^^^^^^^^^ Feb 25 14:49:40 fedi201 panel-start[15232]: File "/nix/store/04wwlaj0av1cqnlyghnj8mkvp82gdg7q-python3-3.12.8-env/lib/python3.12/site-packages/uvicorn/server.py", line 69, in serve Feb 25 14:49:40 fedi201 panel-start[15232]: await self._serve(sockets) Feb 25 14:49:40 fedi201 panel-start[15232]: File "/nix/store/04wwlaj0av1cqnlyghnj8mkvp82gdg7q-python3-3.12.8-env/lib/python3.12/site-packages/uvicorn/server.py", line 76, in _serve Feb 25 14:49:40 fedi201 panel-start[15232]: config.load() Feb 25 14:49:40 fedi201 panel-start[15232]: File "/nix/store/04wwlaj0av1cqnlyghnj8mkvp82gdg7q-python3-3.12.8-env/lib/python3.12/site-packages/uvicorn/config.py", line 434, in load Feb 25 14:49:40 fedi201 panel-start[15232]: self.loaded_app = import_from_string(self.app) Feb 25 14:49:40 fedi201 panel-start[15232]: ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ Feb 25 14:49:40 fedi201 panel-start[15232]: File "/nix/store/04wwlaj0av1cqnlyghnj8mkvp82gdg7q-python3-3.12.8-env/lib/python3.12/site-packages/uvicorn/importer.py", line 22, in import_from_string Feb 25 14:49:40 fedi201 panel-start[15232]: raise exc from None Feb 25 14:49:40 fedi201 panel-start[15232]: File "/nix/store/04wwlaj0av1cqnlyghnj8mkvp82gdg7q-python3-3.12.8-env/lib/python3.12/site-packages/uvicorn/importer.py", line 19, in import_from_string Feb 25 14:49:40 fedi201 panel-start[15232]: module = importlib.import_module(module_str) Feb 25 14:49:40 fedi201 panel-start[15232]: ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ Feb 25 14:49:40 fedi201 panel-start[15232]: File "/nix/store/kjgslpdqchx1sm7a5h9xibi5rrqcqfnl-python3-3.12.8/lib/python3.12/importlib/__init__.py", line 90, in import_module Feb 25 14:49:40 fedi201 panel-start[15232]: return _bootstrap._gcd_import(name[level:], package, level) Feb 25 14:49:40 fedi201 panel-start[15232]: ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ Feb 25 14:49:40 fedi201 panel-start[15232]: File "<frozen importlib._bootstrap>", line 1387, in _gcd_import Feb 25 14:49:40 fedi201 panel-start[15232]: File "<frozen importlib._bootstrap>", line 1360, in _find_and_load Feb 25 14:49:40 fedi201 panel-start[15232]: File "<frozen importlib._bootstrap>", line 1310, in _find_and_load_unlocked Feb 25 14:49:40 fedi201 panel-start[15232]: File "<frozen importlib._bootstrap>", line 488, in _call_with_frames_removed Feb 25 14:49:40 fedi201 panel-start[15232]: File "<frozen importlib._bootstrap>", line 1387, in _gcd_import Feb 25 14:49:40 fedi201 panel-start[15232]: File "<frozen importlib._bootstrap>", line 1360, in _find_and_load Feb 25 14:49:40 fedi201 panel-start[15232]: File "<frozen importlib._bootstrap>", line 1324, in _find_and_load_unlocked Feb 25 14:49:40 fedi201 panel-start[15232]: ModuleNotFoundError: No module named 'panel' Feb 25 14:49:40 fedi201 systemd[1]: panel.service: Main process exited, code=exited, status=1/FAILURE Feb 25 14:49:40 fedi201 systemd[1]: panel.service: Failed with result 'exit-code'. Feb 25 14:49:41 fedi201 systemd[1]: panel.service: Scheduled restart job, restart counter is at 5. Feb 25 14:49:41 fedi201 systemd[1]: panel.service: Start request repeated too quickly. Feb 25 14:49:41 fedi201 systemd[1]: panel.service: Failed with result 'exit-code'. Feb 25 14:49:41 fedi201 systemd[1]: Failed to start panel ASGI server. ``` </details> /cc @fricklerhandwerk edit: [`WSGI_APPLICATION = 'panel.wsgi.application'`](https://git.fediversity.eu/Fediversity/Fediversity/src/commit/1677c9f8d770c57c12ab3487c94530bada8b777d/panel/src/panel/settings.py#L101) seems related?
kiara force-pushed deploy-panel from d1d25117e0
All checks were successful
/ check-pre-commit (pull_request) Successful in 24s
/ check-website (pull_request) Successful in 10s
/ check-peertube (pull_request) Successful in 20s
to d5264a52a1
All checks were successful
/ check-pre-commit (pull_request) Successful in 27s
/ check-website (pull_request) Successful in 12s
/ check-peertube (pull_request) Successful in 23s
2025-02-25 16:13:34 +01:00
Compare
update fedipanel import references
All checks were successful
/ check-pre-commit (pull_request) Successful in 27s
/ check-website (pull_request) Successful in 13s
/ check-peertube (pull_request) Successful in 23s
1d4004ccf4
Author
Owner

it appears my new issue is about not having the PYTHONPATH set, which in the shell seems covered by inputsFrom = [ package ];.

for the panel module itself for example i can fix this by adding:

    systemd.services.${name}.script = ''
      export PYTHONPATH="$PYTHONPATH:${panel}/lib/python3.12/site-packages"
    '';

however, this does not yet address adding the remaining dependencies.

it appears my new issue is about not having the `PYTHONPATH` set, which in the shell seems covered by [`inputsFrom = [ package ];`](https://git.fediversity.eu/Fediversity/Fediversity/src/commit/4e30363c5f3291b71a51a793cab28ca74fd5a0eb/panel/default.nix#L25). for the panel module itself for example i can fix this by adding: ```nix systemd.services.${name}.script = '' export PYTHONPATH="$PYTHONPATH:${panel}/lib/python3.12/site-packages" ''; ``` however, this does not yet address adding the remaining dependencies.
Author
Owner

i tried to look for deps in "${pkgs.python3.withPackages (_: cfg.package.propagatedBuildInputs)}/lib/python3.12/", but this seems not to cover e.g. django, which still seems reported missing.
checking the nix-security-tracker codebase for further inspiration.

i tried to look for deps in `"${pkgs.python3.withPackages (_: cfg.package.propagatedBuildInputs)}/lib/python3.12/"`, but this seems not to cover e.g. django, which still seems reported missing. checking the [nix-security-tracker](https://github.com/Nix-Security-WG/nix-security-tracker) codebase for further inspiration.
minimum setup i got working for deployment
All checks were successful
/ check-pre-commit (pull_request) Successful in 6s
/ check-website (pull_request) Successful in 12s
/ check-peertube (pull_request) Successful in 22s
f828afd5d5
kiara changed title from WIP: deploy fedipanel to deploy fedipanel 2025-02-27 09:19:03 +01:00
@ -32,1 +38,4 @@
django_4
setuptools
]
++ cfg.package.propagatedBuildInputs

This and the above list should be equivalent

This and the above list should be equivalent
Author
Owner

try it, i did 😭

try it, i did 😭
Niols approved these changes 2025-02-27 16:59:16 +01:00
Niols left a comment

LGTM! Have you tried deploying?

LGTM! Have you tried deploying?
Author
Owner

@Niols wrote in Fediversity/Fediversity#201 (comment):

LGTM! Have you tried deploying?

yep! during the standup it was available at demo.fediversity.eu - since then we've nixops4 apply'd other stuff. 🙈

@Niols wrote in https://git.fediversity.eu/Fediversity/Fediversity/pulls/201#issuecomment-4663: > LGTM! Have you tried deploying? yep! during the standup it was available at `demo.fediversity.eu` - since then we've `nixops4 apply`'d other stuff. 🙈
Owner

since then we've nixops4 apply'd other stuff

Bad Niols; bad!

> since then we've `nixops4 apply`'d other stuff Bad Niols; bad!
kiara merged commit 9cc1e40b5d into main 2025-02-27 22:06:26 +01:00
kiara deleted branch deploy-panel 2025-02-27 22:06:26 +01:00
Owner

This was merged, but I see nothing behind demo.fediversity.eu; is that normal? Are we missing stuff? Deployment? DNS entries?

This was merged, but I see nothing behind demo.fediversity.eu; is that normal? Are we missing stuff? Deployment? DNS entries?
Author
Owner

@niols CD is a separate story, and so is separating environments

@niols CD is a separate story, and so is separating environments
Owner

Oh, I didn't necessarily mean CD, I just meant manually - shouldn't we push the configuration to the machine, if it reaches main?

Oh, I didn't necessarily mean CD, I just meant manually - shouldn't we push the configuration to the machine, if it reaches main?
Author
Owner

@niols sure, tho I can't prevent people from invoking it during dev for testing

@niols sure, tho I can't prevent people from invoking it during dev for testing
Owner

Of course!

Of course!
Sign in to join this conversation.
No reviewers
No milestone
No project
3 participants
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
fediversity/fediversity!201
No description provided.