예제 #1
0
    def _assert_successful_run_completion(self, host: Text, run_id: Text,
                                          pipeline_name: Text,
                                          timeout: datetime.timedelta):
        """Waits and asserts a successful KFP pipeline execution.

    Args:
      host: the endpoint of the KFP deployment.
      run_id: the run ID of the execution, can be obtained from the respoonse
        when submitting the pipeline.
      pipeline_name: the name of the pipeline under test.
      timeout: maximal waiting time for this execution, in timedelta.

    Raises:
      RuntimeError: when timeout exceeds after waiting for specified duration.
    """

        status = kubeflow_test_utils.poll_kfp_with_retry(
            host=host,
            run_id=run_id,
            retry_limit=self._N_RETRIES,
            timeout=timeout,
            polling_interval=self._POLLING_INTERVAL)

        workflow_log = self._get_workflow_log(pipeline_name)

        self.assertEqual(
            status.lower(), kubeflow_test_utils.KFP_SUCCESS_STATUS,
            'Pipeline %s failed to complete successfully: %s' %
            (pipeline_name, workflow_log))
예제 #2
0
 def _wait_until_completed(self, run_id: str):
   # This timeout will never expire. polling_count * interval == 20min.
   timeout = datetime.timedelta(hours=1)
   end_state = kubeflow_test_utils.poll_kfp_with_retry(
       self._endpoint, run_id, self._MAX_POLLING_COUNT, timeout,
       self._POLLING_INTERVAL_IN_SECONDS)
   self.assertEqual(end_state.lower(), kubeflow_test_utils.KFP_SUCCESS_STATUS)
예제 #3
0
 def _wait_until_completed(self, run_id: str):
     end_state = kubeflow_test_utils.poll_kfp_with_retry(
         self._endpoint, run_id, self._RETRY_LIMIT, self._TIME_OUT,
         self._POLLING_INTERVAL_IN_SECONDS)
     self.assertEqual(end_state.lower(),
                      kubeflow_test_utils.KFP_SUCCESS_STATUS)