From: Claudio-Daniel Freire Date: Tue, 26 Jul 2011 16:16:57 +0000 (+0200) Subject: Make spanning deployment optional, both for security and interactivity reasons (spann... X-Git-Tag: nepi-3.0.0~346 X-Git-Url: http://git.onelab.eu/?a=commitdiff_plain;h=c3ca0fb063d10e0f2c1a4cfb3a60740ca8b698cf;p=nepi.git Make spanning deployment optional, both for security and interactivity reasons (spanning deployment is interactive, it may not always be appropriate, like in tests) --- diff --git a/src/nepi/testbeds/planetlab/execute.py b/src/nepi/testbeds/planetlab/execute.py index c63a9549..7b98ed9e 100644 --- a/src/nepi/testbeds/planetlab/execute.py +++ b/src/nepi/testbeds/planetlab/execute.py @@ -125,6 +125,8 @@ class TestbedController(testbed_impl.TestbedController): get_attribute_value("plLogLevel") self.tapPortBase = self._attributes.\ get_attribute_value("tapPortBase") + self.p2pDeployment = self._attributes.\ + get_attribute_value("p2pDeployment") self._logger.setLevel(getattr(logging,self.logLevel)) @@ -160,8 +162,9 @@ class TestbedController(testbed_impl.TestbedController): # Oh... retry... pass - # Plan application deployment - self.do_spanning_deployment_plan() + if self.p2pDeployment: + # Plan application deployment + self.do_spanning_deployment_plan() # Configure elements per XML data super(TestbedController, self).do_preconfigure() diff --git a/src/nepi/testbeds/planetlab/metadata.py b/src/nepi/testbeds/planetlab/metadata.py index 92e0b983..fff9b8b6 100644 --- a/src/nepi/testbeds/planetlab/metadata.py +++ b/src/nepi/testbeds/planetlab/metadata.py @@ -1110,6 +1110,23 @@ testbed_attributes = dict({ "flags": Attribute.ExecReadOnly | Attribute.ExecImmutable, "validation_function": validation.is_string }), + "p2p_deployment": dict({ + "name": "p2pDeployment", + "help": "Enable peer-to-peer deployment of applications and dependencies. " + "When enabled, dependency packages and applications are " + "deployed in a P2P fashion, picking a single node to do " + "the building or repo download, while all the others " + "cooperatively exchange resulting binaries or rpms. " + "When deploying to many nodes, this is a far more efficient " + "use of resources. It does require re-encrypting and distributing " + "the slice's private key. Though it is implemented in a secure " + "fashion, if they key's sole purpose is not PlanetLab, then this " + "feature should be disabled.", + "type": Attribute.BOOL, + "value": True, + "flags": Attribute.ExecReadOnly | Attribute.ExecImmutable, + "validation_function": validation.is_bool + }), "slice_ssh_key": dict({ "name": "sliceSSHKey", "help": "The controller-local path to the slice user's ssh private key. " diff --git a/test/testbeds/planetlab/execute.py b/test/testbeds/planetlab/execute.py index 137b2585..40a967ba 100755 --- a/test/testbeds/planetlab/execute.py +++ b/test/testbeds/planetlab/execute.py @@ -53,6 +53,7 @@ class PlanetLabExecuteTestCase(unittest.TestCase): instance.defer_configure("authPass", pl_pwd) instance.defer_configure("plcHost", plchost) instance.defer_configure("tapPortBase", self.port_base) + instance.defer_configure("p2pDeployment", False) # it's interactive, we don't want it in tests return instance diff --git a/test/testbeds/planetlab/integration.py b/test/testbeds/planetlab/integration.py index b5b28370..2d24e3e2 100755 --- a/test/testbeds/planetlab/integration.py +++ b/test/testbeds/planetlab/integration.py @@ -58,6 +58,7 @@ class PlanetLabIntegrationTestCase(unittest.TestCase): pl_desc.set_attribute_value("authPass", pl_pwd) pl_desc.set_attribute_value("plcHost", plchost) pl_desc.set_attribute_value("tapPortBase", self.port_base) + pl_desc.set_attribute_value("p2pDeployment", False) # it's interactive, we don't want it in tests return pl_desc, exp_desc @@ -117,8 +118,12 @@ class PlanetLabIntegrationTestCase(unittest.TestCase): controller.shutdown() @test_util.skipUnless(test_util.pl_auth() is not None, "Test requires PlanetLab authentication info (PL_USER and PL_PASS environment variables)") + @test_util.skipUnless(os.environ.get('NEPI_FULL_TESTS','').lower() in ('1','yes','true','on'), + "Test is interactive, requires NEPI_FULL_TESTS=yes") def test_spanning_deployment(self): pl, exp = self.make_experiment_desc() + + pl.set_attribute_value("p2pDeployment", True) # we do want it here - even if interactive from nepi.testbeds import planetlab as plpackage diff --git a/test/testbeds/planetlab/integration_cross.py b/test/testbeds/planetlab/integration_cross.py index e20ad973..8dcb8cb7 100755 --- a/test/testbeds/planetlab/integration_cross.py +++ b/test/testbeds/planetlab/integration_cross.py @@ -67,6 +67,7 @@ class PlanetLabMultiIntegrationTestCase(unittest.TestCase): pl_desc.set_attribute_value("authPass", pl_pwd) pl_desc.set_attribute_value("plcHost", plchost1) pl_desc.set_attribute_value("tapPortBase", self.port_base) + pl_desc.set_attribute_value("p2pDeployment", False) # it's interactive, we don't want it in tests pl_desc2 = exp_desc.add_testbed_description(pl_provider) pl_desc2.set_attribute_value("homeDirectory", self.root_dir+"v2") @@ -75,7 +76,8 @@ class PlanetLabMultiIntegrationTestCase(unittest.TestCase): pl_desc2.set_attribute_value("authUser", pl_user) pl_desc2.set_attribute_value("authPass", pl_pwd) pl_desc2.set_attribute_value("plcHost", plchost2) - pl_desc2.set_attribute_value("tapPortBase", self.port_base+100) + pl_desc2.set_attribute_value("tapPortBase", self.port_base+500) + pl_desc2.set_attribute_value("p2pDeployment", False) # it's interactive, we don't want it in tests return pl_desc, pl_desc2, exp_desc diff --git a/test/testbeds/planetlab/integration_multi.py b/test/testbeds/planetlab/integration_multi.py index b8e85276..30f56c58 100755 --- a/test/testbeds/planetlab/integration_multi.py +++ b/test/testbeds/planetlab/integration_multi.py @@ -67,6 +67,7 @@ class PlanetLabMultiIntegrationTestCase(unittest.TestCase): pl_desc.set_attribute_value("authPass", pl_pwd) pl_desc.set_attribute_value("plcHost", plchost1) pl_desc.set_attribute_value("tapPortBase", self.port_base) + pl_desc.set_attribute_value("p2pDeployment", False) # it's interactive, we don't want it in tests pl_desc2 = exp_desc.add_testbed_description(pl_provider) pl_desc2.set_attribute_value("homeDirectory", self.root_dir+"v2") @@ -75,7 +76,8 @@ class PlanetLabMultiIntegrationTestCase(unittest.TestCase): pl_desc2.set_attribute_value("authUser", pl_user) pl_desc2.set_attribute_value("authPass", pl_pwd) pl_desc2.set_attribute_value("plcHost", plchost2) - pl_desc.set_attribute_value("tapPortBase", self.port_base+100) + pl_desc2.set_attribute_value("tapPortBase", self.port_base+500) + pl_desc2.set_attribute_value("p2pDeployment", False) # it's interactive, we don't want it in tests return pl_desc, pl_desc2, exp_desc diff --git a/test/testbeds/planetlab/integration_ns3.py b/test/testbeds/planetlab/integration_ns3.py index 80914683..b9ef9529 100755 --- a/test/testbeds/planetlab/integration_ns3.py +++ b/test/testbeds/planetlab/integration_ns3.py @@ -57,6 +57,7 @@ class PlanetLabCrossIntegrationTestCase(unittest.TestCase): pl_desc.set_attribute_value("authPass", pl_pwd) pl_desc.set_attribute_value("plcHost", plchost) pl_desc.set_attribute_value("tapPortBase", self.port_base) + pl_desc.set_attribute_value("p2pDeployment", False) # it's interactive, we don't want it in tests return pl_desc, exp_desc