Skip to content

Commit

Permalink
Added Release Notes, Known Limitations and Contributing section to docs
Browse files Browse the repository at this point in the history
  • Loading branch information
Farshad Ghodsian committed Dec 23, 2024
1 parent f7e96b8 commit 413f318
Show file tree
Hide file tree
Showing 9 changed files with 658 additions and 9 deletions.
4 changes: 2 additions & 2 deletions docs/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@
external_projects = ["amd-gpu-operator"]
external_projects_current_project = "amd-gpu-operator"

project = "AMD Instinct Hub"
version = "1.0.0"
project = "AMD Instinct Documentation"
version = "1.1.0"
release = version
html_title = f"AMD GPU Operator {version}"
author = "Advanced Micro Devices, Inc."
Expand Down
118 changes: 118 additions & 0 deletions docs/contributing/developer-guide.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,118 @@
# Developer Guide

This guide provides information for developers who want to contribute to or modify the AMD GPU Operator.

## Prerequisites

- Go v1.20 (due to [open issues](https://github.com/golang/go/issues/65637) with Go v1.21 or v1.22)
- Docker
- Kubernetes cluster (v1.29.0+) or OpenShift (4.16+)
- `kubectl` or `oc` CLI tool configured to access your cluster
- Access to `rocm/gpu-kernel-module-manager` image (available on Docker Hub)

## Development Environment Setup

- Install Helm:

```bash
curl -fsSL -o get_helm.sh https://raw.githubusercontent.com/helm/helm/main/scripts/get-helm-3
chmod 700 get_helm.sh
./get_helm.sh
```

For alternative installation methods, refer to the [Helm Official Website](https://helm.sh/docs/intro/install/).

- Install Helmify:
- Download the released binary from the [Helmify GitHub release page](https://github.com/arttor/helmify/releases/tag/v0.4.13), unpack it, and move it to your `PATH`.

- Clone the repository:

```bash
git clone https://github.com/ROCm/gpu-operator.git
cd gpu-operator
```

- (Optional) Set up a local Docker registry. If you want to build and host container images locally, you can set up a local Docker registry:

```bash
docker run -d -p 5000:5000 --name registry registry:latest
```

- Modify the registry-related variables in the `Makefile`:
- `DOCKER_REGISTRY`: Set to `localhost:5000` for local development, or your preferred registry
- `IMAGE_NAME`: Set to `rocm/gpu-operator`
- `IMAGE_TAG`: Set as needed (e.g., `v1.0.0` or `latest`)

- Compile the project:

```bash
make
```

This will generate the basic YAML files for CRD and build controller images.

- Build and push the AMD GPU Operator image:

```bash
make docker-build
make docker-push
```

> Note: If you're using a remote registry that requires authentication, ensure you've logged in using `docker login` before pushing.
- Generate Helm charts:
- For vanilla Kubernetes: `make helm`
- For OpenShift: `OPENSHIFT=1 make helm`

## Running Tests

To run the e2e tests:

```bash
make e2e
```

To run e2e tests with a specific Helm chart:

```bash
make e2e GPU_OPERATOR_CHART="path to helm chart"
```

To run e2e test only:

```bash
make -C tests/e2e # run e2e tests only
```

## Creating a Pull Request

1. Fork the repository on GitHub.
2. Create a new branch for your changes.
3. Make your changes and commit them with clear, descriptive commit messages.
4. Push your changes to your fork.
5. Create a pull request against the main repository.

Please ensure your code follows our coding standards and includes appropriate tests.

## Build Documentation Website Locally

- Download mkdocs utilities

```bash
python3 -m pip install mkdocs
```

- Build the website

```bash
cd docs
python3 -m mkdocs build
```

- Deploy the website

```bash
python3 -m mkdocs serve --dev-addr localhost:2345
```

- The local docs website will dynmically update as changes are made to markdown docs.
53 changes: 53 additions & 0 deletions docs/contributing/documentation-build-guide.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
# Documentation Build Guide

This guide provides information for developers who want to contribute to the AMD GPU Operator documentation available at https://dcgpu.docs.amd.com/projects/gpu-operator. The docs use [rocm-docs-core](https://github.com/ROCm/rocm-docs-core) as their base and the below guide will show how you can build and serve the docs locally for testing.

## Building and Serving the Docs

1. Create a Python Virtual Environment (optional, but recommended)

```bash
python3 -m venv .venv/docs
source .venv/docs/bin/activate (or source .venv/docs/Scripts/activate on Windows)
```

2. Install required packages for docs

```bash
pip install -r docs/sphinx/requirements.txt
```

3. Build the docs

```bash
python3 -m sphinx -b html -d _build/doctrees -D language=en ./docs/ docs/_build/html
```

4. Serve docs locally on port 8000

```bash
python3 -m http.server -d ./docs/_build/html/
```

5. You can now view the docs site by going to http://localhost:8000

## Auto-building the docs

Check failure on line 34 in docs/contributing/documentation-build-guide.md

View workflow job for this annotation

GitHub Actions / Documentation / Markdown

Headings should be surrounded by blank lines

docs/contributing/documentation-build-guide.md:34 MD022/blanks-around-headings/blanks-around-headers Headings should be surrounded by blank lines [Expected: 1; Actual: 0; Below] [Context: "## Auto-building the docs"] https://github.com/DavidAnson/markdownlint/blob/v0.28.2/doc/md022.md
The below will allow you to watch the docs directory and rebuild the documenatation each time you make a change to the documentation files:

1. Install Sphinx Autobuild package

```bash
pip install sphinx-autobuild
```

2. Run the autobuild (will also serve the docs on port 8000 automatically)

```bash
sphinx-autobuild -b html -d _build/doctrees -D language=en ./docs docs/_build/html --ignore "docs/_build/*" --ignore "docs/sphinx/_toc.yml"
```

## Troubleshooting

1. **Navigation Menu not displaying new links**

Note that if you've recently added a new link to the navigation menu previously unchanged pages may not correctly display the new link. To fix this delete the existing `_build/` directory and rebuild the docs so that the navigation menu will be rebuilt for all pages.
207 changes: 207 additions & 0 deletions docs/contributing/documentation-standards.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,207 @@
# Documentation Standards

## Voice and Tone

### Writing Style

- Use active voice
- Write in second person ("you") for instructions
- Maintain professional, technical tone
- Be concise and direct
- Use present tense

Examples:

```diff
- The configuration file will be created by the operator
+ The operator creates the configuration file

- One should ensure that all prerequisites are met
+ Ensure all prerequisites are met
```

### Terminology Standards

#### Product Names

- "AMD GPU Operator" (not "GPU operator" or "gpu-operator")
- "Kubernetes" (not "kubernetes" or "K8s")
- "OpenShift" (not "Openshift" or "openshift")
- "AMD ROCm™" (not "ROCM" or "rocm")

#### Technical Terms

| Term | Usage Notes |
|------|-------------|
| AMD GPU driver | Standard term for the driver. Don't use "AMDGPU driver" or "GPU driver" alone |
| worker node | Standard term for cluster nodes. Don't use "worker" or "node" alone |
| DeviceConfig | One word, capital 'D' and 'C' when referring to the resource |
| container image | Use instead of just "image" |
| pod | Lowercase unless starting a sentence |
| namespace | Lowercase unless starting a sentence |

#### Acronym Usage

Always expand acronyms on first use in each document:

- NFD (Node Feature Discovery)
- KMM (Kernel Module Management)
- CRD (Custom Resource Definition)
- CR (Custom Resource)

## Formatting Standards

### Headers

- Use title case for all headers
- Add blank line before and after headers

```markdown
# Main Title

## Section Title

### Subsection Title
```

### Code Blocks

- Always specify language for syntax highlighting
- Use inline code format (`code`) for:
- Command names
- File names
- Variable names
- Resource names
- Use block code format (```) for:
- Command examples
- YAML/JSON examples
- Configuration files
- Output examples

Examples:

````markdown
Install using `helm`:

```bash
helm install amd-gpu-operator rocm/gpu-operator-helm
```

Create a configuration:

```yaml
apiVersion: amd.com/v1alpha1
kind: DeviceConfig
metadata:
name: example
```
````

### Lists

- Maintain consistent indentation (2 spaces)
- End each list item with punctuation
- Add blank line between list items if they contain multiple sentences or code blocks

### Admonitions

Use consistent formatting for notes, warnings, and tips:

```markdown
```{note}
Important supplementary information.
```

```{warning}
Critical information about potential problems.
```

```{tip}
Helpful advice for better usage.
```

```text
### Tables
- Use tables for structured information
- Include header row
- Align columns consistently
- Add blank lines before and after tables
Example:
```markdown
| Parameter | Description | Default |
|-----------|-------------|---------|
| `image` | Container image path | `rocm/gpu-operator:latest` |
| `version` | Driver version | `6.2.0` |
```

## Document Structure

### Standard Sections

Every document should include these sections in order:

1. Title (H1)
2. Brief overview/introduction
3. Prerequisites (if applicable)
4. Main content
5. Verification steps (if applicable)
6. Troubleshooting (if applicable)

### Example Template

```markdown
# Feature Title

Brief description of the feature or component.

## Prerequisites

- Required components
- Required permissions
- Required resources

## Overview

Detailed description of the feature.

## Configuration

Configuration steps and examples.

## Verification

Steps to verify successful implementation.

## Troubleshooting

Common issues and solutions.
```

## File Naming

- Use lowercase
- Use hyphens for spaces
- Be descriptive but concise
- Include category prefix when applicable

Examples:

- `install-kubernetes.md`
- `upgrade-operator.md`

## Links and References

- Use relative links for internal documentation
- Use absolute links for external references
- Include link text that makes sense out of context

Examples:

```markdown
[Installation Guide](../install/kubernetes)
[Kubernetes Documentation](https://kubernetes.io/docs)
```
Loading

0 comments on commit 413f318

Please sign in to comment.