Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,7 @@ public ProcessBuilder getProcessBuilder(List<String> params)

if (getWorkingDir() != null)
{
getLogger().debug("using working directory: " + getWorkingDir().getPath());
getLogger().log(_logLevel, "using working directory: " + getWorkingDir().getPath());
pb.directory(getWorkingDir());
}

Expand Down Expand Up @@ -208,8 +208,8 @@ private void setPath(ProcessBuilder pb)

if (_logPath)
{
getLogger().debug("Existing PATH: " + path);
getLogger().debug("toolDir: " + toolDir);
getLogger().log(_logLevel, "Existing PATH: " + path);
getLogger().log(_logLevel, "toolDir: " + toolDir);
}

if (path == null)
Expand All @@ -234,7 +234,7 @@ private void setPath(ProcessBuilder pb)

if (_logPath)
{
getLogger().debug("using path: " + path);
getLogger().log(_logLevel, "using path: " + path);
}
pb.environment().put("PATH", path);
}
Expand Down Expand Up @@ -275,7 +275,7 @@ public Logger getLogger()
return _log;
}

protected void setLogLevel(Level logLevel)
public void setLogLevel(Level logLevel)
{
_logLevel = logLevel;
}
Expand Down
43 changes: 30 additions & 13 deletions jbrowse/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions jbrowse/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
"build-prod": "npm run clean && cross-env NODE_ENV=production PROD_SOURCE_MAP=source-map webpack --config ./config/prod.config.js --progress --profile",
"clean": "rimraf resources/web/gen && rimraf resources/web/jbrowse/gen && rimraf resources/views/gen",
"prepareCli": "rimraf ./buildCli && rimraf ./resources/external/jb-cli && npm install @jbrowse/cli@1.7.4 --prefix ./buildCli",
"jb-pkg": "npm run prepareCli && npx pkg --outdir=./resources/external/jb-cli ./buildCli/node_modules/@jbrowse/cli && rimraf ./buildCli"
"jb-pkg": "npm run prepareCli && npx pkg --public --outdir=./resources/external/jb-cli ./buildCli/node_modules/@jbrowse/cli && rimraf ./buildCli"
},
"dependencies": {
"@gmod/vcf": "^6.0.9",
Expand All @@ -24,7 +24,7 @@
"@labkey/api": "^1.39.0",
"@labkey/components": "^6.32.2",
"@mui/x-data-grid": "^7.28.1",
"@yao-pkg/pkg": "^6.3.2",
"@yao-pkg/pkg": "^6.6.0",
"assert": "^2.1.0",
"browserify-zlib": "^0.2.0",
"buffer": "^6.0.3",
Expand Down
36 changes: 31 additions & 5 deletions jbrowse/src/org/labkey/jbrowse/JBrowseManager.java
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
package org.labkey.jbrowse;

import org.apache.commons.lang3.SystemUtils;
import org.apache.logging.log4j.Level;
import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger;
import org.jetbrains.annotations.Nullable;
Expand All @@ -42,6 +43,7 @@
import org.labkey.api.security.permissions.InsertPermission;
import org.labkey.api.sequenceanalysis.SequenceAnalysisService;
import org.labkey.api.sequenceanalysis.pipeline.ReferenceGenome;
import org.labkey.api.sequenceanalysis.run.AbstractCommandWrapper;
import org.labkey.api.sequenceanalysis.run.SimpleScriptWrapper;
import org.labkey.api.util.FileType;
import org.labkey.api.util.FileUtil;
Expand Down Expand Up @@ -237,16 +239,45 @@ public void testJBrowseCli() throws Exception
{
File exe = JBrowseManager.get().getJbrowseCli();
SimpleScriptWrapper wrapper = new SimpleScriptWrapper(_log);
wrapper.setLogLevel(Level.INFO);
wrapper.setLogPath(true);
wrapper.setThrowNonZeroExits(false);

File node = AbstractCommandWrapper.resolveFileInPath("node", null, false);
if (node == null)
{
_log.info("Unable to find node in PATH, trying node.exe");
node = AbstractCommandWrapper.resolveFileInPath("node.exe", null, false);
if (node == null)
{
_log.info("Unable to find node.exe in PATH");
}
}
_log.info("node executable location: " + node);

String output = wrapper.executeWithOutput(Arrays.asList(exe.getPath(), "help"));
if (wrapper.getLastReturnCode() != 0)
{
_log.error("Non-zero exit from testJBrowseCli: " + wrapper.getLastReturnCode());
wrapper.getCommandsExecuted().forEach(_log::error);
_log.error("NODE_PATH: " + System.getenv("NODE_PATH"));

_log.error("output: ");
_log.error(output);

// Repeat without output going direct to the server log:
try
{
// NOTE: this is only useful if "npx pkg --debug" is used when building the executables
_log.info("Retrying without all output direct to the system log and DEBUG_PKG=1:");
wrapper.addToEnvironment("DEBUG_PKG", "1");
wrapper.execute(Arrays.asList(exe.getPath(), "help"));
}
catch (Exception e)
{
// Ignore
}

throw new RuntimeException("Non-zero exit running testJBrowseCli: " + wrapper.getLastReturnCode());
}

Expand All @@ -264,11 +295,6 @@ public File getBaseDir(Container c, boolean doCreate)
return null;
}

if (fileRoot == null || !fileRoot.exists())
{
return null;
}

File jbrowseDir = new File(fileRoot, ".jbrowse");
if (!jbrowseDir.exists())
{
Expand Down