Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Adding queueing and batching while running multiple dags. #535

Open
kriyanshishah opened this issue Mar 11, 2024 · 1 comment
Open

Adding queueing and batching while running multiple dags. #535

kriyanshishah opened this issue Mar 11, 2024 · 1 comment
Labels
accepted feature request New feature or request

Comments

@kriyanshishah
Copy link
Contributor

I want to add additional status as in queue.
As we are using dagu for running multiple dags at the same time consuming 5min or more time. So what I wanted to do is, queue the dag processes. and it will run one by one. Do you have any insights on this?

@yohamta
Copy link
Collaborator

yohamta commented Mar 11, 2024

Currently Dagu doesn't have queue system. But we can simulate the same effect by using multiple DAGs.

For Task1, which we aim to run every minute, we start by checking the queue state and proceed only if there are messages waiting:

# run every minute
schedule: "* * * * *"

steps:
  # check queue state
  # exit if there's no message
  - name: check
    # some work to do

To queue tasks for Task1, we can set up another DAG (let's call it Task2) that allows us to push messages into the queue, perhaps through a REST API or other methods. This way, Task2 acts as a trigger for Task1:

Task2

params: "MSG"
steps:
  #  push message into the queue
  - name: push
    command: bash
    script: |
      # push message to the queue (database, redis, file, etc)
      echo $MSG > /tmp/task1-queue

I think implementing queueing feature in Dagu a bit tricky since it doesn't have a central database right now. I'd be happy to hear if there's a good idea for implementing queueing in Dagu.

@yohamta yohamta added feature request New feature or request accepted labels May 11, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
accepted feature request New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants