• Mahmood Ali's avatar
    cli: show lifecycle info in alloc status · ff529619
    Mahmood Ali authored
    Display task lifecycle info in `nomad alloc status <alloc_id>` output.
    I chose to embed it in the Task header and only add it for tasks with
    lifecycle info.
    
    Also, I chose to order the tasks in the following order:
    
    1. prestart non-sidecar tasks
    2. prestart sidecar tasks
    3. main tasks
    
    The tasks are sorted lexicographically within each tier.
    
    Sample output:
    
    ```
    $ nomad alloc status 6ec0eb52
    ID                  = 6ec0eb52-e6c8-665c-169c-113d6081309b
    Eval ID             = fb0caa98
    Name                = lifecycle.cache[0]
    [...]
    
    Task "init" (prestart) is "dead"
    Task Resources
    CPU        Memory       Disk     Addresses
    0/500 MHz  0 B/256 MiB  300 MiB
    [...]
    
    Task "some-sidecar" (prestart sidecar) is "running"
    Task Resources
    CPU        Memory          Disk     Addresses
    0/500 MHz  68 KiB/256 MiB  300 MiB
    [...]
    
    Task "redis" is "running"
    Task Resources
    CPU         Memory           Disk     Addresses
    10/500 MHz  984 KiB/256 MiB  300 MiB
    [...]
    ```
    ff529619