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

Support managing jobSchedulers in bull-board. #827

Open
lpoulin opened this issue Oct 8, 2024 · 16 comments
Open

Support managing jobSchedulers in bull-board. #827

lpoulin opened this issue Oct 8, 2024 · 16 comments

Comments

@lpoulin
Copy link

lpoulin commented Oct 8, 2024

As of [email protected], jobSchedulers are the recommended way to manage scheduled jobs that run on an interval. It would be awesome if these could be managed (added, removed, changed) via the dashboard.

@lpoulin
Copy link
Author

lpoulin commented Oct 8, 2024

I would be happy to work on this btw, sounds fun!

@felixmosh
Copy link
Owner

Go for it :)

@lpoulin
Copy link
Author

lpoulin commented Oct 9, 2024

@felixmosh what are your thoughts about where to have it in the UI? Originally I was thinking to have 'Scheduled' as another status but it's not really a job 'status', so I was thinking about making it a modal that could be opened from the dropdown below 'add job'. My only hesitation there is that it is kind of hidden.

@felixmosh
Copy link
Owner

Can u explain what is new with the new approach?

@lpoulin
Copy link
Author

lpoulin commented Oct 9, 2024

Check out the docs of job schedulers here. Basically, you can add something called a job scheduler to a queue that contains a pattern/interval for putting new jobs on the queue. You can also add job templates with a scheduler that will ensure that all jobs produced by that scheduler inherit the settings.

My idea is that we can have a way to display the job schedulers that exist for the selected queue. From there, we could edit/delete them. It would also be nice to be able to add job schedulers from the UI.

A job scheduler is a thing that produces jobs, not a job itself. But, like jobs, they are something that are added and exist on a queue.

Now I'm thinking it may make sense to display a button in the header actions (iff a queue is selected) to open the scheduler management modal, or perhaps it could even be its own page
image

@felixmosh
Copy link
Owner

felixmosh commented Oct 9, 2024

Ha, cool feature, it should go under queue actions (the place where we have Add Job)
I think that it should apear as a new modal, with that upsertScheduler props.

Pay attension to the fact that this should be added only on bullmq queues (we have a flag for that)

A place to manage jobSchedulers should be in a new Page, which will allow to list them & remove

@lpoulin
Copy link
Author

lpoulin commented Oct 9, 2024

Makes sense, thanks for the feedback. So add 'Add Job Scheduler' under queue actions for adding them, and a new page for listing/managing. How should the user navigate to said page?

@felixmosh
Copy link
Owner

Maybe we should add a link at the right of queue statuses (before 3 dots of queue actions)?

@lpoulin
Copy link
Author

lpoulin commented Oct 11, 2024

There isn't a whole lot of room up there (at my current resolution the statuses go all the way to the queue actions) and if we have to start scrolling it would be hidden. I'm going to add it as a queue action for now and we can iterate.
image

@lpoulin
Copy link
Author

lpoulin commented Oct 11, 2024

Also, could you please point out where the library flag is in the UI so it can be displayed conditionally? Not having luck finding it @felixmosh

@felixmosh
Copy link
Owner

Here,

@steven-t-h
Copy link

@lpoulin are you still working on this? I have a need for this as well, happy to assist

@lpoulin
Copy link
Author

lpoulin commented Nov 27, 2024

Hi @steven-t-h, I have made significant headway on this. The caveat is that as it stands now, jobSchedulders in bullmq 5.x.x are not exactly fully supported. I have spoken with some of them and they are planning to add more support in the next major release.

For example, when retrieving job schedulers, I would expect to see the job template object that it was created with that contains job info/parameters. Additionally, I just recently raised an issue to support retrieving a single scheduler by id (instead of retrieving a list of all of them from a queue).

For these reasons, I put my work on pause for a bit. I did make significant headway, however. I will go ahead and open up a PR so you can take it from there if you'd like. I believe the majority of the remaining work is just beautifying the job scheduler card, but it should be (mostly) functional.

@lpoulin
Copy link
Author

lpoulin commented Nov 27, 2024

In addition, I have concerns about the "Schedulers" status being the straw that broke the camel's back in regards to horizontal real estate of the page. Attached is what I currently have. I know there is a lot that needs to be cleaned up but should be a good starting place at least :)

image

@lpoulin
Copy link
Author

lpoulin commented Nov 27, 2024

@steven-t-h here is the PR of what I have so far: #856

@steven-t-h
Copy link

@lpoulin thanks, I'll definitely take a look

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants