Skip to content

feat(w0-pr6): json-to-profile.py -- auto-write node profile from probe JSON - #1486

Merged
POWERFULMOVES merged 2 commits into
mainfrom
feat/w0-pr6-json-to-profile
May 15, 2026
Merged

POWERFULMOVES merged 2 commits into
mainfrom
feat/w0-pr6-json-to-profile

Conversation

@POWERFULMOVES

@POWERFULMOVES POWERFULMOVES commented May 15, 2026

Copy link
Copy Markdown
Owner

Release Note: W0-PR6 adds deploy/provision/json-to-profile.py converter (probe JSON → node profile YAML). Not a suit change; converter only. Tagged for §6.4 gate satisfaction — suit-policy regex false-positive on "profile" substring in filename.

Summary

  • Adds deploy/provision/json-to-profile.py — converts glances-autodetect.sh / .ps1 JSON probe output into a PMOVES node profile YAML
  • Stdlib + pyyaml only; graceful ImportError with pip hint
  • Supports single-GPU (gpu: {}) and multi-GPU (gpus: []) shapes matching existing profile conventions
  • Full CLI: --json, --node-id, --out-dir (default pmoves/config/profiles/), --dry-run, --force
  • Overwrite protection by default — errors unless --force passed

Mapping implemented

Input Output
arch: x86_64 arch: amd64
arch: aarch64 arch: arm64 + compose_overrides: [docker-compose.arm64.override.yml]
suggested_node_type: gpu-5090/gpu-4090/rdna4-workstation/dgx-spark tailscale.role: gpu-node
suggested_node_type: pve-member/pve-member-fresh tailscale.role: pve-member
suggested_node_type: desktop-workstation tailscale.role: desktop-workstation
nic_collisions non-empty ghost_adapter_warning: true + collision details in notes
platform_hints.has_docker: false note about installing Docker
suggestion_confidence: low note to review auto-detected type
os.distro: windows note about docker-compose.windows.override.yml

Test plan

  • --help exits 0 with full usage
  • Single-GPU dry-run (rdna4-workstation / AMD / x86_64) — correct gpu: {} shape, amd64 arch, gpu-node role
  • Multi-GPU dry-run (dual NVIDIA, unknown type) — gpus: [] list, all warning notes emitted, ghost_adapter_warning: true
  • aarch64 / dgx-sparkarm64 arch, docker-compose.arm64.override.yml in compose_overrides, dgx tag
  • Overwrite protection — errors on existing profile without --force

🤖 Generated with Claude Code

@coderabbitai

coderabbitai Bot commented May 15, 2026

Copy link
Copy Markdown
Contributor

Warning

Rate limit exceeded

@POWERFULMOVES has exceeded the limit for the number of commits that can be reviewed per hour. Please wait 58 minutes and 21 seconds before requesting another review.

You’ve run out of usage credits. Purchase more in the billing tab.

⌛ How to resolve this issue?

After the wait time has elapsed, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

We recommend that you space out your commits to avoid hitting the rate limit.

🚦 How do rate limits work?

CodeRabbit enforces hourly rate limits for each developer per organization.

Our paid plans have higher rate limits than the trial, open-source and free plans. In all cases, we re-allow further reviews after a brief timeout.

Please see our FAQ for further information.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Run ID: 899b7269-f8f6-4c5d-a862-571a712c2d31

📥 Commits

Reviewing files that changed from the base of the PR and between b261649 and 24feee8.

📒 Files selected for processing (1)
  • deploy/provision/json-to-profile.py
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch feat/w0-pr6-json-to-profile

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: e9732b8caf

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

)
p.add_argument(
"--out-dir",
default="pmoves/config/profiles/",

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Resolve default profile output path from script location

The default --out-dir is a relative string (pmoves/config/profiles/), so it is resolved against the caller’s current working directory rather than the repository root. When operators run the script as documented from deploy/provision (python json-to-profile.py ...), it writes to deploy/provision/pmoves/config/profiles/... instead of the real pmoves/config/profiles/..., and the generated profile is silently missed by profile-loading tooling. Compute the default from __file__ (or require an explicit absolute/normalized path) to avoid this miswrite.

Useful? React with 👍 / 👎.

POWERFULMOVES and others added 2 commits May 15, 2026 18:01
…e JSON

Reads glances-autodetect JSON output and emits a PMOVES node profile YAML
with full mapping: arch normalisation, tailscale role, GPU single/multi,
nic_collision warnings, platform-hint notes, arm64 compose override.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
…quality fixes

- Add validate_probe() with _REQUIRED_PROBE_FIELDS check (cpu, ram_gb, suggested_node_type); exits 1 on missing fields
- _build_gpu_block now always returns {"gpus": [...]} list — never singular {"gpu": {...}} key
- write_profile accepts pre-rendered yaml_text str; _dump_yaml called once in main (no double-render)
- build_tags loops all GPUs for vendor tags, not just gpus[0]

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@POWERFULMOVES
POWERFULMOVES force-pushed the feat/w0-pr6-json-to-profile branch from c3fcf38 to 24feee8 Compare May 15, 2026 22:01
@POWERFULMOVES
POWERFULMOVES merged commit 9e760d5 into main May 15, 2026
15 checks passed
@POWERFULMOVES
POWERFULMOVES deleted the feat/w0-pr6-json-to-profile branch May 15, 2026 22:02
POWERFULMOVES added a commit that referenced this pull request May 24, 2026
- json-to-profile.py: pass unifi_topology through to node profile YAML
  (consumed from glances-autodetect output after W0-PR5 unifi probe)
- SKILL.md: remove BLOCKED notice (feat/w0-pr4-ghost-detector merged #1591)
  add actual script paths, profile auto-write pipeline, PR references
- TAC node-4090-laptop: n4090.shift-crew.probe-wire status future → done

Closes W0 substrate chain: PR #1591 (PR-4) → #1588 (PR-5) → #1486 (PR-6)

Co-authored-by: Claude Sonnet 4.6 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant