|
2 | 2 |
|
3 | 3 | import org.apache.commons.io.FileUtils; |
4 | 4 | import org.apache.commons.lang3.StringUtils; |
5 | | -import org.apache.commons.lang3.SystemUtils; |
6 | 5 | import org.jetbrains.annotations.Nullable; |
7 | 6 | import org.json.JSONObject; |
8 | 7 | import org.junit.AfterClass; |
9 | 8 | import org.junit.Assert; |
10 | 9 | import org.junit.Before; |
11 | 10 | import org.junit.BeforeClass; |
12 | 11 | import org.junit.Test; |
13 | | -import org.labkey.api.module.ModuleLoader; |
14 | 12 | import org.labkey.api.pipeline.PipelineJob; |
15 | 13 | import org.labkey.api.pipeline.PipelineJobService; |
| 14 | +import org.labkey.api.pipeline.PipelineService; |
16 | 15 | import org.labkey.api.pipeline.TaskId; |
17 | 16 | import org.labkey.api.pipeline.WorkDirectory; |
18 | 17 | import org.labkey.api.reader.Readers; |
|
25 | 24 | import java.io.File; |
26 | 25 | import java.io.IOException; |
27 | 26 | import java.io.PrintWriter; |
28 | | -import java.util.ArrayList; |
29 | 27 | import java.util.List; |
30 | 28 |
|
31 | 29 | import static org.labkey.api.sequenceanalysis.pipeline.SequencePipelineService.SEQUENCE_TOOLS_PARAM; |
@@ -202,35 +200,7 @@ public void RunBwaRemote() throws Exception |
202 | 200 |
|
203 | 201 | protected void executeJobRemote(File workDir, @Nullable File jobJson) throws IOException |
204 | 202 | { |
205 | | - List<String> args = new ArrayList<>(); |
206 | | - args.add(System.getProperty("java.home") + "/bin/java" + (SystemUtils.IS_OS_WINDOWS ? ".exe" : "")); |
207 | | - |
208 | | - File labkeyBootstrap = new File(System.getProperty("catalina.home"), "lib/labkeyBootstrap.jar"); |
209 | | - if (!labkeyBootstrap.exists()) |
210 | | - { |
211 | | - throw new IOException("Unable to find labkeyBootstrap.jar, expected: " + labkeyBootstrap.getPath()); |
212 | | - } |
213 | | - |
214 | | - args.add("-cp"); |
215 | | - args.add(labkeyBootstrap.getPath()); |
216 | | - args.add("org.labkey.bootstrap.ClusterBootstrap"); |
217 | | - |
218 | | - File webappDir = new File(ModuleLoader.getServletContext().getRealPath("")); |
219 | | - if (!webappDir.exists()) |
220 | | - { |
221 | | - throw new IOException("Unable to find webappdir, expected: " + webappDir.getPath()); |
222 | | - } |
223 | | - |
224 | | - for (String sysProp : new String[]{"labkey.externalModulesDir", "labkey.modulesDir", "cpas.modulesDir"}) |
225 | | - { |
226 | | - String sysPropValue = StringUtils.trimToNull(System.getProperty(sysProp)); |
227 | | - if (sysPropValue != null) |
228 | | - { |
229 | | - args.add("-D" + sysProp +"=" + sysPropValue); |
230 | | - } |
231 | | - } |
232 | | - |
233 | | - args.add("-webappdir=" + webappDir.getPath()); |
| 203 | + List<String> args = PipelineService.get().getClusterStartupArguments(); |
234 | 204 |
|
235 | 205 | File configDir = setupConfigDir(workDir); |
236 | 206 | args.add("-configdir=" + configDir.getPath()); |
|
0 commit comments