-
Notifications
You must be signed in to change notification settings - Fork 117
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
Daemon #497
Daemon #497
Conversation
* Adding more pythonish class attribute setters for uuid * Adding Json representation of process to stored_processes * Adding dbglog tests
Hm .. probably shell script will be needed for better implementation of the https://dpbl.wordpress.com/2017/02/12/a-tutorial-on-python-daemon/ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
See inline comments and questions.
the next pending request. | ||
""" | ||
try: | ||
from pywps.processing.job import Job, JobLauncher |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
JobLauncher
not used.
Running a test with Emu WPS. sync requests work as expected. When running an async execute request I get the following error:
We are missing an upgrade mechanism of the database? |
@jachym @huard @davidcaron In production mode we use supervisor deployed by Ansible: When we merge this PR our installations will break! We need to update our service start scripts. If we accept this PR it needs to go into a 4.4.0 release (together with dropping Python 2.x). |
@jachym Could the watchdog also be a cronjob? So we would just need to add a cronjob (configuration task) instead of running an additional service? We probably need to fix the database upgrade. |
Thank you for the head up. My 2 cents: I think having a separate process to launch jobs is a good idea and will make the queue more resilient. It's closer to something like a celery task queue. We deploy in containers, so the daemon will be in its own container, and a separate entrypoint command for the daemon is much better than a cron job in this case (1 process = 1 container). |
Tested with several emu sleep process. It works when I start the watchdog ... it fills the queue and runs until all jobs are finished: ... but the daemon mode ends immediately: |
Could we provide both, cron-job and daemon service? So we can support several deployment scenarios. I think I would feel safer with a cron-job in the ansible/supervisor scenario. For the docker/container and also for the Werkzeug/demo mode we might want a daemon service. |
Sure! I didn't mean one or the other. I agree the cron-job would be better with ansible outside of containters. |
@jachym @davidcaron @huard I want to work on this "watchdog" PR the next days to fix the job queue handling. I will open a new PR for this ... it will include the code of this one. I want to move code to a new |
@cehbrecht shall we close this PR and continue in #505 (?) |
Yes ... I'm closing this PR. Maybe we should have worked on dev branch. |
This PR introduces new way of async process execution. Async processes are stored to database.
User also needs to start
pywps_daemon.py
script, which will be running as background process and check the database for incoming requests and execute them (using theprocessing.Job
mechanism)Besides that, some smaller changes are introduced:
Contribution Agreement
(as per https://github.com/geopython/pywps/blob/master/CONTRIBUTING.rst#contributions-and-licensing)