Ejemplo n.º 1
0
    def capsule_create(self, context, capsule, requested_networks, limits):
        @utils.synchronized("capsule-" + capsule.uuid)
        def do_capsule_create():
            self._do_capsule_create(context, capsule, requested_networks,
                                    limits)

        utils.spawn_n(do_capsule_create)
 def container_commit(self, context, container, repository, tag=None):
     LOG.debug('Committing the container: %s', container.uuid)
     snapshot_image = None
     try:
         # NOTE(miaohb): Glance is the only driver that support image
         # uploading in the current version, so we have hard-coded here.
         # https://bugs.launchpad.net/zun/+bug/1697342
         snapshot_image = image_driver.create_image(context, repository,
                                                    glance.GlanceDriver())
     except exception.DockerError as e:
         LOG.error("Error occurred while calling glance "
                   "create_image API: %s",
                   six.text_type(e))
     utils.spawn_n(self._do_container_commit, context, snapshot_image,
                   container, repository, tag)
     return snapshot_image.id
Ejemplo n.º 3
0
    def container_create(self,
                         context,
                         limits,
                         requested_networks,
                         requested_volumes,
                         container,
                         run,
                         pci_requests=None):
        @utils.synchronized(container.uuid)
        def do_container_create():
            if not self._attach_volumes(context, container, requested_volumes):
                return
            created_container = self._do_container_create(
                context, container, requested_networks, requested_volumes,
                pci_requests, limits)
            if run and created_container:
                self._do_container_start(context, created_container)

        utils.spawn_n(do_container_create)
Ejemplo n.º 4
0
 def container_unpause(self, context, container):
     utils.spawn_n(self._do_container_unpause, context, container)
Ejemplo n.º 5
0
 def container_start(self, context, container):
     utils.spawn_n(self._do_container_start, context, container)
Ejemplo n.º 6
0
 def container_stop(self, context, container, timeout):
     utils.spawn_n(self._do_container_stop, context, container, timeout)
Ejemplo n.º 7
0
 def container_reboot(self, context, container, timeout):
     utils.spawn_n(self._do_container_reboot, context, container, timeout)
 def add_security_group(self, context, container, security_group):
     utils.spawn_n(self._add_security_group, context, container,
                   security_group)
Ejemplo n.º 9
0
 def container_create(self, context, container):
     utils.spawn_n(self._do_container_create, context, container)
Ejemplo n.º 10
0
    def container_start(self, context, container):
        @utils.synchronized(container.uuid)
        def do_container_start():
            self._do_container_start(context, container)

        utils.spawn_n(do_container_start)
Ejemplo n.º 11
0
    def container_stop(self, context, container, timeout):
        @utils.synchronized(container.uuid)
        def do_container_stop():
            self._do_container_stop(context, container, timeout)

        utils.spawn_n(do_container_stop)
Ejemplo n.º 12
0
    def add_security_group(self, context, container, security_group):
        @utils.synchronized(container.uuid)
        def do_add_security_group():
            self._add_security_group(context, container, security_group)

        utils.spawn_n(do_add_security_group)
Ejemplo n.º 13
0
    def container_delete(self, context, container, force=False):
        @utils.synchronized(container.uuid)
        def do_container_delete():
            self._do_container_delete(context, container, force)

        utils.spawn_n(do_container_delete)
 def container_run(self, context, limits, requested_networks, container):
     utils.spawn_n(self._do_container_run, context, container,
                   requested_networks, limits)
Ejemplo n.º 15
0
 def container_kill(self, context, container, signal):
     utils.spawn_n(self._do_container_kill, context, container, signal)
Ejemplo n.º 16
0
    def container_unpause(self, context, container):
        @utils.synchronized(container.uuid)
        def do_container_unpause():
            self._do_container_unpause(context, container)

        utils.spawn_n(do_container_unpause)
Ejemplo n.º 17
0
 def image_pull(self, context, image):
     utils.spawn_n(self._do_image_pull, context, image)
Ejemplo n.º 18
0
    def container_kill(self, context, container, signal):
        @utils.synchronized(container.uuid)
        def do_container_kill():
            self._do_container_kill(context, container, signal)

        utils.spawn_n(do_container_kill)
Ejemplo n.º 19
0
 def container_run(self, context, container):
     utils.spawn_n(self._do_container_run, context, container)
 def capsule_create(self, context, capsule, requested_networks, limits):
     utils.spawn_n(self._do_capsule_create, context,
                   capsule, requested_networks, limits)