Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/python-package.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ jobs:
strategy:
fail-fast: false
matrix:
python-version: ["3.10"]
python-version: ["3.11"]
Comment thread
PeterC-DLS marked this conversation as resolved.

steps:
- uses: actions/checkout@v4
Expand Down
14 changes: 4 additions & 10 deletions ParProcCo/job_scheduler.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,10 +15,10 @@
from .job_scheduling_information import JobSchedulingInformation
from .slurm.slurm_client import SlurmClient
from .slurm.slurm_rest import (
CurrentEnum as JobStateEnum,
JobDescMsg,
JobInfo,
JobSubmitReq,
JobStateEnum,
StringArray,
Uint32NoValStruct,
Uint64NoValStruct,
Expand All @@ -38,13 +38,6 @@
],
)

# class NewJobStateEnum(Enum):
# CANCELLED = "CANCELLED" #
# LAUNCH_FAILED = "LAUNCH_FAILED" #
# UPDATE_DB = "UPDATE_DB" #
# RECONFIG_FAIL = "RECONFIG_FAIL" #
# POWER_UP_NODE = "POWER_UP_NODE" #


class STATEGROUP(tuple[SLURMSTATE], Enum): # type: ignore
OUTOFTIME = (SLURMSTATE.TIMEOUT, SLURMSTATE.DEADLINE)
Expand Down Expand Up @@ -151,7 +144,7 @@ def fetch_and_update_state(
job_id = job_info.job_id
if job_id is None or job_id < 0:
raise ValueError(f"Job info has invalid job id: {job_info}")
state = job_info.job_state.root
state = job_info.job_state
slurm_state = SLURMSTATE[state[0].value] if state else None

start_time = (
Expand Down Expand Up @@ -532,13 +525,14 @@ def handle_timeouts(
if deadline is not None
]
)
logging.debug("Next deadline: %s", next_deadline)
check_time = min(
((next_deadline - datetime.now()) / 2), timedelta(minutes=1)
)

if not_started:
not_started = handle_not_started(not_started, check_time=check_time)
logging.info("Not started: %i", len(not_started))
logging.info("Not started: %i (%s)", len(not_started), check_time)

for jsi in wait_for_ended(
[v for k, v in running_jobs.items() if k not in not_started],
Expand Down
6 changes: 3 additions & 3 deletions ParProcCo/slurm/README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
Get OpenAPI schema from endpoint:
```
$ curl -H X-SLURM-USER-NAME:${USER} -H X-SLURM-USER-TOKEN:${SLURM_TOKEN) "${SLURM_REST_URL}/openapi" -o slurm-rest.json
$ curl -H X-SLURM-USER-NAME:${USER} -H X-SLURM-USER-TOKEN:${SLURM_TOKEN} "${SLURM_REST_URL}/openapi" -o slurm-rest.json
```
Filter and rename schema and refs to remove version
```
Expand All @@ -9,7 +9,7 @@ $ python generate_models.py -d slurm-rest.json slurmdb-rest.yaml
```
Run datamodel generating script
```
$ datamodel-codegen --input slurm-rest.yaml --target-python-version 3.11 --use-schema-description --use-field-description --output-model-type pydantic_v2.BaseModel --use-union-operator --use-standard-collections --field-constraints --use-double-quotes --output slurm_rest.py
$ datamodel-codegen --input slurmdb-rest.yaml --target-python-version 3.11 --use-schema-description --use-field-description --output-model-type pydantic_v2.BaseModel --use-union-operator --use-standard-collections --field-constraints --use-double-quotes --output slurmdb_rest.py
$ datamodel-codegen --input slurm-rest.yaml --target-python-version 3.12 --use-schema-description --use-field-description --output-model-type pydantic_v2.BaseModel --use-union-operator --use-standard-collections --field-constraints --use-double-quotes --output slurm_rest.py
$ datamodel-codegen --input slurmdb-rest.yaml --target-python-version 3.12 --use-schema-description --use-field-description --output-model-type pydantic_v2.BaseModel --use-union-operator --use-standard-collections --field-constraints --use-double-quotes --output slurmdb_rest.py
```

2 changes: 1 addition & 1 deletion ParProcCo/slurm/generate_models.py
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ def create_argparser():
default=False,
)
ap.add_argument(
"--version", "-v", help="str: slurm OpenAPI version string", default="v0.0.38"
"--version", "-v", help="str: slurm OpenAPI version string", default="v0.0.44"
)
ap.add_argument(
"input_file",
Expand Down
2 changes: 1 addition & 1 deletion ParProcCo/slurm/slurm_client.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
OpenapiKillJobResp,
)

_SLURM_VERSION = "v0.0.42"
_SLURM_VERSION = "v0.0.44"


def get_slurm_token() -> str:
Expand Down
Loading
Loading