Skip to content

About

tooling to support clustermax.ai, the industry standard rating system for neoclouds | 为新型 GPU 云服务商(Neocloud)的行业标准评级体系 clustermax.ai 提供支持的工具

Topics

Resources

Stars

47 stars

Watchers

1 watching

Forks

Latest commit

 

History

177 Commits

Folders and files

Repository files navigation

ClusterMAX

English | 中文

cmax is a CLI for auditing GPU cluster configuration, health, and security.

Quick start

# Stable
pip install clustermax

# Nightly
pip install --pre -U clustermax

# Run
cmax audit

Where to run

Command / mode Run on Why When to use
cmax audit / cmax audit security (--slurm) Slurm login node (or single-node head node running slurmctld) Schedules short srun worker steps across GPU nodes and queries the Slurm controller. Running from a compute node triggers a host role warning because it executes inside a job allocation. Auditing a Slurm cluster, including Slurm on Kubernetes login pods.
cmax audit / cmax audit security (--k8s) Any machine with kubectl access (workstation, bastion, or pod with RBAC) Queries the Kubernetes API and schedules probe pods on GPU worker nodes. Running standalone on a single worker node or pod skips cluster-level checks. Auditing a Kubernetes cluster (set KUBECONFIG if needed).
cmax audit --standalone, --vm, --container, --local Directly on the target GPU host, VM, container, or local machine Inspects only the local host (GPU, kernel, driver, container runtime) and skips scheduler and scale-out fabric checks. Triggers a host role warning on Slurm or Kubernetes nodes (override with --run-here, -y, or a target flag). Auditing a single bare-metal server, VM, container, or workstation, or inspecting one node in isolation.
cmax audit review [PATH] Any machine with saved audit artifacts (audit.values.json or audit.out) Reads saved files offline without running checks or connecting to a cluster. Reviewing past results locally or in CI (--no-interactive / --command).

Supported orchestrators and targets

Orchestrator / target Flag Auto-detected Detection signal
Slurm --slurm ✅ SLURM_JOB_ID, or sbatch in PATH
Kubernetes --k8s ✅ KUBERNETES_SERVICE_HOST, or kubectl cluster-info succeeds
Slurm on Kubernetes (e.g. Slinky) --slurm or --k8s ✅ Login pods with sbatch and reachable scontrol ping default to Slurm; when both Slurm and kubectl are reachable, the CLI prompts to choose unless --slurm, --k8s, or -y is passed
Standalone bare-metal host --standalone ✅ Fallback on Linux when no orchestrator, VM, or container is detected
Virtual machine --vm ✅ Linux VM hypervisor markers when no orchestrator is detected
Container --container ✅ /.dockerenv, /run/.containerenv, or container cgroup markers when no orchestrator is detected
Local machine (macOS) --local ✅ Darwin when no orchestrator is detected (Linux GPU checks report unavailable)

Directory structure

cmax/                        CLI entry points, target selection, report formatting, minimum-version sync
cmax/scripts/1-audit/        Audit collectors (k8s, slurm, standalone), grading scripts, bundled minimum-versions.json
cmax/scripts/1-audit/checks/ Modular fabric, GPU, and system checks
docs/                        Technical notes and policies
tests/                       Automated test suite and fixtures
tools/                       Public-data check script

Dependencies

  • Python >= 3.10
  • prompt-toolkit>=3.0.52,<4
  • PyYAML>=6
  • Dev extras (dev): build>=1, jsonschema>=4, pytest>=8, pytest-xdist>=3

CLI options

Top-level (cmax)

Option Description
-h, --help Show help and exit.
-v, -V, --version Show installed version and exit.

Commands

Command Description
cmax audit Run the full cluster configuration, health, and security audit.
cmax audit security Run the read-only security audit (versions and isolation). Exits with code 2 on critical findings.
cmax audit <profile> Run one profile: versions, isolation, hardware, software, containers, orchestration, networking, storage, health, or access.
cmax audit review [PATH] Review a saved audit directory, audit.values.json, or audit.out (defaults to the newest saved audit).

Audit options (cmax audit, cmax audit security, cmax audit <profile>)

