OSHA OiRA Statistics Deployment
This package contains configuration and scripts for deploying the OSHA OiRA statistics. The buildout configuration sets up a number of metabase instances to serve the statistics and generates scripts to manage them.
Setup
Quickstart
Create a buildout.cfg like this:
[buildout]
extends =
base.cfg
secrets.cfg
[secrets]
<= secrets-production
Run
# make
Installation / Update
One-Shot
If you're installing for the first time, you need to make sure the databases are created (see below). If you're updating an existing installation, it's usually enough to call
# make
or, equivalently,
# make all
This sets up everything in one go except for creating the databases - you may need to do this as a privileged user, and it's unnecessary to run on every update, so it's not included by default. See "Creating the Databases" for instructions.
Step-By-Step
If the one-shot setup fails for some reason or you're interested in the details, read on for a step-by-step setup.
If you're in an environment with managed secrets, decrypt the secrets file with:
# gpg -d secrets.cfg.gpg > secrets.cfg
Create a buildout.cfg that extends base.cfg and, if you're using it, secrets.cfg.
[buildout]
extends =
base.cfg
secrets.cfg
Make sure that there is a secrets section in your buildout.cfg and that it inherits from the correct section in secrets.cfg.gpg:
[secrets]
<= secrets-production
Otherwise set the passwords manually:
[secrets]
metabase-password = secret
ldap-password = secret
If you want to bind to a different address than localhost, set the metabase-host:
[metabase-instance]
metabase-host = oira.local
Then, as usual, run:
# bin/buildout
Alternatively, decrypting and running buildout is done by
# make buildout
Creating the Databases
During the first setup or if you get an error like
psql: FATAL: database "xyz" does not exist
you will need to initialize the postgresql databases. Make sure
- buildout has run sucessfully (
make buildoutorbin/buildout) PSQL_USER(see Makefile) is set to a user who may create postgresql databases- your current user can use sudo to become
PSQL_USER
Once you're set, run
# make create-databases
or, if you're already logged in as an appropriate user
# psql -U postgres < scripts/create-databases.sql
and then retry make all.
Usage
Getting started
If you've run make all successfully, you can skip this section.
To set up the metabase instances:
# bin/init-metabase
or
# make init-metabase
This calls bin/init-metabase-instance (see below) for all instances with the parameters specified in the corresponding buildout sections.
After that you can log in to the metabase instances with the credentials you provided in the buildout configuration.
Making changes
To make changes to the metabase content, modify the data in oira.statistics.deployment.content. It may be convenient to make changes via the UI and then get the corresponding values via the API. You can use the ipybase shell defined in devel.cfg for this purpose.
To apply the changes to the global and country instances, again run
# bin/init-metabase
init-metabase-instance
Applies settings to a single metabase instance. Sets database connection parameters and optionally creates an additional user. Run init-metabase-instance --help for arguments.
init-metabase
Initializes all metabase instances by dropping all database content and running
init-metabase-instance on each of them. Does not take any parameters; buildout writes
them directly into the script. If the environment variable SKIP_DB_RESTORE is set, database contents are not dropped but kept.
Changelog
1.1.3 (2026-05-11)
- Update for Python 3.13 Refs. https://github.com/syslabcom/scrum/issues/4800
1.1.2 (2026-01-21)
-
Removed trailing slashes from URIs Refs. https://github.com/syslabcom/scrum/issues/4181
-
Removed obsolete chart Refs. https://github.com/syslabcom/scrum/issues/4389
1.1.1 (2025-12-09)
- Added tools to Live performance Refs. https://github.com/syslabcom/scrum/issues/4181
1.1.0 (2025-04-01)
- Custom “Learned about OiRA” display for France https://github.com/syslabcom/scrum/issues/2375
- New sector: Agriculture https://github.com/syslabcom/scrum/issues/3312
1.0.0 (2024-06-13)
- Initial release
Metadata
Release files for oira.statistics.deployment 1.1.3
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| oira_statistics_deployment-1.1.3.tar.gz | 660.0 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| oira_statistics_deployment-1.1.3-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 693.3 kB
Release files / oira_statistics_deployment-1.1.3.tar.gz
| Download URL | oira_statistics_deployment-1.1.3.tar.gz |
|---|---|
| Size | 660.0 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
becfc4b500b8c15cb954ac6c6192e65af429315235db116fbf26764c2c3bdab0
|
|
BLAKE2b-256 checksum How to use checksums |
ec13ccd7cf43af773078f80179cf57ba3d5ced5bdba1396cf2e62991cf31e405
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.14.4
|
Release files / oira_statistics_deployment-1.1.3-py3-none-any.whl
| Download URL | oira_statistics_deployment-1.1.3-py3-none-any.whl |
|---|---|
| Size | 33.2 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
7df42e80b98f0ec2d654a9cd3f6d9663cc0d0a7e641af0e643ded77ebbb87e26
|
|
BLAKE2b-256 checksum How to use checksums |
135acdf30fe033738f39fd68b6e7aad63cfe9eb75a476deb93b10c2db61d9233
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.14.4
|