git-svn-id: https://svn.d4science.research-infrastructures.eu/gcube/trunk/data-analysis/dataminer-pool-manager@144535 82a268e6-3cf1-43bd-a215-b396298e98cf
This commit is contained in:
parent
5ae31bfffd
commit
1ec0af6eb3
|
@ -243,16 +243,27 @@ public class AnsibleBridge {
|
||||||
if(pkg!=null) {
|
if(pkg!=null) {
|
||||||
roles.addAll(pkg.getRoles(this.getTemplateManager()));
|
roles.addAll(pkg.getRoles(this.getTemplateManager()));
|
||||||
}
|
}
|
||||||
|
|
||||||
} else if("custom".equalsIgnoreCase(d.getType())) {
|
} else if("custom".equalsIgnoreCase(d.getType())) {
|
||||||
CustomDependencyPackage pkg = new CustomDependencyPackage(d);
|
CustomDependencyPackage pkg = new CustomDependencyPackage(d);
|
||||||
if(pkg!=null) {
|
if(pkg!=null) {
|
||||||
roles.addAll(pkg.getRoles(this.getCustomRoleManager()));
|
roles.addAll(pkg.getRoles(this.getCustomRoleManager()));
|
||||||
}
|
}
|
||||||
} else if("cran".equalsIgnoreCase(d.getType())) {
|
}
|
||||||
|
|
||||||
|
else if("github".equalsIgnoreCase(d.getType())) {
|
||||||
|
CranDependencyPackage pkg = new CranDependencyPackage(d);
|
||||||
|
if(pkg!=null) {
|
||||||
|
roles.addAll(pkg.getRoles(this.getTemplateManager()));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else if("cran".equalsIgnoreCase(d.getType())) {
|
||||||
CranDependencyPackage pkg = new CranDependencyPackage(d);
|
CranDependencyPackage pkg = new CranDependencyPackage(d);
|
||||||
if(pkg!=null) {
|
if(pkg!=null) {
|
||||||
roles.addAll(pkg.getRoles(this.getTemplateManager()));
|
roles.addAll(pkg.getRoles(this.getTemplateManager()));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
return roles;
|
return roles;
|
||||||
}
|
}
|
||||||
|
|
|
@ -33,7 +33,7 @@ public class AlgorithmPackage {
|
||||||
String deps = "";
|
String deps = "";
|
||||||
|
|
||||||
for(Dependency d:a.getDependencies()) {
|
for(Dependency d:a.getDependencies()) {
|
||||||
deps+=String.format("- { role: %s }\n", d.getType()+"-"+d.getName());
|
deps+=String.format("- { role: %s }\n", d.getType()+"-"+d.getName().replaceAll("/", "-"));
|
||||||
}
|
}
|
||||||
deps = deps.trim();
|
deps = deps.trim();
|
||||||
out.put("dependencies", deps);
|
out.put("dependencies", deps);
|
||||||
|
|
|
@ -31,7 +31,7 @@ public class DependencyPackage {
|
||||||
public Collection<Role> getRoles(TemplateManager tm) {
|
public Collection<Role> getRoles(TemplateManager tm) {
|
||||||
Collection<Role> out = new Vector<>();
|
Collection<Role> out = new Vector<>();
|
||||||
for(String mode:new String[]{"add"}) { // "remove", "update"
|
for(String mode:new String[]{"add"}) { // "remove", "update"
|
||||||
String roleName = this.getDependency().getType()+"-"+this.getDependency().getName()+("add".equals(mode) ? "" : "-"+mode);
|
String roleName = this.getDependency().getType()+"-"+this.getDependency().getName().replaceAll("/", "-")+("add".equals(mode) ? "" : "-"+mode);
|
||||||
try {
|
try {
|
||||||
// find template
|
// find template
|
||||||
Role template = tm.getRoleTemplate(this.getDependency().getType()+"-package-"+mode);
|
Role template = tm.getRoleTemplate(this.getDependency().getType()+"-package-"+mode);
|
||||||
|
|
|
@ -215,6 +215,20 @@ public class AlgorithmPackageParser {
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
List<String> gitdependencies = extractMultipleValues(metadata, "github");
|
||||||
|
if (gitdependencies != null) {
|
||||||
|
for (String pkg : gitdependencies) {
|
||||||
|
Dependency dep = new Dependency();
|
||||||
|
|
||||||
|
//if (pkg.startsWith("os:")){
|
||||||
|
dep.setName(pkg);
|
||||||
|
dep.setType("github");
|
||||||
|
out.addDependency(dep);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
List<String> cdependencies = extractMultipleValues(metadata, "custom");
|
List<String> cdependencies = extractMultipleValues(metadata, "custom");
|
||||||
if (cdependencies != null) {
|
if (cdependencies != null) {
|
||||||
for (String pkg : cdependencies) {
|
for (String pkg : cdependencies) {
|
||||||
|
|
|
@ -97,7 +97,7 @@ public class RestPoolManager implements PoolManager {
|
||||||
|
|
||||||
ScopeProvider.instance.set("/gcube/devNext/NextNext");
|
ScopeProvider.instance.set("/gcube/devNext/NextNext");
|
||||||
a.addAlgorithmToVRE(
|
a.addAlgorithmToVRE(
|
||||||
"http://data.d4science.org/cXhJV0s4b3dUN05jZk9qTytQTndqdmVUdURLOTRHeHpHbWJQNStIS0N6Yz0",
|
"http://data.d4science.org/S2h1RHZGd0JpWnBjZk9qTytQTndqcDRLVHNrQUt6QjhHbWJQNStIS0N6Yz0",
|
||||||
"/gcube/devNext/NextNext",
|
"/gcube/devNext/NextNext",
|
||||||
null, null, "test", "transducerers", "N");
|
null, null, "test", "transducerers", "N");
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue