Skip to content

Commit 8f1321e

Browse files
committed
analysis: mount fast ephimeral directory, #TASK-6445
1 parent a7002ed commit 8f1321e

File tree

2 files changed

+8
-1
lines changed

2 files changed

+8
-1
lines changed

opencga-analysis/src/main/java/org/opencb/opencga/analysis/tools/OpenCgaDockerToolScopeStudy.java

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@
1212
import java.io.IOException;
1313
import java.nio.file.Files;
1414
import java.nio.file.Path;
15+
import java.nio.file.Paths;
1516
import java.util.*;
1617
import java.util.stream.Stream;
1718

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

2527
protected InputFileUtils inputFileUtils;
2628

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

3538
@Override

opencga-analysis/src/main/java/org/opencb/opencga/analysis/workflow/NextFlowExecutor.java

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -191,6 +191,10 @@ protected void run() throws Exception {
191191
dockerInputBindings.add(new AbstractMap.SimpleEntry<>(path.toString(), path.toString()));
192192
}
193193

194+
// Mount ephimeral directory
195+
dockerInputBindings.add(new AbstractMap.SimpleEntry<>(ephimeralDir.toAbsolutePath().toString(),
196+
ephimeralDir.toAbsolutePath().toString()));
197+
194198
// Write nextflow.config file
195199
URL nextflowConfig = getClass().getResource("/nextflow.config");
196200
Path nextflowConfigPath;
@@ -234,7 +238,7 @@ protected void run() throws Exception {
234238
// Set HOME environment variable to the temporal input directory. This is because nextflow creates a hidden folder there and,
235239
// when nextflow runs on other dockers, we need to store those files in a path shared between the parent docker and the host
236240
// TODO: Temporal solution
237-
dockerParams.put("-e", "HOME=" + temporalInputDir + " -e OPENCGA_TOKEN=" + getExpiringToken());
241+
dockerParams.put("-e", "HOME=" + ephimeralDir + " -e OPENCGA_TOKEN=" + getExpiringToken());
238242

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

0 commit comments

Comments
 (0)