This commit is contained in:
Nunzio Andrea Galante 2017-04-28 14:26:40 +00:00
parent c8e9329164
commit 7d286d5326
2 changed files with 62 additions and 63 deletions

View File

@ -118,55 +118,54 @@ public class AnsibleWorker {
public void apply(AlgorithmSet as, PrintStream ps, boolean updateSVN) throws IOException, InterruptedException, SVNException { public void apply(AlgorithmSet as, PrintStream ps, boolean updateSVN)
***REMOVED*** TODO execute the playbook and return output throws IOException, InterruptedException, SVNException {
System.out.println(this.getWorkdir()); ***REMOVED*** TODO execute the playbook and return output
try { System.out.println(this.getWorkdir());
Process p = Runtime.getRuntime().exec("ansible-playbook -v -i " + this.getInventoryFile().getAbsolutePath() + " " + this.getPlaybookFile().getAbsolutePath()); try {
Process p = Runtime.getRuntime().exec("ansible-playbook -v -i " + this.getInventoryFile().getAbsolutePath()
+ " " + this.getPlaybookFile().getAbsolutePath());
inheritIO(p.getInputStream(), ps); inheritIO(p.getInputStream(), ps);
inheritIO(p.getErrorStream(), ps); inheritIO(p.getErrorStream(), ps);
if (updateSVN){ if (updateSVN) {
int exitValue = p.waitFor(); int exitValue = p.waitFor();
if (exitValue == 0){ if (exitValue == 0) {
for (Algorithm algo : as.getAlgorithms()){ for (Algorithm algo : as.getAlgorithms()) {
for (Dependency d : algo.getDependencies()) { for (Dependency d : algo.getDependencies()) {
if (d.getType().equals("os")) { if (d.getType().equals("os")) {
List<String> ls = new LinkedList<String>(); List<String> ls = new LinkedList<String>();
ls.add(d.getName()); ls.add(d.getName());
this.updateSVN("r_deb_pkgs.txt", ls); this.updateSVN("r_deb_pkgs.txt", ls);
***REMOVED*** ***REMOVED***
if (d.getType().equals("cran")) { if (d.getType().equals("cran")) {
List<String> ls = new LinkedList<String>(); List<String> ls = new LinkedList<String>();
ls.add(d.getName()); ls.add(d.getName());
this.updateSVN("r_cran_pkgs.txt", ls); this.updateSVN("r_cran_pkgs.txt", ls);
***REMOVED*** ***REMOVED***
if (d.getType().equals("github")) { if (d.getType().equals("github")) {
List<String> ls = new LinkedList<String>(); List<String> ls = new LinkedList<String>();
ls.add(d.getName()); ls.add(d.getName());
this.updateSVN("r_github_pkgs.txt", ls); this.updateSVN("r_github_pkgs.txt", ls);
***REMOVED*** ***REMOVED***
***REMOVED*** ***REMOVED***
***REMOVED*** ***REMOVED***
***REMOVED***
***REMOVED*** ***REMOVED***
***REMOVED*** catch (IOException e) {
e.printStackTrace();
***REMOVED***
***REMOVED*** System.out.println("TODO: execute: ansible-playbook -v -i " +
***REMOVED*** ***REMOVED*** this.getInventoryFile().getName() + " " +
***REMOVED*** this.getPlaybookFile().getName());
***REMOVED*** catch (IOException e) { ***REMOVED***
e.printStackTrace();
***REMOVED***
***REMOVED***System.out.println("TODO: execute: ansible-playbook -v -i " + this.getInventoryFile().getName() + " " + this.getPlaybookFile().getName());
***REMOVED***

View File

@ -283,7 +283,7 @@ public class RestPoolManager implements PoolManager {
***REMOVED*** ProxySelector.setDefault(new ***REMOVED*** ProxySelector.setDefault(new
***REMOVED*** PropertiesBasedProxySelector("/home/ngalante/.proxy-settings")); ***REMOVED*** PropertiesBasedProxySelector("/home/ngalante/.proxy-settings"));
ScopeProvider.instance.set("/gcube/preprod/preVRE"); ScopeProvider.instance.set("/gcube/devNext/NextNext");
***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.getAlgoById("ICHTHYOP_MODEL_ONE_BY_ONE@3141d3aa-5f93-409f-b6f8-9fae0a6c0ee3"));
@ -291,21 +291,21 @@ public class RestPoolManager implements PoolManager {
RestPoolManager a = new RestPoolManager(); RestPoolManager a = new RestPoolManager();
***REMOVED*** a.addAlgorithmToVRE( a.addAlgorithmToVRE(
***REMOVED*** "http:***REMOVED***data.d4science.org/TVc0TW9Ud1FjYlppK0NHd2pvU0owNmRFWHE4OW4xSGNHbWJQNStIS0N6Yz0", "http:***REMOVED***data.d4science.org/TVc0TW9Ud1FjYlppK0NHd2pvU0owNmRFWHE4OW4xSGNHbWJQNStIS0N6Yz0",
***REMOVED*** "test", "test",
***REMOVED*** null, null,
***REMOVED*** null, null,
***REMOVED*** "N", "N",
***REMOVED*** "transducerers", "transducerers",
***REMOVED*** true, false,
***REMOVED*** false); false);
a.addAlgorithmToHost( ***REMOVED*** a.addAlgorithmToHost(
"http:***REMOVED***data.d4science.org/MnovRjZIdGV5WlB0WXE5NVNaZnRoRVg0SU8xZWpWQlFHbWJQNStIS0N6Yz0", ***REMOVED*** "http:***REMOVED***data.d4science.org/MnovRjZIdGV5WlB0WXE5NVNaZnRoRVg0SU8xZWpWQlFHbWJQNStIS0N6Yz0",
"dataminer1-pre.d4science.org", ***REMOVED*** "dataminer1-pre.d4science.org",
"ICHTHYOP_MODEL_ONE_BY_ONE", null, "ICHTHYOP_MODEL", "transducerers", ***REMOVED*** "ICHTHYOP_MODEL_ONE_BY_ONE", null, "ICHTHYOP_MODEL", "transducerers",
"N",false, false); ***REMOVED*** "N",false, false);