Skip to content

Commit 16f3e15

Browse files
yansun1996sajmera-pensando
authored andcommitted
[Build] Add sanity to check docs build
1 parent eee75fa commit 16f3e15

File tree

4 files changed

+28
-4
lines changed

4 files changed

+28
-4
lines changed

Dockerfile.build

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,10 @@ RUN apt-get update -y && \
1717
curl \
1818
gosu \
1919
gpg \
20+
make \
21+
python3-sphinx \
22+
python3-pip \
23+
libsqlite3-dev \
2024
protobuf-compiler \
2125
locales \
2226
ca-certificates \

Makefile

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ PROJECT_VERSION ?= v1.2.0
1111
# GPU Operator Image Build variables
1212
# Note: when using images from DockerHub, please make sure to input the full DockerHub registry URL (docker.io) into DOCKER_REGISTRY
1313
# user's container runtime may not set DockerHub as default registry and auto-search on DockerHub
14+
TOP_DIR = $(PWD)
1415
GOFLAGS := "-mod=mod"
1516
GIT_COMMIT ?= $(shell git rev-parse --short HEAD)
1617
DOCKER_REGISTRY ?= docker.io/rocm
@@ -116,6 +117,12 @@ CONTAINER_WORKDIR := /gpu-operator
116117
BUILD_BASE_IMG ?= ubuntu:22.04
117118
GOLANG_BASE_IMG ?= golang:1.23
118119

120+
##################
121+
# Documentation website build variables
122+
DOCS_DIR := ${TOP_DIR}/docs
123+
BUILD_DIR := $(DOCS_DIR)/_build
124+
HTML_DIR := $(BUILD_DIR)/html
125+
119126
##################
120127
# Makefile targets
121128

@@ -372,6 +379,19 @@ bundle-build: operator-sdk manifests kustomize ## OpenShift Build OLM bundle.
372379
${OPERATOR_SDK} bundle validate ./bundle
373380
docker build -f bundle.Dockerfile -t $(BUNDLE_IMG) .
374381

382+
.PHONY: dep-docs
383+
dep-docs:
384+
pip install -r $(DOCS_DIR)/sphinx/requirements.txt
385+
386+
.PHONY: docs
387+
docs: dep-docs ## Build documentation website
388+
sphinx-build -b html $(DOCS_DIR) $(HTML_DIR)
389+
@echo "Docs built at $(HTML_DIR)/index.html"
390+
391+
.PHONY: clean-docs
392+
clean-docs: ## Clean up documentation website build cache
393+
rm -rf $(BUILD_DIR)
394+
375395
##@ Deployment
376396

377397
ifndef ignore-not-found

docs/troubleshooting.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,13 +21,13 @@ kubectl logs -n kube-amd-gpu <pod-name>
2121

2222
## Potential Issues with default ``DeviceConfig``
2323

24-
* Please refer to [Typical Deployment Scenarios](../usage.html#typical-deployment-scenarios) for more information and get corresponding ```helm install``` commands and configs that fits your specific use case.
24+
* Please refer to {ref}`typical-deployment-scenarios` for more information and get corresponding ```helm install``` commands and configs that fits your specific use case.
2525

2626
* If operand pods (e.g. device plugin, metrics exporter) are stuck in ``Init:0/1`` state, it means your GPU worker doesn't have GPU driver loaded or driver was not loaded properly.
2727

2828
* If you try to use inbox or pre-installed driver please check the node ``dmesg`` to see why the driver was not loaded properly.
2929

30-
* If you want to deploy out-of-tree driver, we suggest check the `Driver Installation Guide <./drivers/installation.html>`_ then modify the default ``DeviceConfig`` to ask Operator to install the out-of-tree GPU driver for your worker nodes.
30+
* If you want to deploy out-of-tree driver, we suggest check the [Driver Installation Guide](./drivers/installation) then modify the default ``DeviceConfig`` to ask Operator to install the out-of-tree GPU driver for your worker nodes.
3131

3232
```bash
3333
kubectl edit deviceconfigs -n kube-amd-gpu default

docs/usage.rst

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,9 @@ Quick Start Guide
33

44
Getting up and running with the AMD GPU Operator and Device Metrics Exporter on Kubernetes is quick and easy. Below is a short guide on how to get started using the helm installation method on a standard Kubernetes install. Note that more detailed instructions on the different installation methods can be found on this site:
55

6-
`GPU Operator Kubernetes Helm Install <../installation/kubernetes-helm.html>`_
6+
`GPU Operator Kubernetes Helm Install <./installation/kubernetes-helm.html>`_
77

8-
`GPU Operator Red Hat OpenShift Install <../installation/openshift-olm.html>`_
8+
`GPU Operator Red Hat OpenShift Install <./installation/openshift-olm.html>`_
99

1010
Installing the GPU Operator
1111
---------------------------

0 commit comments

Comments
 (0)