Skip to content

Latest commit

 

History

History
100 lines (67 loc) · 4.05 KB

README.md

File metadata and controls

100 lines (67 loc) · 4.05 KB

transcriptomics_data_service

Test Status codecov Lint Status Docker Build

Disclaimer: work in progress.

The Transcriptomics Data Service (TDS) is intended to ingest, organize and query data from transcriptomics experiments through an API.

Starting a standalone TDS

Start the TDS server with a local PostgreSQL database for testing by running the following command.

# start
docker compose up --build -d

# stop
docker compose down

The --build argument forces the image to be rebuilt. Be sure to use it if you want code changes to be present.

You can now interact with the API by querying localhost:5000/{endpoint}

For the OpenAPI browser interface, go to localhost:5000/docs.

Local dev

For local development, you can use the docker-compose.dev.yaml file to start a TDS development container that mounts the local directory. The server starts in reload mode to quickly reflect local changes, and debugpy is listening on the container's internal port 9511.

# Set UID for directory permissions in the container
export UID=$(id -u)

# start
docker compose -f ./docker-compose.dev.yaml up --build -d

# stop
docker compose -f ./docker-compose.dev.yaml down

You can then attach VS Code to the tds container, and use the preconfigured Python Debugger (TDS) for interactive debugging.

Using Docker Secrets for the PostgreSQL credential

The TDS Config object has its values populated from environment variables and secrets at startup.

The Config.db_password value is populated by either:

Using a Docker secret is recommended for security, as environment variables are more prone to be leaked.

DB_PASSWORD should only be considered for local development, or if the database is secured and isolated from public access in a private network.

Authorization plugin

The Transcriptomics Data Service is meant to be a reusable microservice that can be integrated in existing stacks. Since authorization schemes vary across projects, TDS allows adopters to code their own authorization plugin, enabling adopters to leverage their existing access control code, tools and policies.

See the authorization docs for more information on how to create and use the authz plugin with TDS.

Endpoints

TODO: replace this with Swagger UI docs generated from CI workflows.

  • /service-info
    • GA4GH service info
  • /ingest
  • /normalize
  • /expressions
  • /experiment
  • /search (WIP)

Docker images

The Transcriptomics Data Service is packaged and released as a Docker image using GitHub Actions.

Images are published in GitHub's container registry, here.

Images are built and published using the following tags:

  • <version>: Build for a tagged release
  • latest: Build for the latest tagged release
  • edge: The top of the main branch
  • pr-<number>: Build for a pull request that targets main

Note: Images with the -dev suffix (e.g. edge-dev) are for local development.

To pull an image, or reference it in a compose file, use this pattern:

docker pull ghcr.io/bento-platform/transcriptomics_data_service:<TAG>