Search in sources :

Example 31 with StageExecutorResult

use of pipelite.stage.executor.StageExecutorResult in project pipelite by enasequence.

the class AbstractLsfExecutor method bhist.

private static String bhist(CmdRunner cmdRunner, String jobId) {
    log.atWarning().log("Checking LSF job results using bhist: " + jobId);
    StageExecutorResult bhistResult = cmdRunner.execute(BHIST_CMD + jobId);
    return bhistResult.getStageLog();
}
Also used : StageExecutorResult(pipelite.stage.executor.StageExecutorResult)

Example 32 with StageExecutorResult

use of pipelite.stage.executor.StageExecutorResult in project pipelite by enasequence.

the class AbstractLsfExecutor method recoverJobUsingBhist.

private static boolean recoverJobUsingBhist(CmdRunner cmdRunner, JobResult jobResult) {
    StageExecutorResult executorResult = extractResultFromBhistOutputOrOutFile(bhist(cmdRunner, jobResult.jobId));
    if (executorResult != null) {
        log.atInfo().log("Recovered job result using LSF bhist for job: " + jobResult.jobId);
        jobResult.result = executorResult;
        return true;
    } else {
        log.atWarning().log("Could not recover job result using LSF bhist for job: " + jobResult.jobId);
        return false;
    }
}
Also used : StageExecutorResult(pipelite.stage.executor.StageExecutorResult)

Example 33 with StageExecutorResult

use of pipelite.stage.executor.StageExecutorResult in project pipelite by enasequence.

the class DescribeJobs method getResult.

/**
 * Returns the stage executor result (active, success, error) for the describe job request. If the
 * result is success or error then the request is removed.
 *
 * @param request the request
 * @return the result
 * @throws PipeliteTimeoutException if no result has been available for a request within the
 *     request timeout
 */
public StageExecutorResult getResult(RequestContext request, List<Integer> permanentErrors) {
    if (!this.requests.containsKey(request)) {
        addRequest(request);
    }
    StageExecutorResult result = this.requests.get(request);
    if (!result.isActive()) {
        removeRequest(request);
        setPermanentError(result, permanentErrors);
    }
    return result;
}
Also used : StageExecutorResult(pipelite.stage.executor.StageExecutorResult)

Aggregations

StageExecutorResult (pipelite.stage.executor.StageExecutorResult)33 Test (org.junit.jupiter.api.Test)14 PipeliteException (pipelite.exception.PipeliteException)5 Stage (pipelite.stage.Stage)5 AtomicInteger (java.util.concurrent.atomic.AtomicInteger)4 KubernetesClientException (io.fabric8.kubernetes.client.KubernetesClientException)3 Collectors (java.util.stream.Collectors)3 IntStream (java.util.stream.IntStream)3 AssertionsForClassTypes.assertThat (org.assertj.core.api.AssertionsForClassTypes.assertThat)3 Mockito.mock (org.mockito.Mockito.mock)3 SpringBootTest (org.springframework.boot.test.context.SpringBootTest)3 ServiceConfiguration (pipelite.configuration.ServiceConfiguration)3 InternalErrorService (pipelite.service.InternalErrorService)3 Pod (io.fabric8.kubernetes.api.model.Pod)2 DefaultKubernetesClient (io.fabric8.kubernetes.client.DefaultKubernetesClient)2 KubernetesClient (io.fabric8.kubernetes.client.KubernetesClient)2 ZonedDateTime (java.time.ZonedDateTime)2 AtomicReference (java.util.concurrent.atomic.AtomicReference)2 StageEntity (pipelite.entity.StageEntity)2 ContainerStatus (io.fabric8.kubernetes.api.model.ContainerStatus)1