-
Notifications
You must be signed in to change notification settings - Fork 20
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
Feature rescheduleJob method #72
Feature rescheduleJob method #72
Conversation
e825e6a
to
0e1945b
Compare
for more information, see https://pre-commit.ci
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.
I move this to "Draft" given the To-DOs and discussions.
src/diracx/db/jobs/db.py
Outdated
from diracx.core.utils import JobStatus | ||
|
||
from ..utils import BaseDB, apply_search_filters | ||
from .schema import Base as JobDBBase | ||
from .schema import InputData, JobJDLs, Jobs | ||
from .schema import InputData, JobJDLs, JobParameters, Jobs, OptimizerParameters |
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.
In #29 (and at the last hackathon) we discuss against adding MySQL support for JobParameters
. Before we ratify this decision I would, at a minimum, avoid adding this here.
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.
Also, I am TBH not sure that OptimizerParameters
will be something that we'll need in DiracX. So, avoid adding code for it atm.
src/diracx/db/jobs/db.py
Outdated
@@ -141,6 +148,20 @@ async def setJobJDL(self, job_id, jdl): | |||
) | |||
await self.conn.execute(stmt) | |||
|
|||
async def getJobJDL(self, job_id: int, original: bool = False) -> str: |
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.
TBH I am not sure we have decided if there will be JDLs in DiracX...
src/diracx/db/jobs/db.py
Outdated
job_id, | ||
{ | ||
"Status": JobStatus.Failed, | ||
"MinorStatus": "Maximum of reschedulings reached", |
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 cleaner way would be to add this to JobMinorStatus
module.
src/diracx/core/utils.py
Outdated
@@ -21,6 +21,7 @@ class JobStatus(str, Enum): | |||
DELETED = "Deleted" | |||
KILLED = "Killed" | |||
RESCHEDULED = "Rescheduled" | |||
MAXRESCHEDULING = "Maximum of reschedulings reached" |
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.
This is not (not in DIRAC at least) a Job Status.
It is a MinorStatus though.
I added a |
@@ -67,6 +67,11 @@ class JobStatus(str, Enum): | |||
RESCHEDULED = "Rescheduled" | |||
|
|||
|
|||
class JobMinorStatus(str, Enum): |
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.
Related issue: #22
Start creating the
rescheduleJob
method inJobDB
as well as the routers methods and atest_insert_and_reschedule
test.Multiple features are missing (commented as TODO) and the method has to be finalized when those features will be added.