aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMarco Capitani <m.capitani@nextworks.it>2017-06-13 09:45:15 +0200
committerMarco Capitani <m.capitani@nextworks.it>2017-06-13 09:45:15 +0200
commit3d16b92c65184d9a7c93a69d2b3393c528bf1dc6 (patch)
tree81898aa682d467147bc3117aadb16f1aa5dc787b
parent57218e2bd37d32a9dafedde90a62b46955ac5e8f (diff)
parenta5e67722327ecb2046798e6ad9a103fb42cb09e8 (diff)
downloadrumba-3d16b92c65184d9a7c93a69d2b3393c528bf1dc6.tar.gz
rumba-3d16b92c65184d9a7c93a69d2b3393c528bf1dc6.zip
Merge branch 'master' into jfed-irati-fixes (rumba access)
-rw-r--r--README.md14
-rw-r--r--rumba/model.py9
-rwxr-xr-xsetup.py3
-rwxr-xr-xtools/rumba-access21
4 files changed, 28 insertions, 19 deletions
diff --git a/README.md b/README.md
index cbe1015..25d79fd 100644
--- a/README.md
+++ b/README.md
@@ -128,15 +128,11 @@ folder.
$ eval `ssh-agent`
$ ssh-add /home/morty/cert.pem
+## Accessing nodes after swap-in
+
To access a node once the experiment swapped in, use the following
- command (in the same terminal where ssh-agent was run):
+ command (in the same terminal where ssh-agent was run in case of jFed):
- $ ssh -A -oProxyCommand="ssh -i $CERTPATH
- -o StrictHostKeyChecking=no $USER@bastion.test.iminds.be
- nc $NODENAME.$EXP.wall2-ilabt-iminds-be.wall2.ilabt.iminds.be 22"
- $USER@$NODENAME.$EXP.wall2-ilabt-iminds-be.wall2.ilabt.iminds.be
+ $ rumba-access $NODE_NAME
- where $CERTPATH is the absolute path of the certificate (e.g.
- /home/morty/cert.pem), $USER is the jFed username (e.g. "ricksanchez"),
- $NODENAME is the name of the node you want to access (e.g. "a"),
- and $EXP is the name of the experiment (e.g. "rochefort10").
+ Where $NODE_NAME is the name of the node to access. \ No newline at end of file
diff --git a/rumba/model.py b/rumba/model.py
index c1c6f5d..9818ac7 100644
--- a/rumba/model.py
+++ b/rumba/model.py
@@ -524,8 +524,11 @@ class Experiment:
def dump_ssh_info(self):
f = open('ssh_info', 'w')
for node in self.nodes:
- f.write("%s %s %s %s\n" % (node.name, self.testbed.username,
- node.ssh_config.hostname, node.ssh_config.port))
+ f.write("%s;%s;%s;%s;%s\n" % (node.name,
+ self.testbed.username,
+ node.ssh_config.hostname,
+ node.ssh_config.port,
+ node.ssh_config.proxycommand))
f.close()
# Examine the nodes and DIFs, compute the registration and enrollment
@@ -643,7 +646,7 @@ class Server:
def get_new_clients(self, interval):
"""
Returns a list of clients of size appropriate to the server's rate.
-
+
The list's size should be a sample from Poisson(arrival_rate) over
interval seconds.
Hence, the average size should be interval * arrival_rate.
diff --git a/setup.py b/setup.py
index 316b6da..85760f2 100755
--- a/setup.py
+++ b/setup.py
@@ -20,5 +20,6 @@ setup(
description="Rumba measurement framework for RINA",
long_description=long_description,
packages=["rumba", "rumba.testbeds", "rumba.prototypes"],
- install_requires=["paramiko", "wheel", "wget"]
+ install_requires=["paramiko", "wheel", "wget"],
+ scripts = ['tools/rumba-access']
)
diff --git a/tools/rumba-access b/tools/rumba-access
index 06b0a02..1cf382e 100755
--- a/tools/rumba-access
+++ b/tools/rumba-access
@@ -1,4 +1,4 @@
-#!/bin/bash
+#!/usr/bin/env bash
FILE=ssh_info
@@ -8,24 +8,33 @@ if [ "$MACHINE_ID" == "" ]; then
exit 255
fi
-USER=$(grep "\<${MACHINE_ID}\>" ${FILE} | awk '{print $2}')
+USER=$(grep "\<${MACHINE_ID}\>" ${FILE} | awk -F';' '{print $2}')
if [ "$USER" == "" ]; then
echo "Error: Node ${MACHINE_ID} unknown"
exit 255
fi
-HOST=$(grep "\<${MACHINE_ID}\>" ${FILE} | awk '{print $3}')
+HOST=$(grep "\<${MACHINE_ID}\>" ${FILE} | awk -F';' '{print $3}')
if [ "$HOST" == "" ]; then
echo "Error: Node ${MACHINE_ID} unknown"
exit 255
fi
-SSH_PORT=$(grep "\<${MACHINE_ID}\>" ${FILE} | awk '{print $4}')
+SSH_PORT=$(grep "\<${MACHINE_ID}\>" ${FILE} | awk -F';' '{print $4}')
if [ "$SSH_PORT" == "" ]; then
echo "Error: Node ${MACHINE_ID} unknown"
exit 255
fi
+PROXY_CMD=$(grep "\<${MACHINE_ID}\>" ${FILE} | awk -F';' '{print $5}')
+if [ "$PROXY_CMD" == "" ]; then
+ echo "Error: Node ${MACHINE_ID} unknown"
+ exit 255
+fi
+
echo "Accessing Rumba node ${MACHINE_ID}"
-# -o IdentityFile=buildroot/irati_rsa
-ssh -o StrictHostKeyChecking=no -o UserKnownHostsFile=/dev/null -p ${SSH_PORT} ${USER}@${HOST}
+if [[ $PROXY_CMD = "None" ]]; then
+ ssh -A -o StrictHostKeyChecking=no -o UserKnownHostsFile=/dev/null -p ${SSH_PORT} ${USER}@${HOST}
+else
+ ssh -A -o StrictHostKeyChecking=no -o UserKnownHostsFile=/dev/null -oProxyCommand="$PROXY_CMD" -p ${SSH_PORT} ${USER}@${HOST}
+fi