ska_src_api_global_execution.models.workstep

The work step models.

Module Contents

Classes

DataLocationModel

The data location model.

ExecutionState

str(object='') -> str

ExecutionType

str(object='') -> str

ProvenanceJson

Provenance information in JSON format.

SystemParameters

System parameters for the work step.

WorkStepModel

The work step model.

WorkStepModelV1

The work step model for version 1 of the API.

class ska_src_api_global_execution.models.workstep.DataLocationModel(/, **data)

Bases: pydantic.BaseModel

digraph inheritance37dd6fe06a { bgcolor=transparent; rankdir=LR; size="8.0, 12.0"; "BaseModel" [fillcolor=white,fontname="Vera Sans, DejaVu Sans, Liberation Sans, Arial, Helvetica, sans",fontsize=10,height=0.25,shape=box,style="setlinewidth(0.5),filled",tooltip="!!! abstract \"Usage Documentation\""]; "DataLocationModel" [URL="#ska_src_api_global_execution.models.workstep.DataLocationModel",fillcolor=white,fontname="Vera Sans, DejaVu Sans, Liberation Sans, Arial, Helvetica, sans",fontsize=10,height=0.25,shape=box,style="setlinewidth(0.5),filled",target="_top",tooltip="The data location model."]; "BaseModel" -> "DataLocationModel" [arrowsize=0.5,style="setlinewidth(0.5)"]; }

The data location model.

format: Annotated[Optional[str], Field(description='Data format', json_schema_extra={'examples': ['FITS']}, default=None)]
id: Annotated[Optional[str], Field(description='Unique data location id', json_schema_extra={'examples': ['7713d537-69f2-478d-b317-ed712bb5a684']}, default_factory=lambda: str(uuid.uuid4()))]
role: Annotated[Optional[str], Field(description='Role for accessing the data location', json_schema_extra={'examples': ['data-access-role']}, default=None)]
uri: Annotated[Optional[str], Field(description='Data location URI', json_schema_extra={'examples': ['s3://bucket_name/path/to/data/']})]
workstep_id: Annotated[Optional[str], Field(description='Unique work step id', json_schema_extra={'examples': ['103dd36e-0877-4e2e-be20-a73792940afb']}, default=None)]
class ska_src_api_global_execution.models.workstep.ExecutionState

Bases: str, enum.Enum

digraph inheritance6a4cbf9780 { bgcolor=transparent; rankdir=LR; size="8.0, 12.0"; "Enum" [fillcolor=white,fontname="Vera Sans, DejaVu Sans, Liberation Sans, Arial, Helvetica, sans",fontsize=10,height=0.25,shape=box,style="setlinewidth(0.5),filled",tooltip="Create a collection of name/value pairs."]; "ExecutionState" [URL="#ska_src_api_global_execution.models.workstep.ExecutionState",fillcolor=white,fontname="Vera Sans, DejaVu Sans, Liberation Sans, Arial, Helvetica, sans",fontsize=10,height=0.25,shape=box,style="setlinewidth(0.5),filled",target="_top"]; "Enum" -> "ExecutionState" [arrowsize=0.5,style="setlinewidth(0.5)"]; }

str(object=’’) -> str str(bytes_or_buffer[, encoding[, errors]]) -> str

Create a new string object from the given object. If encoding or errors is specified, then the object must expose a data buffer that will be decoded using the given encoding and error handler. Otherwise, returns the result of object.__str__() (if defined) or repr(object). encoding defaults to ‘utf-8’. errors defaults to ‘strict’.

completed = 'completed'
defined = 'defined'
failed = 'failed'
queued = 'queued'
running = 'running'
class ska_src_api_global_execution.models.workstep.ExecutionType

Bases: str, enum.Enum

digraph inheritanced6e6819601 { bgcolor=transparent; rankdir=LR; size="8.0, 12.0"; "Enum" [fillcolor=white,fontname="Vera Sans, DejaVu Sans, Liberation Sans, Arial, Helvetica, sans",fontsize=10,height=0.25,shape=box,style="setlinewidth(0.5),filled",tooltip="Create a collection of name/value pairs."]; "ExecutionType" [URL="#ska_src_api_global_execution.models.workstep.ExecutionType",fillcolor=white,fontname="Vera Sans, DejaVu Sans, Liberation Sans, Arial, Helvetica, sans",fontsize=10,height=0.25,shape=box,style="setlinewidth(0.5),filled",target="_top"]; "Enum" -> "ExecutionType" [arrowsize=0.5,style="setlinewidth(0.5)"]; }

