This commit is contained in:
Nunzio Andrea Galante 2017-05-11 16:08:17 +00:00
parent c919d6b0d0
commit 49e78c3d51
4 changed files with 31 additions and 8 deletions

View File

@ -73,10 +73,9 @@ public class RestPoolManager implements PoolManager {
***REMOVED***SecurityTokenProvider.instance.set("3a23bfa4-4dfe-44fc-988f-194b91071dd2-843339462"); ***REMOVED***SecurityTokenProvider.instance.set("3a23bfa4-4dfe-44fc-988f-194b91071dd2-843339462");
RestPoolManager a = new RestPoolManager(); RestPoolManager a = new RestPoolManager();
***REMOVED***a.stageAlgorithm("http:***REMOVED***data.d4science.org/MnovRjZIdGV5WlB0WXE5NVNaZnRoRVg0SU8xZWpWQlFHbWJQNStIS0N6Yz0"); ***REMOVED***a.stageAlgorithm("http:***REMOVED***data.d4science.org/MnovRjZIdGV5WlB0WXE5NVNaZnRoRVg0SU8xZWpWQlFHbWJQNStIS0N6Yz0");
a.publishAlgorithm("http:***REMOVED***data.d4science.org/MnovRjZIdGV5WlB0WXE5NVNaZnRoRVg0SU8xZWpWQlFHbWJQNStIS0N6Yz0", "3a23bfa4-4dfe-44fc-988f-194b91071dd2-843339462"); a.publishAlgorithm("http:***REMOVED***data.d4science.org/MnovRjZIdGV5WlB0WXE5NVNaZnRoRVg0SU8xZWpWQlFHbWJQNStIS0N6Yz0", "708e7eb8-11a7-4e9a-816b-c9ed7e7e99fe-98187548");
***REMOVED*** PoolManager aa = new DataminerPoolManager(); ***REMOVED*** PoolManager aa = new DataminerPoolManager();
***REMOVED*** System.out.println(aa.getAlgoById("ICHTHYOP_MODEL_ONE_BY_ONE@3141d3aa-5f93-409f-b6f8-9fae0a6c0ee3"));
***REMOVED*** System.out.println(aa.getAlgoFromIs());
***REMOVED*** ***REMOVED***

View File

@ -39,9 +39,8 @@ public class DataminerPoolManager {
public DataminerPoolManager(){ public DataminerPoolManager(){
try { try {
***REMOVED***TODO: read this from configuration ***REMOVED***TODO: read this from configuration - fatto
this.svnUpdater = new SVNUpdater( this.svnUpdater = new SVNUpdater(new Props().getSVNrepo());
"https:***REMOVED***svn.d4science.research-infrastructures.eu/gcube/trunk/data-analysis/RConfiguration/RPackagesManagement/");
***REMOVED*** catch (SVNException e) { ***REMOVED*** catch (SVNException e) {
e.printStackTrace(); e.printStackTrace();
***REMOVED*** ***REMOVED***
@ -62,6 +61,7 @@ public class DataminerPoolManager {
public String publishAlgorithm(Algorithm algo, String targetVREToken) throws IOException, InterruptedException { public String publishAlgorithm(Algorithm algo, String targetVREToken) throws IOException, InterruptedException {
Cluster cluster = new Cluster(); Cluster cluster = new Cluster();
***REMOVED***
for (Host h : new HAProxy().listDataMinersByCluster()) { for (Host h : new HAProxy().listDataMinersByCluster()) {
cluster.addHost(h); cluster.addHost(h);
***REMOVED*** ***REMOVED***

View File

@ -27,6 +27,28 @@ public class Props {
***REMOVED*** ***REMOVED***
public String getSVNrepo() {
Properties props = new Properties();
java.io.InputStream input = Props.class.getClassLoader().getResourceAsStream("service.properties");
***REMOVED*** loading properites from properties file
try {
props.load(input);
***REMOVED*** catch (IOException e) {
***REMOVED*** TODO Auto-generated catch block
e.printStackTrace();
***REMOVED***
***REMOVED*** reading proeprty
String path = props.getProperty("SVN_REPO");
return path;
***REMOVED***
public String getStagingHost() { public String getStagingHost() {
Properties props = new Properties(); Properties props = new Properties();
java.io.InputStream input = Props.class.getClassLoader().getResourceAsStream("service.properties"); java.io.InputStream input = Props.class.getClassLoader().getResourceAsStream("service.properties");
@ -46,7 +68,8 @@ public class Props {
***REMOVED*** ***REMOVED***
public static void main(String[] args) { public static void main(String[] args) {
Props a = new Props(); ***REMOVED***Props a = new Props();
System.out.println(a.getStagingHost()); System.out.println(new Props().getSVNrepo());
***REMOVED***System.out.println(a.getStagingHost());
***REMOVED*** ***REMOVED***
***REMOVED*** ***REMOVED***

View File

@ -1,3 +1,4 @@
#YML node file #YML node file
STAGING_HOST: dataminer1-devnext.d4science.org STAGING_HOST: dataminer1-devnext.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 #HAPROXY_CSV: http:***REMOVED***data.d4science.org/Yk4zSFF6V3JOSytNd3JkRDlnRFpDUUR5TnRJZEw2QjRHbWJQNStIS0N6Yz0