Exemple #1
0
    def testDeploySSHCluster(self):
        options = VmManager.defaultRunOptions()
        options.update({'username': ClusterTest.username,
                        'password': ClusterTest.password,
                        'mpi_machine_file': True,
                        'instanceType': self.instanceType,
                        'cluster_admin': 'root',
                        'cluster_user': '******',
                        'master_vmid': None,
                        'tolerate_failures': False,
                        'clean_after_failure': False,
                        'include_master': True,
                        'shared_folder': None,
                        'add_packages': None,
                        'ssh_hostbased': True,
                        'instanceNumber': self.instanceNumber,
                        'verboseLevel': 0,
                        'marketplaceEndpoint': 'https://marketplace.stratuslab.eu'})
        configHolder = ConfigHolder(options)
        runner = VmManagerFactory.create(self.image, configHolder)
        cluster = Cluster(configHolder, runner, options['master_vmid'])
        runner.runInstance()

        self.assertTrue(cluster.deploy() in [0, 128])

        runner.killInstances(runner.vmIds)
    def doWork(self):
        configHolder = ConfigHolder(self.options.__dict__)
        runner = VmManagerFactory.create(self.image, configHolder)
        cluster = Cluster(configHolder, runner, self.options.master_vmid)

        printAction('Starting cluster')
        runner.runInstance()

        cluster.deploy()

        printStep('Done!')