예제 #1
0
    def start_nodes(self, reactor):
        # Destroy the box to begin, so that we are guaranteed
        # a clean build.
        yield run(
            reactor,
            ['vagrant', 'destroy', '-f'],
            path=self.vagrant_path.path)

        if self.package_source.version:
            env = extend_environ(
                FLOCKER_BOX_VERSION=vagrant_version(
                    self.package_source.version))
        else:
            env = os.environ
        # Boot the VMs
        yield run(
            reactor,
            ['vagrant', 'up'],
            path=self.vagrant_path.path,
            env=env)

        for node in self.NODE_ADDRESSES:
            yield remove_known_host(reactor, node)
            yield perform(
                make_dispatcher(reactor),
                run_remotely(
                    username='******',
                    address=node,
                    commands=task_pull_docker_images()
                ),
            )
        returnValue([
            VagrantNode(address=address, distribution=self.distribution)
            for address in self.NODE_ADDRESSES
            ])
예제 #2
0
    def start_cluster(self, reactor):
        # Destroy the box to begin, so that we are guaranteed
        # a clean build.
        yield run(reactor, ["vagrant", "destroy", "-f"], path=self.vagrant_path.path)

        if self.package_source.version:
            env = extend_environ(FLOCKER_BOX_VERSION=vagrant_version(self.package_source.version))
        else:
            env = os.environ
        # Boot the VMs
        yield run(reactor, ["vagrant", "up"], path=self.vagrant_path.path, env=env)

        for node in self.NODE_ADDRESSES:
            yield remove_known_host(reactor, node)

        nodes = pvector(ManagedNode(address=address, distribution=self.distribution) for address in self.NODE_ADDRESSES)

        certificates = Certificates(self.certificates_path)
        cluster = Cluster(
            all_nodes=pvector(nodes),
            control_node=nodes[0],
            agent_nodes=nodes,
            dataset_backend=self.dataset_backend,
            certificates=certificates,
        )

        returnValue(cluster)
예제 #3
0
    def start_nodes(self):
        # Destroy the box to begin, so that we are guaranteed
        # a clean build.
        check_safe_call(
            ['vagrant', 'destroy', '-f'],
            cwd=self.vagrant_path.path)

        box_version = vagrant_version(self.package_source.version)
        # Boot the VMs
        check_safe_call(
            ['vagrant', 'up'],
            cwd=self.vagrant_path.path,
            env=extend_environ(FLOCKER_BOX_VERSION=box_version))

        for node in self.NODE_ADDRESSES:
            remove_known_host(node)
            perform(
                dispatcher,
                run_remotely(
                    username='******',
                    address=node,
                    commands=task_pull_docker_images()
                ),
            )
        return self.NODE_ADDRESSES
예제 #4
0
    def start_cluster(self, reactor):
        # Destroy the box to begin, so that we are guaranteed
        # a clean build.
        yield run(reactor, ['vagrant', 'destroy', '-f'],
                  path=self.vagrant_path.path)

        if self.package_source.version:
            env = extend_environ(FLOCKER_BOX_VERSION=vagrant_version(
                self.package_source.version))
        else:
            env = os.environ
        # Boot the VMs
        yield run(reactor, ['vagrant', 'up'],
                  path=self.vagrant_path.path,
                  env=env)

        for node in self.NODE_ADDRESSES:
            yield remove_known_host(reactor, node)

        nodes = pvector(
            ManagedNode(address=address, distribution=self.distribution)
            for address in self.NODE_ADDRESSES)

        certificates = Certificates(self.certificates_path)
        cluster = Cluster(all_nodes=pvector(nodes),
                          control_node=nodes[0],
                          agent_nodes=nodes,
                          dataset_backend=self.dataset_backend,
                          certificates=certificates)

        returnValue(cluster)
예제 #5
0
    def start_nodes(self, reactor):
        # Destroy the box to begin, so that we are guaranteed
        # a clean build.
        yield run(
            reactor,
            ['vagrant', 'destroy', '-f'],
            path=self.vagrant_path.path)

        if self.package_source.version:
            env = extend_environ(
                FLOCKER_BOX_VERSION=vagrant_version(
                    self.package_source.version))
        else:
            env = os.environ
        # Boot the VMs
        yield run(
            reactor,
            ['vagrant', 'up'],
            path=self.vagrant_path.path,
            env=env)

        for node in self.NODE_ADDRESSES:
            yield remove_known_host(reactor, node)
        returnValue([
            VagrantNode(address=address, distribution=self.distribution)
            for address in self.NODE_ADDRESSES
            ])
예제 #6
0
    def start_nodes(self):
        # Destroy the box to begin, so that we are guaranteed
        # a clean build.
        check_call(['vagrant', 'destroy', '-f'], cwd=self.vagrant_path.path)

        box_version = vagrant_version(self.package_source.version)
        # Boot the VMs
        check_call(['vagrant', 'up'],
                   cwd=self.vagrant_path.path,
                   env=extend_environ(FLOCKER_BOX_VERSION=box_version))

        return self.NODE_ADDRESSES
