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

DB stored tasks #12

Open
tsmgeek opened this issue Aug 28, 2021 · 2 comments
Open

DB stored tasks #12

tsmgeek opened this issue Aug 28, 2021 · 2 comments
Assignees
Labels
question Further information is requested

Comments

@tsmgeek
Copy link

tsmgeek commented Aug 28, 2021

Is your feature request related to a problem? Please describe.
Can't be used if running on phpfpm server farm with separate backends or in docker deploys with no shared storage.

Describe the solution you'd like
Store all takes in DB, deploy to tasks directory via cron script, also updates/deletes tasks as needed.
This could then extend to allowing you to assign tasks to specific nodes or distribute tasks etc as possible future features.

Describe alternatives you've considered
There are other apps that store crons in DB, just not the power of crunz and many are old and just support exec, not php functions.

Additional context
N/a

@lucatacconi lucatacconi self-assigned this Sep 3, 2021
@lucatacconi
Copy link
Owner

Hello, Tsmgeek, thank you for your suggestions.

First of all I would like to point out that Crunz-ui was created specifically to be used with Crunz. In the company where I work, we needed a quick workaround to allow even less skilled developers to load tasks into the system even without using ftp uploads.

It is interesting your proposal to use a DB to save the tasks and I imagine the logs too. However, you must also consider that Crunz-ui is only a graphical interface that uses Crunz as an engine to launch the programmed tasks. Crunz has a process that runs every minute. The process checks if there are tasks compatible with the launch date and time and, if any, runs them through the Php present in the system.

Saving the tasks in DB would mean, every minute, having to read all the tasks scheduled for that date and time and having to write them to the filesystem to prepare them for the Crunz process,but as you well know the file system writing procedure is considerably slow.

Could you suggest me the apps that save cron in db that you have experienced?
Can we deepen your suggestion regarding distributed tasks and tasks assigned to specific nodes?

Regarding the problem you reported, I have no experience with Phpfpm server. However, we have installed Crunz-ui on a Docker.
In that case we used an Apache+PHP Docker. On the Doker server we had scheduled a process to run every minute which called a sh script within the doker image:

/usr/bin/docker exec --user root app04 sh /in4/app04/http/crunz-ui/do_crontab.sh

The called script performed, on the Doker image, the following operation

#!/bin/bash
cd /var/www/crunz-ui-files/crunz/ 
/var/www/http/crunz-ui-files/crunz/crunz-ui.sh

Crunz-ui was then configured to use, for saving the logs, a folder configured as writable at the time of generating the logs.

I am available to verify the installation on your docker systems.

@lucatacconi lucatacconi added the question Further information is requested label Sep 3, 2021
@tsmgeek
Copy link
Author

tsmgeek commented Sep 10, 2021

Dkron/Rundek etc are some other packages that can execute code and get logs but not PHP specific.

We have a app that has a distributed load farm on phpfpm, it does not matter its phpfpm just that it runs across multiple servers and the crons are on several other servers depending on their tasks.

Splitting the 1:1 link between the UI and backend may be quite useful as then your UI can be on a public facing system but the backend "manager" sits on each of your registered cron servers which can stay private, it shuttles config/logs back and forth so the UI can operate independently elsewhere.

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

No branches or pull requests

2 participants