diff --git a/pyproject.toml b/pyproject.toml index 77bed6f..1378c5f 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -68,6 +68,7 @@ jmx = "zocalo.configuration.plugin_jmx:JMX" logging = "zocalo.configuration.plugin_logging:Logging" rabbitmqapi = "zocalo.configuration.plugin_rabbitmqapi:RabbitAPI" slurm = "zocalo.configuration.plugin_slurm:Slurm" +iris = "zocalo.configuration.plugin_slurm:Slurm" smtp = "zocalo.configuration.plugin_smtp:SMTP" storage = "zocalo.configuration.plugin_storage:Storage" diff --git a/src/zocalo/util/slurm/__init__.py b/src/zocalo/util/slurm/__init__.py index 6fefb0c..05994c2 100644 --- a/src/zocalo/util/slurm/__init__.py +++ b/src/zocalo/util/slurm/__init__.py @@ -6,7 +6,7 @@ import requests -import zocalo.configuration +from zocalo.configuration import Configuration from . import models @@ -15,7 +15,7 @@ class SlurmRestApi: def __init__( self, url: str, - version: str = "v0.0.36", + version: str = "v0.0.40", user_name: str | None = None, user_token: str | pathlib.Path | None = None, ): @@ -35,12 +35,13 @@ def __init__( self.session.headers["X-SLURM-USER-TOKEN"] = self.user_token @classmethod - def from_zocalo_configuration(cls, zc: zocalo.configuration.Configuration): + def from_zocalo_configuration(cls, zc: Configuration, cluster: str = "slurm"): + cluster_config = getattr(zc, cluster) return cls( - url=zc.slurm["url"], - version=zc.slurm["api_version"], - user_name=zc.slurm.get("user"), - user_token=zc.slurm.get("user_token"), + url=cluster_config["url"], + version=cluster_config["api_version"], + user_name=cluster_config.get("user"), + user_token=cluster_config.get("user_token"), ) def get( @@ -93,19 +94,21 @@ def delete( response.raise_for_status() return response - def get_jobs(self) -> models.JobsResponse: + def get_jobs(self) -> models.OpenapiJobInfoResp: endpoint = f"slurm/{self.version}/jobs" response = self.get(endpoint) - return models.JobsResponse(**response.json()) + return models.OpenapiJobInfoResp(**response.json()) - def get_job_info(self, job_id: int) -> models.JobsResponse: + def get_job_info(self, job_id: int) -> models.JobInfo: endpoint = f"slurm/{self.version}/job/{job_id}" response = self.get(endpoint) - return models.JobsResponse(**response.json()) + job_info_resp = models.OpenapiJobInfoResp(**response.json()) + jobinfo = next(iter(dict(job_info_resp.jobs).get("__root__", []))) + return jobinfo def submit_job( - self, job_submission: models.JobSubmission - ) -> models.JobSubmissionResponse: + self, job_submission: models.JobSubmitReq + ) -> models.JobSubmitResponseMsg: endpoint = f"slurm/{self.version}/job/submit" response = self.post(endpoint, json=job_submission.dict(exclude_defaults=True)) - return models.JobSubmissionResponse(**response.json()) + return models.JobSubmitResponseMsg(**response.json()) diff --git a/src/zocalo/util/slurm/models.py b/src/zocalo/util/slurm/models.py index 4ded238..a615581 100644 --- a/src/zocalo/util/slurm/models.py +++ b/src/zocalo/util/slurm/models.py @@ -1,551 +1,3243 @@ +# generated by datamodel-codegen: +# filename: wilson-slurm-rest38.yaml +# timestamp: 2024-03-27T13:12:29+00:00 + from __future__ import annotations from enum import Enum -from typing import Any, Dict, List, Optional +from typing import List, Optional from pydantic import BaseModel, Field -class Exclusive(Enum): - user = "user" - mcs = "mcs" +class Flag(Enum): + DELETED = "DELETED" + + +class AccountShort(BaseModel): + description: Optional[str] = None + """ + An arbitrary string describing an account + """ + organization: Optional[str] = None + """ + Organization to which the account belongs + """ + + +class Allocated(BaseModel): + seconds: Optional[int] = None + + +class Default(BaseModel): + qos: Optional[str] = None + + +class Fairshare(BaseModel): + factor: Optional[float] = None + """ + fairshare factor + """ + level: Optional[float] = None + """ + fairshare factor at this level. stored on an assoc as a long double, but that is not needed for display in sshare + """ + + +class TypeEnum(Enum): + USER = "USER" + ASSOCIATION = "ASSOCIATION" + + +class AssocShort(BaseModel): + account: Optional[str] = None + """ + Association account (if assigned) + """ + cluster: Optional[str] = None + """ + Association cluster (if assigned) + """ + id: Optional[int] = None + """ + Numeric Association ID (if known) + """ + partition: Optional[str] = None + """ + Association partition (if assigned) + """ + user: str + """ + Assocation user (if assigned) + """ + + +class AssocShortList(BaseModel): + __root__: List[AssocShort] + + +class BfExitFields(BaseModel): + bf_max_job_start: Optional[int] = None + bf_max_job_test: Optional[int] = None + bf_max_time: Optional[int] = None + bf_node_space_size: Optional[int] = None + end_job_queue: Optional[int] = None + state_changed: Optional[int] = None + + +class Associations(BaseModel): + root: Optional[AssocShort] = None + + +class Controller(BaseModel): + host: Optional[str] = None + port: Optional[int] = None + + +class Flag2(Enum): + REGISTERING = "REGISTERING" + MULTIPLE_SLURMD = "MULTIPLE_SLURMD" + FRONT_END = "FRONT_END" + CRAY_NATIVE = "CRAY_NATIVE" + FEDERATION = "FEDERATION" + EXTERNAL = "EXTERNAL" + + +class ControllerPing(BaseModel): + hostname: Optional[str] = None + latency: Optional[int] = None + mode: Optional[str] = None + pinged: Optional[str] = None + + +class ControllerPingArray(BaseModel): + __root__: List[ControllerPing] + + +class Coord(BaseModel): + direct: Optional[bool] = None + name: str + + +class CoordList(BaseModel): + __root__: List[Coord] + + +class Flag3(Enum): + WILD_MINUTE = "WILD_MINUTE" + WILD_HOUR = "WILD_HOUR" + WILD_DAY_OF_MONTH = "WILD_DAY_OF_MONTH" + WILD_MONTH = "WILD_MONTH" + WILD_DAY_OF_WEEK = "WILD_DAY_OF_WEEK" + + +class Line(BaseModel): + end: Optional[int] = None + start: Optional[int] = None + + +class CronEntry(BaseModel): + command: Optional[str] = None + day_of_month: Optional[str] = None + day_of_week: Optional[str] = None + flags: Optional[List[Flag3]] = None + hour: Optional[str] = None + line: Optional[Line] = None + minute: Optional[str] = None + month: Optional[str] = None + specification: Optional[str] = None + + +class CsvString(BaseModel): + __root__: List[str] + + +class Float64NoVal(BaseModel): + """ + 64 bit floating point number with flags + """ + + infinite: Optional[bool] = False + """ + True if number has been set to infinite. "set" and "number" will be ignored. + """ + number: Optional[float] = None + """ + If set is True the number will be set with value. Otherwise ignore number contents. + """ + set: Optional[bool] = False + """ + True if number has been set. False if number is unset + """ + + +class HostList(BaseModel): + __root__: List[str] + + +class HostListString(BaseModel): + __root__: List[str] + + +class Time(BaseModel): + time_end: Optional[int] = None + time_start: Optional[int] = None + + +class Instance(BaseModel): + cluster: Optional[str] = None + extra: Optional[str] = None + instance_id: Optional[str] = None + instance_type: Optional[str] = None + node_name: Optional[str] = None + time: Optional[Time] = None + + +class InstanceList(BaseModel): + __root__: List[Instance] + + +class Running(BaseModel): + tasks: Optional[int] = None + + +class Max1(BaseModel): + running: Optional[Running] = None + + +class Limits(BaseModel): + max: Optional[Max1] = None + + +class Comment(BaseModel): + administrator: Optional[str] = None + job: Optional[str] = None + system: Optional[str] = None + + +class Flag4(Enum): + NONE = "NONE" + CLEAR_SCHEDULING = "CLEAR_SCHEDULING" + NOT_SET = "NOT_SET" + STARTED_ON_SUBMIT = "STARTED_ON_SUBMIT" + STARTED_ON_SCHEDULE = "STARTED_ON_SCHEDULE" + STARTED_ON_BACKFILL = "STARTED_ON_BACKFILL" + START_RECEIVED = "START_RECEIVED" + + +class Mcs(BaseModel): + label: Optional[str] = None + + +class Reservation(BaseModel): + id: Optional[int] = None + name: Optional[str] = None + + +class CurrentEnum(Enum): + PENDING = "PENDING" + RUNNING = "RUNNING" + SUSPENDED = "SUSPENDED" + COMPLETED = "COMPLETED" + CANCELLED = "CANCELLED" + FAILED = "FAILED" + TIMEOUT = "TIMEOUT" + NODE_FAIL = "NODE_FAIL" + PREEMPTED = "PREEMPTED" + BOOT_FAIL = "BOOT_FAIL" + DEADLINE = "DEADLINE" + OUT_OF_MEMORY = "OUT_OF_MEMORY" + LAUNCH_FAILED = "LAUNCH_FAILED" + UPDATE_DB = "UPDATE_DB" + REQUEUED = "REQUEUED" + REQUEUE_HOLD = "REQUEUE_HOLD" + SPECIAL_EXIT = "SPECIAL_EXIT" + RESIZING = "RESIZING" + CONFIGURING = "CONFIGURING" + COMPLETING = "COMPLETING" + STOPPED = "STOPPED" + RECONFIG_FAIL = "RECONFIG_FAIL" + POWER_UP_NODE = "POWER_UP_NODE" + REVOKED = "REVOKED" + REQUEUE_FED = "REQUEUE_FED" + RESV_DEL_HOLD = "RESV_DEL_HOLD" + SIGNALING = "SIGNALING" + STAGE_OUT = "STAGE_OUT" + + +class State(BaseModel): + current: Optional[List[CurrentEnum]] = None + reason: Optional[str] = None + + +class System(BaseModel): + microseconds: Optional[int] = None + seconds: Optional[int] = None + + +class Total(BaseModel): + microseconds: Optional[int] = None + seconds: Optional[int] = None + + +class User(BaseModel): + microseconds: Optional[int] = None + seconds: Optional[int] = None + + +class JobArrayResponseMsgEntry(BaseModel): + error: Optional[str] = None + """ + Verbose update status or error + """ + error_code: Optional[int] = None + """ + Verbose update status or error + """ + job_id: Optional[int] = None + """ + JobId for updated Job + """ + step_id: Optional[str] = None + """ + StepId for updated Job + """ + why: Optional[str] = None + """ + Update response message + """ + + +class CpuBindingFlag(Enum): + CPU_BIND_TO_THREADS = "CPU_BIND_TO_THREADS" + CPU_BIND_TO_CORES = "CPU_BIND_TO_CORES" + CPU_BIND_TO_SOCKETS = "CPU_BIND_TO_SOCKETS" + CPU_BIND_TO_LDOMS = "CPU_BIND_TO_LDOMS" + CPU_BIND_NONE = "CPU_BIND_NONE" + CPU_BIND_RANK = "CPU_BIND_RANK" + CPU_BIND_MAP = "CPU_BIND_MAP" + CPU_BIND_MASK = "CPU_BIND_MASK" + CPU_BIND_LDRANK = "CPU_BIND_LDRANK" + CPU_BIND_LDMAP = "CPU_BIND_LDMAP" + CPU_BIND_LDMASK = "CPU_BIND_LDMASK" + VERBOSE = "VERBOSE" + CPU_BIND_ONE_THREAD_PER_CORE = "CPU_BIND_ONE_THREAD_PER_CORE" + + +class ExclusiveEnum(Enum): true = "true" false = "false" + user = "user" + mcs = "mcs" + + +class Flag5(Enum): + KILL_INVALID_DEPENDENCY = "KILL_INVALID_DEPENDENCY" + NO_KILL_INVALID_DEPENDENCY = "NO_KILL_INVALID_DEPENDENCY" + HAS_STATE_DIRECTORY = "HAS_STATE_DIRECTORY" + TESTING_BACKFILL = "TESTING_BACKFILL" + GRES_BINDING_ENFORCED = "GRES_BINDING_ENFORCED" + TEST_NOW_ONLY = "TEST_NOW_ONLY" + SEND_JOB_ENVIRONMENT = "SEND_JOB_ENVIRONMENT" + SPREAD_JOB = "SPREAD_JOB" + PREFER_MINIMUM_NODE_COUNT = "PREFER_MINIMUM_NODE_COUNT" + JOB_KILL_HURRY = "JOB_KILL_HURRY" + SKIP_TRES_STRING_ACCOUNTING = "SKIP_TRES_STRING_ACCOUNTING" + SIBLING_CLUSTER_UPDATE_ONLY = "SIBLING_CLUSTER_UPDATE_ONLY" + HETEROGENEOUS_JOB = "HETEROGENEOUS_JOB" + EXACT_TASK_COUNT_REQUESTED = "EXACT_TASK_COUNT_REQUESTED" + EXACT_CPU_COUNT_REQUESTED = "EXACT_CPU_COUNT_REQUESTED" + TESTING_WHOLE_NODE_BACKFILL = "TESTING_WHOLE_NODE_BACKFILL" + TOP_PRIORITY_JOB = "TOP_PRIORITY_JOB" + ACCRUE_COUNT_CLEARED = "ACCRUE_COUNT_CLEARED" + GRED_BINDING_DISABLED = "GRED_BINDING_DISABLED" + JOB_WAS_RUNNING = "JOB_WAS_RUNNING" + JOB_ACCRUE_TIME_RESET = "JOB_ACCRUE_TIME_RESET" + CRON_JOB = "CRON_JOB" + EXACT_MEMORY_REQUESTED = "EXACT_MEMORY_REQUESTED" + USING_DEFAULT_ACCOUNT = "USING_DEFAULT_ACCOUNT" + USING_DEFAULT_PARTITION = "USING_DEFAULT_PARTITION" + USING_DEFAULT_QOS = "USING_DEFAULT_QOS" + USING_DEFAULT_WCKEY = "USING_DEFAULT_WCKEY" + DEPENDENT = "DEPENDENT" + MAGNETIC = "MAGNETIC" + PARTITION_ASSIGNED = "PARTITION_ASSIGNED" + BACKFILL_ATTEMPTED = "BACKFILL_ATTEMPTED" + SCHEDULING_ATTEMPTED = "SCHEDULING_ATTEMPTED" + SAVE_BATCH_SCRIPT = "SAVE_BATCH_SCRIPT" + + +class KillWarningFlag(Enum): + BATCH_JOB = "BATCH_JOB" + ARRAY_TASK = "ARRAY_TASK" + FULL_STEPS_ONLY = "FULL_STEPS_ONLY" + FULL_JOB = "FULL_JOB" + FEDERATION_REQUEUE = "FEDERATION_REQUEUE" + HURRY = "HURRY" + OUT_OF_MEMORY = "OUT_OF_MEMORY" + NO_SIBLING_JOBS = "NO_SIBLING_JOBS" + RESERVATION_JOB = "RESERVATION_JOB" + WARNING_SENT = "WARNING_SENT" + + +class MailTypeEnum(Enum): + BEGIN = "BEGIN" + END = "END" + FAIL = "FAIL" + REQUEUE = "REQUEUE" + TIME_100_ = "TIME=100%" + TIME_90_ = "TIME=90%" + TIME_80_ = "TIME=80%" + TIME_50_ = "TIME=50%" + STAGE_OUT = "STAGE_OUT" + ARRAY_TASKS = "ARRAY_TASKS" + INVALID_DEPENDENCY = "INVALID_DEPENDENCY" + + +class MemoryBindingTypeEnum(Enum): + NONE = "NONE" + RANK = "RANK" + MAP = "MAP" + MASK = "MASK" + LOCAL = "LOCAL" + VERBOSE = "VERBOSE" + SORT = "SORT" + PREFER = "PREFER" + + +class OpenModeEnum(Enum): + APPEND = "APPEND" + TRUNCATE = "TRUNCATE" + + +class PowerFlag(Enum): + EQUAL_POWER = "EQUAL_POWER" + + +class ProfileEnum(Enum): + NOT_SET = "NOT_SET" + NONE = "NONE" + ENERGY = "ENERGY" + LUSTRE = "LUSTRE" + NETWORK = "NETWORK" + TASK = "TASK" + + +class SharedEnum(Enum): + none = "none" + oversubscribe = "oversubscribe" + user = "user" + mcs = "mcs" + + +class X11Enum(Enum): + FORWARD_ALL_NODES = "FORWARD_ALL_NODES" + BATCH_NODE = "BATCH_NODE" + FIRST_NODE = "FIRST_NODE" + LAST_NODE = "LAST_NODE" + + +class JobStateEnum(Enum): + PENDING = "PENDING" + RUNNING = "RUNNING" + SUSPENDED = "SUSPENDED" + COMPLETED = "COMPLETED" + CANCELLED = "CANCELLED" + FAILED = "FAILED" + TIMEOUT = "TIMEOUT" + NODE_FAIL = "NODE_FAIL" + PREEMPTED = "PREEMPTED" + BOOT_FAIL = "BOOT_FAIL" + DEADLINE = "DEADLINE" + OUT_OF_MEMORY = "OUT_OF_MEMORY" + LAUNCH_FAILED = "LAUNCH_FAILED" + UPDATE_DB = "UPDATE_DB" + REQUEUED = "REQUEUED" + REQUEUE_HOLD = "REQUEUE_HOLD" + SPECIAL_EXIT = "SPECIAL_EXIT" + RESIZING = "RESIZING" + CONFIGURING = "CONFIGURING" + COMPLETING = "COMPLETING" + STOPPED = "STOPPED" + RECONFIG_FAIL = "RECONFIG_FAIL" + POWER_UP_NODE = "POWER_UP_NODE" + REVOKED = "REVOKED" + REQUEUE_FED = "REQUEUE_FED" + RESV_DEL_HOLD = "RESV_DEL_HOLD" + SIGNALING = "SIGNALING" + STAGE_OUT = "STAGE_OUT" + + +class Flag7(Enum): + EQUAL_POWER = "EQUAL_POWER" + + +class Power(BaseModel): + flags: Optional[List[Flag7]] = None + + +class ShowFlag(Enum): + ALL = "ALL" + DETAIL = "DETAIL" + MIXED = "MIXED" + LOCAL = "LOCAL" + SIBLING = "SIBLING" + FEDERATION = "FEDERATION" + FUTURE = "FUTURE" + + +class JobInfoGresDetail(BaseModel): + __root__: List[str] + + +class JobResNodes(BaseModel): + """ + job node resources + """ + + __root__: List + """ + job node resources + """ + + +class JobSubmitResponseMsg(BaseModel): + error: Optional[str] = None + error_code: Optional[int] = None + job_id: Optional[int] = None + job_submit_user_msg: Optional[str] = None + step_id: Optional[str] = None + + +class License(BaseModel): + Free: Optional[int] = None + LastConsumed: Optional[int] = None + LastDeficit: Optional[int] = None + LastUpdate: Optional[int] = None + LicenseName: Optional[str] = None + Remote: Optional[bool] = None + Reserved: Optional[int] = None + Total: Optional[int] = None + Used: Optional[int] = None + + +class Licenses(BaseModel): + __root__: List[License] + + +class NextStateAfterRebootEnum(Enum): + INVALID = "INVALID" + UNKNOWN = "UNKNOWN" + DOWN = "DOWN" + IDLE = "IDLE" + ALLOCATED = "ALLOCATED" + ERROR = "ERROR" + MIXED = "MIXED" + FUTURE = "FUTURE" + PERFCTRS = "PERFCTRS" + RESERVED = "RESERVED" + UNDRAIN = "UNDRAIN" + CLOUD = "CLOUD" + RESUME = "RESUME" + DRAIN = "DRAIN" + COMPLETING = "COMPLETING" + NOT_RESPONDING = "NOT_RESPONDING" + POWERED_DOWN = "POWERED_DOWN" + FAIL = "FAIL" + POWERING_UP = "POWERING_UP" + MAINTENANCE = "MAINTENANCE" + REBOOT_REQUESTED = "REBOOT_REQUESTED" + REBOOT_CANCELED = "REBOOT_CANCELED" + POWERING_DOWN = "POWERING_DOWN" + DYNAMIC_FUTURE = "DYNAMIC_FUTURE" + REBOOT_ISSUED = "REBOOT_ISSUED" + PLANNED = "PLANNED" + INVALID_REG = "INVALID_REG" + POWER_DOWN = "POWER_DOWN" + POWER_UP = "POWER_UP" + POWER_DRAIN = "POWER_DRAIN" + DYNAMIC_NORM = "DYNAMIC_NORM" + + +class StateEnum(Enum): + INVALID = "INVALID" + UNKNOWN = "UNKNOWN" + DOWN = "DOWN" + IDLE = "IDLE" + ALLOCATED = "ALLOCATED" + ERROR = "ERROR" + MIXED = "MIXED" + FUTURE = "FUTURE" + PERFCTRS = "PERFCTRS" + RESERVED = "RESERVED" + UNDRAIN = "UNDRAIN" + CLOUD = "CLOUD" + RESUME = "RESUME" + DRAIN = "DRAIN" + COMPLETING = "COMPLETING" + NOT_RESPONDING = "NOT_RESPONDING" + POWERED_DOWN = "POWERED_DOWN" + FAIL = "FAIL" + POWERING_UP = "POWERING_UP" + MAINTENANCE = "MAINTENANCE" + REBOOT_REQUESTED = "REBOOT_REQUESTED" + REBOOT_CANCELED = "REBOOT_CANCELED" + POWERING_DOWN = "POWERING_DOWN" + DYNAMIC_FUTURE = "DYNAMIC_FUTURE" + REBOOT_ISSUED = "REBOOT_ISSUED" + PLANNED = "PLANNED" + INVALID_REG = "INVALID_REG" + POWER_DOWN = "POWER_DOWN" + POWER_UP = "POWER_UP" + POWER_DRAIN = "POWER_DRAIN" + DYNAMIC_NORM = "DYNAMIC_NORM" + + +class OpenapiError(BaseModel): + description: Optional[str] = None + """ + Long form error description + """ + error: Optional[str] = None + """ + Short form error description + """ + error_number: Optional[int] = None + """ + Slurm numeric error identifier + """ + source: Optional[str] = None + """ + Source of error or where error was first detected + """ + + +class OpenapiErrors(BaseModel): + __root__: List[OpenapiError] + + +class Client(BaseModel): + group: Optional[str] = None + """ + Client group (if known) + """ + source: Optional[str] = None + """ + Client source description + """ + user: Optional[str] = None + """ + Client user (if known) + """ + + +class Plugin(BaseModel): + accounting_storage: Optional[str] = None + """ + Slurm accounting plugin + """ + data_parser: Optional[str] = None + """ + Slurm data_parser plugin + """ + name: Optional[str] = None + """ + Slurm plugin name (if applicable) + """ + type: Optional[str] = None + """ + Slurm plugin type (if applicable) + """ + + +class Version(BaseModel): + major: Optional[str] = None + """ + Slurm release major version + """ + micro: Optional[str] = None + """ + Slurm release micro version + """ + minor: Optional[str] = None + """ + Slurm release minor version + """ + + +class Slurm(BaseModel): + cluster: Optional[str] = None + """ + Slurm cluster name + """ + release: Optional[str] = None + """ + Slurm release string + """ + version: Optional[Version] = None + + +class OpenapiWarning(BaseModel): + description: Optional[str] = None + """ + Long form warning description + """ + source: Optional[str] = None + """ + Source of warning or where warning was first detected + """ + + +class OpenapiWarnings(BaseModel): + __root__: List[OpenapiWarning] + + +class Accounts(BaseModel): + allowed: Optional[str] = None + deny: Optional[str] = None + + +class Cpus(BaseModel): + task_binding: Optional[int] = None + total: Optional[int] = None + + +class Groups(BaseModel): + allowed: Optional[str] = None + + +class Flag8(Enum): + force = "force" + + +class Oversubscribe(BaseModel): + flags: Optional[List[Flag8]] = None + jobs: Optional[int] = None + + +class Minimums(BaseModel): + nodes: Optional[int] = None + + +class Nodes1(BaseModel): + allowed_allocation: Optional[str] = None + configured: Optional[str] = None + total: Optional[int] = None + + +class StateEnum1(Enum): + INACTIVE = "INACTIVE" + UNKNOWN = "UNKNOWN" + UP = "UP" + DOWN = "DOWN" + DRAIN = "DRAIN" + + +class Partition(BaseModel): + state: Optional[List[StateEnum1]] = None + + +class Priority(BaseModel): + job_factor: Optional[int] = None + tier: Optional[int] = None + + +class Qos(BaseModel): + allowed: Optional[str] = None + assigned: Optional[str] = None + deny: Optional[str] = None + + +class Tres4(BaseModel): + billing_weights: Optional[str] = None + configured: Optional[str] = None + + +class StatusEnum(Enum): + INVALID = "INVALID" + PENDING = "PENDING" + SUCCESS = "SUCCESS" + ERROR = "ERROR" + SIGNALED = "SIGNALED" + CORE_DUMPED = "CORE_DUMPED" + + +class Flag9(Enum): + NOT_SET = "NOT_SET" + ADD = "ADD" + REMOVE = "REMOVE" + PARTITION_MINIMUM_NODE = "PARTITION_MINIMUM_NODE" + PARTITION_MAXIMUM_NODE = "PARTITION_MAXIMUM_NODE" + PARTITION_TIME_LIMIT = "PARTITION_TIME_LIMIT" + ENFORCE_USAGE_THRESHOLD = "ENFORCE_USAGE_THRESHOLD" + NO_RESERVE = "NO_RESERVE" + REQUIRED_RESERVATION = "REQUIRED_RESERVATION" + DENY_LIMIT = "DENY_LIMIT" + OVERRIDE_PARTITION_QOS = "OVERRIDE_PARTITION_QOS" + NO_DECAY = "NO_DECAY" + USAGE_FACTOR_SAFE = "USAGE_FACTOR_SAFE" + RELATIVE = "RELATIVE" + + +class ModeEnum(Enum): + DISABLED = "DISABLED" + SUSPEND = "SUSPEND" + REQUEUE = "REQUEUE" + CANCEL = "CANCEL" + GANG = "GANG" + + +class QosPreemptList(BaseModel): + __root__: List[str] + + +class QosStringIdList(BaseModel): + """ + List of QOS names + """ + + __root__: List[str] + """ + List of QOS names + """ + + +class ReservationCoreSpec(BaseModel): + core: Optional[str] = None + node: Optional[str] = None + + +class Flag10(Enum): + MAINT = "MAINT" + NO_MAINT = "NO_MAINT" + DAILY = "DAILY" + NO_DAILY = "NO_DAILY" + WEEKLY = "WEEKLY" + NO_WEEKLY = "NO_WEEKLY" + IGNORE_JOBS = "IGNORE_JOBS" + NO_IGNORE_JOBS = "NO_IGNORE_JOBS" + ANY_NODES = "ANY_NODES" + STATIC = "STATIC" + NO_STATIC = "NO_STATIC" + PART_NODES = "PART_NODES" + NO_PART_NODES = "NO_PART_NODES" + OVERLAP = "OVERLAP" + SPEC_NODES = "SPEC_NODES" + TIME_FLOAT = "TIME_FLOAT" + REPLACE = "REPLACE" + ALL_NODES = "ALL_NODES" + PURGE_COMP = "PURGE_COMP" + WEEKDAY = "WEEKDAY" + NO_WEEKDAY = "NO_WEEKDAY" + WEEKEND = "WEEKEND" + NO_WEEKEND = "NO_WEEKEND" + FLEX = "FLEX" + NO_FLEX = "NO_FLEX" + DURATION_PLUS = "DURATION_PLUS" + DURATION_MINUS = "DURATION_MINUS" + NO_HOLD_JOBS_AFTER_END = "NO_HOLD_JOBS_AFTER_END" + NO_PURGE_COMP = "NO_PURGE_COMP" + MAGNETIC = "MAGNETIC" + SKIP = "SKIP" + HOURLY = "HOURLY" + NO_HOURLY = "NO_HOURLY" + REOCCURRING = "REOCCURRING" + + +class ReservationInfoCoreSpec(BaseModel): + __root__: List[ReservationCoreSpec] + + +class Type(Enum): + """ + type + """ + + internal = "internal" + user = "user" + unknown = "unknown" + + +class RollupStat(BaseModel): + """ + recorded rollup statistics + """ + + last_run: Optional[int] = Field(None, alias="last run") + """ + Last time rollup ran (UNIX timestamp) + """ + max_cycle: Optional[int] = None + """ + longest rollup time (seconds) + """ + mean_cycles: Optional[int] = None + """ + average time for rollup (seconds) + """ + total_cycles: Optional[int] = None + """ + number of rollups since last_run + """ + total_time: Optional[int] = None + """ + total time spent doing rollups (seconds) + """ + type: Optional[Type] = None + """ + type + """ + + +class RollupStats(BaseModel): + """ + List of recorded rollup statistics + """ + + __root__: List[RollupStat] + """ + List of recorded rollup statistics + """ + + +class ScheduleExitFields(BaseModel): + default_queue_depth: Optional[int] = None + end_job_queue: Optional[int] = None + licenses: Optional[int] = None + max_job_start: Optional[int] = None + max_rpc_cnt: Optional[int] = None + max_sched_time: Optional[int] = None + + +class SharesFloat128Tres(BaseModel): + name: Optional[str] = None + """ + TRES name + """ + value: Optional[float] = None + """ + TRES value + """ + + +class SharesFloat128TresList(BaseModel): + __root__: List[SharesFloat128Tres] + + +class StatsMsgRpcsByTypeItem(BaseModel): + """ + RPC + """ + + average_time: Optional[int] = None + """ + Average time spent processing RPC in seconds + """ + count: Optional[int] = None + """ + Number of RPCs received + """ + message_type: Optional[str] = None + """ + Message type as string + """ + total_time: Optional[int] = None + """ + Total time spent processing RPC in seconds + """ + type_id: Optional[int] = None + """ + Message type as integer + """ + + +class StatsMsgRpcsByType(BaseModel): + """ + RPCs by message type + """ + + __root__: List[StatsMsgRpcsByTypeItem] + """ + RPCs by message type + """ + + +class StatsMsgRpcsByUserItem(BaseModel): + """ + user + """ + + average_time: Optional[int] = None + """ + Average time spent processing RPC in seconds + """ + count: Optional[int] = None + """ + Number of RPCs received + """ + total_time: Optional[int] = None + """ + Total time spent processing RPC in seconds + """ + user: Optional[str] = None + """ + user name + """ + user_id: Optional[int] = None + """ + user id (numeric) + """ + + +class StatsMsgRpcsByUser(BaseModel): + """ + RPCs by user + """ + + __root__: List[StatsMsgRpcsByUserItem] + """ + RPCs by user + """ + + +class Time2(BaseModel): + average: Optional[int] = None + total: Optional[int] = None + + +class StatsRpc(BaseModel): + count: Optional[int] = None + rpc: Optional[str] = None + time: Optional[Time2] = None + + +class StatsRpcList(BaseModel): + __root__: List[StatsRpc] + + +class StatsUser(BaseModel): + count: Optional[int] = None + time: Optional[Time2] = None + user: Optional[str] = None + + +class StatsUserList(BaseModel): + __root__: List[StatsUser] + + +class Nodes2(BaseModel): + count: Optional[int] = None + List: Optional[HostList] = None + range: Optional[str] = None + + +class StateEnum2(Enum): + PENDING = "PENDING" + RUNNING = "RUNNING" + SUSPENDED = "SUSPENDED" + COMPLETED = "COMPLETED" + CANCELLED = "CANCELLED" + FAILED = "FAILED" + TIMEOUT = "TIMEOUT" + NODE_FAIL = "NODE_FAIL" + PREEMPTED = "PREEMPTED" + BOOT_FAIL = "BOOT_FAIL" + DEADLINE = "DEADLINE" + OUT_OF_MEMORY = "OUT_OF_MEMORY" + LAUNCH_FAILED = "LAUNCH_FAILED" + UPDATE_DB = "UPDATE_DB" + REQUEUED = "REQUEUED" + REQUEUE_HOLD = "REQUEUE_HOLD" + SPECIAL_EXIT = "SPECIAL_EXIT" + RESIZING = "RESIZING" + CONFIGURING = "CONFIGURING" + COMPLETING = "COMPLETING" + STOPPED = "STOPPED" + RECONFIG_FAIL = "RECONFIG_FAIL" + POWER_UP_NODE = "POWER_UP_NODE" + REVOKED = "REVOKED" + REQUEUE_FED = "REQUEUE_FED" + RESV_DEL_HOLD = "RESV_DEL_HOLD" + SIGNALING = "SIGNALING" + STAGE_OUT = "STAGE_OUT" + + +class CPU1(BaseModel): + actual_frequency: Optional[int] = None + + +class Step1(BaseModel): + id: Optional[str] = None + """ + Slurm Job StepId + """ + name: Optional[str] = None + + +class Task(BaseModel): + distribution: Optional[str] = None + + +class Tasks(BaseModel): + count: Optional[int] = None + + +class StringArray(BaseModel): + __root__: List[str] + + +class StringList(BaseModel): + __root__: List[str] + + +class Tres(BaseModel): + count: Optional[int] = None + id: Optional[int] = None + name: Optional[str] = None + type: str + + +class TresList(BaseModel): + __root__: List[Tres] + + +class Uint16NoVal(BaseModel): + """ + Integer number with flags + """ + + infinite: Optional[bool] = False + """ + True if number has been set to infinite. "set" and "number" will be ignored. + """ + number: Optional[int] = None + """ + If set is True the number will be set with value. Otherwise ignore number contents. + """ + set: Optional[bool] = False + """ + True if number has been set. False if number is unset + """ + + +class Uint32NoVal(BaseModel): + """ + Integer number with flags + """ + + infinite: Optional[bool] = False + """ + True if number has been set to infinite. "set" and "number" will be ignored. + """ + number: Optional[int] = None + """ + If set is True the number will be set with value. Otherwise ignore number contents. + """ + set: Optional[bool] = False + """ + True if number has been set. False if number is unset + """ + + +class Uint64NoVal(BaseModel): + """ + Integer number with flags + """ + + infinite: Optional[bool] = False + """ + True if number has been set to infinite. "set" and "number" will be ignored. + """ + number: Optional[int] = None + """ + If set is True the number will be set with value. Otherwise ignore number contents. + """ + set: Optional[bool] = False + """ + True if number has been set. False if number is unset + """ + + +class StateEnum3(Enum): + INVALID = "INVALID" + UNKNOWN = "UNKNOWN" + DOWN = "DOWN" + IDLE = "IDLE" + ALLOCATED = "ALLOCATED" + ERROR = "ERROR" + MIXED = "MIXED" + FUTURE = "FUTURE" + PERFCTRS = "PERFCTRS" + RESERVED = "RESERVED" + UNDRAIN = "UNDRAIN" + CLOUD = "CLOUD" + RESUME = "RESUME" + DRAIN = "DRAIN" + COMPLETING = "COMPLETING" + NOT_RESPONDING = "NOT_RESPONDING" + POWERED_DOWN = "POWERED_DOWN" + FAIL = "FAIL" + POWERING_UP = "POWERING_UP" + MAINTENANCE = "MAINTENANCE" + REBOOT_REQUESTED = "REBOOT_REQUESTED" + REBOOT_CANCELED = "REBOOT_CANCELED" + POWERING_DOWN = "POWERING_DOWN" + DYNAMIC_FUTURE = "DYNAMIC_FUTURE" + REBOOT_ISSUED = "REBOOT_ISSUED" + PLANNED = "PLANNED" + INVALID_REG = "INVALID_REG" + POWER_DOWN = "POWER_DOWN" + POWER_UP = "POWER_UP" + POWER_DRAIN = "POWER_DRAIN" + DYNAMIC_NORM = "DYNAMIC_NORM" + + +class UpdateNodeMsg(BaseModel): + address: Optional[HostListString] = None + """ + communication name + """ + comment: Optional[str] = None + """ + arbitrary comment + """ + cpu_bind: Optional[int] = None + """ + default CPU binding type + """ + extra: Optional[str] = None + """ + arbitrary string + """ + features: Optional[CsvString] = None + """ + new available feature for node + """ + features_act: Optional[CsvString] = None + """ + new active feature for node + """ + gres: Optional[str] = None + """ + new generic resources for node + """ + hostname: Optional[HostListString] = None + """ + node's hostname + """ + name: Optional[HostListString] = None + """ + node to update + """ + reason: Optional[str] = None + """ + reason for node being DOWN or DRAINING + """ + reason_uid: Optional[str] = None + """ + user ID of sending (needed if user root is sending message) + """ + resume_after: Optional[Uint32NoVal] = None + """ + automatically resume DOWN or DRAINED node after this amount of seconds + """ + state: Optional[List[StateEnum3]] = None + """ + assign new node state + """ + weight: Optional[Uint32NoVal] = None + """ + new weight for node + """ + + +class AdministratorLevelEnum(Enum): + Not_Set = "Not Set" + None_ = "None" + Operator = "Operator" + Administrator = "Administrator" + + +class Default1(BaseModel): + account: Optional[str] = None + wckey: Optional[str] = None + + +class Flag11(Enum): + NONE = "NONE" + DELETED = "DELETED" + + +class AdminlevelEnum(Enum): + Not_Set = "Not Set" + None_ = "None" + Operator = "Operator" + Administrator = "Administrator" + + +class UserShort(BaseModel): + adminlevel: Optional[List[AdminlevelEnum]] = None + """ + Admin level of user. Valid levels are None, Operator, and Admin. + """ + defaultaccount: Optional[str] = None + """ + Identify the default bank account name to be used for a job if none is specified at submission time. + """ + defaultwckey: Optional[str] = None + """ + Identify the default Workload Characterization Key. + """ + + +class Flag12(Enum): + DELETED = "DELETED" + + +class Flag13(Enum): + ASSIGNED_DEFAULT = "ASSIGNED_DEFAULT" + + +class WckeyTagStruct(BaseModel): + flags: List[Flag13] + """ + Active flags + """ + wckey: str + """ + WCKey name + """ + + +class Account(BaseModel): + associations: Optional[AssocShortList] = None + coordinators: Optional[CoordList] = None + description: str + flags: Optional[List[Flag]] = None + name: str + organization: str + + +class AccountList(BaseModel): + __root__: List[Account] + + +class Accounting(BaseModel): + TRES: Optional[Tres] = None + allocated: Optional[Allocated] = None + id: Optional[int] = None + start: Optional[int] = None + + +class AccountingList(BaseModel): + __root__: List[Accounting] + + +class AcctGatherEnergy(BaseModel): + average_watts: Optional[int] = None + base_consumed_energy: Optional[int] = None + consumed_energy: Optional[int] = None + current_watts: Optional[Uint32NoVal] = None + last_collected: Optional[int] = None + previous_consumed_energy: Optional[int] = None + + +class Per(BaseModel): + accruing: Optional[Uint32NoVal] = None + count: Optional[Uint32NoVal] = None + submitted: Optional[Uint32NoVal] = None + wall_clock: Optional[Uint32NoVal] = None + + +class Jobs(BaseModel): + accruing: Optional[Uint32NoVal] = None + active: Optional[Uint32NoVal] = None + per: Optional[Per] = None + total: Optional[Uint32NoVal] = None + + +class Account1(BaseModel): + wall_clock: Optional[Uint32NoVal] = None + + +class Per1(BaseModel): + account: Optional[Account1] = None + + +class Group(BaseModel): + active: Optional[TresList] = None + minutes: Optional[TresList] = None + + +class Per2(BaseModel): + job: Optional[TresList] = None + + +class Minutes(BaseModel): + per: Optional[Per2] = None + total: Optional[TresList] = None + + +class Per3(BaseModel): + job: Optional[TresList] = None + node: Optional[TresList] = None + + +class Tres1(BaseModel): + group: Optional[Group] = None + minutes: Optional[Minutes] = None + per: Optional[Per3] = None + total: Optional[TresList] = None + + +class Max(BaseModel): + jobs: Optional[Jobs] = None + per: Optional[Per1] = None + tres: Optional[Tres1] = None + + +class Min(BaseModel): + priority_threshold: Optional[Uint32NoVal] = None + + +class Assoc(BaseModel): + account: Optional[str] = None + accounting: Optional[AccountingList] = None + """ + Usage accounting + """ + cluster: Optional[str] = None + comment: Optional[str] = None + """ + comment for the association + """ + default: Optional[Default] = None + flags: Optional[List[Flag]] = None + id: Optional[AssocShort] = None + """ + Association ID + """ + is_default: Optional[bool] = None + lineage: Optional[str] = None + """ + Complete path up the hierarchy to the root association + """ + max: Optional[Max] = None + min: Optional[Min] = None + parent_account: Optional[str] = None + partition: Optional[str] = None + priority: Optional[Uint32NoVal] = None + qos: Optional[QosStringIdList] = None + """ + List of QOS names + """ + shares_raw: Optional[int] = None + user: str + + +class AssocList(BaseModel): + __root__: List[Assoc] + + +class AssocRecSet(BaseModel): + comment: Optional[str] = None + """ + Comment for the association + """ + defaultqos: Optional[str] = None + """ + Which QOS id is this association default + """ + fairshare: Optional[int] = None + """ + Number of shares allocated to this association + """ + grpjobs: Optional[Uint32NoVal] = None + """ + Max number of jobs the underlying group of associations can run at one time + """ + grpjobsaccrue: Optional[Uint32NoVal] = None + """ + Max number of jobs the underlying group of associations can have accruing priority at one time + """ + grpsubmitjobs: Optional[Uint32NoVal] = None + """ + Max number of jobs the underlying group of associations can submit at one time + """ + grptres: Optional[TresList] = None + grptresmins: Optional[TresList] = None + """ + Max number of cpu minutes the underlying group of associations can run for + """ + grptresrunmins: Optional[TresList] = None + """ + Max number of cpu minutes the underlying group of associations can having running at one time + """ + grpwall: Optional[Uint32NoVal] = None + """ + Total time in minutes the underlying group of associations can run for + """ + maxjobs: Optional[Uint32NoVal] = None + """ + Max number of jobs this association can run at one time + """ + maxjobsaccrue: Optional[Uint32NoVal] = None + """ + Max number of jobs this association can have accruing priority time + """ + maxsubmitjobs: Optional[Uint32NoVal] = None + """ + Max number of jobs that can be submitted by association + """ + maxtresminsperjob: Optional[TresList] = None + """ + Max number of cpu minutes this association can have per job + """ + maxtresperjob: Optional[TresList] = None + """ + Max number of cpus this association can allocate per job + """ + maxtrespernode: Optional[TresList] = None + """ + Max number of TRES this association can allocate per node + """ + maxtresrunmins: Optional[TresList] = None + """ + Max number of cpu minutes this association can having running at one time + """ + maxwalldurationperjob: Optional[Uint32NoVal] = None + """ + Longest time this association can run a job + """ + minpriothresh: Optional[Uint32NoVal] = None + """ + Don't reserve resources for pending jobs unless they have a priority equal to or higher than this + """ + parent: Optional[str] = None + """ + Name of parent account + """ + priority: Optional[Uint32NoVal] = None + """ + Association priority + """ + qoslevel: Optional[QosStringIdList] = None + """ + List of QOS names + """ + + +class ClusterRec(BaseModel): + associations: Optional[Associations] = None + controller: Optional[Controller] = None + flags: Optional[List[Flag2]] = None + name: Optional[str] = None + nodes: Optional[str] = None + rpc_version: Optional[int] = None + select_plugin: Optional[str] = None + tres: Optional[TresList] = None + + +class ClusterRecList(BaseModel): + __root__: List[ClusterRec] + + +class ExtSensorsData(BaseModel): + consumed_energy: Optional[Uint64NoVal] = None + current_watts: Optional[int] = None + energy_update_time: Optional[int] = None + temperature: Optional[Uint32NoVal] = None + + +class Array(BaseModel): + job_id: Optional[int] = None + limits: Optional[Limits] = None + task: Optional[str] = None + task_id: Optional[Uint32NoVal] = None + + +class Het(BaseModel): + job_id: Optional[int] = None + job_offset: Optional[Uint32NoVal] = None + + +class Required(BaseModel): + CPUs: Optional[int] = None + memory_per_cpu: Optional[Uint64NoVal] = None + memory_per_node: Optional[Uint64NoVal] = None + + +class Time1(BaseModel): + elapsed: Optional[int] = None + eligible: Optional[int] = None + end: Optional[int] = None + limit: Optional[Uint32NoVal] = None + start: Optional[int] = None + submission: Optional[int] = None + suspended: Optional[int] = None + system: Optional[System] = None + total: Optional[Total] = None + user: Optional[User] = None + + +class Tres3(BaseModel): + allocated: Optional[TresList] = None + requested: Optional[TresList] = None + + +class JobArrayResponseArray(BaseModel): + __root__: List[JobArrayResponseMsgEntry] + + +class Rlimits(BaseModel): + as_: Optional[Uint64NoVal] = Field(None, alias="as") + """ + Address space limit. + """ + core: Optional[Uint64NoVal] = None + """ + Largest core file that can be created, in bytes. + """ + cpu: Optional[Uint64NoVal] = None + """ + Per-process CPU limit, in seconds. + """ + data: Optional[Uint64NoVal] = None + """ + Maximum size of data segment, in bytes. + """ + fsize: Optional[Uint64NoVal] = None + """ + Largest file that can be created, in bytes. + """ + memlock: Optional[Uint64NoVal] = None + """ + Locked-in-memory address space + """ + nofile: Optional[Uint64NoVal] = None + """ + Number of open files. + """ + nproc: Optional[Uint64NoVal] = None + """ + Number of processes. + """ + rss: Optional[Uint64NoVal] = None + """ + Largest resident set size, in bytes. This affects swapping; processes that are exceeding their resident set size will be more likely to have physical memory taken from them. + """ + stack: Optional[Uint64NoVal] = None + """ + Maximum size of stack segment, in bytes. + """ + + +class JobDescMsg(BaseModel): + account: Optional[str] = None + account_gather_frequency: Optional[str] = None + admin_comment: Optional[str] = None + allocation_node_List: Optional[str] = None + allocation_node_port: Optional[int] = None + argv: Optional[StringArray] = None + array: Optional[str] = None + batch_features: Optional[str] = None + begin_time: Optional[Uint64NoVal] = None + burst_buffer: Optional[str] = None + cluster_constraint: Optional[str] = None + clusters: Optional[str] = None + comment: Optional[str] = None + constraints: Optional[str] = None + container: Optional[str] = None + container_id: Optional[str] = None + contiguous: Optional[bool] = None + core_specification: Optional[int] = None + cpu_binding: Optional[str] = None + cpu_binding_flags: Optional[List[CpuBindingFlag]] = None + cpu_frequency: Optional[str] = None + cpus_per_task: Optional[int] = None + cpus_per_tres: Optional[str] = None + crontab: Optional[CronEntry] = None + current_working_directory: Optional[str] = None + deadline: Optional[int] = None + delay_boot: Optional[int] = None + dependency: Optional[str] = None + distribution: Optional[str] = None + distribution_plane_size: Optional[int] = None + end_time: Optional[int] = None + environment: Optional[StringArray] = None + excluded_nodes: Optional[CsvString] = None + exclusive: Optional[List[ExclusiveEnum]] = None + extra: Optional[str] = None + flags: Optional[List[Flag5]] = None + group_id: Optional[str] = None + hetjob_group: Optional[int] = None + immediate: Optional[bool] = None + job_id: Optional[int] = None + kill_on_node_fail: Optional[bool] = None + kill_warning_delay: Optional[Uint16NoVal] = None + kill_warning_flags: Optional[List[KillWarningFlag]] = None + kill_warning_signal: Optional[str] = None + licenses: Optional[str] = None + mail_type: Optional[List[MailTypeEnum]] = None + mail_user: Optional[str] = None + maximum_cpus: Optional[int] = None + maximum_nodes: Optional[int] = None + mcs_label: Optional[str] = None + memory_binding: Optional[str] = None + memory_binding_type: Optional[List[MemoryBindingTypeEnum]] = None + memory_per_cpu: Optional[Uint64NoVal] = None + memory_per_node: Optional[Uint64NoVal] = None + memory_per_tres: Optional[str] = None + minimum_boards_per_node: Optional[int] = None + minimum_cpus: Optional[int] = None + minimum_cpus_per_node: Optional[int] = None + minimum_nodes: Optional[int] = None + minimum_sockets_per_board: Optional[int] = None + name: Optional[str] = None + network: Optional[str] = None + nice: Optional[int] = None + nodes: Optional[str] = None + ntasks_per_tres: Optional[int] = None + open_mode: Optional[List[OpenModeEnum]] = None + overcommit: Optional[bool] = None + oversubscribe: Optional[bool] = None + partition: Optional[str] = None + power_flags: Optional[List[PowerFlag]] = None + prefer: Optional[str] = None + priority: Optional[Uint32NoVal] = None + profile: Optional[List[ProfileEnum]] = None + qos: Optional[str] = None + reboot: Optional[bool] = None + requeue: Optional[bool] = None + required_nodes: Optional[CsvString] = None + required_switches: Optional[Uint32NoVal] = None + reservation: Optional[str] = None + reserve_ports: Optional[int] = None + rlimits: Optional[Rlimits] = None + script: Optional[str] = None + selinux_context: Optional[str] = None + shared: Optional[List[SharedEnum]] = None + site_factor: Optional[int] = None + sockets_per_node: Optional[int] = None + spank_environment: Optional[StringArray] = None + standard_error: Optional[str] = None + standard_input: Optional[str] = None + standard_output: Optional[str] = None + tasks: Optional[int] = None + tasks_per_board: Optional[int] = None + tasks_per_core: Optional[int] = None + tasks_per_node: Optional[int] = None + tasks_per_socket: Optional[int] = None + temporary_disk_per_node: Optional[int] = None + thread_specification: Optional[int] = None + threads_per_core: Optional[int] = None + time_limit: Optional[Uint32NoVal] = None + time_minimum: Optional[Uint32NoVal] = None + tres_bind: Optional[str] = None + tres_freq: Optional[str] = None + tres_per_job: Optional[str] = None + tres_per_node: Optional[str] = None + tres_per_socket: Optional[str] = None + tres_per_task: Optional[str] = None + user_id: Optional[str] = None + wait_all_nodes: Optional[bool] = None + wait_for_switch: Optional[int] = None + wckey: Optional[str] = None + x11: Optional[List[X11Enum]] = None + x11_magic_cookie: Optional[str] = None + x11_target_host: Optional[str] = None + x11_target_port: Optional[int] = None + + +class JobDescMsgList(BaseModel): + __root__: List[JobDescMsg] + + +class JobRes(BaseModel): + allocated_cores: Optional[int] = None + allocated_cpus: Optional[int] = None + allocated_hosts: Optional[int] = None + allocated_nodes: Optional[JobResNodes] = None + nodes: Optional[str] = None + + +class JobSubmitReq(BaseModel): + job: Optional[JobDescMsg] = None + """ + Job description + """ + jobs: Optional[JobDescMsgList] = None + """ + HetJob description + """ + script: Optional[str] = None + """ + batch job script + """ + + +class OpenapiMeta(BaseModel): + client: Optional[Client] = None + command: Optional[StringArray] = None + """ + CLI command (if applicable) + """ + plugin: Optional[Plugin] = None + slurm: Optional[Slurm] = None + + +class OpenapiPingArrayResp(BaseModel): + errors: Optional[OpenapiErrors] = None + """ + Query errors + """ + meta: Optional[OpenapiMeta] = None + """ + Slurm meta values + """ + pings: ControllerPingArray + """ + pings + """ + warnings: Optional[OpenapiWarnings] = None + """ + Query warnings + """ + + +class OpenapiResp(BaseModel): + errors: Optional[OpenapiErrors] = None + """ + Query errors + """ + meta: Optional[OpenapiMeta] = None + """ + Slurm meta values + """ + warnings: Optional[OpenapiWarnings] = None + """ + Query warnings + """ + + +class OpenapiSlurmdbdQosRemovedResp(BaseModel): + errors: Optional[OpenapiErrors] = None + """ + Query errors + """ + meta: Optional[OpenapiMeta] = None + """ + Slurm meta values + """ + removed_qos: StringList + """ + removed QOS + """ + warnings: Optional[OpenapiWarnings] = None + """ + Query warnings + """ + + +class OpenapiTresResp(BaseModel): + TRES: TresList + """ + TRES + """ + errors: Optional[OpenapiErrors] = None + """ + Query errors + """ + meta: Optional[OpenapiMeta] = None + """ + Slurm meta values + """ + warnings: Optional[OpenapiWarnings] = None + """ + Query warnings + """ + + +class OpenapiUsersAddCondRespStr(BaseModel): + added_users: str + """ + added_users + """ + errors: Optional[OpenapiErrors] = None + """ + Query errors + """ + meta: Optional[OpenapiMeta] = None + """ + Slurm meta values + """ + warnings: Optional[OpenapiWarnings] = None + """ + Query warnings + """ + + +class OpenapiWckeyRemovedResp(BaseModel): + deleted_wckeys: StringList + """ + deleted wckeys + """ + errors: Optional[OpenapiErrors] = None + """ + Query errors + """ + meta: Optional[OpenapiMeta] = None + """ + Slurm meta values + """ + warnings: Optional[OpenapiWarnings] = None + """ + Query warnings + """ + + +class Defaults(BaseModel): + job: Optional[str] = None + memory_per_cpu: Optional[int] = None + partition_memory_per_cpu: Optional[Uint64NoVal] = None + partition_memory_per_node: Optional[Uint64NoVal] = None + time: Optional[Uint32NoVal] = None + + +class Maximums(BaseModel): + cpus_per_node: Optional[Uint32NoVal] = None + cpus_per_socket: Optional[Uint32NoVal] = None + memory_per_cpu: Optional[int] = None + nodes: Optional[Uint32NoVal] = None + over_time_limit: Optional[Uint16NoVal] = None + oversubscribe: Optional[Oversubscribe] = None + partition_memory_per_cpu: Optional[Uint64NoVal] = None + partition_memory_per_node: Optional[Uint64NoVal] = None + shares: Optional[int] = None + time: Optional[Uint32NoVal] = None + + +class Timeouts(BaseModel): + resume: Optional[Uint16NoVal] = None + suspend: Optional[Uint16NoVal] = None + + +class PartitionInfo(BaseModel): + accounts: Optional[Accounts] = None + alternate: Optional[str] = None + cluster: Optional[str] = None + cpus: Optional[Cpus] = None + defaults: Optional[Defaults] = None + grace_time: Optional[int] = None + groups: Optional[Groups] = None + maximums: Optional[Maximums] = None + minimums: Optional[Minimums] = None + name: Optional[str] = None + node_sets: Optional[str] = None + nodes: Optional[Nodes1] = None + partition: Optional[Partition] = None + priority: Optional[Priority] = None + qos: Optional[Qos] = None + suspend_time: Optional[Uint32NoVal] = None + timeouts: Optional[Timeouts] = None + tres: Optional[Tres4] = None + + +class PartitionInfoMsg(BaseModel): + __root__: List[PartitionInfo] + + +class PowerMgmtData(BaseModel): + current_watts: Optional[int] = None + lowest_watts: Optional[int] = None + maximum_watts: Optional[Uint32NoVal] = None + new_job_time: Optional[Uint64NoVal] = None + new_maximum_watts: Optional[int] = None + peak_watts: Optional[int] = None + state: Optional[int] = None + time_start_day: Optional[int] = None + total_energy: Optional[int] = None + + +class Signal(BaseModel): + id: Optional[Uint16NoVal] = None + """ + Signal sent to process (numeric) + """ + name: Optional[str] = None + """ + Signal sent to process + """ + + +class ProcessExitCodeVerbose(BaseModel): + return_code: Optional[Uint32NoVal] = None + """ + Process return code (numeric) + """ + signal: Optional[Signal] = None + status: Optional[List[StatusEnum]] = None + """ + Status given by return code + """ + + +class Per4(BaseModel): + account: Optional[Uint32NoVal] = None + user: Optional[Uint32NoVal] = None + + +class Accruing(BaseModel): + per: Optional[Per4] = None + + +class ActiveJobs(BaseModel): + accruing: Optional[Uint32NoVal] = None + count: Optional[Uint32NoVal] = None + + +class ActiveJobs1(BaseModel): + per: Optional[Per4] = None + + +class Jobs1(BaseModel): + active_jobs: Optional[ActiveJobs1] = None + per: Optional[Per4] = None + + +class Per7(BaseModel): + account: Optional[TresList] = None + job: Optional[TresList] = None + qos: Optional[TresList] = None + user: Optional[TresList] = None + + +class Minutes1(BaseModel): + per: Optional[Per7] = None + + +class Per8(BaseModel): + account: Optional[TresList] = None + job: Optional[TresList] = None + node: Optional[TresList] = None + user: Optional[TresList] = None + + +class Tres5(BaseModel): + minutes: Optional[Minutes1] = None + per: Optional[Per8] = None + total: Optional[TresList] = None + + +class Per9(BaseModel): + job: Optional[Uint32NoVal] = None + qos: Optional[Uint32NoVal] = None + + +class WallClock(BaseModel): + per: Optional[Per9] = None + + +class Max2(BaseModel): + accruing: Optional[Accruing] = None + active_jobs: Optional[ActiveJobs] = None + jobs: Optional[Jobs1] = None + tres: Optional[Tres5] = None + wall_clock: Optional[WallClock] = None + + +class Per10(BaseModel): + job: Optional[TresList] = None + + +class Tres6(BaseModel): + per: Optional[Per10] = None + + +class Min1(BaseModel): + priority_threshold: Optional[Uint32NoVal] = None + tres: Optional[Tres6] = None + + +class Limits1(BaseModel): + factor: Optional[Float64NoVal] = None + grace_time: Optional[int] = None + max: Optional[Max2] = None + min: Optional[Min1] = None + + +class Preempt(BaseModel): + exempt_time: Optional[Uint32NoVal] = None + List: Optional[QosPreemptList] = None + mode: Optional[List[ModeEnum]] = None + + +class Qos1(BaseModel): + description: Optional[str] = None + flags: Optional[List[Flag9]] = None + id: Optional[int] = None + limits: Optional[Limits1] = None + name: Optional[str] = None + preempt: Optional[Preempt] = None + priority: Optional[Uint32NoVal] = None + usage_factor: Optional[Float64NoVal] = None + usage_threshold: Optional[Float64NoVal] = None + + +class QosList(BaseModel): + __root__: List[Qos1] + + +class PurgeCompleted(BaseModel): + time: Optional[Uint32NoVal] = None + + +class ReservationInfo(BaseModel): + accounts: Optional[str] = None + burst_buffer: Optional[str] = None + core_count: Optional[int] = None + core_specializations: Optional[ReservationInfoCoreSpec] = None + end_time: Optional[Uint64NoVal] = None + features: Optional[str] = None + flags: Optional[List[Flag10]] = None + groups: Optional[str] = None + licenses: Optional[str] = None + max_start_delay: Optional[int] = None + name: Optional[str] = None + node_count: Optional[int] = None + node_List: Optional[str] = None + partition: Optional[str] = None + purge_completed: Optional[PurgeCompleted] = None + start_time: Optional[Uint64NoVal] = None + tres: Optional[str] = None + users: Optional[str] = None + watts: Optional[Uint32NoVal] = None + + +class ReservationInfoMsg(BaseModel): + __root__: List[ReservationInfo] + + +class SharesUint64Tres(BaseModel): + name: Optional[str] = None + """ + TRES name + """ + value: Optional[Uint64NoVal] = None + """ + TRES value + """ + + +class SharesUint64TresList(BaseModel): + __root__: List[SharesUint64Tres] + + +class StatsMsg(BaseModel): + agent_count: Optional[int] = None + agent_queue_size: Optional[int] = None + agent_thread_count: Optional[int] = None + bf_active: Optional[bool] = None + bf_backfilled_het_jobs: Optional[int] = None + bf_backfilled_jobs: Optional[int] = None + bf_cycle_counter: Optional[int] = None + bf_cycle_last: Optional[int] = None + bf_cycle_mean: Optional[int] = None + bf_cycle_sum: Optional[int] = None + bf_depth_mean: Optional[int] = None + bf_depth_mean_try: Optional[int] = None + bf_depth_sum: Optional[int] = None + bf_depth_try_sum: Optional[int] = None + bf_exit: Optional[BfExitFields] = None + bf_last_backfilled_jobs: Optional[int] = None + bf_last_depth: Optional[int] = None + bf_last_depth_try: Optional[int] = None + bf_queue_len: Optional[int] = None + bf_queue_len_mean: Optional[int] = None + bf_queue_len_sum: Optional[int] = None + bf_table_size: Optional[int] = None + bf_table_size_mean: Optional[int] = None + bf_when_last_cycle: Optional[Uint64NoVal] = None + dbd_agent_queue_size: Optional[int] = None + gettimeofday_latency: Optional[int] = None + job_states_ts: Optional[Uint64NoVal] = None + jobs_canceled: Optional[int] = None + jobs_completed: Optional[int] = None + jobs_failed: Optional[int] = None + jobs_pending: Optional[int] = None + jobs_running: Optional[int] = None + jobs_started: Optional[int] = None + jobs_submitted: Optional[int] = None + parts_packed: Optional[int] = None + req_time: Optional[Uint64NoVal] = None + req_time_start: Optional[Uint64NoVal] = None + rpcs_by_message_type: Optional[StatsMsgRpcsByType] = None + rpcs_by_user: Optional[StatsMsgRpcsByUser] = None + schedule_cycle_last: Optional[int] = None + schedule_cycle_max: Optional[int] = None + schedule_cycle_mean: Optional[int] = None + schedule_cycle_mean_depth: Optional[int] = None + schedule_cycle_per_minute: Optional[int] = None + schedule_cycle_total: Optional[int] = None + schedule_exit: Optional[ScheduleExitFields] = None + schedule_queue_length: Optional[int] = None + server_thread_count: Optional[int] = None + + +class StatsRec(BaseModel): + RPCs: Optional[StatsRpcList] = None + rollups: Optional[RollupStats] = None + time_start: Optional[int] = None + users: Optional[StatsUserList] = None + + +class RequestedFrequency(BaseModel): + max: Optional[Uint32NoVal] = None + min: Optional[Uint32NoVal] = None + + +class CPU(BaseModel): + governor: Optional[str] = None + requested_frequency: Optional[RequestedFrequency] = None + + +class Energy(BaseModel): + consumed: Optional[Uint64NoVal] = None + + +class Statistics(BaseModel): + CPU: Optional[CPU1] = None + energy: Optional[Energy] = None + + +class Time4(BaseModel): + elapsed: Optional[int] = None + end: Optional[Uint64NoVal] = None + start: Optional[Uint64NoVal] = None + suspended: Optional[int] = None + system: Optional[System] = None + total: Optional[Total] = None + user: Optional[User] = None + + +class StepTresReqMax(BaseModel): + __root__: List[Tres] + + +class StepTresReqMin(BaseModel): + __root__: List[Tres] + + +class StepTresUsageMax(BaseModel): + __root__: List[Tres] + + +class StepTresUsageMin(BaseModel): + __root__: List[Tres] + + +class UsersAddCond(BaseModel): + accounts: Optional[StringList] = None + """ + CSV accounts List + """ + association: Optional[AssocRecSet] = None + """ + Association limits and options + """ + clusters: Optional[StringList] = None + """ + CSV clusters List + """ + partitions: Optional[StringList] = None + """ + CSV partitions List + """ + users: StringList + """ + CSV users List + """ + wckeys: Optional[StringList] = None + """ + CSV WCKeys List + """ + + +class Wckey(BaseModel): + accounting: Optional[AccountingList] = None + cluster: str + flags: Optional[List[Flag12]] = None + id: Optional[int] = None + name: str + user: str + + +class WckeyList(BaseModel): + __root__: List[Wckey] + + +class AccountsAddCond(BaseModel): + accounts: StringList + """ + CSV accounts List + """ + association: Optional[AssocRecSet] = None + """ + Association limits and options + """ + clusters: Optional[StringList] = None + """ + CSV clusters List + """ + + +class Tres2(BaseModel): + group_minutes: Optional[SharesUint64TresList] = None + """ + tres-minute limit + """ + run_seconds: Optional[SharesUint64TresList] = None + """ + currently running tres-secs = grp_used_tres_run_secs + """ + usage: Optional[SharesFloat128TresList] = None + """ + measure of each tres usage + """ + + +class AssocSharesObjWrap(BaseModel): + cluster: Optional[str] = None + """ + cluster name + """ + effective_usage: Optional[float] = None + """ + effective, normalized usage + """ + fairshare: Optional[Fairshare] = None + id: Optional[int] = None + """ + assocation id + """ + name: Optional[str] = None + """ + share name + """ + parent: Optional[str] = None + """ + parent name + """ + partition: Optional[str] = None + """ + partition name + """ + shares: Optional[Uint32NoVal] = None + """ + number of shares allocated + """ + shares_normalized: Optional[Float64NoVal] = None + """ + normalized shares + """ + tres: Optional[Tres2] = None + type: Optional[List[TypeEnum]] = None + """ + user or account association + """ + usage: Optional[int] = None + """ + measure of tresbillableunits usage + """ + usage_normalized: Optional[Float64NoVal] = None + """ + normalized usage + """ + + +class JobInfo(BaseModel): + account: Optional[str] = None + accrue_time: Optional[Uint64NoVal] = None + admin_comment: Optional[str] = None + allocating_node: Optional[str] = None + array_job_id: Optional[Uint32NoVal] = None + array_max_tasks: Optional[Uint32NoVal] = None + array_task_id: Optional[Uint32NoVal] = None + array_task_string: Optional[str] = None + association_id: Optional[int] = None + batch_features: Optional[str] = None + batch_flag: Optional[bool] = None + batch_host: Optional[str] = None + billable_tres: Optional[Float64NoVal] = None + burst_buffer: Optional[str] = None + burst_buffer_state: Optional[str] = None + cluster: Optional[str] = None + cluster_features: Optional[str] = None + command: Optional[str] = None + comment: Optional[str] = None + container: Optional[str] = None + container_id: Optional[str] = None + contiguous: Optional[bool] = None + core_spec: Optional[int] = None + cores_per_socket: Optional[Uint16NoVal] = None + cpu_frequency_governor: Optional[Uint32NoVal] = None + cpu_frequency_maximum: Optional[Uint32NoVal] = None + cpu_frequency_minimum: Optional[Uint32NoVal] = None + cpus: Optional[Uint32NoVal] = None + cpus_per_task: Optional[Uint16NoVal] = None + cpus_per_tres: Optional[str] = None + cron: Optional[str] = None + current_working_directory: Optional[str] = None + deadline: Optional[Uint64NoVal] = None + delay_boot: Optional[Uint32NoVal] = None + dependency: Optional[str] = None + derived_exit_code: Optional[ProcessExitCodeVerbose] = None + """ + return code returned by process + """ + eligible_time: Optional[Uint64NoVal] = None + end_time: Optional[Uint64NoVal] = None + excluded_nodes: Optional[str] = None + exclusive: Optional[List[ExclusiveEnum]] = None + exit_code: Optional[ProcessExitCodeVerbose] = None + """ + return code returned by process + """ + extra: Optional[str] = None + failed_node: Optional[str] = None + features: Optional[str] = None + federation_origin: Optional[str] = None + federation_siblings_active: Optional[str] = None + federation_siblings_viable: Optional[str] = None + flags: Optional[List[Flag5]] = None + gres_detail: Optional[JobInfoGresDetail] = None + group_id: Optional[int] = None + group_name: Optional[str] = None + het_job_id: Optional[Uint32NoVal] = None + het_job_id_set: Optional[str] = None + het_job_offset: Optional[Uint32NoVal] = None + job_id: Optional[int] = None + job_resources: Optional[JobRes] = None + job_size_str: Optional[CsvString] = None + job_state: Optional[List[JobStateEnum]] = None + last_sched_evaluation: Optional[Uint64NoVal] = None + licenses: Optional[str] = None + mail_type: Optional[List[MailTypeEnum]] = None + mail_user: Optional[str] = None + max_cpus: Optional[Uint32NoVal] = None + max_nodes: Optional[Uint32NoVal] = None + maximum_switch_wait_time: Optional[int] = None + mcs_label: Optional[str] = None + memory_per_cpu: Optional[Uint64NoVal] = None + memory_per_node: Optional[Uint64NoVal] = None + memory_per_tres: Optional[str] = None + minimum_cpus_per_node: Optional[Uint16NoVal] = None + minimum_switches: Optional[int] = None + minimum_tmp_disk_per_node: Optional[Uint32NoVal] = None + name: Optional[str] = None + network: Optional[str] = None + nice: Optional[int] = None + node_count: Optional[Uint32NoVal] = None + nodes: Optional[str] = None + oversubscribe: Optional[bool] = None + partition: Optional[str] = None + power: Optional[Power] = None + pre_sus_time: Optional[Uint64NoVal] = None + preempt_time: Optional[Uint64NoVal] = None + preemptable_time: Optional[Uint64NoVal] = None + prefer: Optional[str] = None + priority: Optional[Uint32NoVal] = None + profile: Optional[List[ProfileEnum]] = None + qos: Optional[str] = None + reboot: Optional[bool] = None + requeue: Optional[bool] = None + required_nodes: Optional[str] = None + resize_time: Optional[Uint64NoVal] = None + restart_cnt: Optional[int] = None + resv_name: Optional[str] = None + scheduled_nodes: Optional[str] = None + selinux_context: Optional[str] = None + shared: Optional[List[SharedEnum]] = None + show_flags: Optional[List[ShowFlag]] = None + sockets_per_board: Optional[int] = None + sockets_per_node: Optional[Uint16NoVal] = None + standard_error: Optional[str] = None + standard_input: Optional[str] = None + standard_output: Optional[str] = None + start_time: Optional[Uint64NoVal] = None + state_description: Optional[str] = None + state_reason: Optional[str] = None + submit_time: Optional[Uint64NoVal] = None + suspend_time: Optional[Uint64NoVal] = None + system_comment: Optional[str] = None + tasks: Optional[Uint32NoVal] = None + tasks_per_board: Optional[Uint16NoVal] = None + tasks_per_core: Optional[Uint16NoVal] = None + tasks_per_node: Optional[Uint16NoVal] = None + tasks_per_socket: Optional[Uint16NoVal] = None + tasks_per_tres: Optional[Uint16NoVal] = None + thread_spec: Optional[int] = None + threads_per_core: Optional[Uint16NoVal] = None + time_limit: Optional[Uint32NoVal] = None + time_minimum: Optional[Uint32NoVal] = None + tres_alloc_str: Optional[str] = None + tres_bind: Optional[str] = None + tres_freq: Optional[str] = None + tres_per_job: Optional[str] = None + tres_per_node: Optional[str] = None + tres_per_socket: Optional[str] = None + tres_per_task: Optional[str] = None + tres_req_str: Optional[str] = None + user_id: Optional[int] = None + user_name: Optional[str] = None + wckey: Optional[str] = None + + +class JobInfoMsg(BaseModel): + __root__: List[JobInfo] + + +class Node(BaseModel): + active_features: Optional[CsvString] = None + address: Optional[str] = None + alloc_cpus: Optional[int] = None + alloc_idle_cpus: Optional[int] = None + alloc_memory: Optional[int] = None + architecture: Optional[str] = None + boards: Optional[int] = None + boot_time: Optional[Uint64NoVal] = None + burstbuffer_network_address: Optional[str] = None + cluster_name: Optional[str] = None + comment: Optional[str] = None + cores: Optional[int] = None + cpu_binding: Optional[int] = None + cpu_load: Optional[int] = None + cpus: Optional[int] = None + effective_cpus: Optional[int] = None + energy: Optional[AcctGatherEnergy] = None + external_sensors: Optional[ExtSensorsData] = None + extra: Optional[str] = None + features: Optional[CsvString] = None + free_mem: Optional[Uint64NoVal] = None + gres: Optional[str] = None + gres_drained: Optional[str] = None + gres_used: Optional[str] = None + hostname: Optional[str] = None + instance_id: Optional[str] = None + instance_type: Optional[str] = None + last_busy: Optional[Uint64NoVal] = None + mcs_label: Optional[str] = None + name: Optional[str] = None + next_state_after_reboot: Optional[List[NextStateAfterRebootEnum]] = None + operating_system: Optional[str] = None + owner: Optional[str] = None + partitions: Optional[CsvString] = None + port: Optional[int] = None + power: Optional[PowerMgmtData] = None + real_memory: Optional[int] = None + reason: Optional[str] = None + reason_changed_at: Optional[Uint64NoVal] = None + reason_set_by_user: Optional[str] = None + reservation: Optional[str] = None + resume_after: Optional[Uint64NoVal] = None + slurmd_start_time: Optional[Uint64NoVal] = None + sockets: Optional[int] = None + specialized_cores: Optional[int] = None + specialized_cpus: Optional[str] = None + specialized_memory: Optional[int] = None + state: Optional[List[StateEnum]] = None + temporary_disk: Optional[int] = None + threads: Optional[int] = None + tres: Optional[str] = None + tres_used: Optional[str] = None + tres_weighted: Optional[float] = None + version: Optional[str] = None + weight: Optional[int] = None + + +class Nodes(BaseModel): + __root__: List[Node] + + +class OpenapiAccountsAddCondResp(BaseModel): + account: Optional[AccountShort] = None + """ + Account organization and description + """ + association_condition: Optional[AccountsAddCond] = None + """ + CSV List of accounts, association limits and options, CSV List of clusters + """ + errors: Optional[OpenapiErrors] = None + """ + Query errors + """ + meta: Optional[OpenapiMeta] = None + """ + Slurm meta values + """ + warnings: Optional[OpenapiWarnings] = None + """ + Query warnings + """ + + +class OpenapiAccountsAddCondRespStr(BaseModel): + added_accounts: str + """ + added_accounts + """ + errors: Optional[OpenapiErrors] = None + """ + Query errors + """ + meta: Optional[OpenapiMeta] = None + """ + Slurm meta values + """ + warnings: Optional[OpenapiWarnings] = None + """ + Query warnings + """ + + +class OpenapiAccountsRemovedResp(BaseModel): + errors: Optional[OpenapiErrors] = None + """ + Query errors + """ + meta: Optional[OpenapiMeta] = None + """ + Slurm meta values + """ + removed_accounts: StringList + """ + removed_accounts + """ + warnings: Optional[OpenapiWarnings] = None + """ + Query warnings + """ + + +class OpenapiAccountsResp(BaseModel): + accounts: AccountList + """ + accounts + """ + errors: Optional[OpenapiErrors] = None + """ + Query errors + """ + meta: Optional[OpenapiMeta] = None + """ + Slurm meta values + """ + warnings: Optional[OpenapiWarnings] = None + """ + Query warnings + """ + + +class OpenapiAssocsRemovedResp(BaseModel): + errors: Optional[OpenapiErrors] = None + """ + Query errors + """ + meta: Optional[OpenapiMeta] = None + """ + Slurm meta values + """ + removed_associations: StringList + """ + removed_associations + """ + warnings: Optional[OpenapiWarnings] = None + """ + Query warnings + """ + + +class OpenapiAssocsResp(BaseModel): + associations: AssocList + """ + associations + """ + errors: Optional[OpenapiErrors] = None + """ + Query errors + """ + meta: Optional[OpenapiMeta] = None + """ + Slurm meta values + """ + warnings: Optional[OpenapiWarnings] = None + """ + Query warnings + """ + + +class OpenapiClustersRemovedResp(BaseModel): + deleted_clusters: StringList + """ + deleted_clusters + """ + errors: Optional[OpenapiErrors] = None + """ + Query errors + """ + meta: Optional[OpenapiMeta] = None + """ + Slurm meta values + """ + warnings: Optional[OpenapiWarnings] = None + """ + Query warnings + """ + + +class OpenapiClustersResp(BaseModel): + clusters: ClusterRecList + """ + clusters + """ + errors: Optional[OpenapiErrors] = None + """ + Query errors + """ + meta: Optional[OpenapiMeta] = None + """ + Slurm meta values + """ + warnings: Optional[OpenapiWarnings] = None + """ + Query warnings + """ + + +class OpenapiDiagResp(BaseModel): + errors: Optional[OpenapiErrors] = None + """ + Query errors + """ + meta: Optional[OpenapiMeta] = None + """ + Slurm meta values + """ + statistics: StatsMsg + """ + statistics + """ + warnings: Optional[OpenapiWarnings] = None + """ + Query warnings + """ + + +class OpenapiInstancesResp(BaseModel): + errors: Optional[OpenapiErrors] = None + """ + Query errors + """ + instances: InstanceList + """ + instances + """ + meta: Optional[OpenapiMeta] = None + """ + Slurm meta values + """ + warnings: Optional[OpenapiWarnings] = None + """ + Query warnings + """ + + +class OpenapiJobInfoResp(BaseModel): + errors: Optional[OpenapiErrors] = None + """ + Query errors + """ + jobs: JobInfoMsg + """ + List of jobs + """ + last_backfill: Uint64NoVal + """ + time of last backfill scheduler run (UNIX timestamp) + """ + last_update: Uint64NoVal + """ + time of last job change (UNIX timestamp) + """ + meta: Optional[OpenapiMeta] = None + """ + Slurm meta values + """ + warnings: Optional[OpenapiWarnings] = None + """ + Query warnings + """ + + +class OpenapiJobPostResponse(BaseModel): + errors: Optional[OpenapiErrors] = None + """ + Query errors + """ + job_id: Optional[str] = None + """ + First updated JobId - Use results instead + """ + job_submit_user_msg: Optional[str] = None + """ + First updated Job submision user message - Use results instead + """ + meta: Optional[OpenapiMeta] = None + """ + Slurm meta values + """ + results: Optional[JobArrayResponseArray] = None + """ + Job update results + """ + step_id: Optional[str] = None + """ + First updated StepID - Use results instead + """ + warnings: Optional[OpenapiWarnings] = None + """ + Query warnings + """ + + +class OpenapiJobSubmitResponse(BaseModel): + errors: Optional[OpenapiErrors] = None + """ + Query errors + """ + job_id: Optional[int] = None + """ + submited JobId + """ + job_submit_user_msg: Optional[str] = None + """ + job submision user message + """ + meta: Optional[OpenapiMeta] = None + """ + Slurm meta values + """ + result: Optional[JobSubmitResponseMsg] = None + """ + Job submission + """ + step_id: Optional[str] = None + """ + submited StepID + """ + warnings: Optional[OpenapiWarnings] = None + """ + Query warnings + """ + + +class OpenapiLicensesResp(BaseModel): + errors: Optional[OpenapiErrors] = None + """ + Query errors + """ + last_update: Uint64NoVal + """ + time of last licenses change (UNIX timestamp) + """ + licenses: Licenses + """ + List of licenses + """ + meta: Optional[OpenapiMeta] = None + """ + Slurm meta values + """ + warnings: Optional[OpenapiWarnings] = None + """ + Query warnings + """ + + +class OpenapiNodesResp(BaseModel): + errors: Optional[OpenapiErrors] = None + """ + Query errors + """ + last_update: Uint64NoVal + """ + time of last node change (UNIX timestamp) + """ + meta: Optional[OpenapiMeta] = None + """ + Slurm meta values + """ + nodes: Nodes + """ + List of nodes + """ + warnings: Optional[OpenapiWarnings] = None + """ + Query warnings + """ + + +class OpenapiPartitionResp(BaseModel): + errors: Optional[OpenapiErrors] = None + """ + Query errors + """ + last_update: Uint64NoVal + """ + time of last partition change (UNIX timestamp) + """ + meta: Optional[OpenapiMeta] = None + """ + Slurm meta values + """ + partitions: PartitionInfoMsg + """ + List of partitions + """ + warnings: Optional[OpenapiWarnings] = None + """ + Query warnings + """ + + +class OpenapiReservationResp(BaseModel): + errors: Optional[OpenapiErrors] = None + """ + Query errors + """ + last_update: Uint64NoVal + """ + time of last reservation change (UNIX timestamp) + """ + meta: Optional[OpenapiMeta] = None + """ + Slurm meta values + """ + reservations: ReservationInfoMsg + """ + List of reservations + """ + warnings: Optional[OpenapiWarnings] = None + """ + Query warnings + """ + + +class OpenapiSlurmdbdQosResp(BaseModel): + errors: Optional[OpenapiErrors] = None + """ + Query errors + """ + meta: Optional[OpenapiMeta] = None + """ + Slurm meta values + """ + qos: QosList + """ + List of QOS + """ + warnings: Optional[OpenapiWarnings] = None + """ + Query warnings + """ + + +class OpenapiSlurmdbdStatsResp(BaseModel): + errors: Optional[OpenapiErrors] = None + """ + Query errors + """ + meta: Optional[OpenapiMeta] = None + """ + Slurm meta values + """ + statistics: StatsRec + """ + statistics + """ + warnings: Optional[OpenapiWarnings] = None + """ + Query warnings + """ + + +class OpenapiUsersAddCondResp(BaseModel): + association_condition: Optional[UsersAddCond] = None + """ + Filters to select associations for users + """ + errors: Optional[OpenapiErrors] = None + """ + Query errors + """ + meta: Optional[OpenapiMeta] = None + """ + Slurm meta values + """ + user: Optional[UserShort] = None + """ + Admin level of user, DefaultAccount, DefaultWCKey + """ + warnings: Optional[OpenapiWarnings] = None + """ + Query warnings + """ + + +class OpenapiWckeyResp(BaseModel): + errors: Optional[OpenapiErrors] = None + """ + Query errors + """ + meta: Optional[OpenapiMeta] = None + """ + Slurm meta values + """ + warnings: Optional[OpenapiWarnings] = None + """ + Query warnings + """ + wckeys: WckeyList + """ + wckeys + """ + + +class Consumed(BaseModel): + average: Optional[TresList] = None + max: Optional[StepTresUsageMax] = None + min: Optional[StepTresUsageMin] = None + total: Optional[TresList] = None + + +class Requested(BaseModel): + average: Optional[TresList] = None + max: Optional[StepTresReqMax] = None + min: Optional[StepTresReqMin] = None + total: Optional[TresList] = None + + +class Tres7(BaseModel): + allocated: Optional[TresList] = None + consumed: Optional[Consumed] = None + requested: Optional[Requested] = None + + +class Step(BaseModel): + CPU: Optional[CPU] = None + exit_code: Optional[ProcessExitCodeVerbose] = None + """ + return code returned by process + """ + kill_request_user: Optional[str] = None + nodes: Optional[Nodes2] = None + pid: Optional[str] = None + state: Optional[List[StateEnum2]] = None + statistics: Optional[Statistics] = None + step: Optional[Step1] = None + task: Optional[Task] = None + tasks: Optional[Tasks] = None + time: Optional[Time4] = None + tres: Optional[Tres7] = None + + +class StepList(BaseModel): + __root__: List[Step] + + +class User2(BaseModel): + administrator_level: Optional[List[AdministratorLevelEnum]] = None + associations: Optional[AssocShortList] = None + coordinators: Optional[CoordList] = None + default: Optional[Default1] = None + flags: Optional[List[Flag11]] = None + name: str + old_name: Optional[str] = None + wckeys: Optional[WckeyList] = None + + +class UserList(BaseModel): + __root__: List[User2] + + +class AssocSharesObjList(BaseModel): + __root__: List[AssocSharesObjWrap] + + +class Job(BaseModel): + account: Optional[str] = None + allocation_nodes: Optional[int] = None + array: Optional[Array] = None + association: Optional[AssocShort] = None + block: Optional[str] = None + cluster: Optional[str] = None + comment: Optional[Comment] = None + constraints: Optional[str] = None + container: Optional[str] = None + derived_exit_code: Optional[ProcessExitCodeVerbose] = None + """ + return code returned by process + """ + exit_code: Optional[ProcessExitCodeVerbose] = None + """ + return code returned by process + """ + extra: Optional[str] = None + failed_node: Optional[str] = None + flags: Optional[List[Flag4]] = None + group: Optional[str] = None + het: Optional[Het] = None + job_id: Optional[int] = None + kill_request_user: Optional[str] = None + licenses: Optional[str] = None + mcs: Optional[Mcs] = None + name: Optional[str] = None + nodes: Optional[str] = None + partition: Optional[str] = None + priority: Optional[Uint32NoVal] = None + qos: Optional[str] = None + required: Optional[Required] = None + reservation: Optional[Reservation] = None + script: Optional[str] = None + state: Optional[State] = None + steps: Optional[StepList] = None + submit_line: Optional[str] = None + time: Optional[Time1] = None + tres: Optional[Tres3] = None + used_gres: Optional[str] = None + user: Optional[str] = None + wckey: Optional[WckeyTagStruct] = None + """ + WCKey ID with tagging + """ + working_directory: Optional[str] = None + + +class JobList(BaseModel): + __root__: List[Job] + + +class OpenapiSlurmdbdConfigResp(BaseModel): + accounts: Optional[AccountList] = None + """ + accounts + """ + associations: Optional[AssocList] = None + """ + associations + """ + clusters: Optional[ClusterRecList] = None + """ + clusters + """ + errors: Optional[OpenapiErrors] = None + """ + Query errors + """ + instances: Optional[InstanceList] = None + """ + instances + """ + meta: Optional[OpenapiMeta] = None + """ + Slurm meta values + """ + qos: Optional[QosList] = None + """ + qos + """ + tres: Optional[TresList] = None + """ + tres + """ + users: Optional[UserList] = None + """ + users + """ + warnings: Optional[OpenapiWarnings] = None + """ + Query warnings + """ + wckeys: Optional[WckeyList] = None + """ + wckeys + """ + + +class OpenapiSlurmdbdJobsResp(BaseModel): + errors: Optional[OpenapiErrors] = None + """ + Query errors + """ + jobs: JobList + """ + jobs + """ + meta: Optional[OpenapiMeta] = None + """ + Slurm meta values + """ + warnings: Optional[OpenapiWarnings] = None + """ + Query warnings + """ + + +class OpenapiUsersResp(BaseModel): + errors: Optional[OpenapiErrors] = None + """ + Query errors + """ + meta: Optional[OpenapiMeta] = None + """ + Slurm meta values + """ + users: UserList + """ + users + """ + warnings: Optional[OpenapiWarnings] = None + """ + Query warnings + """ + + +class SharesRespMsg(BaseModel): + shares: Optional[AssocSharesObjList] = None + """ + Assocation shares + """ + total_shares: Optional[int] = None + """ + Total number of shares + """ -class GresFlags(Enum): - disable_binding = "disable-binding" - enforce_binding = "enforce-binding" - - -class OpenMode(Enum): - append = "append" - truncate = "truncate" - - -class Error(BaseModel): - error: Optional[str] = Field(None, description="error message") - errno: Optional[int] = Field(None, description="error number") - - -class JobProperties(BaseModel): - class Config: - use_enum_values = True - - account: Optional[str] = Field( - None, description="Charge resources used by this job to specified account." - ) - account_gather_freqency: Optional[str] = Field( - None, description="Define the job accounting and profiling sampling intervals." - ) - argv: Optional[List[str]] = Field(None, description="Arguments to the script.") - array: Optional[str] = Field( - None, - description="Submit a job array, multiple jobs to be executed with identical parameters. The indexes specification identifies what array index values should be used.", - ) - batch_features: Optional[str] = Field( - None, description="features required for batch script's node" - ) - begin_time: Optional[str] = Field( - None, - description="Submit the batch script to the Slurm controller immediately, like normal, but tell the controller to defer the allocation of the job until the specified time.", - ) - burst_buffer: Optional[str] = Field(None, description="Burst buffer specification.") - cluster_constraints: Optional[str] = Field( - None, - description="Specifies features that a federated cluster must have to have a sibling job submitted to it.", - ) - comment: Optional[str] = Field(None, description="An arbitrary comment.") - constraints: Optional[str] = Field( - None, description="node features required by job." - ) - core_specification: Optional[int] = Field( - None, - description="Count of specialized threads per node reserved by the job for system operations and not used by the application.", - ) - cores_per_socket: Optional[int] = Field( - None, - description="Restrict node selection to nodes with at least the specified number of cores per socket.", - ) - cpu_binding: Optional[str] = Field(None, description="Cpu binding") - cpu_binding_hint: Optional[str] = Field(None, description="Cpu binding hint") - cpu_frequency: Optional[str] = Field( - None, - description="Request that job steps initiated by srun commands inside this sbatch script be run at some requested frequency if possible, on the CPUs selected for the step on the compute node(s).", - ) - cpus_per_gpu: Optional[str] = Field( - None, description="Number of CPUs requested per allocated GPU." - ) - cpus_per_task: Optional[int] = Field( - None, - description="Advise the Slurm controller that ensuing job steps will require ncpus number of processors per task.", - ) - current_working_directory: Optional[str] = Field( - None, - description="Instruct Slurm to connect the batch script's standard output directly to the file name.", - ) - deadline: Optional[str] = Field( - None, - description="Remove the job if no ending is possible before this deadline (start > (deadline - time[-min])).", - ) - delay_boot: Optional[int] = Field( - None, - description="Do not reboot nodes in order to satisfied this job's feature specification if the job has been eligible to run for less than this time period.", - ) - dependency: Optional[str] = Field( - None, - description="Defer the start of this job until the specified dependencies have been satisfied completed.", - ) - distribution: Optional[str] = Field( - None, description="Specify alternate distribution methods for remote processes." - ) - environment: Dict[str, Any] = Field( - ..., description="Dictionary of environment entries." - ) - exclusive: Optional[Exclusive] = Field( - None, - description='The job allocation can share nodes just other users with the "user" option or with the "mcs" option).', - ) - get_user_environment: Optional[bool] = Field( - None, description="Load new login environment for user on job node." - ) - gres: Optional[str] = Field( - None, - description="Specifies a comma delimited list of generic consumable resources.", - ) - gres_flags: Optional[GresFlags] = Field( - None, description="Specify generic resource task binding options." - ) - gpu_binding: Optional[str] = Field( - None, description="Requested binding of tasks to GPU." - ) - gpu_frequency: Optional[str] = Field(None, description="Requested GPU frequency.") - gpus: Optional[str] = Field(None, description="GPUs per job.") - gpus_per_node: Optional[str] = Field(None, description="GPUs per node.") - gpus_per_socket: Optional[str] = Field(None, description="GPUs per socket.") - gpus_per_task: Optional[str] = Field(None, description="GPUs per task.") - hold: Optional[bool] = Field( - None, - description="Specify the job is to be submitted in a held state (priority of zero).", - ) - kill_on_invalid_dependency: Optional[bool] = Field( - None, - description="If a job has an invalid dependency, then Slurm is to terminate it.", - ) - licenses: Optional[str] = Field( - None, - description="Specification of licenses (or other resources available on all nodes of the cluster) which must be allocated to this job.", - ) - mail_type: Optional[str] = Field( - None, description="Notify user by email when certain event types occur." - ) - mail_user: Optional[str] = Field( - None, - description="User to receive email notification of state changes as defined by mail_type.", - ) - mcs_label: Optional[str] = Field( - None, description="This parameter is a group among the groups of the user." - ) - memory_binding: Optional[str] = Field(None, description="Bind tasks to memory.") - memory_per_cpu: Optional[int] = Field( - None, description="Minimum real memory per cpu (MB)." - ) - memory_per_gpu: Optional[int] = Field( - None, description="Minimum memory required per allocated GPU." - ) - memory_per_node: Optional[int] = Field( - None, description="Minimum real memory per node (MB)." - ) - minimum_cpus_per_node: Optional[int] = Field( - None, description="Minimum number of CPUs per node." - ) - minimum_nodes: Optional[bool] = Field( - None, - description="If a range of node counts is given, prefer the smaller count.", - ) - name: Optional[str] = Field( - None, description="Specify a name for the job allocation." - ) - nice: Optional[str] = Field( - None, - description="Run the job with an adjusted scheduling priority within Slurm.", - ) - no_kill: Optional[bool] = Field( - None, - description="Do not automatically terminate a job if one of the nodes it has been allocated fails.", - ) - nodes: Optional[List[int]] = Field( - None, - description="Request that a minimum of minnodes nodes and a maximum node count.", - max_items=2, - # min_items=1, XXX - min_items=2, - ) - open_mode: Optional[OpenMode] = Field( - "append", - description="Open the output and error files using append or truncate mode as specified.", - ) - partition: Optional[str] = Field( - None, description="Request a specific partition for the resource allocation." - ) - prefer: Optional[str] = Field( - None, - description="Comma delimited list of features for scheduler to prefer but not a strict requirement like a constraint. Value can be used for job submission but is only displayed for PENDING jobs.", - ) - priority: Optional[str] = Field( - None, description="Request a specific job priority." - ) - qos: Optional[str] = Field( - None, description="Request a quality of service for the job." - ) - requeue: Optional[bool] = Field( - None, - description="Specifies that the batch job should eligible to being requeue.", - ) - reservation: Optional[str] = Field( - None, description="Allocate resources for the job from the named reservation." - ) - signal: Optional[str] = Field( - None, - description="When a job is within sig_time seconds of its end time, send it the signal sig_num.", - regex="[B:][@]", - ) - sockets_per_node: Optional[int] = Field( - None, - description="Restrict node selection to nodes with at least the specified number of sockets.", - ) - spread_job: Optional[bool] = Field( - None, - description="Spread the job allocation over as many nodes as possible and attempt to evenly distribute tasks across the allocated nodes.", - ) - standard_error: Optional[str] = Field( - None, - description="Instruct Slurm to connect the batch script's standard error directly to the file name.", - ) - standard_in: Optional[str] = Field( - None, - description="Instruct Slurm to connect the batch script's standard input directly to the file name specified.", - ) - standard_out: Optional[str] = Field( - None, - description="Instruct Slurm to connect the batch script's standard output directly to the file name.", - ) - tasks: Optional[int] = Field( - None, - description="Advises the Slurm controller that job steps run within the allocation will launch a maximum of number tasks and to provide for sufficient resources.", - ) - tasks_per_core: Optional[int] = Field( - None, description="Request the maximum ntasks be invoked on each core." - ) - tasks_per_node: Optional[int] = Field( - None, description="Request the maximum ntasks be invoked on each node." - ) - tasks_per_socket: Optional[int] = Field( - None, description="Request the maximum ntasks be invoked on each socket." - ) - thread_specification: Optional[int] = Field( - None, - description="Count of specialized threads per node reserved by the job for system operations and not used by the application.", - ) - threads_per_core: Optional[int] = Field( - None, - description="Restrict node selection to nodes with at least the specified number of threads per core.", - ) - time_limit: Optional[int] = Field(None, description="Step time limit.") - time_minimum: Optional[int] = Field( - None, description="Minimum run time in minutes." - ) - wait_all_nodes: Optional[bool] = Field( - None, description="Do not begin execution until all nodes are ready for use." - ) - wckey: Optional[str] = Field(None, description="Specify wckey to be used with job.") - - -class JobSubmission(BaseModel): - script: str = Field( - ..., description="Executable script (full contents) to run in batch step" - ) - job: Optional[JobProperties] = Field( - None, description="Properties of an array job or non-HetJob" - ) - jobs: Optional[List[JobProperties]] = Field( - None, description="Properties of an HetJob" - ) - - -class JobSubmissionResponse(BaseModel): - errors: Optional[List[Error]] = Field(None, description="slurm errors") - job_id: Optional[int] = Field(None, description="new job ID") - step_id: Optional[str] = Field(None, description="new job step ID") - job_submit_user_msg: Optional[str] = Field( - None, description="Message to user from job_submit plugin" - ) - - -class NodeAllocation(BaseModel): - memory: Optional[int] = Field(None, description="amount of assigned job memory") - cpus: Optional[int] = Field(None, description="amount of assigned job CPUs") - sockets: Optional[Dict[str, Any]] = Field( - None, description="assignment status of each socket by socket id" - ) - cores: Optional[Dict[str, Any]] = Field( - None, description="assignment status of each core by core id" - ) - - -class JobResources(BaseModel): - nodes: Optional[str] = Field(None, description="list of assigned job nodes") - allocated_cpus: Optional[int] = Field( - None, description="number of assigned job cpus" - ) - allocated_hosts: Optional[int] = Field( - None, description="number of assigned job hosts" - ) - allocated_nodes: Optional[Dict[str, NodeAllocation]] = Field( - None, description="node allocations" - ) - - -class JobResponseProperties(BaseModel): - account: Optional[str] = Field( - None, description="Charge resources used by this job to specified account" - ) - accrue_time: Optional[str] = Field( - None, description="time job is eligible for running" - ) - admin_comment: Optional[str] = Field( - None, description="administrator's arbitrary comment" - ) - array_job_id: Optional[str] = Field( - None, description="job_id of a job array or 0 if N/A" - ) - array_task_id: Optional[str] = Field(None, description="task_id of a job array") - array_max_tasks: Optional[str] = Field( - None, description="Maximum number of running array tasks" - ) - array_task_string: Optional[str] = Field( - None, description="string expression of task IDs in this record" - ) - association_id: Optional[str] = Field(None, description="association id for job") - batch_features: Optional[str] = Field( - None, description="features required for batch script's node" - ) - batch_flag: Optional[bool] = Field( - None, description="if batch: queued job with script" - ) - batch_host: Optional[str] = Field( - None, description="name of host running batch script" - ) - flags: Optional[List[str]] = Field(None, description="Job flags") - burst_buffer: Optional[str] = Field(None, description="burst buffer specifications") - burst_buffer_state: Optional[str] = Field( - None, description="burst buffer state info" - ) - cluster: Optional[str] = Field( - None, description="name of cluster that the job is on" - ) - cluster_features: Optional[str] = Field( - None, description="comma separated list of required cluster features" - ) - command: Optional[str] = Field(None, description="command to be executed") - comment: Optional[str] = Field(None, description="arbitrary comment") - contiguous: Optional[bool] = Field( - None, description="job requires contiguous nodes" - ) - core_spec: Optional[str] = Field(None, description="specialized core count") - thread_spec: Optional[str] = Field(None, description="specialized thread count") - cores_per_socket: Optional[str] = Field( - None, description="cores per socket required by job" - ) - billable_tres: Optional[str] = Field(None, description="billable TRES") - cpus_per_task: Optional[str] = Field( - None, description="number of processors required for each task" - ) - cpu_frequency_minimum: Optional[str] = Field( - None, description="Minimum cpu frequency" - ) - cpu_frequency_maximum: Optional[str] = Field( - None, description="Maximum cpu frequency" - ) - cpu_frequency_governor: Optional[str] = Field( - None, description="cpu frequency governor" - ) - cpus_per_tres: Optional[str] = Field( - None, description="semicolon delimited list of TRES=# values" - ) - deadline: Optional[str] = Field(None, description="job start deadline ") - delay_boot: Optional[str] = Field(None, description="command to be executed") - dependency: Optional[str] = Field( - None, description="synchronize job execution with other jobs" - ) - derived_exit_code: Optional[str] = Field( - None, description="highest exit code of all job steps" - ) - eligible_time: Optional[str] = Field( - None, description="time job is eligible for running" - ) - end_time: Optional[str] = Field( - None, description="time of termination, actual or expected" - ) - excluded_nodes: Optional[str] = Field( - None, description="comma separated list of excluded nodes" - ) - exit_code: Optional[int] = Field(None, description="exit code for job") - features: Optional[str] = Field( - None, description="comma separated list of required features" - ) - federation_origin: Optional[str] = Field(None, description="Origin cluster's name") - federation_siblings_active: Optional[str] = Field( - None, description="string of active sibling names" - ) - federation_siblings_viable: Optional[str] = Field( - None, description="string of viable sibling names" - ) - gres_detail: Optional[List[str]] = Field(None, description="Job flags") - group_id: Optional[str] = Field(None, description="group job submitted as") - job_id: Optional[str] = Field(None, description="job ID") - job_resources: Optional[JobResources] = None - job_state: Optional[str] = Field(None, description="state of the job") - last_sched_evaluation: Optional[str] = Field( - None, description="last time job was evaluated for scheduling" - ) - licenses: Optional[str] = Field(None, description="licenses required by the job") - max_cpus: Optional[str] = Field( - None, description="maximum number of cpus usable by job" - ) - max_nodes: Optional[str] = Field( - None, description="maximum number of nodes usable by job" - ) - mcs_label: Optional[str] = Field(None, description="mcs_label if mcs plugin in use") - memory_per_tres: Optional[str] = Field( - None, description="semicolon delimited list of TRES=# values" - ) - name: Optional[str] = Field(None, description="name of the job") - nodes: Optional[str] = Field(None, description="list of nodes allocated to job") - nice: Optional[str] = Field(None, description="requested priority change") - tasks_per_core: Optional[str] = Field( - None, description="number of tasks to invoke on each core" - ) - tasks_per_socket: Optional[str] = Field( - None, description="number of tasks to invoke on each socket" - ) - tasks_per_board: Optional[str] = Field( - None, description="number of tasks to invoke on each board" - ) - cpus: Optional[str] = Field( - None, description="minimum number of cpus required by job" - ) - node_count: Optional[str] = Field( - None, description="minimum number of nodes required by job" - ) - tasks: Optional[str] = Field(None, description="requested task count") - het_job_id: Optional[str] = Field(None, description="job ID of hetjob leader") - het_job_id_set: Optional[str] = Field( - None, description="job IDs for all components" - ) - het_job_offset: Optional[str] = Field( - None, description="HetJob component offset from leader" - ) - partition: Optional[str] = Field(None, description="name of assigned partition") - memory_per_node: Optional[str] = Field( - None, description="minimum real memory per node" - ) - memory_per_cpu: Optional[str] = Field( - None, description="minimum real memory per cpu" - ) - minimum_cpus_per_node: Optional[str] = Field( - None, description="minimum # CPUs per node" - ) - minimum_tmp_disk_per_node: Optional[str] = Field( - None, description="minimum tmp disk per node" - ) - preempt_time: Optional[str] = Field(None, description="preemption signal time") - pre_sus_time: Optional[str] = Field( - None, description="time job ran prior to last suspend" - ) - priority: Optional[str] = Field(None, description="relative priority of the job") - profile: Optional[List[str]] = Field(None, description="Job profiling requested") - qos: Optional[str] = Field(None, description="Quality of Service") - reboot: Optional[bool] = Field( - None, description="node reboot requested before start" - ) - required_nodes: Optional[str] = Field( - None, description="comma separated list of required nodes" - ) - requeue: Optional[bool] = Field( - None, description="enable or disable job requeue option" - ) - resize_time: Optional[str] = Field(None, description="time of latest size change") - restart_cnt: Optional[str] = Field(None, description="count of job restarts") - resv_name: Optional[str] = Field(None, description="reservation name") - shared: Optional[str] = Field( - None, description="type and if job can share nodes with other jobs" - ) - show_flags: Optional[List[str]] = Field(None, description="details requested") - sockets_per_board: Optional[str] = Field( - None, description="sockets per board required by job" - ) - sockets_per_node: Optional[str] = Field( - None, description="sockets per node required by job" - ) - start_time: Optional[str] = Field( - None, description="time execution begins, actual or expected" - ) - state_description: Optional[str] = Field( - None, description="optional details for state_reason" - ) - state_reason: Optional[str] = Field( - None, description="reason job still pending or failed" - ) - standard_error: Optional[str] = Field( - None, description="pathname of job's stderr file" - ) - standard_input: Optional[str] = Field( - None, description="pathname of job's stdin file" - ) - standard_output: Optional[str] = Field( - None, description="pathname of job's stdout file" - ) - submit_time: Optional[str] = Field(None, description="time of job submission") - suspend_time: Optional[str] = Field( - None, description="time job last suspended or resumed" - ) - system_comment: Optional[str] = Field( - None, description="slurmctld's arbitrary comment" - ) - time_limit: Optional[str] = Field(None, description="maximum run time in minutes") - time_minimum: Optional[str] = Field(None, description="minimum run time in minutes") - threads_per_core: Optional[str] = Field( - None, description="threads per core required by job" - ) - tres_bind: Optional[str] = Field( - None, description="Task to TRES binding directives" - ) - tres_freq: Optional[str] = Field(None, description="TRES frequency directives") - tres_per_job: Optional[str] = Field( - None, description="semicolon delimited list of TRES=# values" - ) - tres_per_node: Optional[str] = Field( - None, description="semicolon delimited list of TRES=# values" - ) - tres_per_socket: Optional[str] = Field( - None, description="semicolon delimited list of TRES=# values" - ) - tres_per_task: Optional[str] = Field( - None, description="semicolon delimited list of TRES=# values" - ) - tres_req_str: Optional[str] = Field(None, description="tres reqeusted in the job") - tres_alloc_str: Optional[str] = Field(None, description="tres used in the job") - user_id: Optional[str] = Field(None, description="user id the job runs as") - user_name: Optional[str] = Field(None, description="user the job runs as") - wckey: Optional[str] = Field(None, description="wckey for job") - current_working_directory: Optional[str] = Field( - None, description="pathname of working directory" - ) - - -class JobsResponse(BaseModel): - errors: Optional[List[Error]] = Field(None, description="slurm errors") - jobs: Optional[List[JobResponseProperties]] = Field( - None, description="job descriptions" - ) +class OpenapiSharesResp(BaseModel): + errors: Optional[OpenapiErrors] = None + """ + Query errors + """ + meta: Optional[OpenapiMeta] = None + """ + Slurm meta values + """ + shares: SharesRespMsg + """ + fairshare info + """ + warnings: Optional[OpenapiWarnings] = None + """ + Query warnings + """ diff --git a/tests/configuration/test_plugin_slurm.py b/tests/configuration/test_plugin_slurm.py index c24e298..7c087db 100644 --- a/tests/configuration/test_plugin_slurm.py +++ b/tests/configuration/test_plugin_slurm.py @@ -9,14 +9,14 @@ example: plugin: slurm url: http://example.com - api_version: v0.0.36 + api_version: v0.0.40 example-with-username-and-token: plugin: slurm url: http://example.com:1234 user: admin user_token: sometoken - api_version: v0.0.36 + api_version: v0.0.40 environments: live: @@ -46,7 +46,7 @@ def test_without_username(): assert isinstance(zc.slurm, dict) assert zc.slurm["url"] == "http://example.com" assert "user" not in zc.slurm - assert zc.slurm["api_version"] == "v0.0.36" + assert zc.slurm["api_version"] == "v0.0.40" def test_with_username(): @@ -56,7 +56,7 @@ def test_with_username(): assert isinstance(zc.slurm, dict) assert zc.slurm["url"] == "http://example.com:1234" assert zc.slurm["user"] == "admin" - assert zc.slurm["api_version"] == "v0.0.36" + assert zc.slurm["api_version"] == "v0.0.40" def test_user_token_from_external_file(tmp_path): @@ -69,7 +69,7 @@ def test_user_token_from_external_file(tmp_path): example: plugin: slurm url: http://example.com - api_version: v0.0.36 + api_version: v0.0.40 user_token: {user_token_file} environments: diff --git a/tests/util/test_slurm.py b/tests/util/test_slurm.py index 83e39ec..83526a2 100644 --- a/tests/util/test_slurm.py +++ b/tests/util/test_slurm.py @@ -12,7 +12,7 @@ def zocalo_configuration(mocker): "url": "http://slurm.example.com:1234", "user": "foo", "user_token": "sometoken", - "api_version": "v0.0.36", + "api_version": "v0.0.40", } return zc @@ -29,56 +29,205 @@ def jobs_response(): "errors": [], "jobs": [ { - "batch_host": "cs04r-sc-com13-01", - "flags": ["JOB_WAS_RUNNING"], + "account": "acc", + "accrue_time": {"infinite": False, "number": 0, "set": True}, + "admin_comment": "", + "allocating_node": "vse-200", + "array_job_id": {"infinite": False, "number": 6077609, "set": True}, + "array_max_tasks": {"infinite": False, "number": 2, "set": True}, + "array_task_id": {"infinite": False, "number": 41, "set": True}, + "array_task_string": "", + "association_id": 1845, + "batch_features": "", + "batch_flag": True, + "batch_host": "cma2-2", + "billable_tres": {"infinite": False, "number": 1.0, "set": True}, + "burst_buffer": "", + "burst_buffer_state": "", "cluster": "cluster", - "command": "bash", - "eligible_time": "1675327225", - "end_time": "1706863225", - "exit_code": 0, - "group_id": "12345", - "job_id": "129", + "cluster_features": "", + "command": "cjb_arch.sh", + "comment": "", + "container": "", + "container_id": "", + "contiguous": False, + "core_spec": 0, + "cores_per_socket": {"infinite": False, "number": 0, "set": False}, + "cpu_frequency_governor": { + "infinite": False, + "number": 0, + "set": False, + }, + "cpu_frequency_maximum": {"infinite": False, "number": 0, "set": False}, + "cpu_frequency_minimum": {"infinite": False, "number": 0, "set": False}, + "cpus": {"infinite": False, "number": 1, "set": True}, + "cpus_per_task": {"infinite": False, "number": 1, "set": True}, + "cpus_per_tres": "", + "cron": "", + "current_working_directory": "/home/acc", + "deadline": {"infinite": False, "number": 0, "set": True}, + "delay_boot": {"infinite": False, "number": 0, "set": True}, + "dependency": "", + "derived_exit_code": { + "return_code": {"infinite": False, "number": 0, "set": True}, + "signal": { + "id": {"infinite": False, "number": 0, "set": False}, + "name": "", + }, + "status": ["SUCCESS"], + }, + "eligible_time": {"infinite": False, "number": 1711534808, "set": True}, + "end_time": {"infinite": False, "number": 1712226008, "set": True}, + "excluded_nodes": "", + "exclusive": [], + "exit_code": { + "return_code": {"infinite": False, "number": 0, "set": True}, + "signal": { + "id": {"infinite": False, "number": 0, "set": False}, + "name": "", + }, + "status": ["SUCCESS"], + }, + "extra": "", + "failed_node": "", + "features": "", + "federation_origin": "", + "federation_siblings_active": "", + "federation_siblings_viable": "", + "flags": [ + "JOB_WAS_RUNNING", + "USING_DEFAULT_QOS", + "USING_DEFAULT_WCKEY", + ], + "gres_detail": [], + "group_id": 37524, + "group_name": "acc", + "het_job_id": {"infinite": False, "number": 0, "set": True}, + "het_job_id_set": "", + "het_job_offset": {"infinite": False, "number": 0, "set": True}, + "job_id": 6080221, "job_resources": { - "nodes": "cs04r-sc-com13-01", - "allocated_cpus": 1, + "allocated_cores": 1, + "allocated_cpus": 0, "allocated_hosts": 1, - "allocated_nodes": { - "0": { - "memory": 0, - "cpus": 1, - "sockets": {"0": "unassigned"}, - "cores": {"0": "unassigned"}, + "allocated_nodes": [ + { + "cpus_used": 0, + "memory_allocated": 9000, + "memory_used": 0, + "nodename": "cma2-02", + "sockets": {"0": {"cores": {"8": "allocated"}}}, } - }, + ], + "nodes": "cma2-02", + }, + "job_size_str": [], + "job_state": ["RUNNING"], + "last_sched_evaluation": { + "infinite": False, + "number": 1711534808, + "set": True, + }, + "licenses": "", + "mail_type": [], + "mail_user": "acc", + "max_cpus": {"infinite": False, "number": 0, "set": True}, + "max_nodes": {"infinite": False, "number": 0, "set": True}, + "maximum_switch_wait_time": 0, + "mcs_label": "", + "memory_per_cpu": {"infinite": False, "number": 9000, "set": True}, + "memory_per_node": {"infinite": False, "number": 0, "set": False}, + "memory_per_tres": "", + "minimum_cpus_per_node": {"infinite": False, "number": 1, "set": True}, + "minimum_switches": 0, + "minimum_tmp_disk_per_node": { + "infinite": False, + "number": 0, + "set": True, }, - "job_state": "RUNNING", - "last_sched_evaluation": "1675327225", - "max_cpus": "0", - "max_nodes": "0", - "name": "bash", - "nodes": "cs04r-sc-com13-01", - "tasks_per_board": "0", - "cpus": "1", - "node_count": "1", - "tasks": "1", - "partition": "wilson", - "minimum_cpus_per_node": "1", - "minimum_tmp_disk_per_node": "0", - "priority": "4294901730", + "name": "archive", + "network": "", + "nice": 0, + "node_count": {"infinite": False, "number": 1, "set": True}, + "nodes": "cma2-02", + "oversubscribe": True, + "partition": "cs", + "power": {"flags": []}, + "pre_sus_time": {"infinite": False, "number": 0, "set": True}, + "preempt_time": {"infinite": False, "number": 0, "set": True}, + "preemptable_time": {"infinite": False, "number": 0, "set": True}, + "prefer": "", + "priority": {"infinite": False, "number": 1, "set": True}, + "profile": ["NOT_SET"], "qos": "normal", - "start_time": "1675327225", - "submit_time": "1675327225", - "user_id": "123456", - "user_name": "foo", - "current_working_directory": "/home/foo", + "reboot": False, + "requeue": True, + "required_nodes": "", + "resize_time": {"infinite": False, "number": 0, "set": True}, + "restart_cnt": 0, + "resv_name": "", + "scheduled_nodes": "", + "selinux_context": "", + "shared": [], + "show_flags": ["ALL", "DETAIL", "LOCAL"], + "sockets_per_board": 0, + "sockets_per_node": {"infinite": False, "number": 0, "set": False}, + "standard_error": "archive_6077609-41.err", + "standard_input": "/dev/null", + "standard_output": "archive_6077609-41.out", + "start_time": {"infinite": False, "number": 1711534808, "set": True}, + "state_description": "", + "state_reason": "None", + "submit_time": {"infinite": False, "number": 1711533827, "set": True}, + "suspend_time": {"infinite": False, "number": 0, "set": True}, + "system_comment": "", + "tasks": {"infinite": False, "number": 1, "set": True}, + "tasks_per_board": {"infinite": False, "number": 0, "set": True}, + "tasks_per_core": {"infinite": True, "number": 0, "set": False}, + "tasks_per_node": {"infinite": False, "number": 0, "set": True}, + "tasks_per_socket": {"infinite": True, "number": 0, "set": False}, + "tasks_per_tres": {"infinite": False, "number": 0, "set": True}, + "thread_spec": 32766, + "threads_per_core": {"infinite": False, "number": 0, "set": False}, + "time_limit": {"infinite": False, "number": 11520, "set": True}, + "time_minimum": {"infinite": False, "number": 0, "set": True}, + "tres_alloc_str": "cpu=1,mem=9000M,node=1,billing=1", + "tres_bind": "", + "tres_freq": "", + "tres_per_job": "", + "tres_per_node": "", + "tres_per_socket": "", + "tres_per_task": "", + "tres_req_str": "cpu=1,mem=9000M,node=1,billing=1", + "user_id": 37524, + "user_name": "acc", + "wckey": "", } ], + "last_backfill": {"infinite": False, "number": 1711536308, "set": True}, + "last_update": {"infinite": False, "number": 1711536388, "set": True}, + "meta": { + "client": {"group": "root", "source": "[localhost]:51114", "user": "root"}, + "command": [], + "plugin": { + "accounting_storage": "acc_st/slurmdbd", + "data_parser": "data_parser/v0.0.40", + "name": "Slurm OpenAPI slurmctld", + "type": "openapi/slurmctld", + }, + "slurm": { + "cluster": "cluster", + "release": "23.11.1", + "version": {"major": "23", "micro": "1", "minor": "11"}, + }, + }, + "warnings": [], } def test_get_slurm_api_from_zocalo_configuration(slurm_api): assert slurm_api.url == "http://slurm.example.com:1234" - assert slurm_api.version == "v0.0.36" + assert slurm_api.version == "v0.0.40" assert slurm_api.user_name == "foo" assert slurm_api.user_token == "sometoken" @@ -88,7 +237,7 @@ def test_get_slurm_api_user_token_external_file(tmp_path): user_token_file.write_text("foobar") api = slurm.SlurmRestApi( url="http://slurm.example.com:1234", - version="v0.0.36", + version="v0.0.40", user_name="foo", user_token=user_token_file, ) @@ -97,15 +246,21 @@ def test_get_slurm_api_user_token_external_file(tmp_path): def test_get_jobs(requests_mock, slurm_api, jobs_response): requests_mock.get( - "/slurm/v0.0.36/jobs", + "/slurm/v0.0.40/jobs", json=jobs_response, ) - assert slurm_api.get_jobs() == slurm.models.JobsResponse(**jobs_response) + assert slurm_api.get_jobs() == slurm.models.OpenapiJobInfoResp(**jobs_response) def test_get_job_info(requests_mock, slurm_api, jobs_response): requests_mock.get( - "/slurm/v0.0.36/job/129", + "/slurm/v0.0.40/job/129", json=jobs_response, ) - assert slurm_api.get_job_info(129) == slurm.models.JobsResponse(**jobs_response) + assert slurm_api.get_job_info(129) == next( + iter( + dict(slurm.models.OpenapiJobInfoResp(**jobs_response).jobs).get( + "__root__", [] + ) + ) + )