|
| 1 | +<!-- |
| 2 | +Copyright © Advanced Micro Devices, Inc., or its affiliates. |
| 3 | +
|
| 4 | +SPDX-License-Identifier: MIT |
| 5 | +--> |
| 6 | + |
| 7 | +# Contributing to ROCm CLI |
| 8 | + |
| 9 | +Thank you for your interest in contributing. This document explains how to get started, how work is tracked, and what to expect from the review process. |
| 10 | + |
| 11 | +## Code of Conduct |
| 12 | + |
| 13 | +By participating in this project you agree to abide by the [Code of Conduct](CODE_OF_CONDUCT.md). |
| 14 | + |
| 15 | +## Issue Tracking |
| 16 | + |
| 17 | +Bug reports and feature requests are tracked as [GitHub Issues](../../issues). Before opening a new issue, search existing ones to avoid duplicates. |
| 18 | + |
| 19 | +## Branch and Commit Naming |
| 20 | + |
| 21 | +Use [Conventional Commits](https://www.conventionalcommits.org/) for commit messages: |
| 22 | + |
| 23 | +``` |
| 24 | +feat: add support for vLLM multi-GPU serving |
| 25 | +fix: correct VRAM probe when amd-smi is absent |
| 26 | +docs: clarify GPU selection flag behavior |
| 27 | +chore: bump rust-toolchain to 1.96 |
| 28 | +``` |
| 29 | + |
| 30 | +Branch names should be short and descriptive: |
| 31 | + |
| 32 | +``` |
| 33 | +feat/vllm-multi-gpu |
| 34 | +fix/vram-probe-fallback |
| 35 | +``` |
| 36 | + |
| 37 | +## Development Setup |
| 38 | + |
| 39 | +Prerequisites: Rust (see `rust-toolchain.toml` for the pinned version) and [uv](https://github.com/astral-sh/uv) (for prek and scripts). |
| 40 | + |
| 41 | +```bash |
| 42 | +git clone https://github.com/ROCm/rocm-cli |
| 43 | +cd rocm-cli |
| 44 | +uv tool install prek # or: cargo install --locked prek |
| 45 | +prek install # fast checks on every commit |
| 46 | +prek install -t pre-push # heavier checks on push (clippy + tests) |
| 47 | +``` |
| 48 | + |
| 49 | +`prek` runs the same checks locally that CI enforces: `cargo fmt`, `clippy`, `cargo test`, `ruff` (Python), `shellcheck` (shell), and PowerShell syntax. |
| 50 | + |
| 51 | +### Workspace layout |
| 52 | + |
| 53 | +| Path | Description | |
| 54 | +| --- | --- | |
| 55 | +| `apps/rocm` | Main CLI binary | |
| 56 | +| `apps/rocmd` | Background daemon | |
| 57 | +| `crates/rocm-core` | Core library | |
| 58 | +| `crates/rocm-dash-*` | Dashboard TUI libraries | |
| 59 | +| `crates/rocm-engine-protocol` | Engine IPC protocol | |
| 60 | +| `engines/` | Inference engine adapters (lemonade, vllm) | |
| 61 | + |
| 62 | +### Test commands |
| 63 | + |
| 64 | +| Component | Command | |
| 65 | +| --- | --- | |
| 66 | +| Rust (all crates) | `cargo test` | |
| 67 | +| Lint + format check | `prek run --all-files` | |
| 68 | + |
| 69 | +See `docs/testing.md` for the full test guide and `docs/manual-testing.md` for manual QA steps. |
| 70 | + |
| 71 | +## Making Changes |
| 72 | + |
| 73 | +1. **Fork** the repository and create a branch from `main`. |
| 74 | +2. **Make your changes.** Keep commits focused — one logical change per commit. |
| 75 | +3. **Add or update tests** for any new behavior. |
| 76 | +4. **Run the relevant test suite** before opening a PR. |
| 77 | +5. **Open a pull request** against `main` with a clear title and description following the Conventional Commits format. |
| 78 | + |
| 79 | +### Commit signing and sign-off |
| 80 | + |
| 81 | +Commits must be both cryptographically **signed** and carry a DCO **`Signed-off-by`** trailer. Use `git commit -s` to add the trailer automatically. This is enforced by the prek hooks and by a blocking CI check. |
| 82 | + |
| 83 | +Enable SSH signing once with: |
| 84 | + |
| 85 | +```bash |
| 86 | +git config --global gpg.format ssh |
| 87 | +git config --global user.signingkey ~/.ssh/id_ed25519.pub |
| 88 | +git config --global commit.gpgsign true |
| 89 | +``` |
| 90 | + |
| 91 | +See `docs/commit-signatures.md` for GPG signing, GitHub "Verified" status, and troubleshooting. |
| 92 | + |
| 93 | +### What reviewers look for |
| 94 | + |
| 95 | +- Tests cover the new behavior |
| 96 | +- No secrets, credentials, or internal hostnames in committed files |
| 97 | +- Third-party dependencies declared in `Cargo.lock`; license headers present on new source files (see `licenserc.toml`) |
| 98 | + |
| 99 | +## Reporting Security Issues |
| 100 | + |
| 101 | +Do **not** open a public GitHub Issue for security vulnerabilities. See [SECURITY.md](SECURITY.md) for the responsible disclosure process. |
| 102 | + |
| 103 | +## License |
| 104 | + |
| 105 | +By contributing you agree that your contributions will be licensed under the [MIT License](LICENSE.TXT). |
0 commit comments