This commit is contained in:
Nunzio Andrea Galante 2017-05-11 16:08:17 +00:00
parent 0eb07b35d1
commit 08188449c1
5 changed files with 33 additions and 10 deletions

View File

@ -100,8 +100,8 @@ public class HAProxy {
//URL stockURL = new URL("http://data.d4science.org/c29KTUluTkZnRlB0WXE5NVNaZnRoR0dtYThUSmNTVlhHbWJQNStIS0N6Yz0");
//System.out.println(stockURL);
// dev
// URL stockURL = new
// URL("http://data.d4science.org/c29KTUluTkZnRlB0WXE5NVNaZnRoR0dtYThUSmNTVlhHbWJQNStIS0N6Yz0");
//URL stockURL = new
//URL("http://data.d4science.org/c29KTUluTkZnRlB0WXE5NVNaZnRoR0dtYThUSmNTVlhHbWJQNStIS0N6Yz0");
BufferedReader in = new BufferedReader(new InputStreamReader(stockURL.openStream()));
reader = new CSVReader(in, ',');
String[] nextLine;

View File

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

View File

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

View File

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

View File

@ -1,3 +1,4 @@
#YML node file
STAGING_HOST: dataminer1-devnext.d4science.org
SVN_REPO: https://svn.d4science.research-infrastructures.eu/gcube/trunk/data-analysis/RConfiguration/RPackagesManagement/
#HAPROXY_CSV: http://data.d4science.org/Yk4zSFF6V3JOSytNd3JkRDlnRFpDUUR5TnRJZEw2QjRHbWJQNStIS0N6Yz0