This commit is contained in:
Nunzio Andrea Galante 2017-05-11 15:03:59 +00:00
parent 3f523d3862
commit 23d6c0e725
5 changed files with 19 additions and 14 deletions

View File

@ -96,7 +96,7 @@ public class AnsibleBridge ***REMOVED***
List<Role> algoRoles = new Vector<>();
***REMOVED*** add algorithms and dependencies to the worker
for (Role r : this.generateRoles(algorithm)) ***REMOVED***
for (Role r : this.generateRoles(algorithm,includeAlgorithmDependencies)) ***REMOVED***
algoRoles.add(r);
worker.addRole(r);
***REMOVED***
@ -333,9 +333,10 @@ public class AnsibleBridge ***REMOVED***
return roles;
***REMOVED***
public Collection<Role> generateRoles(Algorithm a) ***REMOVED***
AlgorithmPackage pkg = new AlgorithmPackage(a);
public Collection<Role> generateRoles(Algorithm a,boolean includeAlgorithmDependencies) ***REMOVED***
AlgorithmPackage pkg = new AlgorithmPackage(a,includeAlgorithmDependencies);
return pkg.getRoles(this.getTemplateManager());
***REMOVED***
***REMOVED***
***REMOVED***

View File

@ -14,11 +14,14 @@ import org.gcube.dataanalysis.dataminer.poolmanager.datamodel.Dependency;
public class AlgorithmPackage ***REMOVED***
private Algorithm algorithm;
public AlgorithmPackage(Algorithm a) ***REMOVED***
private boolean includeAlgorithmDependencies;
public AlgorithmPackage(Algorithm a,boolean includeAlgorithmDependencies) ***REMOVED***
this.algorithm = a;
this.includeAlgorithmDependencies = includeAlgorithmDependencies;
***REMOVED***
protected Map<String, String> getDictionary(Algorithm a) ***REMOVED***
Map<String, String> out = new HashMap<String, String>();
out.put("name", a.getName());
@ -32,9 +35,10 @@ public class AlgorithmPackage ***REMOVED***
out.put("description", a.getDescription());
String deps = "";
if(includeAlgorithmDependencies)***REMOVED***
for(Dependency d:a.getDependencies()) ***REMOVED***
deps+=String.format("- ***REMOVED*** role: %s ***REMOVED***\n", d.getType()+"-"+d.getName().replaceAll("/", "-"));
***REMOVED***
***REMOVED******REMOVED***
deps = deps.trim();
out.put("dependencies", deps);
return out;

View File

@ -94,11 +94,11 @@ public class HAProxy ***REMOVED***
***REMOVED******REMOVED***
else ***REMOVED***
***REMOVED*** prod
***REMOVED*** URL stockURL = new
***REMOVED*** URL("http:***REMOVED***data.d4science.org/Yk4zSFF6V3JOSytNd3JkRDlnRFpDUUR5TnRJZEw2QjRHbWJQNStIS0N6Yz0");
URL stockURL = new
URL("http:***REMOVED***data.d4science.org/Yk4zSFF6V3JOSytNd3JkRDlnRFpDUUR5TnRJZEw2QjRHbWJQNStIS0N6Yz0");
***REMOVED***URL stockURL = new URL("http:***REMOVED***"+ ISClient.getHProxy() +":8880/;csv");
URL stockURL = new URL("http:***REMOVED***data.d4science.org/c29KTUluTkZnRlB0WXE5NVNaZnRoR0dtYThUSmNTVlhHbWJQNStIS0N6Yz0");
System.out.println(stockURL);
***REMOVED***URL stockURL = new URL("http:***REMOVED***data.d4science.org/c29KTUluTkZnRlB0WXE5NVNaZnRoR0dtYThUSmNTVlhHbWJQNStIS0N6Yz0");
***REMOVED***System.out.println(stockURL);
***REMOVED*** dev
***REMOVED*** URL stockURL = new
***REMOVED*** URL("http:***REMOVED***data.d4science.org/c29KTUluTkZnRlB0WXE5NVNaZnRoR0dtYThUSmNTVlhHbWJQNStIS0N6Yz0");

View File

@ -223,7 +223,7 @@ public class ISClient ***REMOVED***
a.profile().newBody(this.getAlgoBody(algo));
try ***REMOVED***
SecurityTokenProvider.instance.set(token);
publishScopedResource(a, Arrays.asList(new String[] ***REMOVED*** ScopeProvider.instance.get() ***REMOVED***));
publishScopedResource(a, Arrays.asList(new String[] ***REMOVED*** SecurityTokenProvider.instance.get() ***REMOVED***));
***REMOVED*** catch (Exception e) ***REMOVED***
e.printStackTrace();
***REMOVED***

View File

@ -146,7 +146,7 @@ public class DataminerPoolManager ***REMOVED***
if(retValue == 0) ***REMOVED***
updateSVNDependencies(algo, stagingVRE);
createISResource(algo, targetVREToken);
***REMOVED***createISResource(algo, targetVREToken);
***REMOVED***
***REMOVED*** destroy the worker
worker.destroy();