Skip to content

Commit 423bae4

Browse files
authored
Merge pull request #4 from edera-dev/bleggett/ux-twiddle
Rename to `edera-check`, CLI-ify, support running outside of a container, etc etc
2 parents aebd97b + 52457c5 commit 423bae4

15 files changed

Lines changed: 341 additions & 270 deletions

File tree

.github/workflows/release-artifacts.yml

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ on:
1111
workflow_dispatch:
1212
inputs:
1313
protect_ref:
14-
description: 'Edera Protect commit/branch/tag'
14+
description: 'Edera commit/branch/tag'
1515
default: ''
1616

1717
# Nightly build from HEAD
@@ -57,14 +57,14 @@ jobs:
5757
run: |
5858
echo "Since GitHub doesn't have a way to filter for specific tags in the release event we need to implement this dumb check"
5959
run=true
60-
if [[ '${{ github.event_name }}' == 'release' ]] && [[ '${{ github.ref_name }}' =~ 'protect-chart-*' ]]; then
60+
if [[ '${{ github.event_name }}' == 'release' ]] && [[ '${{ github.ref_name }}' =~ 'chart-*' ]]; then
6161
run=false
6262
fi
6363
echo "Workflow should run: ${run}"
6464
echo "should_run=${run}" >> ${GITHUB_OUTPUT}
6565
6666
oci:
67-
name: 'Build and publish protect-${{ matrix.component }} images'
67+
name: 'Build and publish ${{ matrix.component }} images'
6868
# Check if this is the proper release event.
6969
# TODO: remove this when actions has a better answer
7070
if: ${{ needs.release-gate.outputs.should_run == 'true' }}
@@ -74,7 +74,7 @@ jobs:
7474
fail-fast: false
7575
matrix:
7676
component:
77-
- preflight
77+
- edera-check
7878
permissions:
7979
contents: read
8080
id-token: write
@@ -92,14 +92,14 @@ jobs:
9292
submodules: recursive
9393
persist-credentials: false
9494

95-
- name: 'Build and sign protect-${{ matrix.component }} image'
95+
- name: 'Build and sign ${{ matrix.component }} image'
9696
uses: edera-dev/actions/build-and-sign-image@v0.0.6
9797
with:
9898
component: '${{ matrix.component }}'
9999
event: '${{ github.event_name }}'
100100
repositories: |
101-
ghcr.io/edera-dev/protect-${{ matrix.component }}
102-
${{ env.GCP_REGION }}-docker.pkg.dev/${{ env.GCP_PROJECT }}/staging/protect-${{ matrix.component }}
101+
ghcr.io/edera-dev/${{ matrix.component }}
102+
${{ env.GCP_REGION }}-docker.pkg.dev/${{ env.GCP_PROJECT }}/staging/${{ matrix.component }}
103103
gcp_region: '${{ env.GCP_REGION }}'
104104
gcp_workload_identity_provider: '${{ env.GCP_WORKLOAD_IDENTITY_PROVIDER }}'
105105
gcp_service_account: '${{ env.GCP_SERVICE_ACCOUNT }}'

.gitignore

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,4 +32,4 @@ cli.md
3232

3333
# example outputs
3434
/image-cache
35-
protect-preflight-bundle*
35+
edera-preinstall-report*

Cargo.lock

Lines changed: 99 additions & 20 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Cargo.toml

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
[package]
2-
name = "preflight"
3-
version = "0.1.0"
2+
name = "edera-check"
3+
version = "0.2.0"
44
edition = "2024"
5-
description = "CLI to run pre-deployment checks before running workloads."
5+
description = "CLI to run checks before installing or using Edera"
66

77
[dependencies]
88
anyhow = "1.0.99"
@@ -19,3 +19,5 @@ tokio-stream = { version = "0.1", features = ["io-util", "net"] }
1919
nix = { version= "0.31", features = ["sched"] }
2020
futures = "0.3"
2121
async-trait = "0.1"
22+
clap = { version = "4.5", features = ["derive"] }
23+
console = "0.16"

README.md

Lines changed: 48 additions & 56 deletions
Original file line numberDiff line numberDiff line change
@@ -1,26 +1,34 @@
1-
# Preflight CLI
1+
# edera-check CLI
22

3-
Internal CLI to run **pre-deployment checks** before running workloads.
4-
Checks are organized into groups (e.g., `PVH Checks`, `Kernel Checks`) and controlled via environment variables.
3+
CLI tool to run checks and generate system reports before installing or using Edera.
54