str(object=’’) -> str str(bytes_or_buffer[, encoding[, errors]]) -> str

Create a new string object from the given object. If encoding or errors is specified, then the object must expose a data buffer that will be decoded using the given encoding and error handler. Otherwise, returns the result of object.__str__() (if defined) or repr(object). encoding defaults to ‘utf-8’. errors defaults to ‘strict’.

batch = 'batch'
interactive = 'interactive'
class ska_src_api_global_execution.models.workstep.ProvenanceJson(/, **data)

Bases: pydantic.BaseModel

digraph inheritance09b6cce3ad { bgcolor=transparent; rankdir=LR; size="8.0, 12.0"; "BaseModel" [fillcolor=white,fontname="Vera Sans, DejaVu Sans, Liberation Sans, Arial, Helvetica, sans",fontsize=10,height=0.25,shape=box,style="setlinewidth(0.5),filled",tooltip="!!! abstract \"Usage Documentation\""]; "ProvenanceJson" [URL="#ska_src_api_global_execution.models.workstep.ProvenanceJson",fillcolor=white,fontname="Vera Sans, DejaVu Sans, Liberation Sans, Arial, Helvetica, sans",fontsize=10,height=0.25,shape=box,style="setlinewidth(0.5),filled",target="_top",tooltip="Provenance information in JSON format."]; "BaseModel" -> "ProvenanceJson" [arrowsize=0.5,style="setlinewidth(0.5)"]; }

Provenance information in JSON format.

method: Annotated[Optional[str], Field(description='Method used for processing', json_schema_extra={'examples': ['automated']}, default=None)]
source: Annotated[Optional[str], Field(description='Source of the data or processing', json_schema_extra={'examples': ['dataset-xyz']}, default=None)]
class ska_src_api_global_execution.models.workstep.SystemParameters(/, **data)

Bases: pydantic.BaseModel

digraph inheritance3e67335bad { bgcolor=transparent; rankdir=LR; size="8.0, 12.0"; "BaseModel" [fillcolor=white,fontname="Vera Sans, DejaVu Sans, Liberation Sans, Arial, Helvetica, sans",fontsize=10,height=0.25,shape=box,style="setlinewidth(0.5),filled",tooltip="!!! abstract \"Usage Documentation\""]; "SystemParameters" [URL="#ska_src_api_global_execution.models.workstep.SystemParameters",fillcolor=white,fontname="Vera Sans, DejaVu Sans, Liberation Sans, Arial, Helvetica, sans",fontsize=10,height=0.25,shape=box,style="setlinewidth(0.5),filled",target="_top",tooltip="System parameters for the work step."]; "BaseModel" -> "SystemParameters" [arrowsize=0.5,style="setlinewidth(0.5)"]; }

System parameters for the work step.

cpu_cores: Annotated[Optional[int], Field(description='Number of CPU cores required', json_schema_extra={'examples': [4]}, default=None)]
max_walltime_hours: Annotated[Optional[int], Field(description='Maximum walltime in hours', json_schema_extra={'examples': [4]}, default=None)]
memory_gb: Annotated[Optional[float], Field(description='Amount of memory in GB required', json_schema_extra={'examples': [16]}, default=None)]
paramx: Annotated[Optional[int], Field(description='Example of an additional system parameter', json_schema_extra={'examples': [42]}, default=None)]
requires_gpu: Annotated[Optional[bool], Field(description='Whether GPU is required', json_schema_extra={'examples': [False]}, default=None)]
src_node: Annotated[list[str], Field(description='List of SRC nodes where the work step can be executed', json_schema_extra={'examples': [['CHSRC', 'INSRC']]}, default_factory=list)]
class ska_src_api_global_execution.models.workstep.WorkStepModel(/, **data)

Bases: pydantic.BaseModel

