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 |
Checks each field against the model, and supplies the form's choices |
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, their allowed values and labels, and their constraints come from the
marinerg-schema package. To
change one, change it there and release it. Then move the exact pin in
pyproject.toml and run uv lock. The pin is exact because the CKAN image
installs from pyproject.toml, not the lock.
Develop
uv sync --group dev
uv run tox
uv run tox runs the format check, lint, type check and tests, as CI does. The
tests include the check that the form still takes its rules from the model.
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
Open the newest pipeline for main
and press the play button on release patch, minor or major. The release
pipeline publishes the package to PyPI and the CKAN image to DockerHub. It scans
the image first, and a high or critical vulnerability with a fix stops the
release. Then it tags the commit. 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.7.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.7.0.tar.gz | 1.3 MB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| ckanext_marinerg-0.7.0-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 2.6 MB
Release files / ckanext_marinerg-0.7.0.tar.gz
| Download URL | ckanext_marinerg-0.7.0.tar.gz |
|---|---|
| Size | 1.3 MB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
ab5ef4fd08e5598038ca7419dae1fbbbfd811d0f9e99d4c03adcfac4df297a7a
|
|
BLAKE2b-256 checksum How to use checksums |
00d6e5c795f5f181cdab3f71eb99e5d977a6e46278ec71b10ef372de4f6d3a82
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.14.7
|
Release files / ckanext_marinerg-0.7.0-py3-none-any.whl
| Download URL | ckanext_marinerg-0.7.0-py3-none-any.whl |
|---|---|
| Size | 1.3 MB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
0ce6a73078954714a92040a7e461b49ec47698d49fde1c370aeb1f04579dca79
|
|
BLAKE2b-256 checksum How to use checksums |
58f6c56a06c4ef0febee5821f439a5dc98f539abbf96bc8bfdfeafca8151f53d
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.14.7
|