Production: AlmaLinux host, gunicorn + nginx + systemd, MariaDB + Valkey external. Not containerized.
The role at ansible/roles/lumina is designed to slot into an existing playbook:
# site.yml
- hosts: lumina
become: true
roles:
- role: lumina
vars:
lumina_hostname: catalog.almalinux.org
lumina_secret_key: "{{ vault_lumina_secret_key }}"
lumina_db_password: "{{ vault_lumina_db_password }}"
lumina_oidc_client_id: lumina
lumina_oidc_client_secret: "{{ vault_lumina_oidc_secret }}"
lumina_oidc_issuer: https://keycloak.almalinux.org/realms/almalinux
lumina_review_notify_emails: reviewers@almalinux.orgThe sensitive variables (lumina_secret_key, lumina_db_password,
lumina_oidc_client_secret) should come from ansible-vault.
- AlmaLinux 9 or 10.
- Python 3.12 available (the role installs
python3.12from base repos). - MariaDB and Valkey reachable from the host (separate servers or co-located; the role does not install or manage them).
- TLS cert+key present at
lumina_tls_cert/lumina_tls_key; certbot or an equivalent workflow should manage renewal.
- Installs system packages (Python 3.12, mariadb-connector-c-devel, nginx, git).
- Creates the
luminasystem user and directory layout under/opt/luminaand/var/lib/lumina. - Clones the app repo at
lumina_versioninto/opt/lumina/app. - Creates a virtualenv at
/opt/lumina/venvand installs the app. - Writes
/etc/lumina.envwith all Django settings. - Installs a hardened gunicorn systemd unit listening on
/run/lumina/gunicorn.sock. - Installs an nginx vhost that terminates TLS and proxies to the socket.
- Runs
migrateandcollectstaticon every deploy via handlers.
migrate is sufficient to bring up a usable database: hardware/0003_reference_data
seeds the CPU and GPU families every incoming run is classified against, plus the
three silicon vendors that own them. There is no separate seeding step for
production. That migration is idempotent (get_or_create on vendor and name) and
never overwrites an existing row, so a family whose patterns have been tuned in the
admin keeps them across deploys. seed_devstack is development-only sample data and
is not run here.
Bumping lumina_version (e.g. to a tagged release) triggers the
migrate, collectstatic, and restart handlers. Rollback is just
setting lumina_version back to the prior tag and re-running.
If you want to deploy by hand once to verify the steps work, the equivalent commands are:
sudo dnf install -y python3.12 python3.12-devel gcc git nginx \
mariadb-connector-c-devel pkgconf-pkg-config
sudo useradd --system --home /opt/lumina --shell /sbin/nologin lumina
sudo install -d -o lumina -g lumina /opt/lumina/app /var/lib/lumina/media \
/var/lib/lumina/static /var/log/lumina /run/lumina
sudo -u lumina git clone https://github.com/AlmaLinux/lumina.git /opt/lumina/app
sudo -u lumina python3.12 -m venv /opt/lumina/venv
sudo -u lumina /opt/lumina/venv/bin/pip install -e /opt/lumina/app
sudo -u lumina env $(cat /etc/lumina.env | xargs) \
/opt/lumina/venv/bin/python /opt/lumina/app/manage.py migrateThen enable lumina.service and reload nginx.