From 56c111f01043bdfebad866b71b62825d99f9b2b3 Mon Sep 17 00:00:00 2001 From: Nunzio Andrea Galante Date: Fri, 27 Oct 2017 21:30:20 +0000 Subject: [PATCH] git-svn-id: https://svn.d4science.research-infrastructures.eu/gcube/trunk/data-analysis/dataminer-pool-manager@157810 82a268e6-3cf1-43bd-a215-b396298e98cf --- .../poolmanager/service/StagingJob.java | 4 +- .../poolmanager/util/CheckMethod.java | 38 +++++++++++++++---- .../poolmanager/util/SVNUpdater.java | 5 ++- 3 files changed, 36 insertions(+), 11 deletions(-) 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 af3c990..e88765d 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 @@ -85,7 +85,7 @@ public class StagingJob extends DMPMJob ***REMOVED*** b.deleteFiles(this.algorithm/*, env*/);; int ret = this.executeAnsibleWorker(createWorker(this.algorithm, this.stagingCluster, false, "root")); - + System.out.println("Return code= "+ret); if (ret != 0) ***REMOVED*** this.getStatus(2); @@ -100,7 +100,7 @@ public class StagingJob extends DMPMJob ***REMOVED*** ***REMOVED***System.out.println("2 - Checking existing in env: "+ this.env); - if (b.checkMethod(a.getStagingHost(), SecurityTokenProvider.instance.get())&&(b.algoExists(this.algorithm/*, env*/))) ***REMOVED*** + if (b.checkMethod(a.getStagingHost(), SecurityTokenProvider.instance.get())&&(b.algoExists(this.algorithm))) ***REMOVED*** System.out.println("Interface check ok!"); System.out.println("Both the files exist at the correct path!"); 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 84e27ac..7e6b4dc 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 @@ -13,7 +13,7 @@ import java.util.LinkedList; ***REMOVED*** import java.util.Vector; - +***REMOVED*** ***REMOVED*** import com.jcraft.jsch.Channel; @@ -78,15 +78,18 @@ public class CheckMethod ***REMOVED*** ***REMOVED*** ***REMOVED*** ***REMOVED*** + fileWriter.close(); + return true; + ***REMOVED*** catch (Exception a) ***REMOVED*** a.getMessage(); return false; ***REMOVED*** - return true; ***REMOVED*** + public boolean algoExists(Algorithm a/*, String env*/) throws Exception***REMOVED*** ServiceConfiguration p = new ServiceConfiguration(); @@ -101,6 +104,7 @@ public class CheckMethod ***REMOVED*** if ((this.doesExist(file.getPath()/*,env*/)) && (this.doesExist(file2.getPath()/*,env*/)))***REMOVED*** this.copyFromDmToSVN(file/*,env*/); this.copyFromDmToSVN(file2/*,env*/); + System.out.println("Files have been copied to SVN"); return true; @@ -474,20 +478,40 @@ public class CheckMethod ***REMOVED*** ***REMOVED*** File aa = new File("/home/gcube/wps_algorithms/algorithms/RBLACKBOX_interface.jar"); ***REMOVED*** a.copyFromDmToSVN(aa, "Dev"); +***REMOVED*** -System.out.println(a.checkMethod("dm-pool-manager-proto.d4science.org", - "2eceaf27-0e22-4dbe-8075-e09eff199bf9-98187548")); + +***REMOVED***System.out.println(a.checkMethod("dataminer-ghost-t.pre.d4science.org", +***REMOVED*** "2eceaf27-0e22-4dbe-8075-e09eff199bf9-98187548")); + +***REMOVED***System.out.println(a.checkMethod("dataminer-proto-ghost.d4science.org", +***REMOVED*** "***REMOVED***")); + + System.out.println(a.checkMethod("dataminer-ghost-d.dev.d4science.org", + "***REMOVED***")); +***REMOVED***Algorithm aa = new Algorithm(); +***REMOVED***aa.setName("UDPIPE_WRAPPER"); +***REMOVED***System.out.println(a.algoExists(aa)); +***REMOVED******REMOVED*** +***REMOVED***ServiceConfiguration bp = new ServiceConfiguration(); +***REMOVED******REMOVED*** +***REMOVED***SecurityTokenProvider.instance.set("***REMOVED***"); +***REMOVED******REMOVED*** +***REMOVED***if (a.checkMethod(bp.getStagingHost(), SecurityTokenProvider.instance.get())&&a.algoExists(aa)); ***REMOVED*** +***REMOVED***System.out.println("ciao"); +***REMOVED*** +***REMOVED******REMOVED*** -***REMOVED*** Algorithm al = new Algorithm(); -***REMOVED*** al.setName("RBLACKBOX"); +***REMOVED*** +***REMOVED***Algorithm al = new Algorithm(); +***REMOVED*** al.setName("UDPIPE_WRAPPER"); ***REMOVED*** a.deleteFiles(al); - ***REMOVED*** ***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 99057be..7990cc0 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 @@ -155,9 +155,10 @@ public String getDependencyFileProd(String language/*, String env*/)***REMOVED** ***REMOVED*** public void updateSVNProdAlgorithmList(Algorithm algorithm, String targetVRE, String category, String algorithm_type, String user/*, String env*/) ***REMOVED*** - this.updateSVNAlgorithmList(this.configuration.getSVNProdAlgorithmsList(), algorithm, targetVRE, category, algorithm_type, user); + this.updateSVNAlgorithmList(this.configuration.getSVNProdAlgorithmsList(), algorithm, targetVRE, category, algorithm_type, user); ***REMOVED*** - + + public void updateAlgorithmFiles(File a) throws SVNException***REMOVED*** ***REMOVED***this.updateAlgorithmList(this.configuration.getSVNMainAlgoRepo(), a);