示例#1
0
    def launchCluster(self):
        from boto.ec2.blockdevicemapping import BlockDeviceType
        self.createClusterUtil(args=[
            '--leaderStorage',
            str(self.requestedLeaderStorage), '--nodeTypes', ",".join(
                self.instanceTypes), '-w', ",".join(self.numWorkers),
            '--nodeStorage',
            str(self.requestedLeaderStorage)
        ])

        ctx = AWSProvisioner._buildContext(self.clusterName)
        nodes = AWSProvisioner._getNodesInCluster(ctx,
                                                  self.clusterName,
                                                  both=True)
        nodes.sort(key=lambda x: x.launch_time)
        # assuming that leader is first
        workers = nodes[1:]
        # test that two worker nodes were created
        self.assertEqual(2, len(workers))
        # test that workers have expected storage size
        # just use the first worker
        worker = workers[0]
        worker = next(wait_instances_running(ctx.ec2, [worker]))
        rootBlockDevice = worker.block_device_mapping["/dev/xvda"]
        self.assertTrue(isinstance(rootBlockDevice, BlockDeviceType))
        rootVolume = ctx.ec2.get_all_volumes(
            volume_ids=[rootBlockDevice.volume_id])[0]
        self.assertGreaterEqual(rootVolume.size, self.requestedNodeStorage)
示例#2
0
 def launchCluster(self):
     self.createClusterUtil(args=['-w', '2'])
     ctx = AWSProvisioner._buildContext(self.clusterName)
     # test that two worker nodes were created + 1 for leader
     self.assertEqual(
         2 + 1,
         len(
             AWSProvisioner._getNodesInCluster(ctx,
                                               self.clusterName,
                                               both=True)))
示例#3
0
 def launchCluster(self):
     self.createClusterUtil(args=['--leaderStorage', str(self.requestedLeaderStorage),
                                  '-w', '2', '--nodeStorage', str(self.requestedLeaderStorage)])
     ctx = AWSProvisioner._buildContext(self.clusterName)
     nodes = AWSProvisioner._getNodesInCluster(ctx, self.clusterName, both=True)
     nodes.sort(key=lambda x: x.launch_time)
     # assuming that leader is first
     workers = nodes[1:]
     # test that two worker nodes were created
     self.assertEqual(2, len(workers))
     # test that workers have expected storage size
     # just use the first worker
     worker = workers[0]
     worker = next(wait_instances_running(ctx.ec2, [worker]))
     rootBlockDevice = worker.block_device_mapping["/dev/xvda"]
     self.assertTrue(isinstance(rootBlockDevice, BlockDeviceType))
     rootVolume = ctx.ec2.get_all_volumes(volume_ids=[rootBlockDevice.volume_id])[0]
     self.assertGreaterEqual(rootVolume.size, self.requestedNodeStorage)