|
| 1 | +# Preflight CLI |
| 2 | + |
| 3 | +Internal CLI to run **pre-deployment checks** before running workloads. |
| 4 | +Checks are organized into groups (e.g., `System Checks`, `Scripted Checks`) and controlled via environment variables. |
| 5 | + |
| 6 | +--- |
| 7 | + |
| 8 | +## Usage |
| 9 | + |
| 10 | +Run inside Docker: |
| 11 | + |
| 12 | +```bash |
| 13 | +docker run \ |
| 14 | + --env RUST_LOG=debug \ |
| 15 | + --env EDERA_PREFLIGHT_VERBOSE=true \ |
| 16 | + --env EDERA_PREFLIGHT_SKIP_GROUPS='ScriptedChecks;SystemChecks' \ |
| 17 | + --env EDERA_PREFLIGHT_SCRIPTS_DIR=/scripts \ |
| 18 | + <image> |
| 19 | +``` |
| 20 | + |
| 21 | +--- |
| 22 | + |
| 23 | +## Environment Variables |
| 24 | + |
| 25 | +| Variable | Description | Example | |
| 26 | +| ----------------------------- | ------------------------------------------------------ | ----------------------------- | |
| 27 | +| `RUST_LOG` | Log level (`error`, `warn`, `info`, `debug`, `trace`). | `debug` | |
| 28 | +| `EDERA_PREFLIGHT_VERBOSE` | Enable verbose output (`true`/`false`). | `true` | |
| 29 | +| `EDERA_PREFLIGHT_SKIP_GROUPS` | Semicolon-separated list of groups to skip. | `SystemChecks;ScriptedChecks` | |
| 30 | +| `EDERA_PREFLIGHT_SCRIPTS_DIR` | Directory containing custom shell-script checks. | `/scripts` | |
| 31 | + |
| 32 | +--- |
| 33 | + |
| 34 | +## Example Output |
| 35 | + |
| 36 | +```text |
| 37 | +[2025-09-17T05:05:33Z INFO preflight] Running Group [System Checks] - System requirement checks |
| 38 | +[2025-09-17T05:05:33Z DEBUG preflight::system] total memory = 66617298944 |
| 39 | +[2025-09-17T05:05:33Z ERROR preflight] [System Checks] Errored: group errored |
| 40 | +[2025-09-17T05:05:33Z INFO preflight] [System Checks] Enough Memory: Passed |
| 41 | +[2025-09-17T05:05:33Z ERROR preflight] [System Checks] Should Error: Errored: Pretending to error |
| 42 | +[2025-09-17T05:05:33Z WARN preflight] [System Checks] Should Fail: Failed: Pretending to fail |
| 43 | +[2025-09-17T05:05:33Z INFO preflight] Running Group [Scripted Checks] - Checks composed through small shell scripts |
| 44 | +[2025-09-17T05:05:33Z ERROR preflight] [Scripted Checks] Errored: group errored |
| 45 | +[2025-09-17T05:05:33Z INFO preflight] [Scripted Checks] Should Pass: Passed |
| 46 | +[2025-09-17T05:05:33Z WARN preflight] [Scripted Checks] Should Fail: Failed: script returned Some(1) |
| 47 | +[2025-09-17T05:05:33Z ERROR preflight] [Scripted Checks] /totally/fake/script: Errored: No such file or directory (os error 2) |
| 48 | +Error: checks failed |
| 49 | +``` |
| 50 | + |
| 51 | +* **INFO** → check passed or group started |
| 52 | +* **WARN** → check failed |
| 53 | +* **ERROR** → check errored or group errored |
| 54 | + |
| 55 | +Exit code is **non-zero** if any check/group fails or errors. |
| 56 | + |
| 57 | +--- |
| 58 | + |
| 59 | +## Notes |
| 60 | + |
| 61 | +* Use `EDERA_PREFLIGHT_SKIP_GROUPS` to bypass slow or irrelevant checks. |
| 62 | +* Script-based checks must be **executable** and located in `EDERA_PREFLIGHT_SCRIPTS_DIR`. |
0 commit comments