Mentions légales du service

Skip to content
Snippets Groups Projects
Commit 57ce6281 authored by Robin Tissot's avatar Robin Tissot
Browse files

Add a new worker/queue to avoid waiting for mask recalculation. And fix celery...

Add a new worker/queue to avoid waiting for mask recalculation. And fix celery acks late setting typo.
parent 6537c80b
Branches
Tags
No related merge requests found
...@@ -181,19 +181,21 @@ CELERY_RESULT_BACKEND = 'redis://%s:%d' % (REDIS_HOST, REDIS_PORT) ...@@ -181,19 +181,21 @@ CELERY_RESULT_BACKEND = 'redis://%s:%d' % (REDIS_HOST, REDIS_PORT)
CELERY_ACCEPT_CONTENT = ['application/json'] CELERY_ACCEPT_CONTENT = ['application/json']
CELERY_TASK_SERIALIZER = 'json' CELERY_TASK_SERIALIZER = 'json'
CELERY_RESULT_SERIALIZER = 'json' CELERY_RESULT_SERIALIZER = 'json'
CELERYD_ACKS_LATE = True CELERY_ACKS_LATE = True
# time in seconds a user has to wait after a task is started before being able to recover # time in seconds a user has to wait after a task is started before being able to recover
TASK_RECOVER_DELAY = 60 * 60 * 24 # 1 day TASK_RECOVER_DELAY = 60 * 60 * 24 # 1 day
CELERY_TASK_QUEUES = ( CELERY_TASK_QUEUES = (
Queue('default', routing_key='default'), Queue('default', routing_key='default'),
Queue('live', routing_key='live'), # for everything that needs to be done on the spot to update the ui
Queue('low-priority', routing_key='low-priority'), Queue('low-priority', routing_key='low-priority'),
Queue('gpu', routing_key='gpu'), Queue('gpu', routing_key='gpu'), # for everything that could use a GPU
) )
CELERY_TASK_DEFAULT_QUEUE = 'default' CELERY_TASK_DEFAULT_QUEUE = 'default'
CELERY_TASK_ROUTES = { CELERY_TASK_ROUTES = {
# 'core.tasks.*': {'queue': 'default'}, # 'core.tasks.*': {'queue': 'default'},
'core.tasks.recalculate_masks': {'queue': 'live'},
'core.tasks.generate_part_thumbnails': {'queue': 'low-priority'}, 'core.tasks.generate_part_thumbnails': {'queue': 'low-priority'},
'core.tasks.train': {'queue': 'gpu'}, 'core.tasks.train': {'queue': 'gpu'},
'core.tasks.segtrain': {'queue': 'gpu'}, 'core.tasks.segtrain': {'queue': 'gpu'},
......
...@@ -73,6 +73,10 @@ services: ...@@ -73,6 +73,10 @@ services:
- OMP_NUM_THREADS=1 - OMP_NUM_THREADS=1
command: "celery worker -l INFO -E -A escriptorium -Ofair --prefetch-multiplier 1 -Q default -c ${CELERY_MAIN_CONC:-10} --max-tasks-per-child=10" command: "celery worker -l INFO -E -A escriptorium -Ofair --prefetch-multiplier 1 -Q default -c ${CELERY_MAIN_CONC:-10} --max-tasks-per-child=10"
celery-live:
<<: *app
command: "celery worker -l INFO -E -A escriptorium -Ofair --prefetch-multiplier 1 -Q live -c ${CELERY_LIVE_CONC:-10} --max-tasks-per-child=10"
celery-low-priority: celery-low-priority:
<<: *app <<: *app
command: "celery worker -l INFO -E -A escriptorium -Ofair --prefetch-multiplier 1 -Q low-priority -c ${CELERY_LOW_CONC:-10} --max-tasks-per-child=10" command: "celery worker -l INFO -E -A escriptorium -Ofair --prefetch-multiplier 1 -Q low-priority -c ${CELERY_LOW_CONC:-10} --max-tasks-per-child=10"
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment