This commit is contained in:
Nunzio Andrea Galante 2017-03-01 15:21:40 +00:00
parent 112e385179
commit 8302b626de
3 changed files with 95 additions and 20 deletions

View File

@ -203,11 +203,12 @@ public class AnsibleBridge ***REMOVED***
FileOutputStream fos = new FileOutputStream(n);
PrintStream ps = new PrintStream(fos);
System.setOut(ps);
System.setErr(ps);
worker.apply();
System.setOut(console);
***REMOVED***System.setErr(ps);
System.setErr(console);
worker.apply();
***REMOVED***System.setOut(console);
***REMOVED***worker.apply();
System.out.println("Log stored to to " + n.getAbsolutePath());
***REMOVED*** destroy the worker
@ -235,6 +236,8 @@ public class AnsibleBridge ***REMOVED***
*/
public Collection<Role> generateRoles(Dependency d) ***REMOVED***
Collection<Role> roles = new Vector<>();
if("os".equalsIgnoreCase(d.getType())) ***REMOVED***
OSDependencyPackage pkg = new OSDependencyPackage(d);
if(pkg!=null) ***REMOVED***

View File

@ -30,7 +30,8 @@ public class ISClient ***REMOVED***
Collection<Host> out = new Vector<>();
Host h = new Host();
***REMOVED***h.setName("bb-dataminer.res.eng.it");
h.setName("vm101.ui.savba.sk");
***REMOVED***h.setName("vm101.ui.savba.sk");
h.setName("dataminer1-devnext.d4science.org");
out.add(h);
return out;
***REMOVED*** else ***REMOVED***

View File

@ -10,6 +10,7 @@ import java.util.Vector;
import java.util.zip.ZipEntry;
import java.util.zip.ZipInputStream;
import org.apache.commons.lang.StringEscapeUtils;
***REMOVED***
import org.gcube.dataanalysis.dataminer.poolmanager.datamodel.Dependency;
@ -149,24 +150,91 @@ public class AlgorithmPackageParser ***REMOVED***
* @param metadata
* @return
*/
private Algorithm createAlgorithm(Map<String, List<String>> metadata) ***REMOVED***
Algorithm out = new Algorithm();
out.setName(extractSingleValue(metadata, METADATA_ALGORITHM_NAME));
out.setDescription(extractSingleValue(metadata, METADATA_ALGORITHM_DESCRIPTION));
out.setClazz(extractSingleValue(metadata, METADATA_CLASS_NAME));
List<String> dependencies = extractMultipleValues(metadata, METADATA_PACKAGES);
if (dependencies != null) ***REMOVED***
for (String pkg : dependencies) ***REMOVED***
Dependency dep = new Dependency();
dep.setName(pkg);
dep.setType("os");
out.addDependency(dep);
***REMOVED***
***REMOVED***
return out;
***REMOVED***
***REMOVED*** private Algorithm createAlgorithm(Map<String, List<String>> metadata) ***REMOVED***
***REMOVED*** Algorithm out = new Algorithm();
***REMOVED*** out.setName(extractSingleValue(metadata, METADATA_ALGORITHM_NAME));
***REMOVED*** out.setDescription(extractSingleValue(metadata, METADATA_ALGORITHM_DESCRIPTION));
***REMOVED*** out.setClazz(extractSingleValue(metadata, METADATA_CLASS_NAME));
***REMOVED*** List<String> dependencies = extractMultipleValues(metadata, METADATA_PACKAGES);
***REMOVED*** if (dependencies != null) ***REMOVED***
***REMOVED*** for (String pkg : dependencies) ***REMOVED***
***REMOVED*** Dependency dep = new Dependency();
***REMOVED*** dep.setName(pkg);
***REMOVED*** dep.setType("os");
***REMOVED*** out.addDependency(dep);
***REMOVED*** ***REMOVED***
***REMOVED*** ***REMOVED***
***REMOVED*** return out;
***REMOVED*** ***REMOVED***
private Algorithm createAlgorithm(Map<String, List<String>> metadata) ***REMOVED***
Algorithm out = new Algorithm();
out.setName(extractSingleValue(metadata, METADATA_ALGORITHM_NAME));
out.setDescription(extractSingleValue(metadata, METADATA_ALGORITHM_DESCRIPTION));
out.setClazz(extractSingleValue(metadata, METADATA_CLASS_NAME));
List<String> rdependencies = extractMultipleValues(metadata, "r");
if (rdependencies != null) ***REMOVED***
for (String pkg : rdependencies) ***REMOVED***
Dependency dep = new Dependency();
***REMOVED***if (pkg.startsWith("os:"))***REMOVED***
dep.setName(pkg);
dep.setType("cran");
out.addDependency(dep);
***REMOVED***
***REMOVED***
List<String> osdependencies = extractMultipleValues(metadata, "os");
if (osdependencies != null) ***REMOVED***
for (String pkg : osdependencies) ***REMOVED***
Dependency dep = new Dependency();
***REMOVED***if (pkg.startsWith("os:"))***REMOVED***
dep.setName(pkg);
dep.setType("os");
out.addDependency(dep);
***REMOVED***
***REMOVED***
List<String> cdependencies = extractMultipleValues(metadata, "custom");
if (cdependencies != null) ***REMOVED***
for (String pkg : cdependencies) ***REMOVED***
Dependency dep = new Dependency();
***REMOVED***if (pkg.startsWith("os:"))***REMOVED***
dep.setName(pkg);
dep.setType("custom");
out.addDependency(dep);
***REMOVED***
***REMOVED***
***REMOVED*** if (pkg.startsWith("r:"))***REMOVED***
***REMOVED*** ***REMOVED***String results = StringEscapeUtils.escapeJava(pkg);
***REMOVED*** dep.setName(pkg);
***REMOVED*** dep.setType("cran");
***REMOVED*** ***REMOVED***
***REMOVED*** if (pkg.startsWith("custom:"))***REMOVED***
***REMOVED*** dep.setName(pkg);
***REMOVED*** dep.setType("custom");
***REMOVED*** ***REMOVED***
***REMOVED*** if (!pkg.startsWith("os:")&&!pkg.startsWith("r:")&&!pkg.startsWith("custom:"))***REMOVED***
***REMOVED*** dep.setName(pkg);
***REMOVED*** dep.setType("os");
***REMOVED*** ***REMOVED***
return out;
***REMOVED***
private static String extractSingleValue(Map<String, List<String>> metadata,
String key) ***REMOVED***
List<String> l = metadata.get(key);
@ -177,6 +245,9 @@ public class AlgorithmPackageParser ***REMOVED***
***REMOVED***
***REMOVED***
private static List<String> extractMultipleValues(
Map<String, List<String>> metadata, String key) ***REMOVED***
List<String> l = metadata.get(key);