Skip to content

Commit c9d6c6c

Browse files
authored
feat: adding cadd-rest-api support via docker-compose.override.yml (#48)
1 parent fcd1925 commit c9d6c6c

File tree

5 files changed

+80
-1
lines changed

5 files changed

+80
-1
lines changed

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66
## Docker Compose
77
# Configuration file.
88
.env
9+
/*.env
910
.secrets/
1011

1112
# The Docker Compose "override" YAML file.

docker-compose.override.yml-cadd

Lines changed: 56 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,56 @@
1+
# Docker Compose Override YAML fragment that provides a CADD REST API
2+
# # Server
3+
#
4+
# Quick Manual:
5+
#
6+
# - merge with docker-compose.override.yml
7+
# - place data in the right place
8+
9+
# == Re-useable Definitions ==================================================
10+
11+
# Default service definition for all (incl. postgres/redis/...)
12+
x-service-default: &service_default
13+
networks:
14+
- varfish
15+
restart: unless-stopped
16+
17+
# == Overide Definitions =====================================================
18+
19+
services:
20+
# -- CADD REST API ---------------------------------------------------------
21+
#
22+
# REST API server for CADD sequence variant annotation.
23+
24+
cadd-rest-api-server:
25+
<<: *service_default
26+
image: "${image_cadd_name-bihealth/cadd-rest-api}:${image_cadd_version-0.3.4-0}"
27+
env_file: cadd-rest-api.env
28+
command:
29+
- wsgi
30+
volumes:
31+
- type: bind
32+
source: ${volumes_basedir:-./.dev/volumes}/cadd-rest-api/db
33+
target: /data/db
34+
read_only: false
35+
36+
cadd-rest-api-worker:
37+
<<: *service_default
38+
deploy:
39+
replicas: 5
40+
image: "${image_cadd_name-bihealth/cadd-rest-api}:${image_cadd_version-0.3.4-0}"
41+
env_file: cadd-rest-api.env
42+
command:
43+
- celeryd
44+
volumes:
45+
- type: bind
46+
source: ${volumes_basedir:-./.dev/volumes}/cadd-rest-api/data/annotations
47+
target: /opt/miniconda3/share/cadd-scripts-1.6-0/data/annotations
48+
read_only: true
49+
- type: bind
50+
source: ${volumes_basedir:-./.dev/volumes}/cadd-rest-api/data/prescored
51+
target: /opt/miniconda3/share/cadd-scripts-1.6-0/data/prescored
52+
read_only: true
53+
- type: bind
54+
source: ${volumes_basedir:-./.dev/volumes}/cadd-rest-api/db
55+
target: /data/db
56+
read_only: false

docker-compose.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -105,6 +105,7 @@ services:
105105
- "traefik.http.routers.varfish-web.middlewares=xforward"
106106
- "traefik.http.routers.varfish-web.rule=HostRegexp(`{catchall:.+}`)"
107107
- "traefik.http.services.varfish-web.loadbalancer.server.port=8080"
108+
- "traefik.http.routers.varfish-web.tls=true"
108109

109110
varfish-celerybeat:
110111
<<: *service_varfish_server_default

download-data.sh

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -242,7 +242,7 @@ EOF
242242
mkdir -p $DATA_DIR/download
243243
# Download each entry from download list. Note that we support commenting
244244
# out lines with a leading "#".
245-
grep -v ^# /tmp/download-list.txt >/tmp/download-list.nocomment.txt
245+
grep -v ^# /tmp/download-list.txt | grep -v grch37 >/tmp/download-list.nocomment.txt
246246
while read -r line; do
247247
# Create the download directory.
248248
run mkdir -p $DATA_DIR/download/$line
@@ -251,6 +251,7 @@ while read -r line; do
251251
run s5cmd \
252252
--endpoint-url=$S3_ENDPOINT_URL \
253253
--no-sign-request \
254+
--no-verify-ssl \
254255
sync \
255256
"s3://varfish-public/$(prefix_for $line)/$line/*" \
256257
$DATA_DIR/download/$line \

utils/cadd-rest-api/cadd-rest-api.env

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
# Environment for cadd-rest-api related containers.
2+
3+
LC_ALL=en_US.UTF-8
4+
5+
DATABASE_URL=/data/db/cadd_rest_api.db
6+
7+
# We can share one redis instance but not the database with another celery.
8+
CELERY_BROKER_URL=redis://redis:6379/1
9+
# Only one CADD process can be run per CADD container because of using
10+
# Snakemake.
11+
CELERY_WORKERS=1
12+
13+
DJANGO_ALLOWED_HOSTS="*"
14+
DJANGO_SECRET_KEY="__DJANGO_SECRET_KEY__"
15+
DJANGO_SETTINGS_MODULE="config.settings.production"
16+
DJANGO_SECURE_SSL_REDIRECT=0
17+
18+
CADD_SH=/opt/miniconda3/share/cadd-scripts-1.6-0/CADD.sh
19+
CADD_CONDA=/opt/miniconda3/bin/activate
20+
CADD_TIMEOUT=300

0 commit comments

Comments
 (0)