feat: detection providers + CLI plugin with docker variant detect - #3
Merged
Merged
Conversation
pkg/providers implements compiled-in detection (ADR-5): x86-64 microarchitecture levels via CPUID (psABI v2/v3/v4 checks), a minimal aarch64 baseline, and NVIDIA CUDA via nvidia-smi banner parsing — the cuda_version_lower_bound predicate is expanded into the explicit list of satisfiable known releases so the generic intersection rule applies. A JSON properties file (--properties-file or $DOCKER_VARIANT_PROPERTIES_FILE) substitutes for live detection in tests, CI, and the demo. Provider failures are surfaced as warnings, not fatal errors. cmd/docker-variant is the Docker CLI plugin entry point: the docker-cli-plugin-metadata handshake plus `docker variant detect` (text triples or --json). Claude-Session: https://claude.ai/code/session_01D383U8kkQkJc1yzyC5H5Nk
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
Stacked PR 3/7 (base: #2). Adds the hardware-detection side and the CLI plugin skeleton:
Providerinterface (namespace → feature → preference-ordered values),DetectAllmerging with warning collection (a failing provider never aborts detection).x86_64: psABI microarchitecture levels (v1–v4) computed from CPUID flags viagolang.org/x/sys/cpu; flag set extracted into a struct so tests construct arbitrary CPUs.nvidia: parses thenvidia-smibanner; expandscuda_version_lower_bound("built for CUDA ≥ X") into the explicit satisfiable-release list so pkg/variant's intersection rule applies unchanged. Missing binary = namespace absent; broken driver = warning.aarch64: v8 baseline.--properties-file/DOCKER_VARIANT_PROPERTIES_FILE) — the deterministic-detection mechanism all later e2e tests and the demo rely on.docker-cli-plugin-metadatahandshake anddocker variant detect(--jsonorns :: feature :: valuestriples).Testing
detectreportsx86_64 :: level :: v4,v3,v2,v1and degrades the GPU-less nvidia-smi to a warning as designed.https://claude.ai/code/session_01D383U8kkQkJc1yzyC5H5Nk