Skip to content

Celery & Docker: how to add custom routing? #5489

Answered by snoopfab
VladX09 asked this question in Q&A
Discussion options

You must be logged in to vote

Hello.

You can add a tag to your ops to specify the celery queue that will be used to dispatch the ops on celery workers :

@op(tags={'dagster-celery/queue': 'long_working_ops'})
def long_working_op(context) :    
   ...
@op(tags={'dagster-celery/queue': 'quick_working_ops'})
def quick_working_op(context) :    
   ...

and start your celery workers with the -q flag
for example with docker compose :

entrypoint: "dagster-celery worker start --loglevel=info --app=dagster_celery.app -y celeryconfig.yaml  -q long_working_ops --name long-working-worker"

Hope it helps,

Replies: 1 comment 1 reply

Comment options

You must be logged in to vote
1 reply
@VladX09
Comment options

Answer selected by VladX09
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants