Zun

Add support for autoremove option

Bug #1644901 reported by hongbin
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Zun
Fix Released
Medium
Kien Nguyen

Bug Description

Docker run command has an autoremove option:

  $ docker help run

  Usage: docker run [OPTIONS] IMAGE [COMMAND] [ARG...]

  Run a command in a new container

  Options:

  --rm Automatically remove the container when it exits

Zun could add support for this as well. The difficult part is that the zun-compute needs to watch the container and return the container from DB when it exists.

hongbin (hongbin034)
Changed in zun:
status: New → Triaged
importance: Undecided → Medium
prameswar (prameswar)
Changed in zun:
assignee: nobody → prameswar (prameswar)
prameswar (prameswar)
Changed in zun:
status: Triaged → In Progress
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Related fix proposed to zun (master)

Related fix proposed to branch: master
Review: https://review.openstack.org/418942

Revision history for this message
hongbin (hongbin034) wrote :

Note. This ticket was blocked in before awaiting for the support of interactive mode. Right now, interactive mode is implemented [1] so we can pick up this ticket again.

[1] https://review.openstack.org/#/c/434704/

Revision history for this message
prameswar (prameswar) wrote :

Sorry, Not getting time to work on. If anyone interested can continue this bug.

Changed in zun:
assignee: prameswar (prameswar) → nobody
Kien Nguyen (kiennt2609)
Changed in zun:
assignee: nobody → Kien Nguyen (kiennt2609)
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to zun (master)

Fix proposed to branch: master
Review: https://review.openstack.org/485419

Changed in zun:
assignee: Kien Nguyen (kiennt2609) → Kien Nguyen (kiennt26)
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Related fix merged to zun (master)

Reviewed: https://review.openstack.org/418942
Committed: https://git.openstack.org/cgit/openstack/zun/commit/?id=2a0a7992b959f70696a6b086552d6fad33548584
Submitter: Jenkins
Branch: master

commit 2a0a7992b959f70696a6b086552d6fad33548584
Author: prameswar <email address hidden>
Date: Wed Jan 11 03:22:50 2017 +0000

    Added support for Auto remove the container

    Docker run command has an option that automatically
    removes the container when it exits. This commit introduces
    the equivalent in Zun. In particular, this commit does
    the followings:

    * Introduce an 'auto_remove' field in container. If this
      field is set, the container will be automatically
      removed when it exits.
    * Introduce a new container state 'Delete'. This states
      indicated that the container has been automatically
      removed, but the record is still existed in DB.
    * Bump the docker REST API version to 1.25 or higher
      since 'auto_remove' feature was introduced in 1.25.

    There are several future work of this commit. The first task is
    to add a tempest test to verify the container is indeed
    auto-removed in docker daemon. The second task is to introduce
    a periodic task that purge container in 'Deleted' state.

    Co-Authored-By: Hongbin Lu <email address hidden>
    Co-Authored-By: Kien Nguyen <email address hidden>
    Related-Bug: #1644901

    Change-Id: Ic6d35274a49648bde5e0e7486453a6d1a13f6f2e

Revision history for this message
OpenStack Infra (hudson-openstack) wrote :

Reviewed: https://review.openstack.org/485419
Committed: https://git.openstack.org/cgit/openstack/zun/commit/?id=5caaa8fb212dbb9a1b22732341d19c3d3e47b797
Submitter: Jenkins
Branch: master

commit 5caaa8fb212dbb9a1b22732341d19c3d3e47b797
Author: Kien Nguyen <email address hidden>
Date: Thu Jul 20 10:22:05 2017 +0700

    Add delete_container to periodic task

    - The container with status DELETED is not removed automatically.
    This patch will add delete_container method to remove it
    in periodic task.

    - Increase the severity of log level to Info.

    - Support filter container with status, task_state.

    - Change param handlers to endpoints for consistent.

    Change-Id: I0c703fc2c69c9a582e7cb3b34e8aa08c098e37e4
    Depends-On: Ic6d35274a49648bde5e0e7486453a6d1a13f6f2e
    Related-Bug: #1644901
    Closes-Bug: #1701984

hongbin (hongbin034)
Changed in zun:
status: In Progress → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.