diff --git a/src/main/java/org/gcube/dataanalysis/dataminer/poolmanager/process/AlgorithmPackageParser.java b/src/main/java/org/gcube/dataanalysis/dataminer/poolmanager/process/AlgorithmPackageParser.java index 1f20c26..a3367de 100644 --- a/src/main/java/org/gcube/dataanalysis/dataminer/poolmanager/process/AlgorithmPackageParser.java +++ b/src/main/java/org/gcube/dataanalysis/dataminer/poolmanager/process/AlgorithmPackageParser.java @@ -289,4 +289,31 @@ public class AlgorithmPackageParser ***REMOVED*** ***REMOVED*** ***REMOVED*** + + public static void main(String[] args) ***REMOVED*** + AlgorithmPackageParser ap = new AlgorithmPackageParser(); + String txt = + "Username: giancarlo.panichi\n"+ + "Full Name: Giancarlo Panichi\n"+ + "Email: g.panichi@isti.cnr.it\n"+ + "Language: R\n"+ + "Algorithm Name: RBLACKBOX\n"+ + "Class Name: org.gcube.dataanalysis.executor.rscripts.RBlackBox\n"+ + "Algorithm Description: RBlackBox\n"+ + "Algorithm Category: BLACK_BOX\n"+ + "Interpreter Version: 3.2.1\n"+ + "Packages:\n"+ + "Package Name: DBI\n"+ + "Package Name: RPostgreSQL\n"+ + "Package Name: raster\n"+ + "Package Name: maptools\n"+ + "Package Name: sqldf\n"+ + "Package Name: RJSONIO\n"+ + "Package Name: httr \n"+ + "Package Name: data.table"; + + + ap.parseMetadata(txt); +***REMOVED*** + ***REMOVED*** diff --git a/src/main/java/org/gcube/dataanalysis/dataminer/poolmanager/service/DataminerPoolManager.java b/src/main/java/org/gcube/dataanalysis/dataminer/poolmanager/service/DataminerPoolManager.java index 956f0b8..326886e 100644 --- a/src/main/java/org/gcube/dataanalysis/dataminer/poolmanager/service/DataminerPoolManager.java +++ b/src/main/java/org/gcube/dataanalysis/dataminer/poolmanager/service/DataminerPoolManager.java @@ -28,21 +28,23 @@ public class DataminerPoolManager ***REMOVED*** ***REMOVED*** -***REMOVED***Algorithm algo) throws IOException, InterruptedException ***REMOVED*** +***REMOVED***Algorithm algo, String env) throws IOException, InterruptedException ***REMOVED*** + + Cluster stagingCluster = ClusterBuilder.getStagingDataminerCluster(env); - Cluster stagingCluster = ClusterBuilder.getStagingDataminerCluster(); + ***REMOVED***Cluster rProtoCluster = ClusterBuilder.getRProtoCluster(); - DMPMJob job = new StagingJob(this.svnUpdater, algo, stagingCluster, /*rProtoCluster,*/ ScopeProvider.instance.get()); + DMPMJob job = new StagingJob(this.svnUpdater, algo, stagingCluster, /*rProtoCluster,*/ ScopeProvider.instance.get(), env); String id = job.start(); return id; ***REMOVED*** -***REMOVED***Algorithm algo, String targetVREToken, String targetVRE) throws IOException, InterruptedException ***REMOVED*** +***REMOVED***Algorithm algo, String targetVREToken, String targetVRE, String env) throws IOException, InterruptedException ***REMOVED*** ***REMOVED***Cluster prodCluster = ClusterBuilder.getVRECluster(targetVREToken, targetVRE); - DMPMJob job = new ProductionPublishingJob(this.svnUpdater, algo, /*prodCluster,*/ targetVRE, targetVREToken); + DMPMJob job = new ProductionPublishingJob(this.svnUpdater, algo, /*prodCluster,*/ targetVRE, targetVREToken,env); String id = job.start(); return id; ***REMOVED*** diff --git a/src/main/java/org/gcube/dataanalysis/dataminer/poolmanager/service/ProductionPublishingJob.java b/src/main/java/org/gcube/dataanalysis/dataminer/poolmanager/service/ProductionPublishingJob.java index 990f71d..c6a1738 100644 --- a/src/main/java/org/gcube/dataanalysis/dataminer/poolmanager/service/ProductionPublishingJob.java +++ b/src/main/java/org/gcube/dataanalysis/dataminer/poolmanager/service/ProductionPublishingJob.java @@ -20,13 +20,16 @@ public class ProductionPublishingJob extends DMPMJob ***REMOVED*** ***REMOVED***private Cluster prodCluster; private String targetVREName; private String targetVREToken; + private String env; - public ProductionPublishingJob(SVNUpdater svnUpdater, Algorithm algorithm, /*Cluster prodCluster,*/ String targetVREName, String targetVREToken) throws FileNotFoundException, UnsupportedEncodingException ***REMOVED*** + + public ProductionPublishingJob(SVNUpdater svnUpdater, Algorithm algorithm, /*Cluster prodCluster,*/ String targetVREName, String targetVREToken, String env) throws FileNotFoundException, UnsupportedEncodingException ***REMOVED*** super(svnUpdater); this.algorithm = algorithm; ***REMOVED***this.prodCluster = prodCluster; this.targetVREName = targetVREName; this.targetVREToken = targetVREToken; + this.env= env; this.jobLogs = new File(System.getProperty("user.home") + File.separator + "dataminer-pool-manager" + File.separator + "jobs"); @@ -42,7 +45,7 @@ public class ProductionPublishingJob extends DMPMJob ***REMOVED*** if (CheckPermission.apply(targetVREToken,targetVREName))***REMOVED*** ***REMOVED***this.svnUpdater.updateProdDeps(this.algorithm); - this.svnUpdater.updateSVNProdAlgorithmList(this.algorithm, this.targetVREName, this.algorithm.getFullname(), "Prod"); + this.svnUpdater.updateSVNAlgorithmList(this.algorithm, this.targetVREName, this.algorithm.getFullname(), env); this.getStatus(9); sm.sendNotification(nh.getSuccessSubjectRelease() + " for "+this.algorithm.getName()+ " algorithm", nh.getSuccessBodyRelease(this.buildInfo())); return; diff --git a/src/main/java/org/gcube/dataanalysis/dataminer/poolmanager/service/StagingJob.java b/src/main/java/org/gcube/dataanalysis/dataminer/poolmanager/service/StagingJob.java index 3af1cc1..63903e9 100644 --- a/src/main/java/org/gcube/dataanalysis/dataminer/poolmanager/service/StagingJob.java +++ b/src/main/java/org/gcube/dataanalysis/dataminer/poolmanager/service/StagingJob.java @@ -27,10 +27,12 @@ public class StagingJob extends DMPMJob ***REMOVED*** private Cluster stagingCluster; ***REMOVED*** private Cluster rProtoCluster; private String rProtoVREName; + private String env; + public StagingJob(SVNUpdater svnUpdater, Algorithm algorithm, Cluster stagingCluster, /* Cluster rProtoCluster, */ - String rProtoVREName) throws FileNotFoundException, UnsupportedEncodingException ***REMOVED*** + String rProtoVREName, String env) throws FileNotFoundException, UnsupportedEncodingException ***REMOVED*** super(svnUpdater); this.jobLogs = new File( System.getProperty("user.home") + File.separator + "dataminer-pool-manager" + File.separator + "jobs"); @@ -40,6 +42,8 @@ public class StagingJob extends DMPMJob ***REMOVED*** this.stagingCluster = stagingCluster; ***REMOVED*** this.rProtoCluster = rProtoCluster; this.rProtoVREName = rProtoVREName; + this.env = env; + ***REMOVED***File m = new File(this.jobLogs + File.separator + this.id + "_exitStatus"); ***REMOVED***PrintWriter writer = new PrintWriter(m, "UTF-8"); @@ -58,17 +62,18 @@ public class StagingJob extends DMPMJob ***REMOVED*** try ***REMOVED*** Collection undefinedDependencies = this.svnUpdater.getUndefinedDependencies( - this.svnUpdater.getRProtoDependencyFile(this.algorithm.getLanguage()), + this.svnUpdater.getDependencyFile(this.algorithm.getLanguage(),env), this.algorithm.getDependencies()); if (!undefinedDependencies.isEmpty()) ***REMOVED*** String message = "Following dependencies are not defined:\n"; for (String n : undefinedDependencies) ***REMOVED*** - message += "\n" + n; + message += "\n" + n +"\n"; ***REMOVED*** + this.getStatus(2); - sm.sendNotification(nh.getFailedSubject() +" for "+this.algorithm.getName()+ " algorithm", nh.getFailedBody(this.buildInfo()+message)); + sm.sendNotification(nh.getFailedSubject() +" for "+this.algorithm.getName()+ " algorithm", nh.getFailedBody(message+this.buildInfo())); return; ***REMOVED*** @@ -84,14 +89,14 @@ public class StagingJob extends DMPMJob ***REMOVED*** if (ret == 0) ***REMOVED*** this.getStatus(0); - if (b.checkMethod(a.getStagingHost(), SecurityTokenProvider.instance.get()) - && (b.algoExists(this.algorithm))) ***REMOVED*** + if (b.checkMethod(a.getHost(this.env), SecurityTokenProvider.instance.get()) + && (b.algoExists(this.algorithm, this.env))) ***REMOVED*** System.out.println("Interface check ok!"); System.out.println("Both the files exist at the correct path!"); - this.svnUpdater.updateSVNRProtoAlgorithmList(this.algorithm, this.rProtoVREName, - this.algorithm.getFullname(), "Proto"); + this.svnUpdater.updateSVNAlgorithmList(this.algorithm, this.rProtoVREName, + this.algorithm.getFullname(), env); this.getStatus(9); sm.sendNotification(nh.getSuccessSubject() + " for "+this.algorithm.getName()+ " algorithm", nh.getSuccessBody(this.buildInfo())); @@ -148,7 +153,7 @@ public class StagingJob extends DMPMJob ***REMOVED*** "Algorithm details:\n"+"\n"+ "User: "+this.algorithm.getFullname()+"\n"+ "Algorithm name: "+this.algorithm.getName()+"\n"+ - "Staging DataMiner Host: "+ a.getStagingHost()+"\n"+ + "Staging DataMiner Host: "+ a.getHost(this.env)+"\n"+ "Caller VRE: "+rProtoVREName+"\n"+ "Target VRE: "+rProtoVREName+"\n"; ***REMOVED*** diff --git a/src/main/java/org/gcube/dataanalysis/dataminer/poolmanager/util/CheckMethod.java b/src/main/java/org/gcube/dataanalysis/dataminer/poolmanager/util/CheckMethod.java index bd9394b..7c6d024 100644 --- a/src/main/java/org/gcube/dataanalysis/dataminer/poolmanager/util/CheckMethod.java +++ b/src/main/java/org/gcube/dataanalysis/dataminer/poolmanager/util/CheckMethod.java @@ -85,7 +85,7 @@ public class CheckMethod ***REMOVED*** - public boolean algoExists(Algorithm a) throws Exception***REMOVED*** + public boolean algoExists(Algorithm a, String env) throws Exception***REMOVED*** File file = new File("/home/gcube/wps_algorithms/algorithms/"+a.getName()+".jar"); @@ -96,9 +96,9 @@ public class CheckMethod ***REMOVED*** System.out.println("Second file is located to: "+file2.getPath()); - if ((this.doesExist(file.getPath())) && (this.doesExist(file2.getPath())))***REMOVED*** - this.copyFromDmToSVN(file); - this.copyFromDmToSVN(file2); + if ((this.doesExist(file.getPath(),env)) && (this.doesExist(file2.getPath(),env)))***REMOVED*** + this.copyFromDmToSVN(file,env); + this.copyFromDmToSVN(file2,env); return true; @@ -109,7 +109,7 @@ public class CheckMethod ***REMOVED*** ***REMOVED*** - public boolean doesExist(String path) throws Exception ***REMOVED*** + public boolean doesExist(String path, String env) throws Exception ***REMOVED*** JSch jsch = new JSch(); Session session = null; Channel channel = null; @@ -124,7 +124,7 @@ public class CheckMethod ***REMOVED*** jsch.addIdentity(privateKey); System.out.println("Private Key Added."); - session = jsch.getSession("root", p.getStagingHost()); + session = jsch.getSession("root", p.getHost(env)); System.out.println("session created."); java.util.Properties config = new java.util.Properties(); @@ -163,7 +163,7 @@ public class CheckMethod ***REMOVED*** - public void copyFromDmToSVN(File a) throws Exception ***REMOVED*** + public void copyFromDmToSVN(File a,String env) throws Exception ***REMOVED*** JSch jsch = new JSch(); Session session = null; ServiceConfiguration sc = new ServiceConfiguration(); @@ -177,7 +177,7 @@ public class CheckMethod ***REMOVED*** jsch.addIdentity(privateKey); System.out.println("Private Key Added."); - session = jsch.getSession("root", p.getStagingHost()); + session = jsch.getSession("root", p.getHost(env)); System.out.println("session created."); java.util.Properties config = new java.util.Properties(); @@ -223,21 +223,22 @@ public class CheckMethod ***REMOVED*** ***REMOVED*** System.out.println(a.getStagingHost()); CheckMethod a = new CheckMethod(); - File aa = new File("OCTAVEBLACKBOX.jar"); - System.out.println(aa.getName()); - System.out.println(aa.getPath()); +***REMOVED*** File aa = new File("OCTAVEBLACKBOX.jar"); +***REMOVED*** System.out.println(aa.getName()); +***REMOVED*** System.out.println(aa.getPath()); - a.copyFromDmToSVN(aa); -***REMOVED*** if (a.checkMethod("dataminer1-devnext.d4science.org", "***REMOVED***"))***REMOVED*** -***REMOVED*** System.out.println("ciao");***REMOVED*** + + ***REMOVED***a.copyFromDmToSVN(aa); + if (a.checkMethod("dataminer1-devnext.d4science.org", "***REMOVED***"))***REMOVED*** + System.out.println("ciaocia");***REMOVED*** ***REMOVED******REMOVED*** -***REMOVED*** if (a.doesExist("/home/gcube/wps_algorithms/algorithms/XMEANS_interface.jar"))***REMOVED*** -***REMOVED*** System.out.println("ciao"); + if (a.doesExist("/home/gcube/wps_algorithms/algorithms/RBLACKBOX.jar","Dev"))***REMOVED*** + System.out.println("ciao"); ***REMOVED******REMOVED*** ***REMOVED*** ***REMOVED*** ***REMOVED******REMOVED*** -***REMOVED*** +***REMOVED******REMOVED*** ***REMOVED*** diff --git a/src/main/java/org/gcube/dataanalysis/dataminer/poolmanager/util/ClusterBuilder.java b/src/main/java/org/gcube/dataanalysis/dataminer/poolmanager/util/ClusterBuilder.java index 46d21f9..1f1f831 100644 --- a/src/main/java/org/gcube/dataanalysis/dataminer/poolmanager/util/ClusterBuilder.java +++ b/src/main/java/org/gcube/dataanalysis/dataminer/poolmanager/util/ClusterBuilder.java @@ -13,13 +13,21 @@ public class ClusterBuilder ***REMOVED*** ***REMOVED***1. to complete - public static Cluster getStagingDataminerCluster() throws FileNotFoundException***REMOVED*** + public static Cluster getStagingDataminerCluster(String env) throws FileNotFoundException***REMOVED*** Cluster cluster = new Cluster(); ServiceConfiguration p = new ServiceConfiguration(); - Host h = new Host(p.getStagingHost()); - ***REMOVED***TODO: read this from configuration or IS? - h.setName(p.getStagingHost()); - cluster.addHost(h); + Host h = new Host(); + + if (env.equals("Dev"))***REMOVED*** + h.setName(p.getDevStagingHost()); + cluster.addHost(h); + ***REMOVED*** + + if ((env.equals("Prod")||(env.equals("Proto"))))***REMOVED*** + h.setName(p.getProtoProdStagingHost()); + cluster.addHost(h); + ***REMOVED*** + return cluster; ***REMOVED*** diff --git a/src/main/java/org/gcube/dataanalysis/dataminer/poolmanager/util/SVNUpdater.java b/src/main/java/org/gcube/dataanalysis/dataminer/poolmanager/util/SVNUpdater.java index 0fc47a9..ca5906e 100644 --- a/src/main/java/org/gcube/dataanalysis/dataminer/poolmanager/util/SVNUpdater.java +++ b/src/main/java/org/gcube/dataanalysis/dataminer/poolmanager/util/SVNUpdater.java @@ -44,6 +44,27 @@ public class SVNUpdater ***REMOVED*** ***REMOVED*** this.updateSVN(this.configuration.getSVNRProtoGitHubDepsList(), algorithm.getGitHubDependencies()); ***REMOVED******REMOVED*** + + + public String getDependencyFile(String language, String env)***REMOVED*** + + String a = ""; + if (env.equals("Dev"))***REMOVED*** + a= this.getDevDependencyFile(language); + ***REMOVED*** + + if (env.equals("Prod"))***REMOVED*** + a= this.getProdDependencyFile(language); + ***REMOVED*** + + if (env.equals("Proto"))***REMOVED*** + a= this.getRProtoDependencyFile(language); + ***REMOVED*** + return a; +***REMOVED*** + + + public String getRProtoDependencyFile(String language) ***REMOVED*** switch (language) ***REMOVED*** case "R": @@ -97,6 +118,35 @@ public class SVNUpdater ***REMOVED*** ***REMOVED*** + public String getDevDependencyFile(String language) ***REMOVED*** + switch (language) ***REMOVED*** + case "R": + return this.configuration.getSVNRDevCRANDepsList(); + case "R-blackbox": + return this.configuration.getSVNRDevRBDepsList(); + case "Java": + return this.configuration.getSVNRDevJavaDepsList(); + case "Knime-Workflow": + return this.configuration.getSVNRDevKWDepsList(); + case "Linux-compiled": + return this.configuration.getSVNRDevLinuxCompiledDepsList(); + case "Octave": + return this.configuration.getSVNRDevOctaveDepsList(); + case "Python": + return this.configuration.getSVNRDevPythonDepsList(); + case "Pre-Installed": + return this.configuration.getSVNRDevPreInstalledDepsList(); + case "Windows-compiled": + return this.configuration.getSVNRDevWCDepsList(); + default: + ***REMOVED*** + ***REMOVED*** +***REMOVED*** + + + + + public void readRPRotoDeps(Algorithm algorithm) throws SVNException ***REMOVED*** if (algorithm.getLanguage().equals("R")) ***REMOVED*** @@ -157,6 +207,43 @@ public class SVNUpdater ***REMOVED*** this.checkIfAvaialable("", algorithm.getDependencies()); ***REMOVED*** ***REMOVED*** + + + + public void readRDevDeps(Algorithm algorithm) throws SVNException ***REMOVED*** + if (algorithm.getLanguage().equals("R")) ***REMOVED*** + this.checkIfAvaialable(this.configuration.getSVNRProtoCRANDepsList(), algorithm.getDependencies()); + ***REMOVED*** + if (algorithm.getLanguage().equals("R-blackbox")) ***REMOVED*** + this.checkIfAvaialable("", algorithm.getDependencies()); + ***REMOVED*** + if (algorithm.getLanguage().equals("Java")) ***REMOVED*** + this.checkIfAvaialable("", algorithm.getDependencies()); + ***REMOVED*** + if (algorithm.getLanguage().equals("Knime-Workflow")) ***REMOVED*** + this.checkIfAvaialable(this.configuration.getSVNRProtoCRANDepsList(), algorithm.getDependencies()); + ***REMOVED*** + if (algorithm.getLanguage().equals("Linux-compiled")) ***REMOVED*** + this.checkIfAvaialable("", algorithm.getDependencies()); + ***REMOVED*** + if (algorithm.getLanguage().equals("Octave")) ***REMOVED*** + this.checkIfAvaialable("", algorithm.getDependencies()); + ***REMOVED*** + if (algorithm.getLanguage().equals("Python")) ***REMOVED*** + this.checkIfAvaialable("", algorithm.getDependencies()); + ***REMOVED*** + if (algorithm.getLanguage().equals("Windows-compiled")) ***REMOVED*** + this.checkIfAvaialable("", algorithm.getDependencies()); + ***REMOVED*** + if (algorithm.getLanguage().equals("Pre-Installed")) ***REMOVED*** + this.checkIfAvaialable("", algorithm.getDependencies()); + ***REMOVED*** +***REMOVED*** + + + + + ***REMOVED*** public void updateProdDeps(Algorithm algorithm) ***REMOVED*** ***REMOVED*** this.updateSVN(this.configuration.getSVNProdOSDepsList(), algorithm.getOSDependencies()); @@ -164,8 +251,19 @@ public class SVNUpdater ***REMOVED*** ***REMOVED*** this.updateSVN(this.configuration.getSVNRProdGitHubDepsList(), algorithm.getGitHubDependencies()); ***REMOVED******REMOVED*** - public void updateSVNRProtoAlgorithmList(Algorithm algorithm, String targetVRE, String user, String env) ***REMOVED*** + public void updateSVNAlgorithmList(Algorithm algorithm, String targetVRE, String user, String env) ***REMOVED*** + + if (env.equals("Dev"))***REMOVED*** + this.updateSVNAlgorithmList(this.configuration.getSVNDevAlgorithmsList(), algorithm, targetVRE, user, env); + ***REMOVED*** + + if (env.equals("Prod"))***REMOVED*** + this.updateSVNAlgorithmList(this.configuration.getSVNProdAlgorithmsList(), algorithm, targetVRE, user, env); + ***REMOVED*** + + if (env.equals("Proto"))***REMOVED*** this.updateSVNAlgorithmList(this.configuration.getSVNRProtoAlgorithmsList(), algorithm, targetVRE, user, env); + ***REMOVED*** ***REMOVED*** public void updateSVNProdAlgorithmList(Algorithm algorithm, String targetVRE, String user, String env) ***REMOVED*** @@ -350,11 +448,12 @@ public class SVNUpdater ***REMOVED*** System.out.println("Checking dependencies list: " + file); final ByteArrayOutputStream byteArrayOutputStream = new ByteArrayOutputStream(); svnRepository.getFile(file, SVNRepository.INVALID_REVISION, null, byteArrayOutputStream); - String lines[] = byteArrayOutputStream.toString().split("\\r?\\n"); - List validDependencies = Arrays.asList(lines); - - + List validDependencies = new LinkedList(); + for(String l: byteArrayOutputStream.toString().split("\\r?\\n"))***REMOVED*** + validDependencies.add(l.trim()); + ***REMOVED*** + List undefined = new LinkedList(); diff --git a/src/main/java/org/gcube/dataanalysis/dataminer/poolmanager/util/ServiceConfiguration.java b/src/main/java/org/gcube/dataanalysis/dataminer/poolmanager/util/ServiceConfiguration.java index 7a697db..d35f4bb 100644 --- a/src/main/java/org/gcube/dataanalysis/dataminer/poolmanager/util/ServiceConfiguration.java +++ b/src/main/java/org/gcube/dataanalysis/dataminer/poolmanager/util/ServiceConfiguration.java @@ -133,6 +133,49 @@ public class ServiceConfiguration ***REMOVED*** + ***REMOVED***dev + public String getSVNDevAlgorithmsList()***REMOVED*** + return props.getProperty("svn.dev.algorithms-list"); + ***REMOVED*** + + public String getSVNRDevLinuxCompiledDepsList()***REMOVED*** + return props.getProperty("svn.dev.deps-linux-compiled"); + ***REMOVED*** + + public String getSVNRDevCRANDepsList()***REMOVED*** + return props.getProperty("svn.dev.deps-r"); + ***REMOVED*** + + public String getSVNRDevPreInstalledDepsList()***REMOVED*** + return props.getProperty("svn.dev.deps-pre-installed"); + ***REMOVED*** + + public String getSVNRDevRBDepsList()***REMOVED*** + return props.getProperty("svn.dev.deps-r-blackbox"); + ***REMOVED*** + + public String getSVNRDevJavaDepsList()***REMOVED*** + return props.getProperty("svn.dev.deps-java"); + ***REMOVED*** + + public String getSVNRDevKWDepsList()***REMOVED*** + return props.getProperty("svn.dev.deps-knime-workflow"); + ***REMOVED*** + + public String getSVNRDevOctaveDepsList()***REMOVED*** + return props.getProperty("svn.dev.deps-octave"); + ***REMOVED*** + + public String getSVNRDevPythonDepsList()***REMOVED*** + return props.getProperty("svn.dev.deps-python"); + ***REMOVED*** + + public String getSVNRDevWCDepsList()***REMOVED*** + return props.getProperty("svn.dev.deps-windows-compiled"); + ***REMOVED*** + + + public String getCSVUrl() ***REMOVED*** @@ -140,15 +183,42 @@ public class ServiceConfiguration ***REMOVED*** ***REMOVED*** - public String getStagingHost() ***REMOVED*** - return props.getProperty("STAGING_HOST"); + public String getHost(String env)***REMOVED*** + String a = ""; + + if (env.equals("Dev"))***REMOVED*** + a = this.getDevStagingHost(); + ***REMOVED*** + + if (env.equals("Prod")||(env.equals("Prod")))***REMOVED*** + a = this.getProtoProdStagingHost(); + ***REMOVED*** + return a; + + ***REMOVED*** + + + + public String getDevStagingHost() ***REMOVED*** + return props.getProperty("DEV_STAGING_HOST"); +***REMOVED*** + + + public String getProtoProdStagingHost() ***REMOVED*** + return props.getProperty("PROTO_PROD_STAGING_HOST"); +***REMOVED*** + + public static void main(String[] args) throws FileNotFoundException ***REMOVED*** ServiceConfiguration a = new ServiceConfiguration(); - System.out.println(a.getStagingHost()); + ***REMOVED***System.out.println(a.getStagingHost()); + System.out.println(a.getDevStagingHost()); + System.out.println(a.getProtoProdStagingHost()); System.out.println(a.getCSVUrl()); System.out.println(a.getSVNMainAlgoRepo()); + System.out.println(a.getSVNRProtoCRANDepsList()); ***REMOVED*** diff --git a/src/main/resources/service.properties b/src/main/resources/service.properties index dc074d5..eb00d99 100644 --- a/src/main/resources/service.properties +++ b/src/main/resources/service.properties @@ -1,6 +1,6 @@ #YML node file -#STAGING_HOST: dataminer-proto-ghost.d4science.org -STAGING_HOST: dataminer1-devnext.d4science.org +DEV_STAGING_HOST: dataminer1-devnext.d4science.org +PROTO_PROD_STAGING_HOST: dataminer-proto-ghost.d4science.org SVN_REPO: https:***REMOVED***svn.d4science.research-infrastructures.eu/gcube/trunk/data-analysis/RConfiguration/RPackagesManagement/ #HAPROXY_CSV: http:***REMOVED***data.d4science.org/Yk4zSFF6V3JOSytNd3JkRDlnRFpDUUR5TnRJZEw2QjRHbWJQNStIS0N6Yz0 @@ -34,3 +34,17 @@ svn.prod.deps-octave = svn.prod.deps-python = svn.prod.deps-windows-compiled = + + +svn.dev.algorithms-list = /trunk/data-analysis/DataMinerConfiguration/algorithms/dev/algorithms + +svn.dev.deps-linux-compiled = +svn.dev.deps-pre-installed = +svn.dev.deps-r-blackbox = +svn.dev.deps-r = /trunk/data-analysis/RConfiguration/RPackagesManagement/r_cran_pkgs.txt +svn.dev.deps-java = +svn.dev.deps-knime-workflow = +svn.dev.deps-octave = +svn.dev.deps-python = +svn.dev.deps-windows-compiled = + diff --git a/src/main/webapp/WEB-INF/gcube-app.xml b/src/main/webapp/WEB-INF/gcube-app.xml index 204fb09..3dcfa63 100644 --- a/src/main/webapp/WEB-INF/gcube-app.xml +++ b/src/main/webapp/WEB-INF/gcube-app.xml @@ -1,7 +1,7 @@ dataminer-pool-manager - dataanalysis + DataAnalysis 0.0.1 diff --git a/src/main/webapp/WEB-INF/web.xml b/src/main/webapp/WEB-INF/web.xml index 5596e2b..3c5cc4b 100644 --- a/src/main/webapp/WEB-INF/web.xml +++ b/src/main/webapp/WEB-INF/web.xml @@ -3,40 +3,56 @@ "http:***REMOVED***java.sun.com/dtd/web-app_2_3.dtd" > - Archetype Created Web Application + Archetype Created Web Application + + + Environment + Dev + + This is a context parameter example + + + + REST-API + org.glassfish.jersey.servlet.ServletContainer + + jersey.config.server.provider.packages + + io.swagger.jaxrs.listing, + org.gcube.dataanalysis.dataminer.poolmanager.rest + + 1 + + + + + + + + + REST-API + /api/* + + + + + + + + + + + + - - REST-API - org.glassfish.jersey.servlet.ServletContainer - - jersey.config.server.provider.packages - - io.swagger.jaxrs.listing, - org.gcube.dataanalysis.dataminer.poolmanager.rest - - 1 - - - - REST-API - /api/* - - diff --git a/src/test/java/org/gcube/dataanalysis/dataminerpoolmanager/JobTest.java b/src/test/java/org/gcube/dataanalysis/dataminerpoolmanager/JobTest.java index 531f24f..b2b4434 100644 --- a/src/test/java/org/gcube/dataanalysis/dataminerpoolmanager/JobTest.java +++ b/src/test/java/org/gcube/dataanalysis/dataminerpoolmanager/JobTest.java @@ -24,10 +24,10 @@ public class JobTest ***REMOVED*** Algorithm algo = AlgorithmBuilder.create("http:***REMOVED***data.d4science.org/dENQTTMxdjNZcGRpK0NHd2pvU0owMFFzN0VWemw3Zy9HbWJQNStIS0N6Yz0"); ***REMOVED***test phase - Cluster stagingCluster = ClusterBuilder.getStagingDataminerCluster(); + ***REMOVED***Cluster stagingCluster = ClusterBuilder.getStagingDataminerCluster(); ***REMOVED***Cluster rProtoCluster = ClusterBuilder.getRProtoCluster(); - DMPMJob job = new StagingJob(svnUpdater, algo, stagingCluster, /*rProtoCluster,*/ ScopeProvider.instance.get()); - job.start(); + ***REMOVED***DMPMJob job = new StagingJob(svnUpdater, algo, stagingCluster, /*rProtoCluster,*/ ScopeProvider.instance.get()); + ***REMOVED***job.start(); ***REMOVED***release phase ***REMOVED***Cluster prodCluster = ClusterBuilder.getVRECluster(targetVREToken, targetVRE);