Ejemplo n.º 1
0
 def get_task_runs(self, instance_id):
     """
     :param instance_id: The instance id of the task
     :return: Returns all active and completed tasks of the given instance
     """
     request = task.GetRequest(jobId=peloton.JobID(value=self.job_id),
                               instanceId=instance_id)
     resp = self.client.task_svc.Get(
         request,
         metadata=self.client.jobmgr_metadata,
         timeout=self.config.rpc_timeout_sec,
     )
     assert not resp.HasField("notFound")
     assert not resp.HasField("outOfRange")
     return resp.results
Ejemplo n.º 2
0
 def get_task_info(self, instance_id):
     """
     :param instance_id: The instance id of the task
     :return: The task info for the instance id
     """
     request = task.GetRequest(jobId=peloton.JobID(value=self.job_id),
                               instanceId=instance_id)
     resp = self.client.task_svc.Get(
         request,
         metadata=self.client.jobmgr_metadata,
         timeout=self.config.rpc_timeout_sec,
     )
     assert not resp.HasField("notFound")
     assert not resp.HasField("outOfRange")
     return resp.result