Skip to content

Commit

Permalink
feat: adding cadd-rest-api support via docker-compose.override.yml (#48)
Browse files Browse the repository at this point in the history
  • Loading branch information
holtgrewe authored Jan 24, 2024
1 parent fcd1925 commit c9d6c6c
Show file tree
Hide file tree
Showing 5 changed files with 80 additions and 1 deletion.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
## Docker Compose
# Configuration file.
.env
/*.env
.secrets/

# The Docker Compose "override" YAML file.
Expand Down
56 changes: 56 additions & 0 deletions docker-compose.override.yml-cadd
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
# Docker Compose Override YAML fragment that provides a CADD REST API
# # Server
#
# Quick Manual:
#
# - merge with docker-compose.override.yml
# - place data in the right place

# == Re-useable Definitions ==================================================

# Default service definition for all (incl. postgres/redis/...)
x-service-default: &service_default
networks:
- varfish
restart: unless-stopped

# == Overide Definitions =====================================================

services:
# -- CADD REST API ---------------------------------------------------------
#
# REST API server for CADD sequence variant annotation.

cadd-rest-api-server:
<<: *service_default
image: "${image_cadd_name-bihealth/cadd-rest-api}:${image_cadd_version-0.3.4-0}"
env_file: cadd-rest-api.env
command:
- wsgi
volumes:
- type: bind
source: ${volumes_basedir:-./.dev/volumes}/cadd-rest-api/db
target: /data/db
read_only: false

cadd-rest-api-worker:
<<: *service_default
deploy:
replicas: 5
image: "${image_cadd_name-bihealth/cadd-rest-api}:${image_cadd_version-0.3.4-0}"
env_file: cadd-rest-api.env
command:
- celeryd
volumes:
- type: bind
source: ${volumes_basedir:-./.dev/volumes}/cadd-rest-api/data/annotations
target: /opt/miniconda3/share/cadd-scripts-1.6-0/data/annotations
read_only: true
- type: bind
source: ${volumes_basedir:-./.dev/volumes}/cadd-rest-api/data/prescored
target: /opt/miniconda3/share/cadd-scripts-1.6-0/data/prescored
read_only: true
- type: bind
source: ${volumes_basedir:-./.dev/volumes}/cadd-rest-api/db
target: /data/db
read_only: false
1 change: 1 addition & 0 deletions docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -105,6 +105,7 @@ services:
- "traefik.http.routers.varfish-web.middlewares=xforward"
- "traefik.http.routers.varfish-web.rule=HostRegexp(`{catchall:.+}`)"
- "traefik.http.services.varfish-web.loadbalancer.server.port=8080"
- "traefik.http.routers.varfish-web.tls=true"

varfish-celerybeat:
<<: *service_varfish_server_default
Expand Down
3 changes: 2 additions & 1 deletion download-data.sh
Original file line number Diff line number Diff line change
Expand Up @@ -242,7 +242,7 @@ EOF
mkdir -p $DATA_DIR/download
# Download each entry from download list. Note that we support commenting
# out lines with a leading "#".
grep -v ^# /tmp/download-list.txt >/tmp/download-list.nocomment.txt
grep -v ^# /tmp/download-list.txt | grep -v grch37 >/tmp/download-list.nocomment.txt
while read -r line; do
# Create the download directory.
run mkdir -p $DATA_DIR/download/$line
Expand All @@ -251,6 +251,7 @@ while read -r line; do
run s5cmd \
--endpoint-url=$S3_ENDPOINT_URL \
--no-sign-request \
--no-verify-ssl \
sync \
"s3://varfish-public/$(prefix_for $line)/$line/*" \
$DATA_DIR/download/$line \
Expand Down
20 changes: 20 additions & 0 deletions utils/cadd-rest-api/cadd-rest-api.env
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
# Environment for cadd-rest-api related containers.

LC_ALL=en_US.UTF-8

DATABASE_URL=/data/db/cadd_rest_api.db

# We can share one redis instance but not the database with another celery.
CELERY_BROKER_URL=redis://redis:6379/1
# Only one CADD process can be run per CADD container because of using
# Snakemake.
CELERY_WORKERS=1

DJANGO_ALLOWED_HOSTS="*"
DJANGO_SECRET_KEY="__DJANGO_SECRET_KEY__"
DJANGO_SETTINGS_MODULE="config.settings.production"
DJANGO_SECURE_SSL_REDIRECT=0

CADD_SH=/opt/miniconda3/share/cadd-scripts-1.6-0/CADD.sh
CADD_CONDA=/opt/miniconda3/bin/activate
CADD_TIMEOUT=300

0 comments on commit c9d6c6c

Please sign in to comment.