-
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
initial watchdog #505
initial watchdog #505
Conversation
@jachym @davidcaron @huard could you please have a look at this PR and give your opinion. You can try it with the Emu on the |
Should the
|
We need also a |
The scheduler |
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.
The daemon is sometimes called daemon, sometimes watchdog. I suggest a more descriptive name such as "RequestQueueDaemon".
There seems to be a mechanism in your PR to have a list of processes in the the configuration file. Is this documented ?
Started Emu with
fails with
No such problem in sync mode. |
Also, would it be useful to have two logs, one for the daemon, and one for the server? Since the daemon generates a lot of noise in the logs (with DEBUG), it's hard to find the info relevant to the server. |
class name:
Not yet. It is a quick solution ... I needed this to get the CLI into pywps. See code: It is using the python expression of the process list and loads it via |
+1
Le mar. 17 déc. 2019 05 h 33, MacPingu <notifications@github.com> a écrit :
… The daemon is sometimes called daemon, sometimes watchdog. I suggest a
more descriptive name such as "RequestQueueDaemon".
class name: JobQueueHandler?
module name: jobqueue or queue?
There seems to be a mechanism in your PR to have a list of processes in
the the configuration file. Is this documented ?
Not yet. It is a quick solution ... I needed this to get the CLI into
pywps. See code:
https://github.com/cehbrecht/pywps/blob/7821562ef13c755b3b8ffab737a7c8241301308d/pywps/app/Service.py#L59
It is using the python expression of the process list and loads it via
importlib.
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#505?email_source=notifications&email_token=AAAT2Q2V3N6MI5TDZVOH7ETQZCTJDA5CNFSM4J3MTL6KYY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOEHB5SXQ#issuecomment-566483294>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AAAT2Q2RZI5LQPEDG5ODMATQZCTJDANCNFSM4J3MTL6A>
.
|
It is still working on my side ... I couldn't reproduce the exception.
|
I'm not sure if I want to have two log files ... but I understand the trouble. As an alternative we could have two different types of logging handlers ... skip the db logs in debug mode ... unless they are wanted. Also the job queue can be triggered less frequently ... default was 30 secs. |
@huard Do you have an opinion on the CLI interface? |
Not really. Apart from watchdog name change, it looks good to me. |
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.
That's excellent! Thank you for doing this, I think it will make the queue more resilient.
@huard @davidcaron
|
@cehbrecht I think I understood why the emu docker image did not find any default config files: https://github.com/cehbrecht/pywps/blob/2099b6e4494923eb9b4c5284b079519f295a4e47/pywps/configuration.py#L178-L183 https://github.com/bird-house/emu/blob/0b36f1baabaa33c5e16a60438e333d2a44c410b1/Dockerfile#L31 As we see, the default config file inside the emu docker image (/opt/wps/pywps.cfg) is not in any of the 3 locations above. Should we modify emu docker image to put the default config file in 1 of those 3 locations or add more default locations? |
@tlvu we may want to add an additional default location for searching in the app path. Maybe we can do this in another PR? I think we have to change a bit more for this. Would it be ok to use |
Sure I am fine with this.
Yes for how we can drop the default config file in |
@jachym @tlvu @davidcaron What should we do with the alembic database upgrade? Currently the alembic scripts are not aware that there is an old db with a different schema and the migration step will fail. Should we drop the old DB manually? Or should we add the following to the alembic upgrade script (https://github.com/cehbrecht/pywps/blob/2099b6e4494923eb9b4c5284b079519f295a4e47/pywps/alembic/versions/eead25e2ad3a_create_tables.py#L19):
|
A couple things to consider, and my opinions:
|
I would prefer to drop it.
I have removed the configuration for the prefix. It is now fixed to
I would prefer to just drop the old tables. We just want to get in the alembic managed mode. |
I suppose there's no real value to keep the existing data so we can drop those tables but I think @huard might understand better the implication of flushing existing data. On the flip side, if the existing data is not so useful to preserve, why are we preserving them in the first place? |
we need a database for the job queue. PyWPS also uses the database for request logging ... but those infos are not meant to be kept for ever. |
@jachym @tomkralidis @ldesousa Can you give me advise on this? I think this is the last thing to fix before we can merge. |
I don't know the full context, but for data/database deletion I would prompt the user if they would like to drop the data in question, and if applicable add a |
@tomkralidis I could extend the |
@tomkralidis I have added a force option to the migrate cli to drop the existing db:
|
Everybody is happy ? Squash and merge? @tomkralidis ? @cehbrecht ? @huard and @davidcaron ? please add your review check |
@jachym I'm happy with it. Should we make a 4.2.4 release before and/or open a 4.2.x branch? |
I agree with making 4.2 branch and make release. IMHO since this is compability break, maybe the next release should be called 5.x ? |
I'm ok with 5.x. |
merged to master - thank you all |
Overview
This PR introduces a new
watchdog
module. The code includes the PR #497.Docs are not updated!
Changes:
os.environ
PYWPS_CFG
.I have moved the CLI command line from the birdhouse template to pywps:
bird-house/cookiecutter-birdhouse#52
You can start a pywps with the watchdog like this:
You can also start both services standalone:
The
pywps.cfg
needs to point to the processes list with a python list, see Emu example:https://github.com/bird-house/emu/blob/6347264a8fd0b86bf6d0b7b5fc857aaf449003cd/pywps.cfg#L10
This is a initial implemention to get the cli working. See also issue #118.
Related Issue / Discussion
#497
Additional Information
Contribution Agreement
(as per https://github.com/geopython/pywps/blob/master/CONTRIBUTING.rst#contributions-and-licensing)