Search in sources :

Example 11 with StageExecutorRequest

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

the class SimpleLsfExecutorSubmitCmdTest method cmdMemUnitsMNoDuration.

@Test
public void cmdMemUnitsMNoDuration() throws IOException {
    SimpleLsfExecutor executor = new SimpleLsfExecutor();
    executor.setCmd("test");
    SimpleLsfExecutorParameters params = SimpleLsfExecutorParameters.builder().logDir(Files.createTempDirectory("TEMP").toString()).cpu(2).memory(1).memoryUnits("M").queue("TEST").timeout(Duration.ofMinutes(1)).build();
    executor.setExecutorParams(params);
    Stage stage = Stage.builder().stageName(STAGE_NAME).executor(executor).build();
    StageExecutorRequest request = StageExecutorRequest.builder().pipelineName(PIPELINE_NAME).processId(PROCESS_ID).stage(stage).build();
    String logDir = "\"" + params.resolveLogDir(request, LsfFilePathResolver.Format.WITH_LSF_PATTERN) + "\"";
    String logFileName = params.resolveLogFileName(request);
    executor.setOutFile(params.resolveLogDir(request, LsfFilePathResolver.Format.WITHOUT_LSF_PATTERN));
    String submitCmd = executor.getSubmitCmd(request);
    assertThat(submitCmd).isEqualTo("bsub" + " -outdir " + logDir + " -cwd " + logDir + " -oo " + logFileName + " -n 2 -M 1M -R \"rusage[mem=1M]\" -W 1 -q TEST test");
}
Also used : StageExecutorRequest(pipelite.stage.executor.StageExecutorRequest) Stage(pipelite.stage.Stage) SimpleLsfExecutorParameters(pipelite.stage.parameters.SimpleLsfExecutorParameters) Test(org.junit.jupiter.api.Test)

Example 12 with StageExecutorRequest

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

the class SimpleLsfExecutorSubmitCmdTest method cmdNoMemUnits.

@Test
public void cmdNoMemUnits() throws IOException {
    SimpleLsfExecutor executor = new SimpleLsfExecutor();
    executor.setCmd("test");
    SimpleLsfExecutorParameters params = SimpleLsfExecutorParameters.builder().logDir(Files.createTempDirectory("TEMP").toString()).cpu(2).memory(1).memoryTimeout(Duration.ofMinutes(1)).queue("TEST").timeout(Duration.ofMinutes(1)).build();
    executor.setExecutorParams(params);
    Stage stage = Stage.builder().stageName(STAGE_NAME).executor(executor).build();
    StageExecutorRequest request = StageExecutorRequest.builder().pipelineName(PIPELINE_NAME).processId(PROCESS_ID).stage(stage).build();
    String logDir = "\"" + params.resolveLogDir(request, LsfFilePathResolver.Format.WITH_LSF_PATTERN) + "\"";
    String logFileName = params.resolveLogFileName(request);
    executor.setOutFile(params.resolveLogDir(request, LsfFilePathResolver.Format.WITHOUT_LSF_PATTERN));
    String submitCmd = executor.getSubmitCmd(request);
    assertThat(submitCmd).isEqualTo("bsub" + " -outdir " + logDir + " -cwd " + logDir + " -oo " + logFileName + " -n 2 -M 1 -R \"rusage[mem=1:duration=1]\" -W 1 -q TEST test");
}
Also used : StageExecutorRequest(pipelite.stage.executor.StageExecutorRequest) Stage(pipelite.stage.Stage) SimpleLsfExecutorParameters(pipelite.stage.parameters.SimpleLsfExecutorParameters) Test(org.junit.jupiter.api.Test)

Example 13 with StageExecutorRequest

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

the class SimpleLsfExecutorSubmitCmdTest method cmdNoMemUnitsNoDuration.

@Test
public void cmdNoMemUnitsNoDuration() throws IOException {
    SimpleLsfExecutor executor = new SimpleLsfExecutor();
    executor.setCmd("test");
    SimpleLsfExecutorParameters params = SimpleLsfExecutorParameters.builder().logDir(Files.createTempDirectory("TEMP").toString()).cpu(2).memory(1).queue("TEST").timeout(Duration.ofMinutes(1)).build();
    executor.setExecutorParams(params);
    Stage stage = Stage.builder().stageName(STAGE_NAME).executor(executor).build();
    StageExecutorRequest request = StageExecutorRequest.builder().pipelineName(PIPELINE_NAME).processId(PROCESS_ID).stage(stage).build();
    String logDir = "\"" + params.resolveLogDir(request, LsfFilePathResolver.Format.WITH_LSF_PATTERN) + "\"";
    String logFileName = params.resolveLogFileName(request);
    executor.setOutFile(params.resolveLogDir(request, LsfFilePathResolver.Format.WITHOUT_LSF_PATTERN));
    String submitCmd = executor.getSubmitCmd(request);
    assertThat(submitCmd).isEqualTo("bsub" + " -outdir " + logDir + " -cwd " + logDir + " -oo " + logFileName + " -n 2 -M 1 -R \"rusage[mem=1]\" -W 1 -q TEST test");
}
Also used : StageExecutorRequest(pipelite.stage.executor.StageExecutorRequest) Stage(pipelite.stage.Stage) SimpleLsfExecutorParameters(pipelite.stage.parameters.SimpleLsfExecutorParameters) Test(org.junit.jupiter.api.Test)

Example 14 with StageExecutorRequest

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

the class SimpleLsfExecutorSubmitCmdTest method cmdJobGroup.

@Test
public void cmdJobGroup() throws IOException {
    SimpleLsfExecutor executor = new SimpleLsfExecutor();
    executor.setCmd("test");
    SimpleLsfExecutorParameters params = SimpleLsfExecutorParameters.builder().logDir(Files.createTempDirectory("TEMP").toString()).cpu(2).jobGroup("testGroup").timeout(Duration.ofMinutes(1)).queue("TEST").build();
    executor.setExecutorParams(params);
    Stage stage = Stage.builder().stageName(STAGE_NAME).executor(executor).build();
    StageExecutorRequest request = StageExecutorRequest.builder().pipelineName(PIPELINE_NAME).processId(PROCESS_ID).stage(stage).build();
    String logDir = "\"" + params.resolveLogDir(request, LsfFilePathResolver.Format.WITH_LSF_PATTERN) + "\"";
    String logFileName = params.resolveLogFileName(request);
    executor.setOutFile(params.resolveLogDir(request, LsfFilePathResolver.Format.WITHOUT_LSF_PATTERN));
    ;
    String submitCmd = executor.getSubmitCmd(request);
    assertThat(submitCmd).isEqualTo("bsub" + " -outdir " + logDir + " -cwd " + logDir + " -oo " + logFileName + " -n 2 -W 1 -g testGroup -q TEST test");
}
Also used : StageExecutorRequest(pipelite.stage.executor.StageExecutorRequest) Stage(pipelite.stage.Stage) SimpleLsfExecutorParameters(pipelite.stage.parameters.SimpleLsfExecutorParameters) Test(org.junit.jupiter.api.Test)

Example 15 with StageExecutorRequest

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

the class LsfDefinitionFilePathResolverTest method request.

private final StageExecutorRequest request() {
    Stage stage = Mockito.mock(Stage.class);
    when(stage.getStageName()).thenReturn(STAGE_NAME);
    StageExecutorRequest request = new StageExecutorRequest(PIPELITE_NAME, PROCESS_ID, stage);
    return request;
}
Also used : StageExecutorRequest(pipelite.stage.executor.StageExecutorRequest) Stage(pipelite.stage.Stage)

Aggregations

StageExecutorRequest (pipelite.stage.executor.StageExecutorRequest)21 Test (org.junit.jupiter.api.Test)18 Stage (pipelite.stage.Stage)13 AbstractLsfExecutorParameters (pipelite.stage.parameters.AbstractLsfExecutorParameters)6 LsfExecutorParameters (pipelite.stage.parameters.LsfExecutorParameters)6 SimpleLsfExecutorParameters (pipelite.stage.parameters.SimpleLsfExecutorParameters)6 LsfFilePathResolver (pipelite.stage.path.LsfFilePathResolver)2 LsfLogFilePathResolver (pipelite.stage.path.LsfLogFilePathResolver)2 AtomicReference (java.util.concurrent.atomic.AtomicReference)1 StageExecutorResult (pipelite.stage.executor.StageExecutorResult)1 LsfDefinitionFilePathResolver (pipelite.stage.path.LsfDefinitionFilePathResolver)1