65
---
76

87
## Usage
98

9+
### General usage
10+
11+
```bash
12+
sudo edera-check --help
13+
```
14+
15+
### Run preinstall checks and generate system report
16+
17+
```bash
18+
sudo edera-check preinstall
19+
```
20+
1021
### Run official release via Docker
1122

1223
```bash
1324
docker run \
1425
--pull always \
15-
--env RUST_LOG=debug \
16-
--env EDERA_PREFLIGHT_VERBOSE=true \
17-
--env EDERA_PREFLIGHT_SKIP_GROUPS='PVHChecks;KernelChecks' \
1826
--pid host \
1927
--privileged \
20-
us-central1-docker.pkg.dev/edera-protect/staging/protect-preflight:main
28+
us-central1-docker.pkg.dev/edera-protect/staging/edera-check:main preinstall
2129
```
2230

23-
Podman should also work.
31+
Podman et al should also work.
2432

2533
### Run locally from repo root via Docker
2634

@@ -32,65 +40,49 @@ sh hack/debug/local.sh
3240

3341
---
3442

35-
## Environment Variables
36-
37-
| Variable | Description | Example |
38-
| ----------------------------- | ------------------------------------------------------ | ----------------------------- |
39-
| `RUST_LOG` | Log level (`error`, `warn`, `info`, `debug`, `trace`). | `debug` |
40-
| `EDERA_PREFLIGHT_VERBOSE` | Enable verbose output (`true`/`false`). | `true` |
41-
| `EDERA_PREFLIGHT_SKIP_GROUPS` | Semicolon-separated list of groups to skip. | `PVHChecks;KernelChecks` |
42-
| `EDERA_PREFLIGHT_REPORT_DIR` | Directory to write a report to. Defaults to tmpdir | `/tmp` |
43-
44-
---
45-
4643
## Example Output
4744

