This commit is contained in:
Nunzio Andrea Galante 2017-05-11 15:03:59 +00:00
parent 4fd65602d7
commit 5d6fe0ceb5
5 changed files with 20 additions and 14 deletions

View File

@ -96,7 +96,7 @@ public class AnsibleBridge {
List<Role> algoRoles = new Vector<>();
***REMOVED*** add algorithms and dependencies to the worker
for (Role r : this.generateRoles(algorithm)) {
for (Role r : this.generateRoles(algorithm,includeAlgorithmDependencies)) {
algoRoles.add(r);
worker.addRole(r);
***REMOVED***
@ -333,9 +333,10 @@ public class AnsibleBridge {
return roles;
***REMOVED***
public Collection<Role> generateRoles(Algorithm a) {
AlgorithmPackage pkg = new AlgorithmPackage(a);
public Collection<Role> generateRoles(Algorithm a,boolean includeAlgorithmDependencies) {
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 {
private Algorithm algorithm;
public AlgorithmPackage(Algorithm a) {
private boolean includeAlgorithmDependencies;
public AlgorithmPackage(Algorithm a,boolean includeAlgorithmDependencies) {
this.algorithm = a;
this.includeAlgorithmDependencies = includeAlgorithmDependencies;
***REMOVED***
protected Map<String, String> getDictionary(Algorithm a) {
Map<String, String> out = new HashMap<String, String>();
out.put("name", a.getName());
@ -32,9 +35,10 @@ public class AlgorithmPackage {
out.put("description", a.getDescription());
String deps = "";
if(includeAlgorithmDependencies){
for(Dependency d:a.getDependencies()) {
deps+=String.format("- { role: %s ***REMOVED***\n", d.getType()+"-"+d.getName().replaceAll("/", "-"));
***REMOVED***
***REMOVED******REMOVED***
deps = deps.trim();
out.put("dependencies", deps);
return out;

View File

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

View File

@ -69,10 +69,11 @@ public class RestPoolManager implements PoolManager {
***REMOVED*** ProxySelector.setDefault(new
***REMOVED*** PropertiesBasedProxySelector("/home/ngalante/.proxy-settings"));
***REMOVED***ScopeProvider.instance.set("/d4science.research-infrastructures.eu/gCubeApps/RPrototypingLab");
SecurityTokenProvider.instance.set("3a23bfa4-4dfe-44fc-988f-194b91071dd2-843339462");
ScopeProvider.instance.set("/d4science.research-infrastructures.eu/gCubeApps/RPrototypingLab");
***REMOVED***SecurityTokenProvider.instance.set("3a23bfa4-4dfe-44fc-988f-194b91071dd2-843339462");
RestPoolManager a = new RestPoolManager();
***REMOVED***a.stageAlgorithm("http:***REMOVED***data.d4science.org/MnovRjZIdGV5WlB0WXE5NVNaZnRoRVg0SU8xZWpWQlFHbWJQNStIS0N6Yz0");
a.publishAlgorithm("http:***REMOVED***data.d4science.org/MnovRjZIdGV5WlB0WXE5NVNaZnRoRVg0SU8xZWpWQlFHbWJQNStIS0N6Yz0", "3a23bfa4-4dfe-44fc-988f-194b91071dd2-843339462");
***REMOVED*** PoolManager aa = new DataminerPoolManager();
***REMOVED*** System.out.println(aa.getAlgoById("ICHTHYOP_MODEL_ONE_BY_ONE@3141d3aa-5f93-409f-b6f8-9fae0a6c0ee3"));
***REMOVED*** System.out.println(aa.getAlgoFromIs());

View File

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