Skip to content
This repository was archived by the owner on Aug 29, 2018. It is now read-only.
This repository was archived by the owner on Aug 29, 2018. It is now read-only.

Don't automatically create -data containers #260

@wallrj

Description

@wallrj

gear install creates a -data container for each of its units if one doesn't already exist.

It would be tidier if gear only used the --volumes-from argument if a -data container was found.

This would avoid leaving behind unused -data containers when stateless units are deleted.

Not sure if it's possible to do such a test in the systemd service file, but perhaps the service files would be cleaner if they called a gear wrapper script to launch docker containers and move the various container tests into that script.

See

$ sudo gear install openshift/busybox-http-app:latest my-unit

$ sudo gear list-units -a
ID      SERVER  ACTIVE  SUB     LOAD    TYPE
my-unit         active  running loaded  

$ docker ps -a
CONTAINER ID        IMAGE                               COMMAND                CREATED             STATUS                   PORTS               NAMES
a8360222d9a0        openshift/busybox-http-app:latest   /opt/sti/run           2 hours ago         Up 2 hours               8080/tcp            my-unit             
bed17b6bf149        openshift/busybox-http-app:latest   /bin/true /opt/sti/r   2 hours ago         Exited (0) 2 hours ago                       my-unit-data  

$ sudo gear stop my-unit
Aug 19 05:58:00 localhost.localdomain systemd[1]: Stopping Container my-unit...
Aug 19 05:58:00 localhost.localdomain docker[17573]: my-unit
alter_container_state: Stop job done
journal: Done
Container my-unit is stopped

$ docker ps -a
CONTAINER ID        IMAGE                               COMMAND                CREATED             STATUS                   PORTS               NAMES
bed17b6bf149        openshift/busybox-http-app:latest   /bin/true /opt/sti/r   2 hours ago         Exited (0) 2 hours ago                       my-unit-data        

$ sudo gear delete my-unit
Deleted my-unit

$ docker ps -a
CONTAINER ID        IMAGE                               COMMAND                CREATED             STATUS                   PORTS               NAMES
bed17b6bf149        openshift/busybox-http-app:latest   /bin/true /opt/sti/r   2 hours ago         Exited (0) 2 hours ago                       my-unit-data       

$ sudo gear clean
INFO: 2014/08/19 05:59:54 --- "FAILED CONTAINERS" CLEANUP ---
INFO: 2014/08/19 05:59:54 --- HOME DIRECTORY REPAIR ---
INFO: 2014/08/19 05:59:54 --- PORTS CLEANUP ---

$ docker ps -a
CONTAINER ID        IMAGE                               COMMAND                CREATED             STATUS                   PORTS               NAMES
bed17b6bf149        openshift/busybox-http-app:latest   /bin/true /opt/sti/r   2 hours ago         Exited (0) 2 hours ago                       my-unit-data        

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions