Skip to content

Commit 11401ed

Browse files
committed
Add entrypoint to ParagraphStep
1 parent 06d3358 commit 11401ed

File tree

2 files changed

+12
-12
lines changed

2 files changed

+12
-12
lines changed

SequenceAnalysis/src/org/labkey/sequenceanalysis/run/alignment/ParagraphStep.java

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -229,6 +229,8 @@ else if (!svVcf.exists())
229229

230230
DockerWrapper dockerWrapper = new DockerWrapper("ghcr.io/bimberlabinternal/paragraph:latest", ctx.getLogger(), ctx);
231231
dockerWrapper.setTmpDir(new File(SequencePipelineService.get().getJavaTempDir()));
232+
dockerWrapper.setEntryPoint("/bin/bash");
233+
232234
List<String> paragraphArgs = new ArrayList<>();
233235
paragraphArgs.add("/opt/paragraph/bin/multigrmpy.py");
234236

cluster/src/org/labkey/cluster/pipeline/SlurmExecutionEngine.java

Lines changed: 10 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
package org.labkey.cluster.pipeline;
22

33
import org.apache.commons.lang3.StringUtils;
4-
import org.apache.commons.lang3.math.NumberUtils;
54
import org.apache.logging.log4j.LogManager;
65
import org.apache.logging.log4j.Logger;
76
import org.jetbrains.annotations.NotNull;
@@ -14,7 +13,6 @@
1413
import org.labkey.api.data.ContainerManager;
1514
import org.labkey.api.pipeline.PipelineJob;
1615
import org.labkey.api.pipeline.PipelineJobException;
17-
import org.labkey.api.pipeline.PipelineJobService;
1816
import org.labkey.api.pipeline.PipelineService;
1917
import org.labkey.api.pipeline.PipelineStatusFile;
2018
import org.labkey.api.util.FileUtil;
@@ -312,8 +310,8 @@ else if (headerFound)
312310
String maxRSS = StringUtils.trimToNull(tokens[maxRssIdx]);
313311
if (maxRSS != null)
314312
{
315-
long bytes = FileSizeFormatter.convertStringRepresentationToBytes(maxRSS);
316-
long requestInBytes = FileSizeFormatter.convertStringRepresentationToBytes(getConfig().getRequestMemory() + "G"); //request is always GB
313+
double bytes = FileSizeFormatter.convertStringRepresentationToBytes(maxRSS);
314+
double requestInBytes = FileSizeFormatter.convertStringRepresentationToBytes(getConfig().getRequestMemory() + "G"); //request is always GB
317315
if (bytes > requestInBytes)
318316
{
319317
info = "Job exceeded memory, max was: " + FileSizeFormatter.convertBytesToUnit(bytes, 'G') + "G, requested memory was: " + getConfig().getRequestMemory() + "G";
@@ -780,13 +778,13 @@ private Pair<String, String> getStatusFromQueue(ClusterJob job)
780778
// Based on: https://stackoverflow.com/questions/3758606/how-can-i-convert-byte-size-into-a-human-readable-format-in-java
781779
private static class FileSizeFormatter
782780
{
783-
public static long convertStringRepresentationToBytes(final String value)
781+
public static double convertStringRepresentationToBytes(final String value)
784782
{
785783
try
786784
{
787785
char unit = value.toUpperCase().charAt(value.length() - 1);
788786
long sizeFactor = getSizeFactor(unit);
789-
long size = Long.parseLong(value.substring(0, value.length() - 1));
787+
double size = Double.parseDouble(value.substring(0, value.length() - 1));
790788

791789
return size * sizeFactor;
792790
}
@@ -796,11 +794,11 @@ public static long convertStringRepresentationToBytes(final String value)
796794
}
797795
}
798796

799-
public static long convertBytesToUnit(final long bytes, final char unit)
797+
public static double convertBytesToUnit(final double bytes, final char unit)
800798
{
801799
long sizeFactor = getSizeFactor(unit);
802800

803-
return bytes / sizeFactor;
801+
return bytes / (double)sizeFactor;
804802
}
805803

806804
private static long getSizeFactor(char unit)
@@ -826,11 +824,11 @@ public static class TestCase
826824
@Test
827825
public void testFileSizeFormatter()
828826
{
829-
long bytes = FileSizeFormatter.convertStringRepresentationToBytes("1362624K");
830-
Assert.assertEquals("Incorrect byte value", 1395326976, bytes);
827+
double bytes = FileSizeFormatter.convertStringRepresentationToBytes("1362624K");
828+
Assert.assertEquals("Incorrect byte value", 1395326976.0, bytes, 0.0);
831829

832-
long val2 = FileSizeFormatter.convertBytesToUnit(bytes, 'K');
833-
Assert.assertEquals("Incorrect string value", 1362624, val2);
830+
double val2 = FileSizeFormatter.convertBytesToUnit(bytes, 'K');
831+
Assert.assertEquals("Incorrect string value", 1362624.0, val2, 0.0);
834832
}
835833
}
836834
}

0 commit comments

Comments
 (0)