digraph inheritancece5f5c4e1e { bgcolor=transparent; rankdir=LR; size="8.0, 12.0"; "BaseModel" [fillcolor=white,fontname="Vera Sans, DejaVu Sans, Liberation Sans, Arial, Helvetica, sans",fontsize=10,height=0.25,shape=box,style="setlinewidth(0.5),filled",tooltip="!!! abstract \"Usage Documentation\""]; "WorkStepModel" [URL="#ska_src_api_global_execution.models.workstep.WorkStepModel",fillcolor=white,fontname="Vera Sans, DejaVu Sans, Liberation Sans, Arial, Helvetica, sans",fontsize=10,height=0.25,shape=box,style="setlinewidth(0.5),filled",target="_top",tooltip="The work step model."]; "BaseModel" -> "WorkStepModel" [arrowsize=0.5,style="setlinewidth(0.5)"]; }

The work step model.

arguments: Annotated[Optional[str], Field(description='Arguments for the executable', json_schema_extra={'examples': ['--input data.txt --output result.txt']}, default=None)]
container_image: Annotated[str, Field(description='Container image to be used', json_schema_extra={'examples': ['python:3.8-slim']})]
cpu_cores: Annotated[Optional[int], Field(description='Number of CPU cores required', json_schema_extra={'examples': [4]}, default=None)]
created_at: Annotated[str, Field(description='Timestamp when the work step was created', json_schema_extra={'examples': ['2024-01-01T12:00:00Z']}, default_factory=lambda: datetime.datetime.now(datetime.UTC).isoformat())]
created_by: Annotated[str, Field(description='User who created the work step', json_schema_extra={'examples': ['user-abc']})]
description: Annotated[Optional[str], Field(description='Description of the work step', json_schema_extra={'examples': ['This work step processes data files.']}, default=None)]
executable_entrypoint: Annotated[Optional[str], Field(description='Executable entrypoint', json_schema_extra={'examples': ['python main.py']}, default=None)]
execution: Annotated[ExecutionType, Field(description='Execution environment', json_schema_extra={'examples': ['batch']}, default=ExecutionType.batch)]
finished_at: Annotated[Optional[str], Field(description='Timestamp when the work step completed', json_schema_extra={'examples': ['2024-01-01T14:00:00Z']}, default=None)]
id: Annotated[str, Field(description='Unique work step id', json_schema_extra={'examples': ['103dd36e-0877-4e2e-be20-a73792940afb']}, default_factory=lambda: str(uuid.uuid4()))]
inputs: Annotated[Optional[list[DataLocationModel]], Field(description='List of input data locations', default_factory=list)]
label: Annotated[Optional[str], Field(description='Label for the work step', json_schema_extra={'examples': ['Data Processing Step']}, default=None)]
memory_gb: Annotated[Optional[float], Field(description='Amount of memory in GB required', json_schema_extra={'examples': [16]}, default=None)]
outputs: Annotated[Optional[list[DataLocationModel]], Field(description='List of output data locations', default_factory=list)]
parameters_json: Annotated[Optional[dict], Field(description='Parameters in JSON format', json_schema_extra={'examples': [{'param1': 'value1', 'param2': 10}]}, default_factory=dict)]
parent_workstep_id: Annotated[Optional[str], Field(description='Unique parent work step id', json_schema_extra={'examples': ['workstep-4321']}, default=None)]
progress: Annotated[Optional[float], Field(description='Progress percentage of the work step', json_schema_extra={'examples': [0.0]}, default=0.0)]
provenance_json: Annotated[Optional[dict], Field(description='Provenance information in JSON format', json_schema_extra={'examples': [{'source': 'dataset-xyz', 'method': 'automated'}]}, default_factory=dict)]
requires_gpu: Annotated[Optional[bool], Field(description='Whether GPU is required', json_schema_extra={'examples': [False]}, default=None)]
site: Annotated[str, Field(description='Site where the work step is executed', json_schema_extra={'examples': ['CHSRC']})]
software_id: Annotated[Optional[str], Field(description='Unique software id', json_schema_extra={'examples': ['software-9012']}, default=None)]
started_at: Annotated[Optional[str], Field(description='Timestamp when the work step started', json_schema_extra={'examples': ['2024-01-01T12:30:00Z']}, default=None)]
state: Annotated[Optional[ExecutionState], Field(description='Current state of the work step', json_schema_extra={'examples': ['defined']}, default=ExecutionState.defined)]
walltime_minutes: Annotated[Optional[int], Field(description='Walltime in minutes', json_schema_extra={'examples': [120]}, default=None)]
workflow_id: Annotated[Optional[str], Field(description='Unique workflow id', json_schema_extra={'examples': ['workflow-5678']}, default=None)]
class ska_src_api_global_execution.models.workstep.WorkStepModelV1(/, **data)

Bases: pydantic.BaseModel

digraph inheritance7fa9439ab2 { bgcolor=transparent; rankdir=LR; size="8.0, 12.0"; "BaseModel" [fillcolor=white,fontname="Vera Sans, DejaVu Sans, Liberation Sans, Arial, Helvetica, sans",fontsize=10,height=0.25,shape=box,style="setlinewidth(0.5),filled",tooltip="!!! abstract \"Usage Documentation\""]; "WorkStepModelV1" [URL="#ska_src_api_global_execution.models.workstep.WorkStepModelV1",fillcolor=white,fontname="Vera Sans, DejaVu Sans, Liberation Sans, Arial, Helvetica, sans",fontsize=10,height=0.25,shape=box,style="setlinewidth(0.5),filled",target="_top",tooltip="The work step model for version 1 of the API."]; "BaseModel" -> "WorkStepModelV1" [arrowsize=0.5,style="setlinewidth(0.5)"]; }

The work step model for version 1 of the API.

container_image: Annotated[str, Field(description='Container image to be used', json_schema_extra={'examples': ['python:3.8-slim']})]
created_by: Annotated[Optional[str], Field(description='User who created the work step', json_schema_extra={'examples': ['user-abc']}, default=None)]
description: Annotated[Optional[str], Field(description='Description of the work step', json_schema_extra={'examples': ['This work step processes data files.']}, default=None)]
executable_entrypoint: Annotated[str, Field(description='Executable entrypoint', json_schema_extra={'examples': ['python main.py']})]
execution: Annotated[ExecutionType, Field(description='Execution environment', json_schema_extra={'examples': ['batch']})]
finished_at: Annotated[Optional[str], Field(description='Timestamp when the work step completed', json_schema_extra={'examples': ['2024-01-01T14:00:00Z']}, default=None)]
id: Annotated[str, Field(description='Unique work step id', json_schema_extra={'examples': ['103dd36e-0877-4e2e-be20-a73792940afb']}, default_factory=lambda: str(uuid.uuid4()))]
input_data: Annotated[Optional[list[str]], Field(description='List of input data URIs', json_schema_extra={'examples': [['s3://bucket/input1.fits', 's3://bucket/input2.fits']]}, default_factory=list)]
output_data: Annotated[Optional[list[str]], Field(description='List of output data URIs', json_schema_extra={'examples': [['s3://bucket/output1.fits', 's3://bucket/output2.fits']]}, default_factory=list)]
parameters: Annotated[Optional[str], Field(description='Arguments for the executable', json_schema_extra={'examples': ['--input data.txt --output result.txt']}, default=None)]
provenance_json: Annotated[Optional[dict], Field(description='Provenance information in JSON format', json_schema_extra={'examples': [{'source': 'dataset-xyz', 'method': 'automated'}]}, default_factory=dict)]
started_at: Annotated[Optional[str], Field(description='Timestamp when the work step started', json_schema_extra={'examples': ['2024-01-01T12:30:00Z']}, default=None)]
state: Annotated[Optional[ExecutionState], Field(description='Current state of the work step', json_schema_extra={'examples': ['defined']}, default=ExecutionState.defined)]
system_parameters: Annotated[Optional[SystemParameters], Field(description='System parameters for the work step', json_schema_extra={'examples': [{'src_node': ['CHSRC', 'INSRC'], 'max_walltime_hours': 4, 'cpu_cores': 4, 'memory_gb': 16.0, 'requires_gpu': False, 'paramx': 42}]}, default_factory=SystemParameters)]
workflow_id: Annotated[Optional[str], Field(description='Unique workflow id', json_schema_extra={'examples': ['workflow-5678']}, default=None)]