ska_oso_pdm.entities.common.procedures

The procedures modules 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. The contents of the modules are presented in the diagram below.

../../../_images/procedures.png

Class diagram for the procedure module

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

# JSON modelled specifically by procedures
...
"activities":{
  "allocate": {
    "procedure_type": "filesystemscript",
    "path": "/path/to/allocatescript.py",
    "default_args": {
      "init": {"args": ["posarg1","posarg2"],
        "kwargs": {"argname": "argval"}
      },
      "run": {
        "args": ["posarg1","posarg2"],
        "kwargs": {"argname": "argval"
        }
      }
    }
  },
  "observe": {
    "procedure_type": "gitscript",
    "path": "/relative/path/to/scriptinsiderepo.py",
    "repo": "https://gitlab.com/script_repo/operational_scripts",
    "branch": "main",
    "default_args": {
      "init": {"args": ["posarg1","posarg2"],
        "kwargs": {"argname": "argval"}
      },
      "run": {
        "args": ["posarg1","posarg2"],
        "kwargs": {"argname": "argval"
        }
      }
    }
  }
}

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

class EmbeddedScript(content: str, default_args: Dict[str, ska_oso_pdm.entities.common.procedures.PythonArguments] = None)[source]

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

class FileSystemScript(path: str, default_args: Dict[str, ska_oso_pdm.entities.common.procedures.PythonArguments] = None)[source]

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

class GitScript(repo: str, path: str, branch: Optional[str] = None, commit: Optional[str] = None, default_args: Dict[str, ska_oso_pdm.entities.common.procedures.PythonArguments] = None)[source]

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