git-svn-id: https://svn.d4science.research-infrastructures.eu/gcube/trunk/data-analysis/dataminer-pool-manager@147247 82a268e6-3cf1-43bd-a215-b396298e98cf
This commit is contained in:
parent
a07d71b392
commit
8409cfde2f
|
@ -62,14 +62,16 @@ public class HAProxy ***REMOVED***
|
|||
cl.setName("genericworkers_proto");
|
||||
***REMOVED***
|
||||
***REMOVED***dev HAProxy
|
||||
if (HProxy.equals("dataminer-d-workers.d4science.org")) ***REMOVED***
|
||||
if (HProxy.equals("dataminer-d-workers.d4science.org")||(HProxy.equals("dataminer-d-d4s.d4science.org"))) ***REMOVED***
|
||||
cl.setName("devnext_backend");
|
||||
***REMOVED***
|
||||
|
||||
***REMOVED***
|
||||
***REMOVED***preProd HAProxy
|
||||
***REMOVED*** if (HProxy.equals("dataminer1-pre.d4science.org")) ***REMOVED***
|
||||
***REMOVED*** cl.setName("dataminer1-pre.d4science.org");
|
||||
***REMOVED*** ***REMOVED***
|
||||
return cl;
|
||||
|
||||
***REMOVED***
|
||||
|
||||
|
||||
|
||||
public List<Host> listDataMinersByCluster() throws IOException ***REMOVED***
|
||||
|
@ -77,26 +79,40 @@ public class HAProxy ***REMOVED***
|
|||
***REMOVED*** Cluster cluster = this.getClusterByHProxy();
|
||||
Cluster cluster = this.MapCluster();
|
||||
List<Host> out = new LinkedList<Host>();
|
||||
***REMOVED*** prod
|
||||
***REMOVED***URL stockURL = new URL("http:***REMOVED***data.d4science.org/Yk4zSFF6V3JOSytNd3JkRDlnRFpDUUR5TnRJZEw2QjRHbWJQNStIS0N6Yz0");
|
||||
URL stockURL = new URL("http:***REMOVED***"+ ISClient.getHProxy() +":8880/;csv");
|
||||
System.out.println(stockURL);
|
||||
***REMOVED*** dev
|
||||
***REMOVED*** URL stockURL = new
|
||||
***REMOVED*** URL("http:***REMOVED***data.d4science.org/c29KTUluTkZnRlB0WXE5NVNaZnRoR0dtYThUSmNTVlhHbWJQNStIS0N6Yz0");
|
||||
BufferedReader in = new BufferedReader(new InputStreamReader(stockURL.openStream()));
|
||||
reader = new CSVReader(in, ',');
|
||||
String[] nextLine;
|
||||
while ((nextLine = reader.readNext()) != null) ***REMOVED***
|
||||
if (nextLine[1].equals("BACKEND") || (nextLine[1].equals("FRONTEND"))) ***REMOVED***
|
||||
continue;
|
||||
***REMOVED***
|
||||
Host a = new Host();
|
||||
|
||||
if (nextLine[0].equals(cluster.getName())) ***REMOVED***
|
||||
Host a = new Host();
|
||||
a.setName(nextLine[1]);
|
||||
out.add(a);
|
||||
System.out.println(a.getFullyQualifiedName());
|
||||
***REMOVED***no proxy dataminer (preprod)
|
||||
if (cluster.getName() == null)***REMOVED***
|
||||
a.setName(ISClient.getHProxy());
|
||||
out.add(a);
|
||||
***REMOVED***
|
||||
|
||||
***REMOVED*** if preprod, just one dm available
|
||||
***REMOVED*** if (cluster.getName().equals("dataminer1-pre.d4science.org")) ***REMOVED***
|
||||
***REMOVED*** a.setName("dataminer1-pre.d4science.org");
|
||||
***REMOVED*** out.add(a);
|
||||
***REMOVED******REMOVED***
|
||||
else ***REMOVED***
|
||||
***REMOVED*** prod
|
||||
***REMOVED*** URL stockURL = new
|
||||
***REMOVED*** URL("http:***REMOVED***data.d4science.org/Yk4zSFF6V3JOSytNd3JkRDlnRFpDUUR5TnRJZEw2QjRHbWJQNStIS0N6Yz0");
|
||||
URL stockURL = new URL("http:***REMOVED***" + ISClient.getHProxy() + ":8880/;csv");
|
||||
System.out.println(stockURL);
|
||||
***REMOVED*** dev
|
||||
***REMOVED*** URL stockURL = new
|
||||
***REMOVED*** URL("http:***REMOVED***data.d4science.org/c29KTUluTkZnRlB0WXE5NVNaZnRoR0dtYThUSmNTVlhHbWJQNStIS0N6Yz0");
|
||||
BufferedReader in = new BufferedReader(new InputStreamReader(stockURL.openStream()));
|
||||
reader = new CSVReader(in, ',');
|
||||
String[] nextLine;
|
||||
while ((nextLine = reader.readNext()) != null) ***REMOVED***
|
||||
if (nextLine[1].equals("BACKEND") || (nextLine[1].equals("FRONTEND"))) ***REMOVED***
|
||||
continue;
|
||||
***REMOVED***
|
||||
if (nextLine[0].equals(cluster.getName())) ***REMOVED***
|
||||
a.setName(nextLine[1]);
|
||||
out.add(a);
|
||||
System.out.println(a.getFullyQualifiedName());
|
||||
***REMOVED***
|
||||
***REMOVED***
|
||||
***REMOVED***
|
||||
return out;
|
||||
|
|
|
@ -566,30 +566,27 @@ public class DataminerPoolManager implements PoolManager ***REMOVED***
|
|||
|
||||
***REMOVED***
|
||||
|
||||
public String addAlgorithmsToHost(AlgorithmSet algorithms, String hostname, String uuid, boolean updateSVN) throws IOException, InterruptedException, SVNException ***REMOVED***
|
||||
public String addAlgorithmsToHost(AlgorithmSet algorithms, String hostname, String uuid, boolean updateSVN)
|
||||
throws IOException, InterruptedException, SVNException ***REMOVED***
|
||||
|
||||
***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***
|
||||
***REMOVED*** cluster.addHost(h);
|
||||
for (Host h : new HAProxy().listDataMinersByCluster()) ***REMOVED***
|
||||
if (h.getName().equals(hostname)) ***REMOVED***
|
||||
cluster.addHost(h);
|
||||
***REMOVED***
|
||||
***REMOVED***
|
||||
***REMOVED*** if(ISClient.getHProxy().equals(hostname))***REMOVED***
|
||||
***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 ***REMOVED***
|
||||
return new AlgorithmPackageParser().parsePackage(url);
|
||||
***REMOVED***
|
||||
|
|
Loading…
Reference in New Issue