poiesis.core.services.torc package¶
Submodules¶
poiesis.core.services.torc.torc module¶
Task orchestrator (Torc).
- class poiesis.core.services.torc.torc.Torc(task)[source]¶
Bases:
objectTorc service.
- Parameters:
task (
TesTask) – Task object from task request
- task¶
Task object from task request
- kubernetes_client¶
Kubernetes client
- pvc_name¶
Name of the PVC created
- async create_pvc(name, size)[source]¶
Create a PVC for the task.
Tif and Tof will use this PVC to read and write data, and executor will the data from the PVC for its use.
- Parameters:
name (
str) – Name of the PVCsize (
float|None) – Size of the PVC
- Raises:
Exception – If the PVC creation fails.
- Return type:
None
- async execute()[source]¶
Defines the template method, for each service namely Texam, Tif, Tof.
- Return type:
None
- async texam_execution(task)[source]¶
Execute the Texam job.
- Parameters:
task (
TesTask) – The TES task that needs to be executed.- Raises:
Exception – If the Texam job fails.
- Return type:
None
- async tif_execution(name, inputs)[source]¶
Execute the Tif job.
- Parameters:
name (
str) – Name of the task, will be modified to create Tif job name.inputs (
list[TesInput] |None) – List of inputs given in the task.volumes – List of volumes given in the task.
- Raises:
Exception – If the Tif job fails.
- Return type:
None
poiesis.core.services.torc.torc_execution_template module¶
Torc’s template for each service.
- class poiesis.core.services.torc.torc_execution_template.TorcExecutionTemplate[source]¶
Bases:
ABCTorcTemplate is a template class for the Torc service.
- kubernetes_client¶
Kubernetes client.
- message_broker¶
Message broker.
- message¶
Message for the message broker, which would be sent to TOrc.
- db¶
Database client.
- id¶
Task identifier
- async create_job(task_id, job_name, commands, metadata)[source]¶
Create the K8s filer job.
TIF and TOF jobs are created using this method.
- Parameters:
task_id (
str) – The id of the task.job_name (
str) – The name of the job, either TIF or TOF.commands (
list[str]) – The filer commands to run.args – The arguments to pass to the filer commands.
metadata (
V1ObjectMeta) – The metadata for the job to be used in K8s manifest.
- Return type:
None
- async execute()[source]¶
Defines the template method, for each service namely Texam, Tif, Tof.
- Return type:
None
- abstract property id: str¶
Task identifier - must be implemented by subclasses.
poiesis.core.services.torc.torc_texam_execution module¶
Create Texam Job and monitor it.
- class poiesis.core.services.torc.torc_texam_execution.TorcTexamExecution(task)[source]¶
Bases:
TorcExecutionTemplateTif execution class.
This class is responsible for creating the Texam Job and monitoring it.
- Parameters:
task (
TesTask) – The TES task that needs to be executed.
- id¶
The id of the TES task.
- task¶
The TES task that needs to be executed.
- kubernetes_client¶
Kubernetes
- message_broker¶
Message broker.
- message¶
Message for the message broker.
- property id: str¶
Return the task ID.
poiesis.core.services.torc.torc_tif_execution module¶
Create Tif Job and monitor it.
- class poiesis.core.services.torc.torc_tif_execution.TorcTifExecution(id, inputs)[source]¶
Bases:
TorcExecutionTemplateTif execution class.
This class is responsible for creating the Tif Job.
- Parameters:
name – The name of the TES task will be modified for Tif Job.
inputs (
list[TesInput] |None) – The list of inputs that Tif will create and monitor.
- name¶
The name of the TES task will be modified for Tif Job.
- inputs¶
The list of inputs that Tif will create and monitor.
- message_broker¶
Message broker client.
- message¶
Message for the message broker which would to sent to TOrc.
- kubernetes_client¶
Kubernetes client.
- property id: str¶
Return the task ID.
poiesis.core.services.torc.torc_tof_execution module¶
Create TOF Job and monitor it.
- class poiesis.core.services.torc.torc_tof_execution.TorcTofExecution(id, outputs)[source]¶
Bases:
TorcExecutionTemplateTOF execution class.
This class is responsible for creating the Tof Job.
- Parameters:
name – The name of the TES task will be modified for TOF Job.
outputs (
list[TesOutput] |None) – The list of outputs that Tof will create and monitor.
- name¶
The name of the TES task will be modified for TOF Job.
- outputs¶
The list of outputs that TOF will create and monitor.
- message_broker¶
Message broker client.
- message¶
Message for the message broker which would to sent to TOrc.
- kubernetes_client¶
Kubernetes client.
- property id: str¶
Return the task ID.
Module contents¶
Task orchestrator (Torc).