|
4 | 4 | import org.labkey.api.cluster.ClusterService; |
5 | 5 | import org.labkey.api.data.Container; |
6 | 6 | import org.labkey.api.pipeline.PipelineJob; |
| 7 | +import org.labkey.api.pipeline.PipelineJobService; |
7 | 8 | import org.labkey.api.pipeline.PipelineValidationException; |
8 | 9 | import org.labkey.api.pipeline.RemoteExecutionEngine; |
9 | 10 | import org.labkey.api.pipeline.TaskId; |
@@ -86,22 +87,40 @@ public File getSerializedJobFile(File jobLogFile) |
86 | 87 | @Override |
87 | 88 | public File getExpectedSubmitScript(PipelineJob job) |
88 | 89 | { |
89 | | - if (job.getActiveTaskFactory() != null) |
| 90 | + if (job.isActiveTaskLocal()) |
| 91 | + { |
| 92 | + //nothing to do: |
| 93 | + return null; |
| 94 | + } |
| 95 | + else if (job.getActiveTaskFactory() != null) |
90 | 96 | { |
91 | 97 | String location = job.getActiveTaskFactory().getExecutionLocation(); |
92 | | - if (SlurmExecutionEngine.TYPE.equals(location)) |
93 | | - { |
94 | | - return SlurmExecutionEngine.getExpectedSubmitScript(job); |
95 | | - } |
96 | | - else if (HTCondorExecutionEngine.TYPE.equals(location)) |
| 98 | + for (RemoteExecutionEngine<?> engine : PipelineJobService.get().getRemoteExecutionEngines()) |
97 | 99 | { |
98 | | - return HTCondorExecutionEngine.getExpectedSubmitScript(job); |
| 100 | + if (location.equals(engine.getConfig().getLocation())) |
| 101 | + { |
| 102 | + if (SlurmExecutionEngine.TYPE.equals(engine.getType())) |
| 103 | + { |
| 104 | + return SlurmExecutionEngine.getExpectedSubmitScript(job); |
| 105 | + } |
| 106 | + else if (HTCondorExecutionEngine.TYPE.equals(engine.getType())) |
| 107 | + { |
| 108 | + return HTCondorExecutionEngine.getExpectedSubmitScript(job); |
| 109 | + } |
| 110 | + |
| 111 | + job.getLogger().error("Unknown execution engine type: " + engine.getType()); |
| 112 | + return null; |
| 113 | + } |
99 | 114 | } |
100 | | - } |
101 | | - |
102 | | - job.getLogger().error("Unable to find appropriate remote execution engine for job: " + job.getJobGUID() + ", with active task factory: " + (job.getActiveTaskFactory() != null ? job.getActiveTaskFactory().getId() : " null")); |
103 | 115 |
|
104 | | - return null; |
| 116 | + job.getLogger().error("Unable to find remote execution engine for location: " + location); |
| 117 | + return null; |
| 118 | + } |
| 119 | + else |
| 120 | + { |
| 121 | + job.getLogger().error("TaskFactory is null, cannot identify submit script"); |
| 122 | + return null; |
| 123 | + } |
105 | 124 | } |
106 | 125 |
|
107 | 126 | @Override |
|
0 commit comments