ckanext-marinerg
This is the CKAN extension behind the MARINERG-i data catalogue, where test facilities describe the datasets from their marine renewable energy test campaigns. The data stays in Zenodo; the catalogue makes it findable. The extension adds a marine metadata form, controlled vocabularies, DOI prefill from Zenodo, facility pickers, a DCAT-AP export for European harvesters, and Keycloak login.
New to data catalogues? Start with How the catalogue works. It explains the concepts and lists what is built and what is not.
Run it locally
You need Docker or Podman.
cd infra
cp .env.example .env
docker compose -f compose.yml -f compose.local.yml up -d --build
CKAN is on http://localhost:5001. Log in as ckan_admin, password ckan_admin.
On Apple Silicon, set CKAN_PLATFORM=linux/arm64 in .env first.
The local stack mounts this repo into the container, so Python changes take
effect straight away. Restart the ckan service to pick up template changes,
and rebuild with --build after a dependency change. The Zenodo prefill talks
to a zenodo-mock
on port 8766, so a local run never touches real Zenodo. The facility pickers
expect the access portal on port 8000, and show nothing without it.
Find your way around
Start at ckanext/marinerg/plugin.py, which registers everything with CKAN.
| Path | What it does |
|---|---|
schemas/dataset.yaml |
The dataset form: fields, help text and layout |
validators.py |
Rejects values outside the controlled vocabularies |
profile.py |
Adds our fields to the DCAT-AP export |
signposting.py |
Adds FAIR Signposting headers to dataset pages |
actions.py |
Zenodo prefill, and the facility and equipment lookups |
oidc_*.py |
Keycloak login, and roles from the ckan_role claim |
registry/ |
Vocabulary labels, fetched by scripts/fetch_* |
templates/, assets/ |
The theme |
The fields and their allowed values come from the
marinerg-schema package. To
change a vocabulary, change it there and release it, then run
uv lock --upgrade-package marinerg-schema here.
Develop
uv sync --group dev
uv run pytest
uv run ruff check ckanext tests
uv run ruff format ckanext tests
uv run mypy ckanext
uv run python scripts/check_schema_convergence.py
The tests stub CKAN, so they need no CKAN install. Ruff targets Python 3.10, because that's what CKAN 2.11 runs.
Theme
The theme is one stylesheet, assets/css/marinerg-theme.css, loaded after
CKAN's own. Only style what CKAN doesn't, and match CKAN's markup instead of
overriding it. Set the logo, favicon and site title in CKAN's config at
/ckan-admin/config, not in CSS.
We don't use a compiled SCSS theme. CKAN's theme variables can't be overridden without forking its SCSS, which would break on each CKAN upgrade.
Configuration
infra/Dockerfile bakes these keys into ckan.ini, except the token, which
is only set at runtime. The runtime environment variable overrides the baked
value.
| Key | Runtime variable | Purpose |
|---|---|---|
marinerg.facility_api_url |
MARINERG_FACILITY_API_URL |
The access portal's API, for the facility pickers |
marinerg.facility_api_token |
MARINERG_FACILITY_API_TOKEN |
A token to see non-public facilities |
marinerg.portal_base_url |
MARINERG_PORTAL_BASE_URL |
The access portal, for policy links and facility identifiers |
marinerg.zenodo_api_url |
The Zenodo API for prefill | |
marinerg.zenodo_api_key |
Optional Zenodo key for prefill |
Unset, the facility pickers and portal links show nothing. The OIDC settings
and the plugin list are read at runtime. See infra/README.md.
Release
Run a pipeline on main with RELEASE_FIELD set to patch, minor or
major. It tags a release, which publishes the package and the CKAN image.
Then set the new image tag in the
infra repo and deploy.
Licence
AGPL-3.0-or-later. See LICENSE. Copyright © Irish Centre for
High-End Computing (ICHEC).
Metadata
Release files for ckanext-marinerg 0.6.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| ckanext_marinerg-0.6.0.tar.gz | 1.3 MB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| ckanext_marinerg-0.6.0-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 2.6 MB
Release files / ckanext_marinerg-0.6.0.tar.gz
| Download URL | ckanext_marinerg-0.6.0.tar.gz |
|---|---|
| Size | 1.3 MB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
f4a00b22e76e8e501776e7680406dd361d67f364aec219d51393e1a214aa26b6
|
|
BLAKE2b-256 checksum How to use checksums |
324efa6fb18e8840840567a0d1ae89daa000c503589ff3d11f01faa5848b3c3b
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.14.6
|
Release files / ckanext_marinerg-0.6.0-py3-none-any.whl
| Download URL | ckanext_marinerg-0.6.0-py3-none-any.whl |
|---|---|
| Size | 1.3 MB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
be88e4e170bfceb020949b1323c9380d6c9b1cafc58cfcfc6ca61c682ae131e5
|
|
BLAKE2b-256 checksum How to use checksums |
de21650b49dc9c65080800597de5c9400ce28f1f589dc82334960d0f02037cb8
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.14.6
|