-%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%
% NEPI, a framework to manage network experiments
% Copyright (C) 2013 INRIA
%
% This program is free software: you can redistribute it and/or modify
-% it under the terms of the GNU General Public License as published by
-% the Free Software Foundation, either version 3 of the License, or
-% (at your option) any later version.
+% it under the terms of the GNU General Public License version 2 as
+% published by the Free Software Foundation;
%
% This program is distributed in the hope that it will be useful,
% but WITHOUT ANY WARRANTY; without even the implied warranty of
\endgroup
-To use Python you will need to set the PATH environmental variable as:
+To use Python you will need to set the PATH environmen variable as:
\begingroup
\fontsize{10pt}{12pt}\selectfont
\fontsize{10pt}{12pt}\selectfont
\begin{verbatim}
-$ hg clone http://nepi.inria.fr/code/nepi -r nepi-3-dev
+$ hg clone http://nepi.inria.fr/code/nepi -r nepi-3.2.0
\end{verbatim}
\endgroup
\end{lstlisting}
Next we will define two Python functions: \emph{add\_node} and \emph{add\_app}.
-The first one to register \textit{LinuxNodes} resources and the second one to
-register LinuxApplications resources.
+The first one to register linux::Node resources and the second one to
+register linux::Application resources.
\begin{lstlisting}[language=Python]
%cpaste
def add_node(ec, hostname, username, ssh_key):
- node = ec.register_resource("LinuxNode")
+ node = ec.register_resource("linux::Node")
ec.set(node, "hostname", hostname)
ec.set(node, "username", username)
ec.set(node, "identity", ssh_key)
- ec.set(node, "cleanHome", True)
+ ec.set(node, "cleanExperiment", True)
ec.set(node, "cleanProcesses", True)
return node
def add_app(ec, command, node):
- app = ec.register_resource("LinuxApplication")
+ app = ec.register_resource("linux::Application")
ec.set(app, "command", command)
ec.register_connection(app, node)
return app
The actual deployment of the experiment requires the method \textit{deploy} to
be invoked.
-The \textit{LinuxNode} resource exposes the hostname, username and identity
+The linux::Node resource exposes the hostname, username and identity
attributes. This attributes provide information about the SSH credentials
needed to log in to the Linux host.
The \textit{hostname} is the one that identifies the physical host you want
'absolute' path to the SSH private key in your local computer that allows you
to log in to the host.
-The \textit{command} attribute of the \textit{LinuxApplication} resource
+The \textit{command} attribute of the linux::Application resource
expects a BASH command line string to be executed in the remote host.
-Apart from the \emph{command} attribute, the \emph{LinuxApplication}
+Apart from the \emph{command} attribute, the linux::Application
resource exposes several other attributes that allow to upload,
compile and install arbitrary sources.
-The add\_app function registers a connection between a \textit{LinuxNode} and a
-\textit{LinuxApplication}.
+The add\_app function registers a connection between a linux::Node and a
+linux::Application.
Lets now use these functions to describe a simple experiment.
Choose a host where you have an account, and can access using SSH
\begin{lstlisting}[language=Python]
-hostname = "<the-hostname>"
-username = "<my-username>"
-identity = "</home/myuser/.ssh/id_rsa>"
+hostname = <the-hostname>
+username = <my-username>
+identity = </home/myuser/.ssh/id_rsa>
node = add_node(ec, hostname, username, ssh_key)
app = add_app(ec, "ping -c3 nepi.inria.fr", node)
one directory named node-1 which will contain the files (e.g. result traces)
associated to the LinuxNode reosurce you just deployed.
In fact for every resource deployed associated to that host (e.g. each
-LinuxApplication), NEPI will create a directory to place files related to it.
+linux::Application), NEPI will create a directory to place files related to it.
The name of the directory identifies the type of resources (e.g. 'node',
'app', etc) and it is followed by the global unique identifier (guid).
\end{lstlisting}
-Once a \textit{LinuxApplication} has reached the state 'STARTED',
+Once a linux::Application has reached the state 'STARTED',
we can retrieve the 'stdout' trace, which should contain the output
of the PING command.