4845
```text
49-
[2026-02-13T00:28:35Z INFO preflight] Writing all files to /tmp/protect-preflight-bundle-20260213-002835
50-
[2026-02-13T00:28:35Z INFO preflight] Running Group [System Checks] - System requirement checks
51-
[2026-02-13T00:28:35Z DEBUG preflight::checkers::system] Enough space on disk mounted at / - 617760940032
52-
[2026-02-13T00:28:35Z DEBUG preflight::checkers::system] Not enough space on disk mounted at /etc/resolv.conf - 9729925120
53-
[2026-02-13T00:28:35Z DEBUG preflight::checkers::system] Enough space on disk mounted at /etc/hostname - 617760940032
54-
[2026-02-13T00:28:35Z DEBUG preflight::checkers::system] Enough space on disk mounted at /etc/hosts - 617760940032[2026-02-13T00:28:35Z DEBUG preflight::checkers::system] total memory = 28762972160
55-
[2026-02-13T00:28:35Z INFO preflight::helpers] [System Checks] Passed
56-
[2026-02-13T00:28:35Z INFO preflight::helpers] [System Checks] Enough Memory: Passed
57-
[2026-02-13T00:28:35Z INFO preflight::helpers] [System Checks] Enough Disk: Passed
58-
[2026-02-13T00:28:35Z INFO preflight] Running Group [PVH Checks] - PVH capability checks
59-
[2026-02-13T00:28:35Z DEBUG preflight::checkers::pvh] VM_CR=0x0 (svmdis=0)
60-
[2026-02-13T00:28:35Z DEBUG preflight::checkers::pvh] EFER=0x200d01 (SVME=0)
61-
[2026-02-13T00:28:35Z DEBUG preflight::checkers::pvh] AMD-V supported but unavailable under hypervisor
62-
[2026-02-13T00:28:35Z DEBUG preflight::checkers::pvh] Virtualization is enabled or can be enabled
63-
[2026-02-13T00:28:35Z DEBUG preflight::helpers] [PVH Checks] Skipped
64-
[2026-02-13T00:28:35Z INFO preflight::helpers] [PVH Checks] PVH Support: Passed
65-
[2026-02-13T00:28:35Z INFO preflight] Running Group [Kernel Checks] - Kernel requirement checks
66-
[2026-02-13T00:28:35Z DEBUG preflight::checkers::kernel] module msr
67-
[2026-02-13T00:28:35Z DEBUG preflight::checkers::kernel] module nf_tables
68-
[2026-02-13T00:28:35Z INFO preflight::helpers] [Kernel Checks] Passed
69-
[2026-02-13T00:28:35Z INFO preflight::helpers] [Kernel Checks] Host Has Necessary Modules: Passed
70-
[2026-02-13T00:28:35Z INFO preflight::helpers] [Kernel Checks] Host Kernel Version Is Good: Passed
71-
[2026-02-13T00:28:35Z INFO preflight] Running Group [System Info Recorder] - System requirement and status checks - records for informational purposes
72-
[2026-02-13T00:28:35Z INFO preflight::helpers] [System Info Recorder] Passed
73-
[2026-02-13T00:28:35Z INFO preflight::helpers] [System Info Recorder] Record lspci -vvv: Passed
74-
[2026-02-13T00:28:35Z INFO preflight::helpers] [System Info Recorder] Record dmidecode: Passed
75-
[2026-02-13T00:28:35Z INFO preflight::helpers] [System Info Recorder] Record /proc/cpuinfo: Passed
76-
[2026-02-13T00:28:35Z INFO preflight::helpers] [System Info Recorder] Record /proc/cmdline: Passed
77-
[2026-02-13T00:28:35Z INFO preflight::helpers] [System Info Recorder] Record /boot/grub2/grub.cfg: Passed
78-
[2026-02-13T00:28:35Z INFO preflight::helpers] [System Info Recorder] Record boot/config-6.18.6: Passed
79-
[2026-02-13T00:28:35Z DEBUG preflight] Read 84023 bytes of tar
80-
[2026-02-13T00:28:35Z INFO preflight] Wrote to: /tmp/protect-preflight-bundle-20260213-002835.tar.gz
46+
» sudo edera-check preinstall
47+
48+
Running Group System Checks - System requirement checks
49+
✅ System Checks: Passed
50+
• Enough Memory: Passed
51+
• Enough Disk: Passed
52+
Running Group PVH Checks - PVH capability checks
53+
✅ PVH Checks: Passed
54+
• PVH Support: Passed
55+
Running Group Kernel Checks - Kernel requirement checks
56+
✅ Kernel Checks: Passed
57+
• Host Has Necessary Modules: Passed
58+
• Host Kernel Version Is Good: Passed
59+
Running Group IOMMU Checks - IOMMU capability checks
60+
✅ IOMMU Checks: Passed
61+
• IOMMU Support: Passed
62+
Running Group System Info Recorder - Record system information for reporting purposes
63+
✅ System Info Recorder: Passed
64+
• Record lspci -vvv: Passed
65+
• Record dmidecode: Passed
66+
• Record /proc/cpuinfo: Passed
67+
• Record /proc/cmdline: Passed
68+
• Record /boot/grub2/grub.cfg: Passed
69+
• Record boot/config-6.18.7-200.fc43.x86_64: Passed
70+
✨ All Done! Report saved: /tmp/edera-preinstall-report-StolidWingnut-20260213-222635.tar.gz
8171
```
8272

83-
* **INFO** → check passed or group started
84-
* **WARN** → check failed
85-
* **ERROR** → check errored or group errored
86-
8773
Exit code is **non-zero** if any check/group fails or errors.
8874

8975
---
9076

9177
## Notes
9278

93-
* Use `EDERA_PREFLIGHT_SKIP_GROUPS` to bypass slow or irrelevant checks.
79+
Run
80+
81+
``` bash
82+
edera-check preinstall --help
83+
```
84+
85+
for a list of available configuration options and usage tweaks.
9486

9587
## Dev Notes
9688

hack/debug/local.sh

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -5,12 +5,9 @@ VER=$(date +%s)
55
USERIMG=$(whoami)
66
REGISTRY="localhost"
77

8-
docker build . -f ./images/Containerfile.preflight -t "${REGISTRY}/${USERIMG}-preflight-debug:${VER}"
8+
docker build . -f ./images/Containerfile.edera-check -t "${REGISTRY}/${USERIMG}-edera-check-debug:${VER}"
99

1010
docker run --privileged --pid="host" \
1111
-e RUST_LOG="debug" \
1212
-e EDERA_PREFLIGHT_VERBOSE=true \
13-
-e EDERA_PREFLIGHT_TARGET_DIR='/host' \
14-
-e EDERA_PREFLIGHT_SKIP_GROUPS='' \
15-
-e EDERA_PREFLIGHT_SCRIPTS_DIR=/scripts \
16-
"${REGISTRY}/${USERIMG}-preflight-debug:${VER}"
13+
"${REGISTRY}/${USERIMG}-edera-check-debug:${VER}" preinstall

0 commit comments

Comments
 (0)