Ejemplo n.º 1
0
    def _copy_docker_conf_file(self):
        # the docker_conf.json file is used to pass information
        # to the dockercompute plugin. (see
        # integration_tests_plugins/dockercompute)
        docl.execute('mkdir -p {0}'.format(constants.DOCKER_COMPUTE_DIR))
        with tempfile.NamedTemporaryFile() as f:
            json.dump({
                # The dockercompute plugin needs to know where to find the
                # docker host
                'docker_host': docl.docker_host(),

                # Used for cleanup purposes
                'env_label': self.env_label
            }, f)
            f.flush()
            docl.copy_file_to_manager(
                source=f.name,
                target=os.path.join(constants.DOCKER_COMPUTE_DIR,
                                    'docker_conf.json'))
        self.chown(constants.CLOUDIFY_USER, constants.DOCKER_COMPUTE_DIR)
Ejemplo n.º 2
0
    def _copy_docker_conf_file(self):
        # the docker_conf.json file is used to pass information
        # to the dockercompute plugin. (see
        # integration_tests_plugins/dockercompute)
        docl.execute('mkdir -p /root/dockercompute')
        with tempfile.NamedTemporaryFile() as f:
            json.dump(
                {
                    # The dockercompute plugin needs to know where to find the
                    # docker host
                    'docker_host': docl.docker_host(),

                    # Used to know from where to mount the plugins storage dir
                    # on dockercompute node instances containers
                    'plugins_storage_dir': self.plugins_storage_dir,

                    # Used for cleanup purposes
                    'env_label': self.env_label
                },
                f)
            f.flush()
            docl.copy_file_to_manager(
                source=f.name, target='/root/dockercompute/docker_conf.json')
Ejemplo n.º 3
0
    def get_docker_host():
        """
        returns the host IP

        """
        return docl.docker_host()