Skip to content

About

A dockerised version of the GBIF.no resolver

Resources

Stars

0 stars

Watchers

4 watching

Forks

Repository files navigation

run-tests

resolver-docker

Django API for resolver data, deployed on Sigma2 NIRD (nird-lmd) in namespace gbif-no-ns8095k.

Local development

Create environment settings in dev.env (one KEY=value per line), then run:

docker compose -f docker-compose.dev.yml up

Run tests:

docker compose -f docker-compose.test.yml up --abort-on-container-exit --exit-code-from web

Production deployment target

  • Namespace: gbif-no-ns8095k
  • Deployment: resolver-web
  • Service: resolver-web
  • Ingress hosts:
    • resolver.gbif.no (public canonical host)
    • resolver.gbif-no.sigma2.no (platform host)
  • K8s manifests: k8s/nird/

Detailed cluster setup notes are in k8s/nird/README.md.

One-time prerequisites

  1. Configure kubectl context nird-lmd with nird-toolkit-auth-helper.
  2. Ensure resolver-env secret exists in gbif-no-ns8095k:
kubectl create secret generic resolver-env \
  -n gbif-no-ns8095k \
  --from-env-file=prod.env \
  --dry-run=client -o yaml | kubectl apply -f -

Add a newly generated DISCORD_WEBHOOK_URL to the secret if ingestion alerts are needed. An older webhook was committed to this repository and should be revoked; the importer skips webhook notifications when this setting is absent.

Deploying new code changes

Recommended flow (immutable image tag)

  1. Build and push a tagged image:
export IMAGE_TAG=$(git rev-parse --short HEAD)
docker buildx build --platform linux/amd64 -t gbifnorway/resolver:${IMAGE_TAG} --push .
  1. Update deployment image and wait for rollout:
kubectl --context nird-lmd -n gbif-no-ns8095k set image deploy/resolver-web resolver-web=gbifnorway/resolver:${IMAGE_TAG}
kubectl --context nird-lmd -n gbif-no-ns8095k rollout status deploy/resolver-web
  1. Verify:
kubectl --context nird-lmd -n gbif-no-ns8095k get pods,svc,ingress
curl -fsS https://resolver.gbif-no.sigma2.no/?format=json | head

Current CI flow

GitHub Actions tests and publishes gbifnorway/resolver:latest and a tag with the full commit SHA on push to main.

After CI publishes, deploy the commit-tagged image:

IMAGE_TAG=$(git rev-parse HEAD)
kubectl --context nird-lmd -n gbif-no-ns8095k set image deploy/resolver-web resolver-web=gbifnorway/resolver:${IMAGE_TAG}
kubectl --context nird-lmd -n gbif-no-ns8095k rollout status deploy/resolver-web

Rollback

If a deploy fails:

kubectl --context nird-lmd -n gbif-no-ns8095k rollout history deploy/resolver-web
kubectl --context nird-lmd -n gbif-no-ns8095k rollout undo deploy/resolver-web
kubectl --context nird-lmd -n gbif-no-ns8095k rollout status deploy/resolver-web

About

A dockerised version of the GBIF.no resolver

Resources

Stars

0 stars

Watchers

4 watching

Forks

Releases

Packages

Used by

Contributors

Languages