diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 28931f013..e16f65bf6 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -77,13 +77,51 @@ NVIDIA is willing to work with partners for adding platform support for the GPU To file feature requests, bugs, or questions, submit an issue at https://github.com/NVIDIA/gpu-operator/issues -To contribute to the project, file a Pull Request at https://github.com/NVIDIA/gpu-operator/pulls. Contributions do not require explicit contributor license agreements (CLA), but we expect contributors to sign their work. +To contribute to the project, file a Pull Request at https://github.com/NVIDIA/gpu-operator/pulls. Contributions do not require explicit contributor license agreements (CLA), but we expect contributors to [sign](#signing) their work. Before beginning implementation or opening a Pull Request for a significant change, first open an issue describing the problem or proposal. A significant change includes, but is not limited to, architectural changes, new features, breaking changes to API or behavior, and non-trivial bug fixes. +Reviewers are automatically assigned to Pull Requests from the [OWNERS](CODEOWNERS) file. +The approval / decision-making process is documented in [GOVERNANCE.md](GOVERNANCE.md) + All contributions must adhere to the [Code of Conduct](CODE_OF_CONDUCT.md). +## Development Environment Setup + +### Prerequisites +* [Go](https://go.dev/doc/install) (see `go.mod` for the minimum required version) +* [Docker](https://docs.docker.com/get-docker/) (for building container images) +* [Helm v3](https://helm.sh/docs/intro/install/) (for rendering and/or installing the Helm chart) +* [golangci-lint](https://golangci-lint.run/docs/welcome/install/) (for running `make lint`) + +Install additional development tools by running `make install-tools`. + +### Common make targets +```console +make build # compile +make cmds # build all Go executables +make build-image # build the gpu-operator container image + +make unit-test # run unit tests +make fmt # apply gofmt to codebase +make goimports # apply goimports to the codebase +make lint # lint codebase with golangci-lint + +make validate-generated-assets # validate all generated code / assets are up-to-date + +make manifests # generate CRDs/RBAC from kubebuilder markers +make generate # generate zz_generated.deepcopy.go +make generate-clientsets # generate clientsets for APIs +make sync-crds # copy generated CRDs in config/crd/bases/* to helm chart and OLM bundle + +make validate-helm-values # verify that images referenced in helm values are valid +make validate-csv # verify that images referenced in the OLM bundle's CSV file are valid + +make validate-modules # verify that go.mod and go.sum are up-to-date +make check-third-party-notices # verify that `THIRD_PARTY_NOTICES.md` is up-to-date +``` + ## Signing your work Want to hack on the NVIDIA GPU Operator? Awesome! diff --git a/tools/go.mod b/tools/go.mod index e1a1ec89f..0a59827af 100644 --- a/tools/go.mod +++ b/tools/go.mod @@ -5,6 +5,7 @@ go 1.26.0 require ( github.com/google/go-licenses/v2 v2.0.1 github.com/jandelgado/gcov2lcov v1.1.1 + golang.org/x/tools v0.49.0 k8s.io/code-generator v0.37.0 sigs.k8s.io/controller-tools v0.22.0 sigs.k8s.io/kustomize/kustomize/v5 v5.8.1 @@ -55,8 +56,8 @@ require ( golang.org/x/net v0.58.0 // indirect golang.org/x/sync v0.22.0 // indirect golang.org/x/sys v0.47.0 // indirect + golang.org/x/telemetry v0.0.0-20260811182544-a038080d80e5 // indirect golang.org/x/text v0.41.0 // indirect - golang.org/x/tools v0.49.0 // indirect google.golang.org/genproto/googleapis/api v0.0.0-20260526163538-3dc84a4a5aaa // indirect google.golang.org/genproto/googleapis/rpc v0.0.0-20260526163538-3dc84a4a5aaa // indirect google.golang.org/protobuf v1.36.12-0.20260120151049-f2248ac996af // indirect diff --git a/tools/go.sum b/tools/go.sum index 4bbba734c..968d32402 100644 --- a/tools/go.sum +++ b/tools/go.sum @@ -250,6 +250,8 @@ golang.org/x/sys v0.0.0-20200930185726-fdedc70b468f/go.mod h1:h1NjWce9XRLGQEsW7w golang.org/x/sys v0.6.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.47.0 h1:o7XGOvZQCADBQQ4Y7VNq2dRWQR7JmOUW8Kxx4ZsNgWs= golang.org/x/sys v0.47.0/go.mod h1:4GL1E5IUh+htKOUEOaiffhrAeqysfVGipDYzABqnCmw= +golang.org/x/telemetry v0.0.0-20260811182544-a038080d80e5 h1:ZUSxONxc981v7AW7QUg+I9WwZzSTTJ019ENBYr5pV/Q= +golang.org/x/telemetry v0.0.0-20260811182544-a038080d80e5/go.mod h1:LVehoXe41cL5SCVQilsV7Gg6BNG+Js6P9PhSbYTIUkQ= golang.org/x/term v0.45.0 h1:NwWyBmoJCbfTHpxrWoZ9C6/VxOf7ic219I8xZZFdrf0= golang.org/x/term v0.45.0/go.mod h1:9aqxs0blBcrm/n0L9QW0aRVD+ktan8ssZromtqJC43w= golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= diff --git a/tools/tools.go b/tools/tools.go index 63e45f769..8377fbf60 100644 --- a/tools/tools.go +++ b/tools/tools.go @@ -22,6 +22,7 @@ package tools import ( _ "github.com/google/go-licenses/v2" _ "github.com/jandelgado/gcov2lcov" + _ "golang.org/x/tools/cmd/goimports" _ "k8s.io/code-generator/cmd/client-gen" _ "sigs.k8s.io/controller-tools/cmd/controller-gen" _ "sigs.k8s.io/kustomize/kustomize/v5"