Skip to main content

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. Sign 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 read from the access portal's API, at MARINERG_FACILITY_API_URL in .env. The portal must list host.docker.internal in its DJANGO_ALLOWED_HOSTS, or it refuses CKAN's requests and the pickers stay empty.

.env.example sets fixed secrets, so API tokens keep working after up --force-recreate. To load example datasets, follow scripts/SEEDING.md.

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. The image runs CKAN 2.12 on Python 3.14. Ruff targets Python 3.10, which CKAN 2.11 runs, so the package still installs there.

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.9.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for ckanext-marinerg 0.9.0
File Size Uploaded
ckanext_marinerg-0.9.0.tar.gz 1.3 MB Details

Built distribution (wheel)

Table of built distributions (wheels) for ckanext-marinerg 0.9.0
File Interpreter ABI Platform
ckanext_marinerg-0.9.0-py3-none-any.whl Python 3 none any Details

Total release size: 2.6 MB

Release files / ckanext_marinerg-0.9.0.tar.gz

Download URL ckanext_marinerg-0.9.0.tar.gz
Size 1.3 MB
Tags Source
SHA-256 checksum
How to use checksums
9e0cb45348ee9b6b52a3532968bd43d84463bab6c19cb0fb863f594d81cc00a5
BLAKE2b-256 checksum
How to use checksums
f890cc7c90dbcffbf12d416b3a1b259d2a96156e9fa33c998dafb09ed0774099
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.9.0-py3-none-any.whl

Download URL ckanext_marinerg-0.9.0-py3-none-any.whl
Size 1.3 MB
Tags Python 3
SHA-256 checksum
How to use checksums
acbbf221b1ed8bdb02aab73fe164250fadf933a890cec071b584abede7c05acc
BLAKE2b-256 checksum
How to use checksums
e5b4d322a658128b1ad7701cc51f2eafa2b4a178496da98ba235f9e84dc1dacf
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.14.7

Release history Release notifications | RSS feed

0.10.0

2 release files

This release

0.9.0 This release

2 release files

0.8.1

2 release files

0.8.0

2 release files

0.7.2

2 release files

0.7.1

2 release files

0.7.0

2 release files

0.6.0

2 release files

0.5.1

2 release files

0.5.0

2 release files

0.4.0

2 release files

0.3.0

2 release files

0.2.0

2 release files

0.1.1

2 release files

0.1.0

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page