|
3 | 3 | import org.json.JSONObject; |
4 | 4 | import org.labkey.api.data.Container; |
5 | 5 | import org.labkey.api.module.ModuleLoader; |
| 6 | +import org.labkey.api.pipeline.PipeRoot; |
| 7 | +import org.labkey.api.pipeline.PipelineService; |
6 | 8 | import org.labkey.api.sequenceanalysis.pipeline.JobResourceSettings; |
7 | 9 | import org.labkey.api.sequenceanalysis.pipeline.ToolParameterDescriptor; |
8 | 10 | import org.labkey.primeseq.PrimeseqModule; |
9 | 11 |
|
10 | 12 | import java.util.Arrays; |
| 13 | +import java.util.Collection; |
| 14 | +import java.util.HashSet; |
11 | 15 | import java.util.List; |
| 16 | +import java.util.Set; |
12 | 17 |
|
13 | 18 | /** |
14 | 19 | * Created by bimber on 9/30/2016. |
@@ -43,4 +48,37 @@ public boolean isAvailable(Container c) |
43 | 48 | { |
44 | 49 | return c.getActiveModules().contains(ModuleLoader.getInstance().getModule(PrimeseqModule.class)); |
45 | 50 | } |
| 51 | + |
| 52 | + @Override |
| 53 | + public Collection<String> getDockerVolumes(Container c) |
| 54 | + { |
| 55 | + Set<String> volumes = new HashSet<>(); |
| 56 | + volumes.add("/home/groups/prime-seq"); |
| 57 | + volumes.add("/home/exacloud/gscratch"); |
| 58 | + |
| 59 | + PipeRoot pr = PipelineService.get().findPipelineRoot(c); |
| 60 | + if (pr != null && pr.getRootPath().exists()) |
| 61 | + { |
| 62 | + if (pr.getRootPath().getPath().startsWith("/home/groups/")) |
| 63 | + { |
| 64 | + String folderName = pr.getRootPath().getPath().replaceAll("^/home/groups/", "").split("/")[0]; |
| 65 | + volumes.add("/home/groups/" + folderName); |
| 66 | + } |
| 67 | + } |
| 68 | + |
| 69 | + if (c.isWorkbook()) |
| 70 | + { |
| 71 | + PipeRoot pr2 = PipelineService.get().findPipelineRoot(c.getParent()); |
| 72 | + if (pr2 != null && pr2.getRootPath().exists()) |
| 73 | + { |
| 74 | + if (pr2.getRootPath().getPath().startsWith("/home/groups/")) |
| 75 | + { |
| 76 | + String folderName = pr2.getRootPath().getPath().replaceAll("^/home/groups/", "").split("/")[0]; |
| 77 | + volumes.add("/home/groups/" + folderName); |
| 78 | + } |
| 79 | + } |
| 80 | + } |
| 81 | + |
| 82 | + return volumes; |
| 83 | + } |
46 | 84 | } |
0 commit comments