-
Notifications
You must be signed in to change notification settings - Fork 58
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
Flexible scheduling #204
Closed
35 of 36 tasks
Tracked by
#3065
jpbruinsslot opened this issue
Jan 2, 2023
· 2 comments
· Fixed by #2786 · May be fixed by minvws/nl-kat-mula#32
Closed
35 of 36 tasks
Tracked by
#3065
Flexible scheduling #204
jpbruinsslot opened this issue
Jan 2, 2023
· 2 comments
· Fixed by #2786 · May be fixed by minvws/nl-kat-mula#32
Labels
mula
Issues related to the scheduler
Comments
TwistMeister
added
enhancement
New feature or request
and removed
feature request
labels
Feb 6, 2023
jpbruinsslot
changed the title
[Feature] Recurring / rescheduling tasks
[Mula] Recurring / rescheduling tasks
Feb 16, 2023
jpbruinsslot
changed the title
[Mula] Recurring / rescheduling tasks
[Mula] Recurring / rescheduling jobs
Feb 16, 2023
jpbruinsslot
changed the title
[Mula] Recurring / rescheduling jobs
[Mula] Scheduled jobs
Feb 16, 2023
Closed
Closed
Closed
This was referenced Jul 10, 2023
Closed
Closed
4 tasks
4 tasks
Merged
9 tasks
10 tasks
The design has been agreed upon, with the advice to make sure that database normalization would be possible in the future |
Open
3 tasks
3 tasks
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Context
The scheduler now references the
/random
endpoint from octopoes to get ooi's for rescheduling of tasks (ooi * available boefjes = tasks). To keep track of recurring tasks within the scheduler we allow for:Proposed solution
Changes
Change 1:
Schedule
modelCreate a new model
Schedule
which contains the necessary information to create a newTask
. ASchedule
has a 1-to-many relationship with an instancedTask
. The updated entity relationship diagram for the scheduler:With both models looking like follows:
nl-kat-coordination/mula/scheduler/models/schema.py
Lines 22 to 41 in 3942029
nl-kat-coordination/mula/scheduler/models/task.py
Lines 47 to 66 in 3942029
The
data
field contains the actual data that is needed for a task runner to execute its task, in case of aBoefjeScheduler
this is aBoefjeTask
:Change 2: Removal of the
PrioritizedItem
table and modelRemoval of the
PrioritizedItem
model and table. By removing this, a substantial decrease in data duplication within the scheduler has been achieved. The queue is now 'materialized' by filtering on the task table based on the status of aTask
, i.e. all task with the statusQUEUED
. In practice this means the following, when a task is created (either by manual entry, enabling of boefjes, rescheduling, etc) this task is added to the task table, and for every task that gets created aSchedule
is created as well.Example of both
Task
andSchedule
table, here aSchedule
already scheduled aTask
in the past, andQUEUED
aTask
in the future.Schedule table:
{}
0 12 * * 1
Task table:
{}
{}
When a task with the highest priority needs to be removed from the queue the following code is then being executed:
nl-kat-coordination/mula/scheduler/storage/pq_store.py
Lines 16 to 34 in 3942029
The rescheduling of tasks can be imagined as follows: the
BoefjeScheduler
queries theSchedule
table where the deadline has passed (meaning a task needs to be scheduled now, and pushed onto the queue). ATask
will be created and inserted into theTask
table. A Task Runner can then retrieve a task through the server API, run the task and update the status when it finished.Tasklist
job_store
tests #2286Job.p_item
attribute #2313jobs
api endpoints #2288jobs
endpoints #2306p_item
data deduplication #2611p_item
data deduplication > data model definitions #2650p_item
data deduplication > refactor migrations #2651p_item
data deduplication > refactor schedulers #2652TaskSchema
toSchedule
#2989test_scheduler.py
#3276Pull Request
Associated issues
The text was updated successfully, but these errors were encountered: