This commit is contained in:
Nunzio Andrea Galante 2017-04-28 13:26:47 +00:00
parent 34b1d254a4
commit c8e9329164
2 changed files with 13 additions and 62 deletions

View File

@ -197,33 +197,10 @@ public class RestPoolManager implements PoolManager {
@DefaultValue("false") @QueryParam("updateSVN") boolean updateSVN)
throws IOException, InterruptedException, SVNException {
Algorithm algo = this.getAlgorithm(algorithm, /*vre*/null, null, name, description, category, algorithmType, skipJava);
***REMOVED*** publish algo
if (publish) {
service.addAlgToIs(algo);
***REMOVED***
***REMOVED*** update svn
***REMOVED*** if (updateSVN){
***REMOVED*** for (Dependency d : algo.getDependencies()) {
***REMOVED***
***REMOVED*** if (d.getType().equals("os")) {
***REMOVED*** List<String> ls = new LinkedList<String>();
***REMOVED*** ls.add(d.getName());
***REMOVED*** service.updateSVN("r_deb_pkgs.txt", ls);
***REMOVED*** ***REMOVED***
***REMOVED*** if (d.getType().equals("cran")) {
***REMOVED*** List<String> ls = new LinkedList<String>();
***REMOVED*** ls.add(d.getName());
***REMOVED*** service.updateSVN("r_cran_pkgs.txt", ls);
***REMOVED*** ***REMOVED***
***REMOVED*** if (d.getType().equals("github")) {
***REMOVED*** List<String> ls = new LinkedList<String>();
***REMOVED*** ls.add(d.getName());
***REMOVED*** service.updateSVN("r_github_pkgs.txt", ls);
***REMOVED*** ***REMOVED***
***REMOVED*** ***REMOVED***
***REMOVED******REMOVED***
return service.addAlgorithmToVRE(algo, ScopeProvider.instance.get(),updateSVN);
***REMOVED***
@ -246,32 +223,9 @@ public class RestPoolManager implements PoolManager {
Algorithm algo = this.getAlgorithm(algorithm, null, hostname, name, description, category, algorithmType,
skipJava);
***REMOVED*** publish algo
if (publish) {
service.addAlgToIs(algo);
***REMOVED***
***REMOVED*** update svn
***REMOVED*** if (updateSVN){
***REMOVED*** for (Dependency d : algo.getDependencies()) {
***REMOVED***
***REMOVED*** if (d.getType().equals("os")) {
***REMOVED*** List<String> ls = new LinkedList<String>();
***REMOVED*** ls.add(d.getName());
***REMOVED*** service.updateSVN("r_deb_pkgs.txt", ls);
***REMOVED*** ***REMOVED***
***REMOVED*** if (d.getType().equals("cran")) {
***REMOVED*** List<String> ls = new LinkedList<String>();
***REMOVED*** ls.add(d.getName());
***REMOVED*** service.updateSVN("r_cran_pkgs.txt", ls);
***REMOVED*** ***REMOVED***
***REMOVED*** if (d.getType().equals("github")) {
***REMOVED*** List<String> ls = new LinkedList<String>();
***REMOVED*** ls.add(d.getName());
***REMOVED*** service.updateSVN("r_github_pkgs.txt", ls);
***REMOVED*** ***REMOVED***
***REMOVED*** ***REMOVED***
***REMOVED******REMOVED***
return service.addAlgorithmToHost(algo, hostname,updateSVN);
***REMOVED***
@ -329,7 +283,7 @@ public class RestPoolManager implements PoolManager {
***REMOVED*** ProxySelector.setDefault(new
***REMOVED*** PropertiesBasedProxySelector("/home/ngalante/.proxy-settings"));
ScopeProvider.instance.set("/gcube/devNext/NextNext");
ScopeProvider.instance.set("/gcube/preprod/preVRE");
***REMOVED*** PoolManager aa = new DataminerPoolManager();
***REMOVED*** System.out.println(aa.getAlgoById("ICHTHYOP_MODEL_ONE_BY_ONE@3141d3aa-5f93-409f-b6f8-9fae0a6c0ee3"));
@ -349,9 +303,9 @@ public class RestPoolManager implements PoolManager {
a.addAlgorithmToHost(
"http:***REMOVED***data.d4science.org/MnovRjZIdGV5WlB0WXE5NVNaZnRoRVg0SU8xZWpWQlFHbWJQNStIS0N6Yz0",
"dataminer1-devnext.d4science.org",
"dataminer1-pre.d4science.org",
"ICHTHYOP_MODEL_ONE_BY_ONE", null, "ICHTHYOP_MODEL", "transducerers",
"N",false, true);
"N",false, false);

View File

@ -566,30 +566,27 @@ public class DataminerPoolManager implements PoolManager {
***REMOVED***
public String addAlgorithmsToHost(AlgorithmSet algorithms, String hostname, String uuid, boolean updateSVN) throws IOException, InterruptedException, SVNException {
public String addAlgorithmsToHost(AlgorithmSet algorithms, String hostname, String uuid, boolean updateSVN)
throws IOException, InterruptedException, SVNException {
***REMOVED*** create the cluster (dataminers in the vre)
Cluster cluster = new Cluster();
cluster.addHost(new ISClient().getDataminer(hostname));
***REMOVED*** for(Host h:new ISClient().listDataminersInVRE()) {
***REMOVED*** cluster.addHost(h);
for (Host h : new HAProxy().listDataMinersByCluster()) {
if (h.getName().equals(hostname)) {
cluster.addHost(h);
***REMOVED***
***REMOVED***
***REMOVED*** if(ISClient.getHProxy().equals(hostname)){
***REMOVED*** cluster.addHost(new ISClient().getDataminer(hostname));
***REMOVED*** ***REMOVED***
***REMOVED*** apply the changes
AnsibleBridge a = new AnsibleBridge();
return a.applyAlgorithmSetToCluster(algorithms, cluster, uuid,updateSVN ).getWorkerId();
return a.applyAlgorithmSetToCluster(algorithms, cluster, uuid, updateSVN).getWorkerId();
***REMOVED***
public Algorithm extractAlgorithm(String url) throws IOException {
return new AlgorithmPackageParser().parsePackage(url);
***REMOVED***