git-svn-id: https://svn.d4science.research-infrastructures.eu/gcube/trunk/data-analysis/dataminer-pool-manager@148478 82a268e6-3cf1-43bd-a215-b396298e98cf
This commit is contained in:
parent
3331ec29b2
commit
d428b52929
|
@ -96,7 +96,7 @@ public class AnsibleBridge {
|
|||
List<Role> algoRoles = new Vector<>();
|
||||
|
||||
// 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);
|
||||
}
|
||||
|
@ -333,9 +333,10 @@ public class AnsibleBridge {
|
|||
return roles;
|
||||
}
|
||||
|
||||
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());
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -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;
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
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 }\n", d.getType()+"-"+d.getName().replaceAll("/", "-"));
|
||||
}
|
||||
}}
|
||||
deps = deps.trim();
|
||||
out.put("dependencies", deps);
|
||||
return out;
|
||||
|
|
|
@ -94,11 +94,11 @@ public class HAProxy {
|
|||
//}
|
||||
else {
|
||||
// prod
|
||||
// URL stockURL = new
|
||||
// URL("http://data.d4science.org/Yk4zSFF6V3JOSytNd3JkRDlnRFpDUUR5TnRJZEw2QjRHbWJQNStIS0N6Yz0");
|
||||
URL stockURL = new
|
||||
URL("http://data.d4science.org/Yk4zSFF6V3JOSytNd3JkRDlnRFpDUUR5TnRJZEw2QjRHbWJQNStIS0N6Yz0");
|
||||
//URL stockURL = new URL("http://"+ ISClient.getHProxy() +":8880/;csv");
|
||||
URL stockURL = new URL("http://data.d4science.org/c29KTUluTkZnRlB0WXE5NVNaZnRoR0dtYThUSmNTVlhHbWJQNStIS0N6Yz0");
|
||||
System.out.println(stockURL);
|
||||
//URL stockURL = new URL("http://data.d4science.org/c29KTUluTkZnRlB0WXE5NVNaZnRoR0dtYThUSmNTVlhHbWJQNStIS0N6Yz0");
|
||||
//System.out.println(stockURL);
|
||||
// dev
|
||||
// URL stockURL = new
|
||||
// URL("http://data.d4science.org/c29KTUluTkZnRlB0WXE5NVNaZnRoR0dtYThUSmNTVlhHbWJQNStIS0N6Yz0");
|
||||
|
|
|
@ -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() }));
|
||||
publishScopedResource(a, Arrays.asList(new String[] { SecurityTokenProvider.instance.get() }));
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
|
|
|
@ -69,10 +69,11 @@ public class RestPoolManager implements PoolManager {
|
|||
// ProxySelector.setDefault(new
|
||||
// PropertiesBasedProxySelector("/home/ngalante/.proxy-settings"));
|
||||
|
||||
//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");
|
||||
//SecurityTokenProvider.instance.set("3a23bfa4-4dfe-44fc-988f-194b91071dd2-843339462");
|
||||
RestPoolManager a = new RestPoolManager();
|
||||
//a.stageAlgorithm("http://data.d4science.org/MnovRjZIdGV5WlB0WXE5NVNaZnRoRVg0SU8xZWpWQlFHbWJQNStIS0N6Yz0");
|
||||
a.publishAlgorithm("http://data.d4science.org/MnovRjZIdGV5WlB0WXE5NVNaZnRoRVg0SU8xZWpWQlFHbWJQNStIS0N6Yz0", "3a23bfa4-4dfe-44fc-988f-194b91071dd2-843339462");
|
||||
// PoolManager aa = new DataminerPoolManager();
|
||||
// System.out.println(aa.getAlgoById("ICHTHYOP_MODEL_ONE_BY_ONE@3141d3aa-5f93-409f-b6f8-9fae0a6c0ee3"));
|
||||
// System.out.println(aa.getAlgoFromIs());
|
||||
|
|
|
@ -146,7 +146,7 @@ public class DataminerPoolManager {
|
|||
|
||||
if(retValue == 0) {
|
||||
updateSVNDependencies(algo, stagingVRE);
|
||||
createISResource(algo, targetVREToken);
|
||||
//createISResource(algo, targetVREToken);
|
||||
}
|
||||
// destroy the worker
|
||||
worker.destroy();
|
||||
|
|
Loading…
Reference in New Issue