-
Notifications
You must be signed in to change notification settings - Fork 62
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
DRAFT: Add scheduler worker to create reoccuring processors #427
Draft
dale-wahl
wants to merge
27
commits into
master
Choose a base branch
from
scheduler
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
To-do - fix up and add options to scheduler view (e.g. delete/change) - add scheduler view to navigator - tie jobs to datasets? (either in scheduler view or, perhaps, filter dataset view) - more testing...
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
The main worker is
backend/workers/scheduler.py
which mostly imitates thewebtool/views/api_tool.py
queue_dataset()
endpoint. It creates a new dataset, queues a job for it, and then links them. It also adds a new database table which can be used to link multiple datasets to each other (since otherwise they are only linked by a job which is deleted when finished). I added some framework to allow this scheduler to update queries.Currently the manager runs this scheduler processor at the desired interval. This seems fine to me, but I also toyed with the idea of one scheduler job running and managing all scheduled jobs itself separately. This might be preferable depending on how interactive we want to be.
I have not developed the frontend yet. I was thinking relatively simple: List the main scheduler job with a button to display each created dataset. Buttons to cancel the scheduler and to update the interval. Possibly update the query if desired.
There is one thing with queries that I am not sure yet how to address. A user may want to rerun the exact query over and over to find change (keep querying the same date range and see if records are edited/deleted/etc.), but a user may reasonably want to create a rolling query (runs same search terms each week for the previous week). I need to sort out how we might do that and allow the user to choose. Right now the same exact query is run (for many processors you can leave out the date and accomplish nearly the same thing as the second case above).