Unit State

The unit status is one way to know what is happening with a unit in the application.

Use the Shipa app info -a to see the unit status.

$ shipa app info -a dashboard
Application: dashboard
Repository: [email protected]:dashboard.git
Platform: python
...
Units: 1
+------------+---------+
| Unit       | State   |
+------------+---------+
| 8cf863c4c1 | started |
+------------+---------+

The following list describes the available statuses for units in Shipa:

  • Created is the initial status of an unit.
  • Building is the status for units being provisioned by the provisioner, for example during deployment.
  • Error is the status for units that failed to start, because of an application error.
  • Starting is set when the container is started in docker.
  • Started is for cases where the unit is up and running.
  • Stopped is for cases where the unit has been stopped.

The unit state flow can be represented by the following chart:

+----------+                           start          +---------+
| building |                   +---------------------+| stopped |
+----------+                   |                      +---------+
      ^                        |                           ^
      |                        |                           |
 deploy unit                   |                         stop
      |                        |                           |
      +                        v       RegisterUnit        +
 +---------+  app unit   +----------+  SetUnitStatus  +---------+
 | created | +---------> | starting | +-------------> | started |
 +---------+             +----------+                 +---------+
                               +                         ^ +
                               |                         | |
                         SetUnitStatus                   | |
                               |                         | |
                               v                         | |
                           +-------+     SetUnitStatus   | |
                           | error | +-------------------+ |
                           +-------+ <---------------------+

Did this page help you?