Skip to content

Commit c7fe57d

Browse files
authored
slurm priority support (#419)
1 parent 9ce257c commit c7fe57d

File tree

2 files changed

+12
-0
lines changed

2 files changed

+12
-0
lines changed

src/xpk/core/kjob.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -86,6 +86,7 @@ class PodTemplateDefaults(Enum):
8686
workingDir: {working_directory}
8787
{resources}
8888
{node_selector}
89+
priorityClassName: {priority}
8990
restartPolicy: OnFailure
9091
serviceAccountName: {service_account}
9192
"""
@@ -286,6 +287,7 @@ def create_job_template_instance(
286287
working_directory=working_directory,
287288
resources=resources,
288289
node_selector=node_selector,
290+
priority=args.priority if hasattr(args, "priority") else "medium",
289291
service_account=service_account,
290292
)
291293
if system is not None and system.accelerator_type == AcceleratorType["GPU"]:

src/xpk/parser/common.py

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -247,3 +247,13 @@ def add_slurm_arguments(custom_parser: argparse.ArgumentParser):
247247
'and "days-hours:minutes:seconds".'
248248
),
249249
)
250+
custom_parser.add_argument(
251+
'--priority',
252+
type=str,
253+
default='medium',
254+
choices=['very-low', 'low', 'medium', 'high', 'very-high'],
255+
help=(
256+
'A priority, one of `very-low`, `low`, `medium`, `high` or'
257+
' `very-high`. Defaults to `medium`.'
258+
),
259+
)

0 commit comments

Comments
 (0)