+ svn diff svn://scm.gforge.inria.fr/svn/xtreemos/grid/srds/tags/0.2.19 svn://scm.gforge.inria.fr/svn/xtreemos/grid/srds/tags/0.2.20 Index: test/jsdlGrid5000Tests.xml =================================================================== --- test/jsdlGrid5000Tests.xml (.../0.2.19) (revision 0) +++ test/jsdlGrid5000Tests.xml (.../0.2.20) (revision 3246) @@ -0,0 +1,2 @@ +My Gnuplot invocationSimple application invocation: User wants to run the application 'gnuplot' to produce a plotted graphical ile based on some data shipped in from elsewhere(perhaps as part of a workflow). A front-end application will then build into an animation of spinning data. Front-end application knows URL for data file which must be staged-in. Front-end application wants to stage in a control file that it specifiesdirectly which directs gnuplot to produce the outputfiles. In case of error, messages should be produced onstderr (also to be staged on completion) and no images are to be transferred.gnuplot/usr/local/bin/gnuplotcontrol.txtinput.datoutput1.pngi38604Linux020971520000209715200000031457280010control.txtoverwritetruehttp://foo.bar.com/~me/control.txtinput.datoverwritetruehttp://foo.bar.com/~me/input.datoutput1.pngoverwritetruersync://spoolmachine/userdir + Index: VERSION =================================================================== --- VERSION (.../0.2.19) (revision 3246) +++ VERSION (.../0.2.20) (revision 3246) @@ -1,2 +1,2 @@ -0.2.19 +0.2.20 Index: src/eu/xtreemos/ads/connection/rmi/InterfaceAEMclientRMI.java =================================================================== --- src/eu/xtreemos/ads/connection/rmi/InterfaceAEMclientRMI.java (.../0.2.19) (revision 3246) +++ src/eu/xtreemos/ads/connection/rmi/InterfaceAEMclientRMI.java (.../0.2.20) (revision 3246) @@ -1,5 +1,6 @@ package eu.xtreemos.ads.connection.rmi; import java.rmi.RemoteException; +import java.security.cert.X509Certificate; import eu.xtreemos.ads.exceptions.ClientNotFoundException; /** @@ -11,5 +12,6 @@ public interface InterfaceAEMclientRMI extends RMIclientInterface{ //public void AEMlocate(long clientID, String jsdlQuery)throws RemoteException,ClientNotFoundException; - public String AEMlocate(String jsdlQuery)throws RemoteException,ClientNotFoundException; + //public String AEMlocate(String jsdlQuery)throws RemoteException,ClientNotFoundException; + public String AEMlocate(String jsdlQuery,String xacmlDocument, X509Certificate userXOSDCert, Integer howMany) throws RemoteException,ClientNotFoundException; } Index: src/eu/xtreemos/ads/connection/rmi/stub/AEMclientRMI.java =================================================================== --- src/eu/xtreemos/ads/connection/rmi/stub/AEMclientRMI.java (.../0.2.19) (revision 3246) +++ src/eu/xtreemos/ads/connection/rmi/stub/AEMclientRMI.java (.../0.2.20) (revision 3246) @@ -9,6 +9,7 @@ import eu.xtreemos.ads.rss.RssQueue; import java.rmi.RemoteException; +import java.security.cert.X509Certificate; import org.apache.log4j.Logger; @@ -25,7 +26,7 @@ } /******************** INTERFACCIA RMI ESPOSTA *************************/ - public String AEMlocate(String jsdlQuery) throws RemoteException,ClientNotFoundException + /*public String AEMlocate(String jsdlQuery) throws RemoteException,ClientNotFoundException { AEMRequest req = new AEMRequest(jsdlQuery, this); @@ -41,8 +42,27 @@ } } return glueReply; + }*/ + public String AEMlocate(String jsdlQuery,String xacmlDocument, X509Certificate userXOSDCert, Integer howMany) throws RemoteException,ClientNotFoundException + { + + AEMRequest req = new AEMRequest(jsdlQuery,xacmlDocument, userXOSDCert, howMany, this); + glueReply = null; + RssQueue.push(req); + log.info("A new request has arrived to RMI\r\n"+jsdlQuery); + synchronized (this) { + try { + + if(glueReply==null)this.wait(); + } catch (InterruptedException e) { + log.error(e.getMessage()); + } + } + return glueReply; } + + public void AEMsetADSresultSet(String glueResponse) { synchronized (this) { Index: src/eu/xtreemos/ads/connection/rmi/testing/RmitestingClass.java =================================================================== --- src/eu/xtreemos/ads/connection/rmi/testing/RmitestingClass.java (.../0.2.19) (revision 3246) +++ src/eu/xtreemos/ads/connection/rmi/testing/RmitestingClass.java (.../0.2.20) (revision 3246) @@ -86,7 +86,7 @@ } try { - return aem.AEMlocate(jsdl); + return aem.AEMlocate(jsdl,null,null,10); } catch (RemoteException e) { e.printStackTrace(); Index: src/eu/xtreemos/ads/connection/HttpsServer/WebServer.java =================================================================== --- src/eu/xtreemos/ads/connection/HttpsServer/WebServer.java (.../0.2.19) (revision 3246) +++ src/eu/xtreemos/ads/connection/HttpsServer/WebServer.java (.../0.2.20) (revision 3246) @@ -10,7 +10,9 @@ import java.util.Hashtable; import java.util.StringTokenizer; +import eu.xtreemos.ads.dht.DhtObjectFactory; import eu.xtreemos.ads.dht.ProcessManager; +import eu.xtreemos.ads.qengine.QueryProvider; import eu.xtreemos.ads.srds_configuration.SrdsConfiguration; import eu.xtreemos.ads.util.NodeNetInformation; @@ -28,9 +30,9 @@ String welcomePage= " " +".:SRDS webinterface:." +"" - +"" + +"" +"" - +"" + +"" +"" +"" +"" @@ -41,17 +43,21 @@ +"

