Skip to content

Update install.py to handle external django apps with server mode#11627

Merged
pslh merged 28 commits into
engine-3.26from
fixinst
Jul 21, 2026
Merged

Update install.py to handle external django apps with server mode#11627
pslh merged 28 commits into
engine-3.26from
fixinst

Conversation

@pslh

@pslh pslh commented Jul 17, 2026

Copy link
Copy Markdown
Member

Add a USER field to all four installation mode classes - for server and server_devel this indicates the user who should own db and other files. Pass inst to all relevant functions.

Use VENV openquake/server/manage.py rather than django-admin + env vars; in server mode we need to run some commands as root but others as openquake, running sudo while also changing the environment is uncomfortable. Manage.py already has the correct environment settings and so can be used with sudo more easily.

Run migrations before running app postinstall scripts

Some code cleanup in install_or_postinstall_standalone required. Not yet tested on Windows/mac.

@pslh
pslh requested review from micheles, ptormene and vot4anto July 17, 2026 18:16
@vot4anto

Copy link
Copy Markdown
Contributor

@micheles

Copy link
Copy Markdown
Contributor

Makes sense to me. When the tests are green consider it approved.

@vot4anto

Copy link
Copy Markdown
Contributor

@vot4anto

vot4anto commented Jul 18, 2026

Copy link
Copy Markdown
Contributor

Linux devel server installation: https://github.com/gem/oq-engine/actions/runs/29647261456

@vot4anto

Copy link
Copy Markdown
Contributor

The devel server is not more available on docker container: https://github.com/gem/oq-engine/actions/runs/29748728805

@nastasi-oq
nastasi-oq self-requested a review July 20, 2026 14:08
@vot4anto

Copy link
Copy Markdown
Contributor

MacOS devel installation, It is correct that all this migration on devel installation?

https://github.com/gem/oq-engine/actions/runs/29770604234/job/88447453040#step:5:388

Do we need auth for a devel installation?
Apply all migrations: auth, contenttypes, django_gem_taxonomy

@vot4anto

vot4anto commented Jul 20, 2026

Copy link
Copy Markdown
Contributor

Windows devel installation:
same behaviour of MacOS:
https://github.com/gem/oq-engine/actions/runs/29770570335/job/88447349879#step:6:431
Apply all migrations: auth, contenttypes, django_gem_taxonomy

And the action fail:

Traceback (most recent call last):
  File "C:\Users\runneradmin\openquake\Lib\site-packages\django\core\management\commands\dumpdata.py", line 261, in handle
    stream = open_method(file_path, "wt", **kwargs)
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
FileNotFoundError: [Errno 2] No such file or directory: '/tmp/taxonomy_standard_dump-18701794.json'

gem/django-gem-taxonomy#5

@vot4anto

Copy link
Copy Markdown
Contributor

Server installation:
https://github.com/gem/oq-engine/actions/runs/29770378572

We could add it to all PRs; had that been the case, we would have spotted the existing errors.

@vot4anto

Copy link
Copy Markdown
Contributor

Run also of extended tests:
https://github.com/gem/oq-engine/actions/runs/29772067354

@vot4anto vot4anto left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@pslh
pslh merged commit e43e40b into engine-3.26 Jul 21, 2026
4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants