ska_oso_pdm.sb_definition.procedures

The ska_oso_pdm.sb_definition.procedures module models SB entities concerned with the script execution requirements. This includes the scripts that should process the SB and the git identifier, including the repository and branch.

../../_images/ska_oso_pdm_sb_definition_procedures.svg

Class diagram for the procedure module

An example serialisation of this model to JSON is shown below.

  "activities": {
    "allocate": {
      "kind": "filesystem",
      "path": "file:///path/to/allocatescript.py",
      "function_args": {
        "init": {
          "args": [
            "posarg1",
            "posarg2"
          ],
          "kwargs": {
            "argname": "argval"
          }
        },
        "main": {
          "args": [
            "posarg1",
            "posarg2"
          ],
          "kwargs": {
            "argname": "argval"
          }
        }
      }
    },
    "observe": {
      "kind": "git",
      "path": "git://relative/path/to/scriptinsiderepo.py",
      "repo": "https://gitlab.com/script_repo/operational_scripts",
      "branch": "main",
      "function_args": {
        "init": {
          "args": [
            "posarg1",
            "posarg2"
          ],
          "kwargs": {
            "argname": "argval"
          }
        },
        "main": {
          "args": [
            "posarg1",
            "posarg2"
          ],
          "kwargs": {
            "argname": "argval"
          }
        }
      }
    }
  },

The procedures module defines a representation of the procedures listed in the activities of the SKA scheduling block.

class FilesystemScript(*, function_args: dict[str, PythonArguments] = None, kind: Literal[ScriptKind.FILESYSTEM] = ScriptKind.FILESYSTEM, path: str)[source]

Represents an FilesystemScript to be run as an activity in an SKA scheduling block.

class GitScript(*, function_args: dict[str, PythonArguments] = None, kind: Literal[ScriptKind.GIT] = ScriptKind.GIT, path: str, repo: str, branch: str | None = None, commit: str | None = None)[source]

Represents an GitScript to be run as an activity in an SKA scheduling block.

class InlineScript(*, function_args: dict[str, PythonArguments] = None, kind: Literal[ScriptKind.INLINE] = ScriptKind.INLINE, content: str)[source]

Represents an InlineScript to be ran as an activity in an SKA scheduling block.