How to use the dockerspawner.DockerSpawner.start function in dockerspawner

To help you get started, we’ve selected a few dockerspawner examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github everware / everware / everware / container_handler.py View on Github external
self.user.name
                )
                start_command.extend(make_nginx_start_command(nginx_config))
                start_command.extend(make_custom_start_command(self.everware_config['start_command']))
            else:
                start_command.extend(make_default_start_command(self.get_env()))
            extra_create_kwargs.update({
                'command': start_command.get_single_command()
            })

        extra_host_config = {
            'port_bindings': {
                self.container_port: (self.container_ip,)
            }
        }
        ip, port = yield DockerSpawner.start(self, image,
                            extra_create_kwargs=extra_create_kwargs,
                            extra_host_config=extra_host_config)
        return ip, port
github rgbkrk / jupyterhub-compmodels-deploy / roles / jupyterhub / files / swarmspawner.py View on Github external
self.log.debug("Swarm nodes are: {}".format(self.node_info))

        # specify extra host configuration
        if extra_host_config is None:
            extra_host_config = {}
        if 'mem_limit' not in extra_host_config:
            extra_host_config['mem_limit'] = '1g'

        # specify extra creation options
        if extra_create_kwargs is None:
            extra_create_kwargs = {}
        if 'working_dir' not in extra_create_kwargs:
            extra_create_kwargs['working_dir'] = self.homedir

        # start the container
        yield DockerSpawner.start(
            self, image=image,
            extra_create_kwargs=extra_create_kwargs,
            extra_host_config=extra_host_config)

        # figure out what the node is and then get its ip
        name = yield self.lookup_node_name()
        self.user.server.ip = self.node_info[name]
        self.log.info("{} was started on {} ({}:{})".format(
            self.container_name, name, self.user.server.ip, self.user.server.port))

        self.log.info(self.env)
github compmodels / jupyterhub / swarmspawner.py View on Github external
self.log.debug("Swarm nodes are: {}".format(self.node_info))

        # specify extra host configuration
        if extra_host_config is None:
            extra_host_config = {}
        if 'mem_limit' not in extra_host_config:
            extra_host_config['mem_limit'] = '1g'

        # specify extra creation options
        if extra_create_kwargs is None:
            extra_create_kwargs = {}
        if 'working_dir' not in extra_create_kwargs:
            extra_create_kwargs['working_dir'] = self.homedir

        # start the container
        yield DockerSpawner.start(
            self, image=image,
            extra_create_kwargs=extra_create_kwargs,
            extra_host_config=extra_host_config)

        # figure out what the node is and then get its ip
        name = yield self.lookup_node_name()
        self.user.server.ip = self.node_info[name]
        self.log.info("{} was started on {} ({}:{})".format(
            self.container_name, name, self.user.server.ip, self.user.server.port))

        self.log.info(self.env)