git-svn-id: https://svn.d4science.research-infrastructures.eu/gcube/trunk/data-analysis/dataminer-pool-manager@146965 82a268e6-3cf1-43bd-a215-b396298e98cf
This commit is contained in:
parent
f25ac50a25
commit
8238deb146
|
@ -1,69 +1,3 @@
|
||||||
***REMOVED******REMOVED***
|
|
||||||
***REMOVED***
|
|
||||||
***REMOVED***import static org.gcube.resources.discovery.icclient.ICFactory.clientFor;
|
|
||||||
***REMOVED***import static org.gcube.resources.discovery.icclient.ICFactory.queryFor;
|
|
||||||
***REMOVED***
|
|
||||||
***REMOVED***import java.util.Collection;
|
|
||||||
***REMOVED******REMOVED***
|
|
||||||
***REMOVED***import java.util.Vector;
|
|
||||||
***REMOVED***
|
|
||||||
***REMOVED***import org.gcube.common.resources.gcore.ServiceEndpoint;
|
|
||||||
***REMOVED******REMOVED***
|
|
||||||
***REMOVED***import org.gcube.dataanalysis.dataminer.poolmanager.datamodel.Domain;
|
|
||||||
***REMOVED******REMOVED***
|
|
||||||
***REMOVED***import org.gcube.resources.discovery.client.api.DiscoveryClient;
|
|
||||||
***REMOVED***import org.gcube.resources.discovery.client.queries.api.SimpleQuery;
|
|
||||||
***REMOVED***
|
|
||||||
***REMOVED***public class ISClient {
|
|
||||||
***REMOVED***
|
|
||||||
***REMOVED*** /**
|
|
||||||
***REMOVED*** * Return the list of hosts (dataminers) in a given VRE
|
|
||||||
***REMOVED*** *
|
|
||||||
***REMOVED*** * @param vreName
|
|
||||||
***REMOVED*** * @return
|
|
||||||
***REMOVED*** */
|
|
||||||
***REMOVED*** public Collection<Host> listDataminersInVRE() {
|
|
||||||
***REMOVED***
|
|
||||||
***REMOVED*** boolean remote = false;
|
|
||||||
***REMOVED***
|
|
||||||
***REMOVED*** if (!remote) {
|
|
||||||
***REMOVED*** Collection<Host> out = new Vector<>();
|
|
||||||
***REMOVED*** Host h = new Host();
|
|
||||||
***REMOVED*** ***REMOVED***h.setName("bb-dataminer.res.eng.it");
|
|
||||||
***REMOVED*** ***REMOVED***h.setName("vm101.ui.savba.sk");
|
|
||||||
***REMOVED*** h.setName("dataminer1-devnext.d4science.org");
|
|
||||||
***REMOVED*** out.add(h);
|
|
||||||
***REMOVED*** return out;
|
|
||||||
***REMOVED*** ***REMOVED*** else {
|
|
||||||
***REMOVED***
|
|
||||||
***REMOVED*** SimpleQuery query = queryFor(ServiceEndpoint.class);
|
|
||||||
***REMOVED***
|
|
||||||
***REMOVED*** ***REMOVED***old version
|
|
||||||
***REMOVED*** ***REMOVED***query.addCondition("$resource/Profile/Category/text() eq 'DataAnalysis'")
|
|
||||||
***REMOVED*** ***REMOVED***.addCondition("$resource/Profile/Name/text() eq 'DataMiner'");
|
|
||||||
***REMOVED***
|
|
||||||
***REMOVED*** query.addCondition("$resource/Profile/Platform/Name/text() eq 'DataMiner'");
|
|
||||||
***REMOVED***
|
|
||||||
***REMOVED*** DiscoveryClient<ServiceEndpoint> client = clientFor(ServiceEndpoint.class);
|
|
||||||
***REMOVED***
|
|
||||||
***REMOVED*** List<ServiceEndpoint> resources = client.submit(query);
|
|
||||||
***REMOVED***
|
|
||||||
***REMOVED*** Collection<Host> out = new Vector<>();
|
|
||||||
***REMOVED*** for (ServiceEndpoint r : resources) {
|
|
||||||
***REMOVED*** Host h = new Host();
|
|
||||||
***REMOVED*** h.setName(r.profile().runtime().hostedOn());
|
|
||||||
***REMOVED*** out.add(h);
|
|
||||||
***REMOVED*** ***REMOVED***
|
|
||||||
***REMOVED*** return out;
|
|
||||||
***REMOVED*** ***REMOVED***
|
|
||||||
***REMOVED*** ***REMOVED***
|
|
||||||
***REMOVED***
|
|
||||||
***REMOVED*** public static void main(String[] args) {
|
|
||||||
***REMOVED*** ISClient a = new ISClient();
|
|
||||||
***REMOVED*** ScopeProvider.instance.set("/gcube/devNext/NextNext");
|
|
||||||
***REMOVED*** System.out.println(a.listDataminersInVRE());
|
|
||||||
***REMOVED******REMOVED***
|
|
||||||
***REMOVED******REMOVED***
|
|
||||||
***REMOVED***
|
***REMOVED***
|
||||||
|
|
||||||
import static org.gcube.resources.discovery.icclient.ICFactory.clientFor;
|
import static org.gcube.resources.discovery.icclient.ICFactory.clientFor;
|
||||||
|
@ -138,113 +72,109 @@ public class ISClient {
|
||||||
***REMOVED***
|
***REMOVED***
|
||||||
return h;
|
return h;
|
||||||
***REMOVED***
|
***REMOVED***
|
||||||
|
|
||||||
|
|
||||||
|
***REMOVED*** return the HProxy hostname in the VRE
|
||||||
***REMOVED*** return the HProxy hostname in the VRE
|
public static String getHProxy() {
|
||||||
public static String getHProxy(){
|
Host h = new Host();
|
||||||
Host h = new Host();
|
SimpleQuery query = queryFor(ServiceEndpoint.class);
|
||||||
SimpleQuery query = queryFor(ServiceEndpoint.class);
|
query.addCondition("$resource/Profile/Platform/Name/text() eq 'DataMiner'");
|
||||||
query.addCondition("$resource/Profile/Platform/Name/text() eq 'DataMiner'");
|
DiscoveryClient<ServiceEndpoint> client = clientFor(ServiceEndpoint.class);
|
||||||
DiscoveryClient<ServiceEndpoint> client = clientFor(ServiceEndpoint.class);
|
List<ServiceEndpoint> resources = client.submit(query);
|
||||||
List<ServiceEndpoint> resources = client.submit(query);
|
h.setName(resources.get(0).profile().runtime().hostedOn());
|
||||||
h.setName(resources.get(0).profile().runtime().hostedOn());
|
return h.getName();
|
||||||
return h.getName();
|
|
||||||
***REMOVED***
|
***REMOVED***
|
||||||
|
|
||||||
***REMOVED***return the Cluster hostname from the IS
|
***REMOVED*** return the Cluster hostname from the IS
|
||||||
***REMOVED***to develop
|
***REMOVED*** to develop
|
||||||
***REMOVED***public Cluster getCluster(){
|
***REMOVED*** public Cluster getCluster(){
|
||||||
***REMOVED*** Cluster cl = new Cluster();
|
***REMOVED*** Cluster cl = new Cluster();
|
||||||
***REMOVED*** String HProxy = this.getHProxy();
|
***REMOVED*** String HProxy = this.getHProxy();
|
||||||
***REMOVED*** SimpleQuery query = queryFor(ServiceEndpoint.class);
|
***REMOVED*** SimpleQuery query = queryFor(ServiceEndpoint.class);
|
||||||
***REMOVED*** query.addCondition("$resource/Profile/Platform/Name/text() eq 'DataMiner'");
|
***REMOVED*** query.addCondition("$resource/Profile/Platform/Name/text() eq
|
||||||
***REMOVED*** DiscoveryClient<ServiceEndpoint> client = clientFor(ServiceEndpoint.class);
|
***REMOVED*** 'DataMiner'");
|
||||||
***REMOVED*** List<ServiceEndpoint> resources = client.submit(query);
|
***REMOVED*** DiscoveryClient<ServiceEndpoint> client =
|
||||||
***REMOVED*** cl.setName(resources.get(0).profile().runtime().hostedOn());
|
***REMOVED*** clientFor(ServiceEndpoint.class);
|
||||||
***REMOVED*** return null;
|
***REMOVED*** List<ServiceEndpoint> resources = client.submit(query);
|
||||||
***REMOVED***
|
***REMOVED*** cl.setName(resources.get(0).profile().runtime().hostedOn());
|
||||||
***REMOVED******REMOVED***
|
***REMOVED*** return null;
|
||||||
|
***REMOVED***
|
||||||
|
***REMOVED*** ***REMOVED***
|
||||||
|
|
||||||
***REMOVED***return the dataminer hostnames from the IS
|
***REMOVED*** return the dataminer hostnames from the IS
|
||||||
***REMOVED***to develop
|
***REMOVED*** to develop
|
||||||
***REMOVED***public List<Host> getDM(){
|
***REMOVED*** public List<Host> getDM(){
|
||||||
***REMOVED*** Cluster cl = new Cluster();
|
***REMOVED*** Cluster cl = new Cluster();
|
||||||
***REMOVED*** String HProxy = this.getHProxy();
|
***REMOVED*** String HProxy = this.getHProxy();
|
||||||
***REMOVED*** SimpleQuery query = queryFor(ServiceEndpoint.class);
|
***REMOVED*** SimpleQuery query = queryFor(ServiceEndpoint.class);
|
||||||
***REMOVED*** query.addCondition("$resource/Profile/Platform/Name/text() eq 'DataMiner'");
|
***REMOVED*** query.addCondition("$resource/Profile/Platform/Name/text() eq
|
||||||
***REMOVED*** DiscoveryClient<ServiceEndpoint> client = clientFor(ServiceEndpoint.class);
|
***REMOVED*** 'DataMiner'");
|
||||||
***REMOVED*** List<ServiceEndpoint> resources = client.submit(query);
|
***REMOVED*** DiscoveryClient<ServiceEndpoint> client =
|
||||||
***REMOVED*** cl.setName(resources.get(0).profile().runtime().hostedOn());
|
***REMOVED*** clientFor(ServiceEndpoint.class);
|
||||||
***REMOVED*** return null;
|
***REMOVED*** List<ServiceEndpoint> resources = client.submit(query);
|
||||||
***REMOVED***
|
***REMOVED*** cl.setName(resources.get(0).profile().runtime().hostedOn());
|
||||||
***REMOVED******REMOVED***
|
***REMOVED*** return null;
|
||||||
|
***REMOVED***
|
||||||
|
***REMOVED*** ***REMOVED***
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Return the list of hosts (dataminers) in a given VRE
|
||||||
|
*
|
||||||
|
* @param vreName
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
public Collection<Host> listDataminersInVRE() {
|
||||||
|
|
||||||
|
boolean remote = false;
|
||||||
/**
|
|
||||||
* Return the list of hosts (dataminers) in a given VRE
|
|
||||||
*
|
|
||||||
* @param vreName
|
|
||||||
* @return
|
|
||||||
*/
|
|
||||||
public Collection<Host> listDataminersInVRE() {
|
|
||||||
|
|
||||||
boolean remote = false;
|
if (!remote) {
|
||||||
|
Collection<Host> out = new Vector<>();
|
||||||
|
Host h = new Host();
|
||||||
|
***REMOVED*** h.setName("bb-dataminer.res.eng.it");
|
||||||
|
***REMOVED*** h.setName("vm101.ui.savba.sk");
|
||||||
|
h.setName("dataminer1-devnext.d4science.org");
|
||||||
|
out.add(h);
|
||||||
|
***REMOVED***
|
||||||
|
***REMOVED*** else {
|
||||||
|
|
||||||
if (!remote) {
|
SimpleQuery query = queryFor(ServiceEndpoint.class);
|
||||||
Collection<Host> out = new Vector<>();
|
|
||||||
Host h = new Host();
|
|
||||||
***REMOVED***h.setName("bb-dataminer.res.eng.it");
|
|
||||||
***REMOVED***h.setName("vm101.ui.savba.sk");
|
|
||||||
h.setName("dataminer1-devnext.d4science.org");
|
|
||||||
out.add(h);
|
|
||||||
return out;
|
|
||||||
***REMOVED*** else {
|
|
||||||
|
|
||||||
SimpleQuery query = queryFor(ServiceEndpoint.class);
|
***REMOVED*** old version
|
||||||
|
***REMOVED*** query.addCondition("$resource/Profile/Category/text() eq
|
||||||
|
***REMOVED*** 'DataAnalysis'")
|
||||||
|
***REMOVED*** .addCondition("$resource/Profile/Name/text() eq 'DataMiner'");
|
||||||
|
|
||||||
***REMOVED***old version
|
query.addCondition("$resource/Profile/Platform/Name/text() eq 'DataMiner'");
|
||||||
***REMOVED***query.addCondition("$resource/Profile/Category/text() eq 'DataAnalysis'")
|
|
||||||
***REMOVED***.addCondition("$resource/Profile/Name/text() eq 'DataMiner'");
|
|
||||||
|
|
||||||
query.addCondition("$resource/Profile/Platform/Name/text() eq 'DataMiner'");
|
DiscoveryClient<ServiceEndpoint> client = clientFor(ServiceEndpoint.class);
|
||||||
|
|
||||||
DiscoveryClient<ServiceEndpoint> client = clientFor(ServiceEndpoint.class);
|
|
||||||
|
|
||||||
List<ServiceEndpoint> resources = client.submit(query);
|
List<ServiceEndpoint> resources = client.submit(query);
|
||||||
|
|
||||||
Collection<Host> out = new Vector<>();
|
Collection<Host> out = new Vector<>();
|
||||||
for (ServiceEndpoint r : resources) {
|
for (ServiceEndpoint r : resources) {
|
||||||
Host h = new Host();
|
Host h = new Host();
|
||||||
h.setName(r.profile().runtime().hostedOn());
|
h.setName(r.profile().runtime().hostedOn());
|
||||||
out.add(h);
|
out.add(h);
|
||||||
***REMOVED***
|
***REMOVED***
|
||||||
return out;
|
***REMOVED***
|
||||||
***REMOVED***
|
***REMOVED***
|
||||||
***REMOVED***
|
***REMOVED***
|
||||||
|
|
||||||
public static void main(String[] args) throws IOException, SVNException {
|
public static void main(String[] args) throws IOException, SVNException {
|
||||||
ISClient a = new ISClient();
|
ISClient a = new ISClient();
|
||||||
ScopeProvider.instance.set("/gcube/devNext/NextNext");
|
ScopeProvider.instance.set("/gcube/devNext/NextNext");
|
||||||
***REMOVED***System.out.println(a.getHProxy());
|
***REMOVED*** System.out.println(a.getHProxy());
|
||||||
***REMOVED***System.out.println(a.MapCluster());
|
***REMOVED*** System.out.println(a.MapCluster());
|
||||||
***REMOVED***System.out.println(a.listDataMinersByCluster());
|
***REMOVED*** System.out.println(a.listDataMinersByCluster());
|
||||||
***REMOVED***System.out.println(a.listDataMinersByCluster());
|
***REMOVED*** System.out.println(a.listDataMinersByCluster());
|
||||||
|
|
||||||
|
***REMOVED*** List<Dependency> list = new LinkedList<Dependency>();
|
||||||
***REMOVED***List<Dependency> list = new LinkedList<Dependency>();
|
***REMOVED*** Dependency aa = new Dependency();
|
||||||
***REMOVED***Dependency aa = new Dependency();
|
***REMOVED*** aa.setName("testnunzio");
|
||||||
***REMOVED***aa.setName("testnunzio");
|
***REMOVED*** aa.setType("cran:");
|
||||||
***REMOVED***aa.setType("cran:");
|
***REMOVED*** list.add(aa);
|
||||||
***REMOVED***list.add(aa);
|
|
||||||
|
***REMOVED*** a.checkSVNdep();
|
||||||
|
***REMOVED*** System.out.println(a.getDataminer("dataminer1-devnext.d4science.org").getDomain());
|
||||||
|
***REMOVED*** System.out.println(a.listDataminersInVRE());
|
||||||
|
|
||||||
|
|
||||||
***REMOVED***a.checkSVNdep();
|
|
||||||
***REMOVED***System.out.println(a.getDataminer("dataminer1-devnext.d4science.org").getDomain());
|
|
||||||
***REMOVED***System.out.println(a.listDataminersInVRE());
|
|
||||||
***REMOVED***
|
***REMOVED***
|
||||||
***REMOVED***
|
***REMOVED***
|
||||||
|
|
Loading…
Reference in New Issue