Skip to content

Latest commit

 

History

History
226 lines (162 loc) · 13.6 KB

CONTRIBUTING.md

File metadata and controls

226 lines (162 loc) · 13.6 KB

Contribute to the NVIDIA GPU Operator

Introduction

Kubernetes provides access to special hardware resources such as NVIDIA GPUs, NICs, Infiniband adapters and other devices through the device plugin framework. However, managing special hardware resources in Kubernetes is difficult and prone to errors. GPUs and NICs require special drivers, plugins, runtimes, libraries to ensure fully high-performance functionality.

nvidia-gpu-operator

Moreover, NVIDIA software components such as drivers have been traditionally deployed as part of the base operating system image. This meant that there was a different image for CPU vs. GPU nodes that infrastructure teams would have to manage as part of the software lifecycle. This in turn requires sophisticated automation as part of the provisioning phase for GPU nodes in Kubernetes.

The NVIDIA GPU Operator was primarily built to address these challenges. It leverages the standard Operator Framework within Kubernetes to automate the management of all NVIDIA software components needed to provision GPUs within Kubernetes.

The NVIDIA GPU Operator is an open-source product built and maintained by NVIDIA. It is currently validated on a set of platforms (including specific NVIDIA GPUs, operating systems and deployment configurations). The purpose of this document is to briefly describe the architecture of the GPU Operator, so that partners can extend the GPU Operator to support other platforms.

Architecture

The GPU Operator is made up of the following software components - each of the components runs as a container, including NVIDIA drivers. The associated code is linked to each of the components below:

github.com/
├── NVIDIA/
│   ├── gpu-operator                 (CRD and controller logic that implements the reconciliation)
│   ├── k8s-device-plugin            (NVIDIA Device Plugin for Kubernetes)
│   ├── gpu-driver-container         (NVIDIA Driver qualified for data center GPUs)
│   ├── nvidia-container-toolkit     (NVIDIA Container Toolkit, runtime for Docker)
│   ├── dcgm-exporter                (NVIDIA DCGM for monitoring and telemetry)
│   ├── gpu-feature-discovery        (NVIDIA GPU Feature Discovery for Kubernetes)
│   ├── mig-manager                  (NVIDIA Multi-Instance GPU Manager for Kubernetes)
│   ├── sandbox-device-plugin        (NVIDIA Device Plugin for sandboxed environments)
│   ├── vgpu-device-manager          (NVIDIA vGPU Device Manager for Kubernetes)
│   ├── kata-manager                 (NVIDIA Kata Manager for Kubernetes)
│   ├── samples                      (CUDA VectorAdd sample used for validation steps)

License

The NVIDIA GPU Operator is open-source and its components are licensed under the permissive Apache 2.0 license.

Artifacts

The NVIDIA GPU Operator has the following artifacts as part of the product release:

  1. Source Code
  2. Documentation
  3. Container Images
  4. Helm Charts

The GPU Operator releases follow calendar versioning.

Source Code

The NVIDIA GPU Operator source code is available on GitHub at https://github.com/NVIDIA/gpu-operator

Documentation

The official NVIDIA GPU Operator documentation is available at https://docs.nvidia.com/datacenter/cloud-native/gpu-operator/latest/index.html.

For any questions or issues related to documentation, file an issue in our documentation repository.

Container Images

Releases of the GPU Operator include container images that are currently available on NVIDIA NGC Catalog.

Helm Charts

To simplify the deployment, the Operator can be installed using a Helm chart (note only Helm v3 is supported). The documentation for helm installation can be viewed here.

Contributions

NVIDIA is willing to work with partners for adding platform support for the GPU Operator. The GPU Operator is open-source and permissively licensed under the Apache 2.0 license with only minimal requirements for source code contributions.

To file feature requests or bugs, submit an issue at https://github.com/NVIDIA/gpu-operator/issues. For questions, start a discussion at https://github.com/NVIDIA/gpu-operator/discussions or ask in the #gpu-operator channel in our community Slack at https://inviter.co/dsx-ai-factory.

All external contributions start with an issue. External contributors must have an accepted issue that is assigned to them before they open a pull request. See Contribution workflow. Contributions do not require explicit contributor license agreements (CLA), but we expect contributors to sign their work.

Reviewers are automatically assigned to Pull Requests from the OWNERS file. PR approval and decision-making for major changes are documented in GOVERNANCE.md.

All contributions must adhere to the Code of Conduct.

AI Usage

