def update(self):
    self.logger.debug('Updating component %s', self.getName())
    client = getDockerClient()

    # Get the list of currently running container(s).
    existing_containers = self.getAllContainers(client)
    existing_primary = self.getPrimaryContainer()

    # Start the new instance.
    container = self.start()
    if not container:
      return False

    # Mark all the existing containers as draining.
    for existing in existing_containers:
      setContainerStatus(existing, 'draining')

    # Update the port proxy to redirect the external ports to the new
    # container.
    report('Redirecting traffic to new container', component=self)
    self.manager.adjustForUpdatingComponent(self, container)

    # Signal the existing primary container to terminate
    if existing_primary is not None:
      self.manager.terminateContainer(existing_primary, self)

    return True
Updates a running instance of the component. Returns True on success and False
dataset/ETHPy150Open DevTable/gantryd/runtime/component.py/Component.update