Skip to content
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

Merged
merged 14 commits into from
Oct 19, 2023

Conversation

natthan-pigoux
Copy link
Contributor

Related issue: #22

Start creating the rescheduleJob method in JobDB as well as the routers methods and a test_insert_and_reschedule test.
Multiple features are missing (commented as TODO) and the method has to be finalized when those features will be added.

@natthan-pigoux natthan-pigoux changed the title Feature/npigoux reschedule Feature/npigoux rescheduleJob method Sep 5, 2023
@natthan-pigoux natthan-pigoux changed the title Feature/npigoux rescheduleJob method Feature rescheduleJob method Sep 5, 2023
@chrisburr chrisburr force-pushed the feature/npigoux-reschedule branch 2 times, most recently from e825e6a to 0e1945b Compare September 6, 2023 08:10
Copy link
Contributor

@fstagni fstagni left a 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.

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
Copy link
Contributor

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.

Copy link
Contributor

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 Show resolved Hide resolved
@@ -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:
Copy link
Contributor

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 Show resolved Hide resolved
job_id,
{
"Status": JobStatus.Failed,
"MinorStatus": "Maximum of reschedulings reached",
Copy link
Contributor

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.

@fstagni fstagni marked this pull request as draft September 8, 2023 14:12
@@ -21,6 +21,7 @@ class JobStatus(str, Enum):
DELETED = "Deleted"
KILLED = "Killed"
RESCHEDULED = "Rescheduled"
MAXRESCHEDULING = "Maximum of reschedulings reached"
Copy link
Contributor

@fstagni fstagni Sep 18, 2023

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.

@natthan-pigoux
Copy link
Contributor Author

I added a JobMinorStatus class in models and I now insert status in the JobLoggingDB.
Waiting for JobPolicy and TaskQueueDB (#63) to continue.

@natthan-pigoux natthan-pigoux marked this pull request as ready for review September 20, 2023 13:59
@@ -67,6 +67,11 @@ class JobStatus(str, Enum):
RESCHEDULED = "Rescheduled"


class JobMinorStatus(str, Enum):
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@chrisburr chrisburr merged commit 2cb5a85 into DIRACGrid:main Oct 19, 2023
4 of 5 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants