-
Notifications
You must be signed in to change notification settings - Fork 303
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
Replace fle_utils.cronograph with a third party (btw I hear that celery contains a lot of vitamins) #2891
Comments
Interesting idea!
The original version did have a number of things run via background jobs (e.g. the video downloading was queued by the main process and then picked up and run by the cron), but most of this was removed over a year ago, and turned into immediate direct thread spawning. The only thing still being handled by chronograph is the automatic background hourly data sync.
I didn't recall us having too many issues with chronograph, at least since very early on, so I did a bit of a survey. Most of those issues just mention cron in passing (e.g. quoting the log output with Most of the others were either related to the old way of doing things, or were about small optimizations to improve the efficiency of what is already a very lightweight library (it's basically just two tables -- jobs and logs -- with a few helper functions around it for scheduling, and tracking status). I've wanted to use Celery in projects for a long time now, and our central server could definitely be a great place to do that (since we have full control over the deployment environment, and we will be doing more and more job-processing stuff there). For the ka-lite app itself, I hadn't considered celery as an option, since:
|
Great idea re: using celery for the upgrade process. I've been thinking of making a separate server to handle the whole software update process to avoid any leftover processes, but offloading that to celery is one good possibility too. |
So instead of having a buggy and inferior job scheduler, let's use a truly great third-party app for this!!
I'm thinking about Celery of course :) KA Lite seems to have a lot of background jobs, and this is a fundamental part of the platform that cannot be refactored.
For motivation on why our own implementation should be removed, have a look at the issues it has caused over time:
https://github.com/learningequality/ka-lite/issues?q=cron
How you want to run Celery is configurable. For instance, for dev and testing, there is the
CELERY_ALWAYS_EAGER
setting.I would recommend kicking things off with having a pure-Django broker. The amount of jobs currently does not warrant for any super-fast compiled OS-specific broker.
Yet, the Celery worker process has to be started in an OS-specific fashion.
Running on OSX:
https://github.com/celery/celery/tree/3.1/extra/osx/
Running on Windows:
https://www.calazan.com/windows-tip-run-applications-in-the-background-using-task-scheduler/
The text was updated successfully, but these errors were encountered: