Skip to content

Commit

Permalink
analysis: mount fast ephimeral directory, #TASK-6445
Browse files Browse the repository at this point in the history
  • Loading branch information
pfurio committed Jan 28, 2025
1 parent a7002ed commit 8f1321e
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
import java.io.IOException;
import java.nio.file.Files;
import java.nio.file.Path;
import java.nio.file.Paths;
import java.util.*;
import java.util.stream.Stream;

Expand All @@ -21,6 +22,7 @@ public abstract class OpenCgaDockerToolScopeStudy extends OpenCgaToolScopeStudy
protected List<AbstractMap.SimpleEntry<String, String>> dockerInputBindings;
// Directory where temporal input files will be stored
protected Path temporalInputDir;
protected Path ephimeralDir;

protected InputFileUtils inputFileUtils;

Expand All @@ -30,6 +32,7 @@ protected void check() throws Exception {
this.dockerInputBindings = new LinkedList<>();
this.temporalInputDir = Files.createDirectory(getOutDir().resolve(".opencga_input"));
this.inputFileUtils = new InputFileUtils(catalogManager);
this.ephimeralDir = Paths.get("/usr/share/pod");
}

@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -191,6 +191,10 @@ protected void run() throws Exception {
dockerInputBindings.add(new AbstractMap.SimpleEntry<>(path.toString(), path.toString()));
}

// Mount ephimeral directory
dockerInputBindings.add(new AbstractMap.SimpleEntry<>(ephimeralDir.toAbsolutePath().toString(),
ephimeralDir.toAbsolutePath().toString()));

// Write nextflow.config file
URL nextflowConfig = getClass().getResource("/nextflow.config");
Path nextflowConfigPath;
Expand Down Expand Up @@ -234,7 +238,7 @@ protected void run() throws Exception {
// Set HOME environment variable to the temporal input directory. This is because nextflow creates a hidden folder there and,
// when nextflow runs on other dockers, we need to store those files in a path shared between the parent docker and the host
// TODO: Temporal solution
dockerParams.put("-e", "HOME=" + temporalInputDir + " -e OPENCGA_TOKEN=" + getExpiringToken());
dockerParams.put("-e", "HOME=" + ephimeralDir + " -e OPENCGA_TOKEN=" + getExpiringToken());

// dockerParams.put("-e", "HOME=" + temporalInputDir);
// dockerParams.put("-e", "OPENCGA_TOKEN=" + getExpiringToken());
Expand Down

0 comments on commit 8f1321e

Please sign in to comment.