Scalaris monitor

" +"

Xosd Logger

"; - String upPage= "

SRDS control web-interface

"; + String upPage= "

SRDS control web-interface

"; String OWPage=""; String ScalarisPage= ""; + this.requestType.put("OW.htm", OWPage); this.requestType.put("Scalaris.htm", ScalarisPage); + //this.requestType.put("Log.htm", "file:///var/log/xosd/xosd.log"); this.requestType.put("index.htm", welcomePage); this.requestType.put("menupage.htm", menuPage); this.requestType.put("up.htm", upPage); + + } public static String createOnFlyPage(String requestedPage){ page=""; @@ -70,39 +76,38 @@ } - command="tail --lines=100 /var/log/xosd/xosd.log "+greps; - String[] cmdArray = { + command="tail --lines=100 /var/log/xosd/xosd.log "+greps; + String[] cmdArray = { "/bin/sh", "-c", command }; - try { - Process p = Runtime.getRuntime().exec(cmdArray); - is = p.getInputStream(); - err = p.getErrorStream(); - page="
"+
-			"Filter search:" +
-			"
"+ - ""+ - "" + - "
" + - "

" + - "
"; - page+=readStream(err) + readStream(is); - page+="
"; + try { + Process p = Runtime.getRuntime().exec(cmdArray); + is = p.getInputStream(); + err = p.getErrorStream(); + page="
"+
+					"Filter search:" +
+					"
"+ + ""+ + "" + + "
" + + "

