Skip to content

Commit b1f3b0d

Browse files
committed
Initial Checkin
0 parents  commit b1f3b0d

File tree

4 files changed

+80
-0
lines changed

4 files changed

+80
-0
lines changed

.dockerignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
.git

Dockerfile

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
# Dockerfile for pygwas-celery worker
2+
# Version 0.1
3+
4+
FROM timeu/gwas_base
5+
MAINTAINER Uemit Seren <uemit.seren@gmail.com>
6+
7+
WORKDIR /conf
8+
9+
# necessary otherwise chown won't work
10+
RUN mkdir /log && mkdir /DATA mkdir /GENOTYPE
11+
12+
# add celery user and group
13+
RUN groupadd -r celery && useradd -r -g celery celery
14+
RUN chown celery:celery -R /log /DATA
15+
16+
RUN /env/bin/pip install 'gwaportalpipeline>=0.2.7'
17+
18+
ADD celeryconfig.py /conf/celeryconfig.py
19+
20+
# add colume after chown otherwise it doesnt work
21+
VOLUME ["/log","/conf","/DATA","/GENOTYPE"]
22+
23+
USER celery
24+
25+
CMD ["-l","INFO","--logfile","/log/celery.log"]
26+
27+
ENTRYPOINT ["/env/bin/celery","-A", "gwaportalpipeline","worker"]

README.md

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
# timeu/pygwas_celery
2+
3+
[`timeu/pygwas_celery`](https://index.docker.io/u/timeu/pygwas_celery) is a [docker](https://docker.io) image that is based on [`timeu/pygwas`](https://registry.hub.docker.com/u/timeu/gwas_base/) docker image and has [celery](http://www.celeryproject.org/) setup in order to run [PyGWAS](https://github.com/timeu/PyGWAS) as a distributed task.
4+
5+
6+
## Usage
7+
8+
9+
- RUN with default configuration. Listens to all Queues
10+
11+
docker run -e "BROKER_URL=amqp://username:pw@BROKER_HOST:5672/VHOST" -e "REST_HOST=http://REST_HOST" -e "REST_USERNAME=USERNAME" -e "REST_PASSWORD=PW" timeu/pygwas_celery
12+
13+
- Pass specific options to celery executable (i.e Queue, concurrency, etc)
14+
15+
docker run -e "BROKER_URL=amqp://username:pw@BROKER_HOST:5672/VHOST" -e "REST_HOST=http://REST_HOST" -e "REST_USERNAME=USERNAME" -e "REST_PASSWORD=PW" timeu/pygwas_celery -Q gwas.portal.fast
16+
17+
18+
## Notes
19+
20+
Following volumes are defined:
21+
22+
- /conf .. contains the celeryconfig.py file
23+
- /GWASDATA .. folder where celery will the input & output files
24+
- /GENOTYPE .. folder that contains the genotype data
25+
26+
27+

celeryconfig.py

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
from kombu import Exchange, Queue
2+
import os
3+
BROKER_URL = os.environ['CELERY_BROKER']
4+
CELERY_RESULT_BACKEND = 'rpc'
5+
CELERY_RESULT_PERSISTENT = True
6+
CELERY_TASK_SERIALIZER = 'json'
7+
CELERY_RESULT_SERIALIZER = 'json'
8+
CELERY_ACCEPT_CONTENT = ['json']
9+
10+
gwas_exchange = Exchange('gwas', type='direct')
11+
enrichment_exchange = Exchange('enrichment',type='direct')
12+
13+
14+
15+
CELERY_QUEUES = (
16+
Queue('gwas.portal.worker.slow', gwas_exchange, routing_key='gwas.portal.worker.slow'),
17+
Queue('gwas.portal.worker.fast', gwas_exchange, routing_key='gwas.portal.worker.fast'),
18+
Queue('enrichment',enrichment_exchange,routing_key='enrichment')
19+
)
20+
21+
22+
CELERY_ROUTES = {
23+
'gwaportalpipeline.gwas.run_gwas':{'queue':'gwas.portal.worker.fast'},
24+
'gwaportalpipeline.enrichment.candidate_gene_list_enrichment':{'queue':'enrichment'}
25+
}

0 commit comments

Comments
 (0)