-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
ended up boosting celery config from neurovault
- Loading branch information
Showing
6 changed files
with
57 additions
and
19 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,13 @@ | ||
FROM python:3.4 | ||
FROM python:3.5 | ||
|
||
ENV PYTHONUNBUFFERED 1 | ||
|
||
#RUN groupadd -r open_fmri && useradd --create-home --home-dir /home/open_fmri -r -g open_fmri open_fmri | ||
#USER open_fmri | ||
#WORKDIR /home/open_fmri | ||
|
||
RUN apt-get update && apt-get install -y postgresql-client | ||
|
||
# Requirements have to be pulled and installed here, otherwise caching won't work | ||
ADD ./requirements.txt /requirements.txt | ||
|
||
RUN pip install -r /requirements.txt | ||
#RUN groupadd -r open_fmri && useradd -r -g open_fmri open_fmri |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
import datetime | ||
|
||
from celery import shared_task, Celery | ||
|
||
app = Celery('open_fmri') | ||
app.config_from_object('django.conf:settings.base') | ||
app.autodiscover_tasks(lambda: settings.INSTALLED_APPS) | ||
|
||
@app.task(name='test_parse') | ||
def test_parse(): | ||
logger = test_parse.get_logger() | ||
logger.info(str(datetime.now)) | ||
return datetime.now() | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,22 +1,12 @@ | ||
from __future__ import absolute_import | ||
|
||
import os | ||
|
||
from celery import Celery | ||
from django.conf import settings | ||
|
||
from django.conf import settings # noqa | ||
|
||
app = Celery('open_fmri') | ||
#os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'neurovault.settings') | ||
celery = Celery('open_fmri') | ||
|
||
# Using a string here means the worker will not have to | ||
# pickle the object when using Windows. | ||
app.config_from_object('django.conf:settings') | ||
app.autodiscover_tasks(lambda: settings.INSTALLED_APPS) | ||
|
||
app.conf.update( | ||
CELERY_RESULT_BACKEND='djcelery.backends.database:DatabaseBackend', | ||
) | ||
|
||
@app.task(bind=True) | ||
def debug_task(self): | ||
print('Request: {0!r}'.format(self.request)) | ||
celery.config_from_object('django.conf:settings') | ||
celery.autodiscover_tasks(lambda: settings.INSTALLED_APPS) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -10,6 +10,7 @@ model_mommy | |
opbeat | ||
pillow | ||
psycopg2 | ||
redis | ||
requests | ||
requests-cache | ||
uwsgi |