Commit d45ee4f
authored
Add pid, namespace, age, health, restarts to services ls (#2782)
## Summary
This PR adds additional output to the `devbox services ls` command to
see specifically to see the status of the readiness checks.
Without the HEALTH information in the output it's impossible to tell if
a service is still booting up or if it is fully up and running based on
the readiness check.
Before:
```
NAME STATUS EXIT CODE
failed-server Completed -1
good-server Launching 0
starting-server Launching 0
```
After:
```
Services running in process-compose:
PID NAME NAMESPACE STATUS AGE HEALTH RESTARTS EXIT CODE
19996 good-server default Launching 5s Ready 0 0
19995 starting-server default Launching 5s Not Ready 0 0
19997 failed-server default Completed 2s - 0 -1
```
## Additional consideration
This PR brings the output of `devbox services ls` closer to that of
`process-compose list -o wide`.
The output of `process-compose list -o wide` for comparison:
```
PID NAME NAMESPACE STATUS AGE HEALTH RESTARTS EXITCODE
11518 failed-server default Completed 2s - 0 -1
11520 good-server default Launching 3s Ready 0 0
11519 starting-server default Launching 3s Not Ready 0 0
```
(The only differences I see is the spacing between columns and no space
in the title EXITCODE)
## How was it tested?
With a sample process-compose.yaml file and running:
```
devbox run build
dist/devbox shell
devbox services start
devbox services ls
```
The sample process-compose.yaml file used for testing.
```
processes:
good-server:
command: python -m http.server 8081
is_daemon: true
readiness_probe:
exec:
command: curl -f http://localhost:8081
initial_delay_seconds: 1
period_seconds: 1
starting-server:
command: python -m http.server 8082
is_daemon: true
readiness_probe:
exec:
command: curl -f http://localhost:8082/wait
initial_delay_seconds: 1
period_seconds: 100
failed-server:
command: python -m http.server 8083
is_daemon: true
readiness_probe:
exec:
command: curl -f http://localhost:8083/not_there
initial_delay_seconds: 1
period_seconds: 1
```
## Community Contribution License
All community contributions in this pull request are licensed to the
project
maintainers under the terms of the
[Apache 2 License](https://www.apache.org/licenses/LICENSE-2.0).
By creating this pull request, I represent that I have the right to
license the
contributions to the project maintainers under the Apache 2 License as
stated in
the
[Community Contribution
License](https://github.com/jetify-com/opensource/blob/main/CONTRIBUTING.md#community-contribution-license).1 parent fe4678f commit d45ee4f
2 files changed
+19
-8
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
124 | 124 | | |
125 | 125 | | |
126 | 126 | | |
127 | | - | |
| 127 | + | |
128 | 128 | | |
129 | | - | |
| 129 | + | |
130 | 130 | | |
131 | 131 | | |
132 | 132 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
10 | 10 | | |
11 | 11 | | |
12 | 12 | | |
| 13 | + | |
13 | 14 | | |
14 | 15 | | |
15 | 16 | | |
16 | 17 | | |
17 | 18 | | |
18 | 19 | | |
19 | 20 | | |
20 | | - | |
21 | | - | |
22 | | - | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
23 | 29 | | |
24 | 30 | | |
25 | 31 | | |
| |||
91 | 97 | | |
92 | 98 | | |
93 | 99 | | |
94 | | - | |
95 | | - | |
96 | | - | |
| 100 | + | |
| 101 | + | |
| 102 | + | |
| 103 | + | |
| 104 | + | |
| 105 | + | |
| 106 | + | |
| 107 | + | |
97 | 108 | | |
98 | 109 | | |
99 | 110 | | |
| |||
0 commit comments