diff --git a/libs/bibitools/src/main/java/de/unibi/techfak/bibiserv/BiBiTools.java b/libs/bibitools/src/main/java/de/unibi/techfak/bibiserv/BiBiTools.java index edec154..f5f05a2 100644 --- a/libs/bibitools/src/main/java/de/unibi/techfak/bibiserv/BiBiTools.java +++ b/libs/bibitools/src/main/java/de/unibi/techfak/bibiserv/BiBiTools.java @@ -22,15 +22,9 @@ */ package de.unibi.techfak.bibiserv; -import de.unibi.techfak.bibiserv.cms.TenumParam; -import de.unibi.techfak.bibiserv.cms.TenumValue; -import de.unibi.techfak.bibiserv.cms.Tfunction; -import de.unibi.techfak.bibiserv.cms.TinputOutput; -import de.unibi.techfak.bibiserv.cms.Tparam; +import de.unibi.techfak.bibiserv.cms.*; import de.unibi.techfak.bibiserv.cms.Tparam.Max; import de.unibi.techfak.bibiserv.cms.Tparam.Min; -import de.unibi.techfak.bibiserv.cms.TparamGroup; -import de.unibi.techfak.bibiserv.cms.TrunnableItem; import de.unibi.techfak.bibiserv.debug.DDataSource; import de.unibi.techfak.bibiserv.exception.BiBiToolsException; import de.unibi.techfak.bibiserv.exception.DBConnectionException; @@ -932,8 +926,8 @@ public File getTmpDir() throws FileNotFoundException { * * @return */ - public Element getToolDescription() { - return (Element) runnableitem; + public TrunnableItem getToolDescription() { + return runnableitem; } /** @@ -2285,7 +2279,7 @@ public String generateCmdLineString(String id, Map hash, String StringBuffer cmdline = new StringBuffer(getExecCmd()); // test if cmdline describe a valid executable (only if 'UseDocker' is unset) - if (getProperty("UseDocker") == null || !getProperty("UseDocker").equalsIgnoreCase("true")) { + if (!getToolDescription().getExecutable().getExecInfo().getExecutableType().equalsIgnoreCase("docker")) { File test = new File(cmdline.toString()); if (testexec && !(test.exists() && test.isFile() && test.canExecute())) { @@ -2949,35 +2943,31 @@ private TinputOutput search_for_input(String id) { */ private String getExecCmd() { StringBuffer cmdbuf = new StringBuffer(); - if (getProperty("UseDocker") == null || !getProperty("UseDocker").equalsIgnoreCase("true")) { - if (getProperty("executable.rootpath") != null) { - cmdbuf.append(getProperty("executable.rootpath")); - if (!endWithFileSeparator(cmdbuf)) { - cmdbuf.append(this.separator); - } - if (getProperty("executable.path.isrelativ").equalsIgnoreCase("true")) { - cmdbuf.append(runnableitem.getExecutable().getExecInfo().getPath()); - if (!endWithFileSeparator(cmdbuf)) { - cmdbuf.append(this.separator); - } - } - } else { + + Texecutable executable = getToolDescription().getExecutable(); + boolean isDocker = getToolDescription().getExecutable().getExecInfo().getExecutableType().equalsIgnoreCase("docker"); + if (getProperty("executable.rootpath") != null && !isDocker) { + cmdbuf.append(getProperty("executable.rootpath")); + if (!endWithFileSeparator(cmdbuf)) { + cmdbuf.append(this.separator); + } + if (getProperty("executable.path.isrelativ").equalsIgnoreCase("true")) { cmdbuf.append(runnableitem.getExecutable().getExecInfo().getPath()); if (!endWithFileSeparator(cmdbuf)) { cmdbuf.append(this.separator); } } } else { - String orga = getProperty("DockerHubOrganization"); - if (orga != null) { - cmdbuf.append("docker run "); - cmdbuf.append(" --rm=true"); - cmdbuf.append(" -v ").append(getProperty("spooldir.base")).append(":").append(getProperty("spooldir.base")); - cmdbuf.append(" ").append(orga).append("/").append(runnableitem.getId()); - cmdbuf.append(" /usr/local/bin/"); - } else { - cmdbuf.append("# BiBiTool.properties doesn't contain a property named 'DockerHubOrganization'!"); + cmdbuf.append("docker "); + cmdbuf.append("run "); + cmdbuf.append("--entrypoint='" + runnableitem.getExecutable().getExecInfo().getPath() + "' "); + try { + cmdbuf.append("-v "); + cmdbuf.append(getSpoolDir().toString() + ":" + getSpoolDir().toString() + ":rw "); + } catch (FileNotFoundException e) { + e.printStackTrace(); } + cmdbuf.append(executable.getExecInfo().getImage() + " "); } cmdbuf.append(runnableitem.getExecutable().getExecInfo().getCallingInformation()); return cmdbuf.toString(); diff --git a/libs/bibitools/src/main/java/de/unibi/techfak/bibiserv/impl/JobProxyCall.java b/libs/bibitools/src/main/java/de/unibi/techfak/bibiserv/impl/JobProxyCall.java index d1ce444..a826e86 100644 --- a/libs/bibitools/src/main/java/de/unibi/techfak/bibiserv/impl/JobProxyCall.java +++ b/libs/bibitools/src/main/java/de/unibi/techfak/bibiserv/impl/JobProxyCall.java @@ -29,7 +29,6 @@ import de.unibi.techfak.bibiserv.exception.IdNotFoundException; import java.io.File; import java.io.FileInputStream; -import java.io.FileNotFoundException; import java.io.IOException; import java.io.InputStreamReader; import java.io.OutputStream; @@ -39,7 +38,6 @@ import java.net.URI; import java.net.URISyntaxException; import java.net.URL; -import java.util.logging.Level; import org.apache.log4j.Logger; import org.json.*; @@ -77,7 +75,16 @@ public JobProxyCall() { */ public JobProxyCall(BiBiTools wsstools) { this(wsstools, wsstools.getStatus()); - // get servr JobProxyServer from + setUri(wsstools); + } + + @Override + public void setBiBiTools(BiBiTools bibitools) { + super.setBiBiTools(bibitools); + setUri(bibitools); + } + + private void setUri(BiBiTools biBiTools){ try { uri = new URI(wsstools.getProperty("JobProxyServer.URI", "http://localhost:9999/")); } catch (URISyntaxException e) { @@ -88,7 +95,6 @@ public JobProxyCall(BiBiTools wsstools) { // should not occure } } - } public JobProxyCall(BiBiTools submitted_wsstools, Status submitted_status) { diff --git a/libs/bibitools/src/main/java/de/unibi/techfak/bibiserv/impl/LocalCall.java b/libs/bibitools/src/main/java/de/unibi/techfak/bibiserv/impl/LocalCall.java index 4ff17a6..af8f0f7 100644 --- a/libs/bibitools/src/main/java/de/unibi/techfak/bibiserv/impl/LocalCall.java +++ b/libs/bibitools/src/main/java/de/unibi/techfak/bibiserv/impl/LocalCall.java @@ -29,7 +29,6 @@ import de.unibi.techfak.bibiserv.exception.DBConnectionException; import java.io.File; -import java.io.FileInputStream; /** * Implements the Call interface executing a program directly on the local diff --git a/libs/ontoaccess/pom.xml b/libs/ontoaccess/pom.xml index 525c373..daf16a1 100644 --- a/libs/ontoaccess/pom.xml +++ b/libs/ontoaccess/pom.xml @@ -34,13 +34,13 @@ org.apache.jena jena-core - 2.10.1 + 2.7.1 com.github.ansell.pellet pellet-jena - 2.3.6-ansell + 2.3.2