OPUS4 / application

OPUS 4 application.
Other
15 stars 21 forks source link

Easy management of CRON jobs using a management class #446

Open kaustabhbarman opened 2 years ago

kaustabhbarman commented 2 years ago

We have a number of CRON jobs that perform some recurring tasks such as checking consistency, workspace files, sending notifications, etc. At the moment, these jobs are being setup manually. An easier way to manage these CRON jobs would be to have a management class that can perform some operations like listing out the jobs, their status, enable/disable them and also schedule them. We can further use this class to have commands as OPUS 4 CL to perform these operations.

On top of it, there will also be a possibility to develop a user interface to manage the same as an admin. Issue #417 also talks about this in a brief context.

kaustabhbarman commented 2 years ago

I looked up some PHP packages to manage CRON tasks. I found quite a few. I will list out some of them. One thing that I found common in all of them is that we will still need to add one cron job to cron tab (a crontab entry) which will run every minute and delegate the responsibility to the package runner/scheduler.

j3nsch commented 2 years ago

That sounds like Gearman on a conceptional level. The workers are replaced by a cron job that then checks for jobs and executes them. That could be useful because it would avoid setting up job specific works. Although with Gearman we could also setup generic works, at least one, to run any kind of job.

So I think the details are important here. If we have to write a worker, we have to deal with memory leaks and such. That is one of the problems with the Gearman approach for us. Do those other solutions run the jobs in separate processes, so the process gets thrown away after execution? That would take care of memory leak issues.

This is useful, but you need to look at the requirements and use case we already have or build on them to figure out the details. Also this isn't exactly what we were looking for in this issue. In this issue here we are not looking for managing jobs, but Cron scripts, a hopefully simpler task. Basically adding/removing/listing line in the local crontab so we can integrate their management directly into the OPUS 4 tools without a user having to read documentation, finding out what Cron scripts are available and setting them up manually. If we could make that easier, that would be useful.

So keep going, find the proper issue for three tools you found or create one, look at the pros/cons, and come up with a plan. Make sure we are on the same page. The easiest way to do that is to write down your thoughts.