예제 #7
0
    def start_nodes(self):
        # Destroy the box to begin, so that we are guaranteed
        # a clean build.
        check_call(
            ['vagrant', 'destroy', '-f'],
            cwd=self.vagrant_path.path)

        # Boot the VMs
        check_call(
            ['vagrant', 'up'],
            cwd=self.vagrant_path.path,
            env=extend_environ(
                FLOCKER_BOX_VERSION=vagrant_version(flocker.__version__)))

        return self.NODE_ADDRESSES
예제 #8
0
    def start_nodes(self):
        # Destroy the box to begin, so that we are guaranteed
        # a clean build.
        check_safe_call(['vagrant', 'destroy', '-f'],
                        cwd=self.vagrant_path.path)

        box_version = vagrant_version(self.package_source.version)
        # Boot the VMs
        check_safe_call(['vagrant', 'up'],
                        cwd=self.vagrant_path.path,
                        env=extend_environ(FLOCKER_BOX_VERSION=box_version))

        for node in self.NODE_ADDRESSES:
            run_tasks_on_node(username='******',
                              address=node,
                              commands=task_pull_docker_images())
        return self.NODE_ADDRESSES
예제 #9
0
    def start_cluster(self, reactor):
        # Destroy the box to begin, so that we are guaranteed
        # a clean build.
        yield run(
            reactor,
            ['vagrant', 'destroy', '-f'],
            path=self.vagrant_path.path)

        if self.package_source.version:
            env = extend_environ(
                FLOCKER_BOX_VERSION=vagrant_version(
                    self.package_source.version))
        else:
            env = os.environ
        # Boot the VMs
        yield run(
            reactor,
            ['vagrant', 'up'],
            path=self.vagrant_path.path,
            env=env)

        for node in self.NODE_ADDRESSES:
            yield remove_known_host(reactor, node)

        nodes = pvector(
            ManagedNode(address=address, distribution=self.distribution)
            for address in self.NODE_ADDRESSES
        )

        certificates = Certificates(self.certificates_path)
        # Default volume size is meaningless here as Vagrant only uses ZFS, and
        # not a block device backend.
        # XXX Change ``Cluster`` to not require default_volume_size
        default_volume_size = int(GiB(1).to_Byte().value)
        cluster = Cluster(
            all_nodes=pvector(nodes),
            control_node=nodes[0],
            agent_nodes=nodes,
            dataset_backend=self.dataset_backend,
            certificates=certificates,
            default_volume_size=default_volume_size,
        )

        returnValue(cluster)
예제 #10
0
    def start_cluster(self, reactor):
        # Destroy the box to begin, so that we are guaranteed
        # a clean build.
        yield run(
            reactor,
            ['vagrant', 'destroy', '-f'],
            path=self.vagrant_path.path)

        if self.package_source.version:
            env = extend_environ(
                FLOCKER_BOX_VERSION=vagrant_version(
                    self.package_source.version))
        else:
            env = os.environ
        # Boot the VMs
        yield run(
            reactor,
            ['vagrant', 'up'],
            path=self.vagrant_path.path,
            env=env)

        for node in self.NODE_ADDRESSES:
            yield remove_known_host(reactor, node)

        nodes = pvector(
            ManagedNode(address=address, distribution=self.distribution)
            for address in self.NODE_ADDRESSES
        )

        certificates = Certificates(self.certificates_path)
        # Default volume size is meaningless here as Vagrant only uses ZFS, and
        # not a block device backend.
        # XXX Change ``Cluster`` to not require default_volume_size
        default_volume_size = int(GiB(1).to_Byte().value)
        cluster = Cluster(
            all_nodes=pvector(nodes),
            control_node=nodes[0],
            agent_nodes=nodes,
            dataset_backend=self.dataset_backend,
            certificates=certificates,
            default_volume_size=default_volume_size,
        )

        returnValue(cluster)
예제 #11
0
    def start_cluster(self, reactor):
        # Destroy the box to begin, so that we are guaranteed
        # a clean build.
        yield run(
            reactor,
            ['vagrant', 'destroy', '-f'],
            path=self.vagrant_path.path)

        if self.package_source.version:
            env = extend_environ(
                FLOCKER_BOX_VERSION=vagrant_version(
                    self.package_source.version))
        else:
            env = os.environ
        # Boot the VMs
        yield run(
            reactor,
            ['vagrant', 'up'],
            path=self.vagrant_path.path,
            env=env)

        for node in self.NODE_ADDRESSES:
            yield remove_known_host(reactor, node)

        nodes = pvector(
            ManagedNode(address=address, distribution=self.distribution)
            for address in self.NODE_ADDRESSES
        )

        cluster = yield configured_cluster_for_nodes(
            reactor,
            Certificates(self.certificates_path),
            nodes,
            self.dataset_backend,
            self.dataset_backend_configuration,
        )

        returnValue(cluster)