" + + "
"; + page+=readStream(err) + readStream(is); + page+="
"; - - - - } catch (Exception e) { - logger.error(e); - page=e.getMessage(); - } - - } - else page="Bad request"; - return page; + } catch (Exception e) { + logger.error(e); + page=e.getMessage(); + } + + } else if (requestedPage.startsWith("Namespaces.htm")){ + + } + else page="Bad request"; + return page; } static private String readStream(InputStream in) { StringBuffer all = new StringBuffer(); Index: src/eu/xtreemos/ads/connection/dixi/SRDSMng.java =================================================================== --- src/eu/xtreemos/ads/connection/dixi/SRDSMng.java (.../0.2.19) (revision 3246) +++ src/eu/xtreemos/ads/connection/dixi/SRDSMng.java (.../0.2.20) (revision 3246) @@ -54,9 +54,7 @@ import eu.xtreemos.annotations.XOSDSERVICE; import eu.xtreemos.annotations.XOSDXATI; -import eu.xtreemos.srdsaccess.jobDirectory.IJobDirectory; -import eu.xtreemos.srdsaccess.resmng.IResourceDiscovery; //import eu.xtreemos.system.communication.bus.CallbackMessage; import eu.xtreemos.system.communication.exceptions.XOSException; @@ -79,8 +77,7 @@ public class SRDSMng extends Abstract2wayStage { Logger logger = Logger.getLogger(SRDSMng.class); - protected IJobDirectory adsJobDirectory; - protected IResourceDiscovery adsResourceDiscovery; + private AEMclientDixi aem; private JDSclientDixi jds; Index: src/eu/xtreemos/ads/dht/DhtObjectFactory.java =================================================================== --- src/eu/xtreemos/ads/dht/DhtObjectFactory.java (.../0.2.19) (revision 3246) +++ src/eu/xtreemos/ads/dht/DhtObjectFactory.java (.../0.2.20) (revision 3246) @@ -47,7 +47,7 @@ * TODO : Currently there is ONLY the local cache. * The AbstractDhtObjects include the specification of features needed by their namespaces * */ - private Hashtable NameSpaces = new Hashtable(); + public static Hashtable NameSpaces = new Hashtable(); private FeatureList defaultFeatures; // a feature list targeted at namespaces Index: src/eu/xtreemos/ads/test/AEMQueryGenerator.java =================================================================== --- src/eu/xtreemos/ads/test/AEMQueryGenerator.java (.../0.2.19) (revision 0) +++ src/eu/xtreemos/ads/test/AEMQueryGenerator.java (.../0.2.20) (revision 3246) @@ -0,0 +1,293 @@ + /** Copyright (c) 2008, 2009 Consiglio Nazionale delle Ricerche. + * All rights reserved. + * + * This file is part of ADS. ADS is part of XtreemOS, a Linux-based Grid + * Operating System, see for more details. The + * XtreemOS project has been developed with the financial support of the + * European Commission's IST program under contract #FP6-033576. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are + * met: + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in + * the documentation and/or other materials provided with the distribution. + * * Neither the name of the XtreemOS project nor the names of its + * partners and/or contributors may be used to endorse or promote + * products derived from this software without specific prior written + * permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED + * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A + * PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER + * OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, + * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, + * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR + * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF + * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS + * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +package eu.xtreemos.ads.test; + + +import java.io.BufferedReader; +import java.io.File; +import java.io.FileReader; +import java.io.PrintStream; +import java.net.InetAddress; +import java.rmi.registry.LocateRegistry; +import java.rmi.registry.Registry; +import java.util.Vector; + +import org.apache.commons.cli.CommandLine; +import org.apache.commons.cli.CommandLineParser; +import org.apache.commons.cli.Options; +import org.apache.commons.cli.PosixParser; + +import eu.xtreemos.ads.connection.rmi.InterfaceAEMclientRMI; +import eu.xtreemos.ads.srds_configuration.SrdsConfiguration; + + +public class AEMQueryGenerator +{ + /** + * + * @author carlini + * + */ + + private int ITERATIONS = 3; + private long DISTANCE = 200; + private String OUTPUT_FILE; + private Integer NODES = 0; + private int ID = 0; + + private InterfaceAEMclientRMI aemrmi = null; + String host = null; + + private Long startTestTime; + + private Vector result = new Vector(); + + private String jsdlQuery="" + + "" + + "" + + "A demanding job" + + "" + + "A sample resource requirements JSDL." + + "" + + "" + + "" + + "" + + "" + + "" + + "" + + "" + + "1000002000.0" + + "2500000000.0" + + "" + + "" + + "" + + "1.0" + + "" + + "" + + "x86" + + "" + + "" + + "" + + ""; + + + String jsdl_filename = "test/jsdlGrid5000Tests.xml"; + + public String getStringFromJsdl(String filename) + { + try + { + File f = new File(filename); + BufferedReader br = new BufferedReader(new FileReader(f)); + + String newline = br.readLine(); + String jsdl=""; + while (newline!=null) + { + jsdl+= newline; + newline=br.readLine(); + } + + return jsdl; + } + catch (Exception e) {e.printStackTrace();} + return null; + } + + + public static void main(String args[]) + { + // Initialize the configution + //SrdsConfiguration.initialize(); + + // create and connects the class for test + AEMQueryGenerator aem = new AEMQueryGenerator(); + aem.doConnection(); + aem.parseCLI(args); + + // write the output file at init: to test the presence. + aem.writeOnFile(aem.result); + + // Runs for 10, 30.. ..90 % of nodes. + for (int i=1; i<=10; i = i+3) + { + aem.startTestTime = System.currentTimeMillis(); + aem.result.add("["+i*10+"]"); + double perc = new Integer(i).doubleValue() * 10d / 100d; + if (aem.partecipate(perc)) + { + System.out.println(aem.ID + ": Session "+i+" started."); + aem.start(i); + } + else + { + System.out.println(aem.ID + ": Session "+i+" skipped."); + aem.synchro(10000l); + } + + } + + aem.writeOnFile(aem.result); + + System.out.println("======= TEST DONE ============"); + + } + + public void doConnection() + { + try + { + host = InetAddress.getLocalHost().getHostAddress(); + OUTPUT_FILE = host; + System.out.println("try to connect at: //"+host+"/AEMclientRMI"); + Registry registry = LocateRegistry.getRegistry(); + aemrmi = (InterfaceAEMclientRMI) registry.lookup("//"+host+"/AEMclientRMI"); + + } + catch (Exception e) + { + System.out.println("can't connect to rmi service JDSclientRMI" +e.getMessage()); + e.printStackTrace(); + System.exit(1); + } + } + + public void parseCLI(String[] args) + { + Options options = new Options(); + options.addOption("i", true, "Number of query to sumbit per cycle. Zero or negative results as infinite"); + options.addOption("d", true, "Distance in milliseconds between queries"); + options.addOption("o", true, "Output file"); + options.addOption("nodes", true, "Total nodes partecipate to a test"); + options.addOption("id", true, "Id of the node"); + + try + { + CommandLineParser parser = new PosixParser(); + CommandLine cmd = parser.parse( options, args); + + if (cmd.getOptionValue("i") != null) + ITERATIONS = Integer.parseInt(cmd.getOptionValue("i")); + + if (ITERATIONS <= 0) + System.exit(1); + + if (cmd.getOptionValue("d") != null) + DISTANCE = Long.parseLong(cmd.getOptionValue("d")); + + if (cmd.getOptionValue("o") != null) + OUTPUT_FILE = cmd.getOptionValue("o"); + + if (cmd.getOptionValue("nodes") != null) + NODES = Integer.parseInt(cmd.getOptionValue("nodes")); + + if (cmd.getOptionValue("id") != null) + ID = Integer.parseInt(cmd.getOptionValue("id")); + } + catch (Exception e) {e.printStackTrace();} + } + + public void start(int session) + { + this.synchro(1000l); + + result.add("(AEMRequest)"); + for (int iter=0; iter < ITERATIONS; iter++) + { + try + { + Thread.sleep(DISTANCE); + long before = System.currentTimeMillis(); + String aem_result = aemrmi.AEMlocate(jsdlQuery,null,null,NODES*10/100); + long after = System.currentTimeMillis(); + result.add(new Long(after - before).toString()); + } + catch (Exception e) + { + e.printStackTrace(); result.add(e.getMessage()); + } + } + + this.synchro(10000l); + } + + + private void synchro(Long checkpoint) + { + Long current = System.currentTimeMillis(); + + // se this.startTestTime + checkpoint > current -- diff > 0 -- aspetto diff + // else continuo al volo!!! + + Long diff = this.startTestTime + checkpoint - current; + + if (diff > 0) + { + try {Thread.sleep(diff);} catch (Exception e) {e.printStackTrace();} + } + else + System.out.println(ID+ ": delay "+diff); + } + + private boolean partecipate(double percent) + { + double node_partecipate = Math.floor(NODES.doubleValue() * percent); + System.out.println(ID+" "+node_partecipate); + return ID <= node_partecipate; + } + + private void writeOnFile(Vector result) + { + // write information on output file + StringBuilder sb = new StringBuilder(); + for (String item : result) + sb.append(item).append("\n"); + + File f = new File(OUTPUT_FILE); + if (f.exists()) + f.delete(); + + try + { + PrintStream out = new PrintStream(OUTPUT_FILE); + out.print(sb.toString()); + out.close(); + } + catch (Exception e) {e.printStackTrace();} + + System.out.println(this.ID + ": Write on output file: "+f.getAbsolutePath()); + } + +} Index: src/eu/xtreemos/ads/test/console/AemConsoleTest.java =================================================================== --- src/eu/xtreemos/ads/test/console/AemConsoleTest.java (.../0.2.19) (revision 3246) +++ src/eu/xtreemos/ads/test/console/AemConsoleTest.java (.../0.2.20) (revision 3246) @@ -538,10 +538,27 @@ } //CORES ? if (aux.getClass().getName().equals("eu.xtreemos.rss.attribute.CoresAttribute")) { - ArchAttribute ca = (ArchAttribute) aux; - resources += ""; - resources += ca.getArchName(); - resources += ""; + resources += ""; + CoresAttribute coresmin = (CoresAttribute) range.getMin(); + CoresAttribute coresmax = (CoresAttribute) range.getMax(); + // upper bounded + if (coresmin == null && coresmax != null) { + resources += "" + coresmax.getCores() + ""; + resources += ""; + continue; + } + // lower bounded + if (coresmin != null && coresmax == null) { + resources += "" + coresmin.getCores() + ""; + resources += ""; + continue; + } + // default case + resources += ""; + resources += "" + coresmin.getCores() + ""; + resources += "" + coresmax.getCores() + ""; + resources += ""; + resources += ""; } // CPU ? if (aux.getClass().getName().equals("eu.xtreemos.rss.attribute.ArchAttribute")) { Index: src/eu/xtreemos/ads/test/JDSQueryGenerator.java =================================================================== --- src/eu/xtreemos/ads/test/JDSQueryGenerator.java (.../0.2.19) (revision 3246) +++ src/eu/xtreemos/ads/test/JDSQueryGenerator.java (.../0.2.20) (revision 3246) @@ -374,4 +374,7 @@ } catch (Exception e) {e.printStackTrace();} } + + + } Index: src/eu/xtreemos/ads/srds_configuration/SrdsConfiguration.java =================================================================== --- src/eu/xtreemos/ads/srds_configuration/SrdsConfiguration.java (.../0.2.19) (revision 3246) +++ src/eu/xtreemos/ads/srds_configuration/SrdsConfiguration.java (.../0.2.20) (revision 3246) @@ -279,14 +279,25 @@ commands_and_confs.put("command.start", (String) properties.get(path+".scalaris.command.start") ); commands_and_confs.put("command.stop", (String) properties.get(path+".scalaris.command.stop") ); commands_and_confs.put("configurationFile", configurationPath +(String) properties.get(path+".scalaris.configurationFile")); + try{ scalaris_webServerPort = Integer.parseInt((String) properties.get(path+".scalaris.webserverPort")); + }catch(NumberFormatException e){ + log.info("ATTENTION: Webserver port for Scalaris not found: using default port 9001"); + scalaris_webServerPort=9001; + } runningDhtScript.put((String) properties.get(path+".scalaris.type"), commands_and_confs); commands_and_confs = new Hashtable(); commands_and_confs.put("command.start", configurationPath + (String) properties.get(path+".ow.command.start") ); commands_and_confs.put("command.stop", configurationPath +(String) properties.get(path+".ow.command.stop") ); commands_and_confs.put("configurationFile", configurationPath +(String) properties.get(path+".ow.configurationFile")); + try{ ow_webServerPort = Integer.parseInt((String) properties.get(path+".ow.webserverPort")); + } catch (NumberFormatException e){ + log.info("ATTENTION: Webserver port for OW not found: using default port 3998"); + ow_webServerPort=3998; + } + runningDhtScript.put((String) properties.get(path+".ow.type"), commands_and_confs); @@ -300,8 +311,12 @@ log.info("glue schema file: "+ pathToGlueSchemaFile); diskdevice = (String) properties.get("srds.configuration.device.disk"); bandAvailable = (String) properties.get("srds.configuration.device.ethernet"); - + try{ srds_webServerPort = Integer.parseInt((String) properties.get("srds.configurations.webserverPort")); + }catch (NumberFormatException e){ + log.info("ATTENTION: Webserver port for SRDS not found: using default port 9000"); + srds_webServerPort=9000; + } } /** Index: src/eu/xtreemos/ads/Facade.java =================================================================== --- src/eu/xtreemos/ads/Facade.java (.../0.2.19) (revision 3246) +++ src/eu/xtreemos/ads/Facade.java (.../0.2.20) (revision 3246) @@ -33,9 +33,8 @@ import eu.xtreemos.ads.util.NodeNetInformation; import eu.xtreemos.rss.XtreemRSS; import eu.xtreemos.rss.protocol.QueryForwarder; -import eu.xtreemos.srdsaccess.jobDirectory.TestJobDirectory; -import eu.xtreemos.srdsaccess.resmng.TestResourceDiscovery; + /** * Facade is the entry point for SRDS. It manage the requests from: * AEM, JDS and DMS. It can use either RMI or DIXI for handling connections Index: src/eu/xtreemos/ads/client_implementation/AEMRequest.java =================================================================== --- src/eu/xtreemos/ads/client_implementation/AEMRequest.java (.../0.2.19) (revision 3246) +++ src/eu/xtreemos/ads/client_implementation/AEMRequest.java (.../0.2.20) (revision 3246) @@ -46,6 +46,13 @@ this.JSDL = JSDLQuery; this.setResults=rmi; } + public AEMRequest(String JSDLQuery, String xacmlDocument, X509Certificate userXOSDCert, Integer howMany, AEMclientRMI rmiObject){ + this.JSDL = JSDLQuery; + this.setResults=rmiObject; + this.xacmlDocument=xacmlDocument; + this.userXOSDCert=userXOSDCert; + this.howMany=howMany; + } public AEMRequest(String JSDLQuery, String xacmlDocument, X509Certificate userXOSDCert, Integer howMany, AEMclientDixi dixiObject){ this.JSDL = JSDLQuery; Index: lib/overlayweaver.jar =================================================================== Cannot display: file marked as a binary type. svn:mime-type = application/octet-stream Index: lib/xtreemrss.jar =================================================================== Cannot display: file marked as a binary type. svn:mime-type = application/octet-stream