From 0ea70c88f1b3b4be37376bb20feebce11135fdeb Mon Sep 17 00:00:00 2001 From: Claudio-Daniel Freire Date: Fri, 1 Jul 2011 15:30:14 +0200 Subject: [PATCH] More feedback on the PlanetLab testbed (it takes a looong time to do stuff, feedback is necessary) --- src/nepi/testbeds/planetlab/application.py | 21 +++++++++++++++++++ .../testbeds/planetlab/scripts/tun_connect.py | 2 ++ 2 files changed, 23 insertions(+) diff --git a/src/nepi/testbeds/planetlab/application.py b/src/nepi/testbeds/planetlab/application.py index 953d439d..7a9e726a 100644 --- a/src/nepi/testbeds/planetlab/application.py +++ b/src/nepi/testbeds/planetlab/application.py @@ -139,6 +139,7 @@ class Dependency(object): return local_path def setup(self): + print >>sys.stderr, "Setting up", self self._make_home() self._launch_build() self._finish_build() @@ -158,6 +159,7 @@ class Dependency(object): def async_setup_wait(self): if not self._setup: + print >>sys.stderr, "Waiting for", self, "to be setup" if self._setuper: self._setuper.join() if not self._setup: @@ -341,6 +343,8 @@ class Dependency(object): delay = min(30,delay*1.2) else: raise RuntimeError, "Failed to set up build slave %s: cannot get pid" % (self.home_path,) + + print >>sys.stderr, "Deploying", self def _do_wait_build(self): pid = self._build_pid @@ -348,6 +352,7 @@ class Dependency(object): if pid and ppid: delay = 1.0 + first = True while True: status = rspawn.remote_status( pid, ppid, @@ -363,6 +368,14 @@ class Dependency(object): self._build_pid = self._build_ppid = None break else: + if first: + print >>sys.stderr, "Waiting for", self, "to finish building", + if self._master is not None: + print >>sys.stderr, "(build master)" + else: + print >>sys.stderr, "(build slave)" + + first = False time.sleep(delay*(0.5+random.random())) delay = min(30,delay*1.2) @@ -393,11 +406,14 @@ class Dependency(object): "(expected %r, got %r), see buildlog: %s" % ( self.home_path, pid, ppid, self._master_token, slave_token, buildlog) + print >>sys.stderr, "Built", self + def _do_kill_build(self): pid = self._build_pid ppid = self._build_ppid if pid and ppid: + print >>sys.stderr, "Killing build of", self rspawn.remote_kill( pid, ppid, host = self.node.hostname, @@ -460,6 +476,8 @@ class Dependency(object): def _do_install(self): if self.install: + print >>sys.stderr, "Installing", self + # Install application try: self._popen_ssh_command( @@ -587,6 +605,8 @@ class Application(Dependency): ) def start(self): + print >>sys.stderr, "Starting", self + # Create shell script with the command # This way, complex commands and scripts can be ran seamlessly # sync files @@ -696,6 +716,7 @@ class Application(Dependency): ident_key = self.node.ident_path, server_key = self.node.server_key ) + print >>sys.stderr, "Killed", self class NepiDependency(Dependency): diff --git a/src/nepi/testbeds/planetlab/scripts/tun_connect.py b/src/nepi/testbeds/planetlab/scripts/tun_connect.py index 98e53339..af7126c3 100644 --- a/src/nepi/testbeds/planetlab/scripts/tun_connect.py +++ b/src/nepi/testbeds/planetlab/scripts/tun_connect.py @@ -286,6 +286,7 @@ def pl_vif_start(tun_path, tun_name): stdout = open("/vsys/vif_up.out","r") out.append(stdout.read()) stdout.close() + time.sleep(1) # Serialize access to vsys lockfile = open("/tmp/nepi-tun-connect.lock", "a") @@ -320,6 +321,7 @@ def pl_vif_stop(tun_path, tun_name): stdout = open("/vsys/vif_down.out","r") out.append(stdout.read()) stdout.close() + time.sleep(1) # Serialize access to vsys lockfile = open("/tmp/nepi-tun-connect.lock", "a") -- 2.47.0