Holds views and test data to fire up a dev instance of StatusDB (CouchDB). This repository replaces the StatusDB_views repository which was kept private. The databases documentation attempts to give an overview of each database and explain its purpose.
The first part of this repository is the code for the CouchDB views used for the NGI Stockholm StatusDB. The views are organised in the directory StatusDB_views and listed in the views_config.yaml.
StatusDB_views was kept private since it could contain some project details or other details that was not supposed to be public. However this decision was changed in 2026 since there is no real reason to keep sensitive information in this repository. The content of the repository was moved to StatusDB_NGI since the git history might still hide details which are not supposed to be made public. Here are the contributors of the old repository:
- @aanil
- @alneberg
- @galithil
- @kedhammar
- @chuan-wang
- @remiolsen
- @kate-v-stepanova
- @silverslott
- @ewels
- @vezzi
- @sylvinite
- @ssjunnebo
- @FranBonath
- @pekrau
- @mariogiov
Thank you!
The views are located in the directory StatusDB_views inside the repo and are subsequently organised into directories for databases and design documents.
Each view consists of one or two files, one for the map function and one (optional) for the reduce function.
They need to follow the naming pattern <view_name>.map.js and <view_name>.reduce.js.
Each database, design document and view is listed in the config file views_config.yaml.
To try to keep the views_config.yaml file up to date with the content of the repository, the script script/validate_views_config.py can be used:
> python scripts/validate_views_config.py --config views_config.yaml --views-dir StatusDB_views --check
✅ Config is up to date with directory structure
And to update the config (default is that a new view will not be included in dev):
> python scripts/validate_views_config.py --config views_config.yaml --views-dir StatusDB_views --update
The second part of this repository is the seed data, which is mock data that can be used for testing and demoing a range of internal services that use StatusDB as its backend. The data is located in the seed_data directory and is used to populate the database when building the docker image.
The seed_data/ directory contains JSON documents that are loaded into CouchDB on startup.
seed_data/
├── <database_name>/ # Creates a database and loads all JSON files into it
├── doc1.json
└── doc2.json
Each JSON file should contain a single CouchDB document. If the document has an _id field, it will be used as the document ID. Otherwise, CouchDB will auto-generate an ID.
Example document (seed_data/example_project.json):
{
"_id": "project_001",
"type": "project",
"name": "Example Genomics Project",
"project_id": "P12345",
...
}The docker image is most commonly used in the docker-compose setup for genomics status, see Using with Genomics Status In that case, the docker is built automatically as part of the setup. However, in case the docker image should be used standalone, it needs to be built using:
cd Statusdb_NGI
docker build .
And starting a container using
docker run -d \
-p 5984:5984 \
-e COUCHDB_USER=admin \
-e COUCHDB_PASSWORD=admin \
ghcr.io/scilifelab/StatusDB_NGI:latestAfter this, CouchDB will be available at:
- API: http://localhost:5984
- Fauxton UI: http://localhost:5984/_utils
- Credentials:
admin/admin
The seed data is automatically loaded on first startup along with all views in the Statusdb_Views directory. It's prepared to use different scenarios where only a subset of views and data could be loaded, but currently there is only one stage scenario where all views and data is loaded.
To persist data between container restarts:
docker run -d \
-p 5984:5984 \
-e COUCHDB_USER=admin \
-e COUCHDB_PASSWORD=admin \
-v couchdb-data:/opt/couchdb/data \
ghcr.io/scilifelab/StatusDB_NGI:latestdocker build -t StatusDB_NGI .
docker run -p 5984:5984 -e COUCHDB_USER=admin -e COUCHDB_PASSWORD=admin StatusDB_NGIThere is a github workflow file written to facilitate automatic build and publishing of the seed data container, but it is not yet in use.
The genomics-status repository is configured to use this image in its docker compose setup. When starting docker compose, it will automatically build the image and populate it with the seed data, using the stage scenario.