Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 10 additions & 7 deletions .github/workflows/test_integration_e2e.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,14 @@ on:
jobs:
e2e-integration-tests:
runs-on: ubuntu-latest

env:
# Use the small 12-hour file (committed to the repo) to avoid a large
# download in CI. The 3-month file is only needed for production.
# Job-level so every `docker compose` call sees the same config and
# does not recreate the running services.
OPENMRG_NETCDF_FILE: /app/example_data/openMRG_cmls_20150827_12hours.nc
OPENMRG_NETCDF_FILE_URL: ""

steps:
- uses: actions/checkout@v4

Expand Down Expand Up @@ -69,11 +76,6 @@ jobs:
cat ssh_keys/known_hosts

- name: Start services
env:
# Use the small 12-hour file (committed to the repo) to avoid a large
# download in CI. The 3-month file is only needed for production.
OPENMRG_NETCDF_FILE: /app/example_data/openMRG_cmls_20150827_12hours.nc
OPENMRG_NETCDF_FILE_URL: ""
run: |
docker compose up -d database sftp_receiver parser_demo_openmrg_main webserver mno_simulator_openmrg
sleep 10
Expand Down Expand Up @@ -118,7 +120,8 @@ jobs:

- name: Run E2E integration tests
run: |
docker compose --profile testing run --rm integration_tests
# --no-deps: services are already running; don't let compose recreate them
docker compose --profile testing run --rm --no-deps integration_tests

- name: Show logs on failure
if: failure()
Expand Down
29 changes: 29 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -215,3 +215,32 @@ users:
A user with multiple independent CML subnetworks gets one parser per source;
all sources share the same `user_id` so Grafana sees their data unified.

### Admin accounts

An optional top-level `admins:` list in `users.yml` defines web-login accounts
that see **all providers** at once:

```yaml
admins:
- id: gmdi_admin
display_name: Administrator
```

After running the generator, set a password with
`python scripts/set_password.py gmdi_admin`. Admin accounts get two extra pages
(they have no tenant data of their own):

- `/admin/realtime` — map of every CML, coloured per provider, with per-provider toggles,
and an embedded Grafana time series (RSL / TSL) below it; clicking a link on the map
selects that provider and CML in the panel
- `/admin/archive` — per-provider summary and daily record-count / mean-RSL plots

Admin views query as `webserver_role` (read-only session), which already has
read access across tenants; no database migration is needed. All admins share
one extra Grafana org (created by `init_grafana` when `admins:` is set) with a
`webserver_role` datasource and the dashboard in `grafana/admin_dashboards/`.
Auth-proxy logins map to Grafana users by login name, so do not use `admin` as
an admin id: it resolves to Grafana's built-in `admin` account. Admin routes are
guarded by `@admin_required` in `webserver/main.py` — use it on any new
cross-tenant route.

1 change: 1 addition & 0 deletions grafana/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
FROM python:3.11-slim
RUN pip install --no-cache-dir requests
COPY init_grafana.py /init_grafana.py
COPY admin_dashboards /admin_dashboards
CMD ["python", "/init_grafana.py"]
Loading
Loading