AI-assisted contributions are welcome, however, you must understand your code. If you can't explain what your changes do and how they interact with the greater system without the aid of AI tools, your contribution may not be accepted. AI should assist your effort, not replace it or shift the burden of understanding, testing, and reviewing onto maintainers.

The human contributor is accountable for all code, regardless of how much was AI-generated. Each contribution must name the human behind the change via a DCO sign-off.

Maintainers may close issues and PRs that are unproductive or low-quality, without explanation, regardless of whether AI tools were used or not. If a contributor repeatedly opens unproductive issues or PRs, they may be blocked from contributing to the project because it is disruptive and disrespectful of the maintainers' time.

Below are some unacceptable usages of AI that will likely result in your contribution being closed:

  • Submitting AI-generated issues or PRs without thorough review and verification
  • Submitting AI-generated code that you cannot explain or answer questions about during review
  • Using AI to generate replies to review comments or issue discussions
  • Submitting AI-generated code that contains unnecessary refactoring or unrelated changes not scoped to the problem the PR is solving

Contribution workflow

To propose a new issue: start at step 1.
To work on an existing issue: skip to step 3 and claim an accepted issue with no assignees.

  1. Open an issue. Use the bug report template to report a defect, or the feature request template to propose new behavior or a major change. Indicate if you want to work on the issue. Each new issue gets the needs-triage label.
  2. Wait for triage. A maintainer reviews the issue against the triage criteria. The maintainer then labels the issue accepted, needs-more-info, or closes it.
  3. Claim the issue. When an issue is accepted, comment on it expressing interest and summarizing your proposed solution. Issue authors have priority if they indicate they would like to work on it. Other claims are first-come, first-served. A maintainer discusses your plan with you and assigns the issue to you when the plan is ready.
  4. Open a pull request. File a pull request at https://github.com/NVIDIA/gpu-operator/pulls and link the issue in the description (for example, Fixes #1234). Maintainers close pull requests that do not link an issue assigned to the author, and pull requests that are duplicates of existing ones.

Issue labels

Each open issue has one state label and one category label. For example, needs-triage and bug together identify a bug report that no maintainer has reviewed yet.

Label Type Meaning
needs-triage State No maintainer has reviewed the issue yet.
needs-more-info State Maintainers are waiting for more information from the author. If the issue has no activity for 30 days, it is closed.
accepted State The issue is approved for work. Contributors can claim it.
bug Category A defect in existing behavior.
feature Category A request for new behavior.

Triage criteria

Maintainers use these questions to triage an issue:

  • Is the problem clear and reproducible?
  • Is the issue a duplicate, or does other work already address it?
  • Does the issue fit the supported use cases and the project priorities?
  • Is the proposed approach appropriate?
  • Does the issue align with the product roadmap?

Development Environment Setup

Prerequisites

  • Go (see go.mod for the minimum required version)
  • Docker (for building container images)
  • Helm v3 (for rendering and/or installing the Helm chart)
  • golangci-lint (for running make lint)

Install additional development tools by running make install-tools.

Common make targets

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! We only require you to sign your work, the below section describes this!

The sign-off is a simple line at the end of the explanation for the patch. Your signature certifies that you wrote the patch or otherwise have the right to pass it on as an open-source patch. The rules are pretty simple: if you can certify the below (from developercertificate.org):

Developer Certificate of Origin
Version 1.1

Copyright (C) 2004, 2006 The Linux Foundation and its contributors.
1 Letterman Drive
Suite D4700
San Francisco, CA, 94129

Everyone is permitted to copy and distribute verbatim copies of this
license document, but changing it is not allowed.

Developer's Certificate of Origin 1.1

By making a contribution to this project, I certify that:

(a) The contribution was created in whole or in part by me and I
    have the right to submit it under the open source license
    indicated in the file; or

(b) The contribution is based upon previous work that, to the best
    of my knowledge, is covered under an appropriate open source
    license and I have the right under that license to submit that
    work with modifications, whether created in whole or in part
    by me, under the same open source license (unless I am
    permitted to submit under a different license), as indicated
    in the file; or

(c) The contribution was provided directly to me by some other
    person who certified (a), (b) or (c) and I have not modified
    it.

(d) I understand and agree that this project and the contribution
    are public and that a record of the contribution (including all
    personal information I submit with it, including my sign-off) is
    maintained indefinitely and may be redistributed consistent with
    this project or the open source license(s) involved.

Then you just add a line to every git commit message:

Signed-off-by: Joe Smith <joe.smith@email.com>

Use your real name (sorry, no pseudonyms or anonymous contributions.)

If you set your user.name and user.email git configs, you can sign your commit automatically with git commit -s.