Option Description
--show List included checks for the target without running them.
--local, --vm, --container, --standalone, --slurm, --k8s Select the audit target explicitly (mutually exclusive; auto-detected when omitted).
-y, --yes Accept the reported target, host role check, and interface check without prompting.
--run-here Run on this host even when it looks like a cluster node that does not fit the target (still prints the warning).
--no-fetch-minimums Skip fetching the published minimum-version table at launch and grade against the cached or bundled table.
-v, --verbose Increase report detail (default -v; repeat up to -vvv).

Additional options for cmax audit security

Option Description
--dry-run Resolve the security audit plan without running checks.
-o yaml, --output yaml Print the --dry-run plan as YAML (requires --dry-run).
--output-file PATH Write --dry-run -o yaml output to a new file.
--output-dir DIR Write audit logs and reports to a new directory (default: ~/.clustermax/audit/<timestamp>/).
--exit-zero Return exit code 0 even when critical findings are reported.

Review options (cmax audit review [PATH])

Option Description
-v, --verbose Increase report detail (default -v; repeat up to -vvv).
--command COMMAND Run summary, all, passes, show, find, raw, or paths and exit. Repeatable.
--no-interactive Print the saved audit report and exit without opening the interactive prompt.

Security audit table

Grading minimums and vendor advisories are published in the ClusterMAX minimum-versions table.

At launch, every live cmax audit run fetches the latest machine-readable table from minimum-versions.json and caches it in ~/.cache/clustermax/ (or $XDG_CACHE_HOME/clustermax/). When offline or when --no-fetch-minimums is passed, the CLI grades against the cached or bundled table. A CLI release that predates the table's schema version keeps its bundled table and asks you to update clustermax.

Example YAML plan

$ cmax audit security --vm --dry-run -o yaml
# Resolved dry-run plan for cmax audit security.
# Only the core audit manifest is enabled; unrelated tests are summarized.
version: 4
manifest_selection:
  enabled:
  - audit.audit
  disabled_count: 0
  disabled_by_phase:
    audit: 0
audit_profile:
  name: security
  dry_run: true
  command: cmax audit security
  target:
    selection: explicit
    environment: vm
    harness: standalone
  scope:
    core_collector: true
    checks:
      fabric: true
      gpu: false
      system: false
    general_findings_report: false
    standard_report: true
  artifacts:
  - audit.out
  - audit.values.json
  checks:
  - securityVersions.amdDriver.status
  - provider.vclusterTenancy.mode
  - securityVersions.nvidiaDriver.status
  - securityVersions.nvidiaContainerToolkit.status
  - securityVersions.cudaToolkit.status
  - securityVersions.runc.status
  - securityVersions.containerd.status
  - securityVersions.docker.status
  - securityVersions.connectxFirmware.status
  - securityVersions.dcgm.status
  - securityVersions.dcgmExporter.status
  - securityVersions.snap4Container.status
  - securityVersions.virtioNetBluefield.status
  - securityVersions.virtioNetBluefield.exposure
  - securityVersions.dpuHostIsolation.status
  - security.januscape.status
  - security.kvmSvm.status
  - security.guestKernel.newerInstalled
  - security.ubuntuNobleKernelMinimum.status
  - security.guestKernel.ubuntuCveStatus
  - security.fragnesia.status
  - security.badEpoll.status
  - security.sctpSendall.status
  - security.pwnescape.status
  - security.slurmGpuDeviceIsolation.status
  - qemu-virtio-serial
  - vmscape
  - observability-isolation
  - bmc-ipmi
  - kubernetes-nodes-proxy
  - ingress-nginx-cve-2025-1974
  - ufm-profile
  - pcie-passthrough
  - nvlink-boundary
  - mig-side-channel
  - gpu-ecc-rowhammer
  - nvidia-cdi-hook-monitoring
  - ray-dashboard-exposure
  - aistore
  - ssh-pq-kex
  - ssh-pq-host-key

About

tooling to support clustermax.ai, the industry standard rating system for neoclouds | 为新型 GPU 云服务商(Neocloud)的行业标准评级体系 clustermax.ai 提供支持的工具

Topics

Resources

Stars

47 stars

Watchers

1 watching

Forks

Releases

Used by

Contributors

Languages