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 1bf44e6..9c5da00 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*** + + public static void main(String[] args) { + 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/rest/RestPoolManager.java b/src/main/java/org/gcube/dataanalysis/dataminer/poolmanager/rest/RestPoolManager.java index 4ded20e..7335031 100644 --- a/src/main/java/org/gcube/dataanalysis/dataminer/poolmanager/rest/RestPoolManager.java +++ b/src/main/java/org/gcube/dataanalysis/dataminer/poolmanager/rest/RestPoolManager.java @@ -9,10 +9,12 @@ import java.net.UnknownHostException; ***REMOVED*** import java.util.Set; +import javax.servlet.ServletContext; import javax.ws.rs.GET; import javax.ws.rs.Path; import javax.ws.rs.Produces; import javax.ws.rs.QueryParam; +import javax.ws.rs.core.Context; ***REMOVED*** import org.gcube.common.authorization.library.AuthorizationEntry; @@ -21,17 +23,27 @@ import org.gcube.common.authorization.library.AuthorizationEntry; import org.gcube.dataanalysis.dataminer.poolmanager.datamodel.Algorithm; import org.gcube.dataanalysis.dataminer.poolmanager.service.DataminerPoolManager; import org.gcube.dataanalysis.dataminer.poolmanager.util.AlgorithmBuilder; +import org.gcube.smartgears.ContextProvider; +import org.gcube.smartgears.context.application.ApplicationContext; ***REMOVED*** ***REMOVED*** import org.tmatesoft.svn.core.SVNException; @Path("/") public class RestPoolManager implements PoolManager { + + + + ***REMOVED***@Context ServletContext context; private static final Logger LOGGER = LoggerFactory.getLogger(RestPoolManager.class); private DataminerPoolManager service = new DataminerPoolManager(); - + + ***REMOVED***@Context + private ApplicationContext context = ContextProvider.get(); + + @GET @Path("/algorithm/stage") @@ -39,8 +51,9 @@ public class RestPoolManager implements PoolManager { public String stageAlgorithm( @QueryParam("algorithmPackageURL") String algorithmPackageURL /*@QueryParam("category") String category*/) throws IOException, InterruptedException { - Algorithm algo = AlgorithmBuilder.create(algorithmPackageURL); - return this.service.stageAlgorithm(algo); + Algorithm algo = AlgorithmBuilder.create(algorithmPackageURL); + String env = context.application().getInitParameter("Environment"); + return this.service.stageAlgorithm(algo,env); ***REMOVED*** @@ -53,7 +66,8 @@ public class RestPoolManager implements PoolManager { @QueryParam("targetVRE") String targetVRE /*@QueryParam("category") String category*/) throws IOException, InterruptedException { Algorithm algo = AlgorithmBuilder.create(algorithmPackageURL); - return this.service.publishAlgorithm(algo, targetVREToken, targetVRE); + String env = context.application().getInitParameter("Environment"); + return this.service.publishAlgorithm(algo, targetVREToken, targetVRE,env); ***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 6bdaec8..12f5771 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*** - public String stageAlgorithm(Algorithm algo) throws IOException, InterruptedException { + public String stageAlgorithm(Algorithm algo, String env) throws IOException, InterruptedException { + + 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*** - public String publishAlgorithm(Algorithm algo, String targetVREToken, String targetVRE) throws IOException, InterruptedException { + public String publishAlgorithm(Algorithm algo, String targetVREToken, String targetVRE, String env) throws IOException, InterruptedException { ***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 eba9e7b..8fd53ae 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***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 { + + public ProductionPublishingJob(SVNUpdater svnUpdater, Algorithm algorithm, /*Cluster prodCluster,*/ String targetVREName, String targetVREToken, String env) throws FileNotFoundException, UnsupportedEncodingException { 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 { if (CheckPermission.apply(targetVREToken,targetVREName)){ ***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 0a65146..62e9126 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 { 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 { + String rProtoVREName, String env) throws FileNotFoundException, UnsupportedEncodingException { 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 { 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 { try { Collection undefinedDependencies = this.svnUpdater.getUndefinedDependencies( - this.svnUpdater.getRProtoDependencyFile(this.algorithm.getLanguage()), + this.svnUpdater.getDependencyFile(this.algorithm.getLanguage(),env), this.algorithm.getDependencies()); if (!undefinedDependencies.isEmpty()) { String message = "Following dependencies are not defined:\n"; for (String n : undefinedDependencies) { - 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 { if (ret == 0) { this.getStatus(0); - if (b.checkMethod(a.getStagingHost(), SecurityTokenProvider.instance.get()) - && (b.algoExists(this.algorithm))) { + if (b.checkMethod(a.getHost(this.env), SecurityTokenProvider.instance.get()) + && (b.algoExists(this.algorithm, this.env))) { 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 { "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 85a9a35..ec0d591 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 { - public boolean algoExists(Algorithm a) throws Exception{ + public boolean algoExists(Algorithm a, String env) throws Exception{ File file = new File("/home/gcube/wps_algorithms/algorithms/"+a.getName()+".jar"); @@ -96,9 +96,9 @@ public class CheckMethod { System.out.println("Second file is located to: "+file2.getPath()); - if ((this.doesExist(file.getPath())) && (this.doesExist(file2.getPath()))){ - this.copyFromDmToSVN(file); - this.copyFromDmToSVN(file2); + if ((this.doesExist(file.getPath(),env)) && (this.doesExist(file2.getPath(),env))){ + this.copyFromDmToSVN(file,env); + this.copyFromDmToSVN(file2,env); return true; @@ -109,7 +109,7 @@ public class CheckMethod { ***REMOVED*** - public boolean doesExist(String path) throws Exception { + public boolean doesExist(String path, String env) throws Exception { JSch jsch = new JSch(); Session session = null; Channel channel = null; @@ -124,7 +124,7 @@ public class CheckMethod { 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 { - public void copyFromDmToSVN(File a) throws Exception { + public void copyFromDmToSVN(File a,String env) throws Exception { JSch jsch = new JSch(); Session session = null; ServiceConfiguration sc = new ServiceConfiguration(); @@ -177,7 +177,7 @@ public class CheckMethod { 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*** 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", "708e7eb8-11a7-4e9a-816b-c9ed7e7e99fe-98187548")){ -***REMOVED*** System.out.println("ciao");***REMOVED*** + + ***REMOVED***a.copyFromDmToSVN(aa); + if (a.checkMethod("dataminer1-devnext.d4science.org", "708e7eb8-11a7-4e9a-816b-c9ed7e7e99fe-98187548")){ + System.out.println("ciaocia");***REMOVED*** ***REMOVED******REMOVED*** -***REMOVED*** if (a.doesExist("/home/gcube/wps_algorithms/algorithms/XMEANS_interface.jar")){ -***REMOVED*** System.out.println("ciao"); + if (a.doesExist("/home/gcube/wps_algorithms/algorithms/RBLACKBOX.jar","Dev")){ + 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 ce5d4f5..9688daa 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***1. to complete - public static Cluster getStagingDataminerCluster() throws FileNotFoundException{ + public static Cluster getStagingDataminerCluster(String env) throws FileNotFoundException{ 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")){ + h.setName(p.getDevStagingHost()); + cluster.addHost(h); + ***REMOVED*** + + if ((env.equals("Prod")||(env.equals("Proto")))){ + 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 02ab0bd..2fe322d 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*** this.updateSVN(this.configuration.getSVNRProtoGitHubDepsList(), algorithm.getGitHubDependencies()); ***REMOVED******REMOVED*** + + + public String getDependencyFile(String language, String env){ + + String a = ""; + if (env.equals("Dev")){ + a= this.getDevDependencyFile(language); + ***REMOVED*** + + if (env.equals("Prod")){ + a= this.getProdDependencyFile(language); + ***REMOVED*** + + if (env.equals("Proto")){ + a= this.getRProtoDependencyFile(language); + ***REMOVED*** + return a; +***REMOVED*** + + + public String getRProtoDependencyFile(String language) { switch (language) { case "R": @@ -97,6 +118,35 @@ public class SVNUpdater { ***REMOVED*** + public String getDevDependencyFile(String language) { + switch (language) { + 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: + return null; + ***REMOVED*** +***REMOVED*** + + + + + public void readRPRotoDeps(Algorithm algorithm) throws SVNException { if (algorithm.getLanguage().equals("R")) { @@ -157,6 +207,43 @@ public class SVNUpdater { this.checkIfAvaialable("", algorithm.getDependencies()); ***REMOVED*** ***REMOVED*** + + + + public void readRDevDeps(Algorithm algorithm) throws SVNException { + if (algorithm.getLanguage().equals("R")) { + this.checkIfAvaialable(this.configuration.getSVNRProtoCRANDepsList(), algorithm.getDependencies()); + ***REMOVED*** + if (algorithm.getLanguage().equals("R-blackbox")) { + this.checkIfAvaialable("", algorithm.getDependencies()); + ***REMOVED*** + if (algorithm.getLanguage().equals("Java")) { + this.checkIfAvaialable("", algorithm.getDependencies()); + ***REMOVED*** + if (algorithm.getLanguage().equals("Knime-Workflow")) { + this.checkIfAvaialable(this.configuration.getSVNRProtoCRANDepsList(), algorithm.getDependencies()); + ***REMOVED*** + if (algorithm.getLanguage().equals("Linux-compiled")) { + this.checkIfAvaialable("", algorithm.getDependencies()); + ***REMOVED*** + if (algorithm.getLanguage().equals("Octave")) { + this.checkIfAvaialable("", algorithm.getDependencies()); + ***REMOVED*** + if (algorithm.getLanguage().equals("Python")) { + this.checkIfAvaialable("", algorithm.getDependencies()); + ***REMOVED*** + if (algorithm.getLanguage().equals("Windows-compiled")) { + this.checkIfAvaialable("", algorithm.getDependencies()); + ***REMOVED*** + if (algorithm.getLanguage().equals("Pre-Installed")) { + this.checkIfAvaialable("", algorithm.getDependencies()); + ***REMOVED*** +***REMOVED*** + + + + + ***REMOVED*** public void updateProdDeps(Algorithm algorithm) { ***REMOVED*** this.updateSVN(this.configuration.getSVNProdOSDepsList(), algorithm.getOSDependencies()); @@ -164,8 +251,19 @@ public class SVNUpdater { ***REMOVED*** this.updateSVN(this.configuration.getSVNRProdGitHubDepsList(), algorithm.getGitHubDependencies()); ***REMOVED******REMOVED*** - public void updateSVNRProtoAlgorithmList(Algorithm algorithm, String targetVRE, String user, String env) { + public void updateSVNAlgorithmList(Algorithm algorithm, String targetVRE, String user, String env) { + + if (env.equals("Dev")){ + this.updateSVNAlgorithmList(this.configuration.getSVNDevAlgorithmsList(), algorithm, targetVRE, user, env); + ***REMOVED*** + + if (env.equals("Prod")){ + this.updateSVNAlgorithmList(this.configuration.getSVNProdAlgorithmsList(), algorithm, targetVRE, user, env); + ***REMOVED*** + + if (env.equals("Proto")){ this.updateSVNAlgorithmList(this.configuration.getSVNRProtoAlgorithmsList(), algorithm, targetVRE, user, env); + ***REMOVED*** ***REMOVED*** public void updateSVNProdAlgorithmList(Algorithm algorithm, String targetVRE, String user, String env) { @@ -350,11 +448,12 @@ public class SVNUpdater { 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")){ + 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 c09c9cf..dd197f6 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***dev + public String getSVNDevAlgorithmsList(){ + return props.getProperty("svn.dev.algorithms-list"); + ***REMOVED*** + + public String getSVNRDevLinuxCompiledDepsList(){ + return props.getProperty("svn.dev.deps-linux-compiled"); + ***REMOVED*** + + public String getSVNRDevCRANDepsList(){ + return props.getProperty("svn.dev.deps-r"); + ***REMOVED*** + + public String getSVNRDevPreInstalledDepsList(){ + return props.getProperty("svn.dev.deps-pre-installed"); + ***REMOVED*** + + public String getSVNRDevRBDepsList(){ + return props.getProperty("svn.dev.deps-r-blackbox"); + ***REMOVED*** + + public String getSVNRDevJavaDepsList(){ + return props.getProperty("svn.dev.deps-java"); + ***REMOVED*** + + public String getSVNRDevKWDepsList(){ + return props.getProperty("svn.dev.deps-knime-workflow"); + ***REMOVED*** + + public String getSVNRDevOctaveDepsList(){ + return props.getProperty("svn.dev.deps-octave"); + ***REMOVED*** + + public String getSVNRDevPythonDepsList(){ + return props.getProperty("svn.dev.deps-python"); + ***REMOVED*** + + public String getSVNRDevWCDepsList(){ + return props.getProperty("svn.dev.deps-windows-compiled"); + ***REMOVED*** + + + public String getCSVUrl() { @@ -140,15 +183,42 @@ public class ServiceConfiguration { ***REMOVED*** - public String getStagingHost() { - return props.getProperty("STAGING_HOST"); + public String getHost(String env){ + String a = ""; + + if (env.equals("Dev")){ + a = this.getDevStagingHost(); + ***REMOVED*** + + if (env.equals("Prod")||(env.equals("Prod"))){ + a = this.getProtoProdStagingHost(); + ***REMOVED*** + return a; + + ***REMOVED*** + + + + public String getDevStagingHost() { + return props.getProperty("DEV_STAGING_HOST"); +***REMOVED*** + + + public String getProtoProdStagingHost() { + return props.getProperty("PROTO_PROD_STAGING_HOST"); +***REMOVED*** + + public static void main(String[] args) throws FileNotFoundException { 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 595565c..224a3dd 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 { 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);