Add machine-readable deployment validation tools#1359
Merged
Conversation
Add scripts/validation/ with three standard-library Python tools that report a stable machine-readable verdict for automation and AI agents: - deepops_doctor.py: provisioning-environment preflight (Ansible, Galaxy dependencies, Kubespray submodule, config directory, inventory parse, and optional remote reachability/GPU checks) - validate_slurm.py: Slurm deployment validation (controller, node availability, gres/gpu configuration, single-GPU srun job) - validate_k8s.py: Kubernetes GPU deployment validation (node readiness, allocatable GPUs, GPU Operator pod health, optional CUDA smoke pod) Each prints one line per check or a flat JSON object with --json, exits nonzero on failure with an explicit failures list, and documents the Slurm login GPU-hiding behavior that otherwise reads as a driver failure. Includes stdlib unit tests and docs/deepops/validation.md.
Document the intentional non-fatal parse paths flagged as empty except blocks (malformed allocatable GPU values, best-effort GPU pod summary, inventory JSON decode) and remove an unused test import.
Live validation showed the GPU-hide mechanism is a runtime 'systemctl set-property sshd.service DeviceAllow' drop-in under /etc/systemd/system.control/, not a unit override under /etc/systemd/system/, so the directory listing check never matched. Query the DeviceAllow property directly, which is accurate regardless of drop-in location.
Contributor
Author
Live validation summaryAll three tools were exercised end-to-end on a disposable single-GPU server (Ubuntu 22.04) through full Slurm and Kubernetes deployments:
The live run also caught and fixed a real detection bug: Slurm login GPU hiding is applied as a runtime All CodeQL/code-quality findings on the initial head were fixed and each bot thread answered. |
michael-balint
approved these changes
Jul 14, 2026
This was referenced Jul 14, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
scripts/validation/with three dependency-free Python tools that answer "did the deployment work?" with a stable machine-readable contract for automation and AI agents:deepops_doctor.py— provisioning-environment preflight: Ansible present, Galaxy dependencies installed, Kubespray submodule initialized, config directory present, inventory parses with hosts;--remoteadds host reachability, NVIDIA PCI device detection, and sshd override reporting.validate_slurm.py— Slurm deployment validation: controller reachability, node availability,gres/gpuconfiguration, and a single-GPUsrun nvidia-smijob.validate_k8s.py— Kubernetes GPU deployment validation: node readiness, allocatablenvidia.com/gpu, GPU Operator pod health, and an optional CUDA smoke pod (--cuda-smoke).--json, exit0/1/2, and fail loudly with an explicitfailureslist.nvidia-smiover SSH reports no devices on cluster nodes) that otherwise reads as a driver failure.docs/deepops/validation.mdand standard-library unit tests.Validation
python3 -m unittest discover -s scripts/validation/tests: 10 tests, all passpy_compileand--helpsmoke for all three toolsdeepops_doctor.pyrun against an unprepared checkout correctly fails with actionable fix hints for each missing prerequisitegit diff --check, public sanitizer on all added files, OS compatibility and component audits unchangedNotes
deepops-validatenamespace (kept on failure for debugging).scripts/k8s/verify_gpu.shremains the exhaustive every-GPU job test; these tools are the fast structured health contract.