Skip to content

Commit

Permalink
Rename k8s-dra-driver to k8s-dra-driver-gpu
Browse files Browse the repository at this point in the history
Signed-off-by: Kevin Klues <[email protected]>
  • Loading branch information
klueska committed Feb 6, 2025
1 parent 8e185f8 commit 3f55da6
Show file tree
Hide file tree
Showing 64 changed files with 170 additions and 170 deletions.
8 changes: 4 additions & 4 deletions .common-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -118,8 +118,8 @@ trigger-pipeline:
.scan-base:
stage: scan
variables:
IMAGE: "${CI_REGISTRY_IMAGE}/k8s-dra-driver:${CI_COMMIT_SHORT_SHA}-${DIST}"
IMAGE_ARCHIVE: "k8s-dra-driver-${CI_COMMIT_SHORT_SHA}-${DIST}-${PLATFORM_ARCH}.tar"
IMAGE: "${CI_REGISTRY_IMAGE}/k8s-dra-driver-gpu:${CI_COMMIT_SHORT_SHA}-${DIST}"
IMAGE_ARCHIVE: "k8s-dra-driver-gpu-${CI_COMMIT_SHORT_SHA}-${DIST}-${PLATFORM_ARCH}.tar"
before_script:
- docker login -u "${CI_REGISTRY_USER}" -p "${CI_REGISTRY_PASSWORD}" "${CI_REGISTRY}"
- docker pull --platform="${PLATFORM}" "${IMAGE}"
Expand Down Expand Up @@ -184,7 +184,7 @@ scan-ubi8-arm64:
stage: release
variables:
# Define the source image for the release
IMAGE_NAME: "${CI_REGISTRY_IMAGE}/k8s-dra-driver"
IMAGE_NAME: "${CI_REGISTRY_IMAGE}/k8s-dra-driver-gpu"
VERSION: "${CI_COMMIT_SHORT_SHA}"
# OUT_IMAGE_VERSION is overridden for external releases
OUT_IMAGE_VERSION: "${CI_COMMIT_SHORT_SHA}"
Expand Down Expand Up @@ -219,7 +219,7 @@ scan-ubi8-arm64:
OUT_REGISTRY_USER: "${CI_REGISTRY_USER}"
OUT_REGISTRY_TOKEN: "${CI_REGISTRY_PASSWORD}"
OUT_REGISTRY: "${CI_REGISTRY}"
OUT_IMAGE_NAME: "${CI_REGISTRY_IMAGE}/staging/k8s-dra-driver"
OUT_IMAGE_NAME: "${CI_REGISTRY_IMAGE}/staging/k8s-dra-driver-gpu"

# Define an external release step that pushes an image to an external repository.
# This includes a devlopment image off main.
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/image.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ jobs:
password: ${{ secrets.GITHUB_TOKEN }}
- name: Build image
env:
IMAGE_NAME: ghcr.io/${LOWERCASE_REPO_OWNER}/k8s-dra-driver
IMAGE_NAME: ghcr.io/${LOWERCASE_REPO_OWNER}/k8s-dra-driver-gpu
VERSION: ${COMMIT_SHORT_SHA}
run: |
echo "${VERSION}"
Expand Down
2 changes: 1 addition & 1 deletion .gitlab-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ unit-tests:
.image-build:
stage: image-build
variables:
IMAGE_NAME: "${CI_REGISTRY_IMAGE}/k8s-dra-driver"
IMAGE_NAME: "${CI_REGISTRY_IMAGE}/k8s-dra-driver-gpu"
VERSION: "${CI_COMMIT_SHORT_SHA}"
PUSH_ON_BUILD: "true"
before_script:
Expand Down
2 changes: 1 addition & 1 deletion .golangci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -17,4 +17,4 @@ run:

linters-settings:
goimports:
local-prefixes: "github.com/NVIDIA/k8s-dra-driver"
local-prefixes: "github.com/NVIDIA/k8s-dra-driver-gpu"
6 changes: 3 additions & 3 deletions .nvidia-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -33,19 +33,19 @@ variables:
# On the multi-arch builder we don't need the qemu setup.
SKIP_QEMU_SETUP: "1"
# Define the public staging registry
STAGING_REGISTRY: registry.gitlab.com/nvidia/cloud-native/k8s-dra-driver/staging
STAGING_REGISTRY: registry.gitlab.com/nvidia/cloud-native/k8s-dra-driver-gpu/staging
STAGING_VERSION: ${CI_COMMIT_SHORT_SHA}

.image-pull:
stage: image-build
variables:
IN_REGISTRY: "${STAGING_REGISTRY}"
IN_IMAGE_NAME: k8s-dra-driver
IN_IMAGE_NAME: k8s-dra-driver-gpu
IN_VERSION: "${STAGING_VERSION}"
OUT_REGISTRY_USER: "${CI_REGISTRY_USER}"
OUT_REGISTRY_TOKEN: "${CI_REGISTRY_PASSWORD}"
OUT_REGISTRY: "${CI_REGISTRY}"
OUT_IMAGE_NAME: "${CI_REGISTRY_IMAGE}/k8s-dra-driver"
OUT_IMAGE_NAME: "${CI_REGISTRY_IMAGE}/k8s-dra-driver-gpu"
PUSH_MULTIPLE_TAGS: "false"
# We delay the job start to allow the public pipeline to generate the required images.
when: delayed
Expand Down
10 changes: 5 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -46,10 +46,10 @@ subdirectory, so take a moment to browse through the various files and see
what's available:

```console
git clone https://github.com/NVIDIA/k8s-dra-driver.git
git clone https://github.com/NVIDIA/k8s-dra-driver-gpu.git
```
```console
cd k8s-dra-driver
cd k8s-dra-driver-gpu
```

### Setting up the infrastructure
Expand All @@ -76,8 +76,8 @@ This should show two pods running in the `nvidia` namespace:
kubectl get pods -n nvidia
```
```
NAME READY STATUS RESTARTS AGE
nvidia-dra-driver-k8s-dra-driver-gpu-kubelet-plugin-5vfp9 1/1 Running 0 69s
NAME READY STATUS RESTARTS AGE
k8s-dra-driver-gpu-kubelet-plugin-5vfp9 1/1 Running 0 69s
```

### Run the examples by following the steps in the demo script
Expand Down Expand Up @@ -146,7 +146,7 @@ set -e
export VERSION=v0.1.0
REGISTRY=nvcr.io/nvidia/cloud-native
IMAGE=k8s-dra-driver
IMAGE=k8s-dra-driver-gpu
PLATFORM=ubi8
sudo true
Expand Down
2 changes: 1 addition & 1 deletion api/nvidia.com/resource/v1beta1/sharing_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ import (
"github.com/stretchr/testify/require"
"k8s.io/apimachinery/pkg/api/resource"

configapi "github.com/NVIDIA/k8s-dra-driver/api/nvidia.com/resource/v1beta1"
configapi "github.com/NVIDIA/k8s-dra-driver-gpu/api/nvidia.com/resource/v1beta1"
)

func TestMpsPerDevicePinnedMemoryLimitNormalize(t *testing.T) {
Expand Down
2 changes: 1 addition & 1 deletion cmd/nvidia-dra-gpu-plugin/device_state.go
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ import (
"k8s.io/kubernetes/pkg/kubelet/checkpointmanager"
cdiapi "tags.cncf.io/container-device-interface/pkg/cdi"

configapi "github.com/NVIDIA/k8s-dra-driver/api/nvidia.com/resource/v1beta1"
configapi "github.com/NVIDIA/k8s-dra-driver-gpu/api/nvidia.com/resource/v1beta1"
)

type OpaqueDeviceConfig struct {
Expand Down
4 changes: 2 additions & 2 deletions cmd/nvidia-dra-gpu-plugin/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,8 @@ import (

"k8s.io/klog/v2"

"github.com/NVIDIA/k8s-dra-driver/internal/info"
"github.com/NVIDIA/k8s-dra-driver/pkg/flags"
"github.com/NVIDIA/k8s-dra-driver-gpu/internal/info"
"github.com/NVIDIA/k8s-dra-driver-gpu/pkg/flags"
)

const (
Expand Down
2 changes: 1 addition & 1 deletion cmd/nvidia-dra-gpu-plugin/sharing.go
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ import (
cdiapi "tags.cncf.io/container-device-interface/pkg/cdi"
cdispec "tags.cncf.io/container-device-interface/specs-go"

configapi "github.com/NVIDIA/k8s-dra-driver/api/nvidia.com/resource/v1beta1"
configapi "github.com/NVIDIA/k8s-dra-driver-gpu/api/nvidia.com/resource/v1beta1"
)

const (
Expand Down
4 changes: 2 additions & 2 deletions cmd/nvidia-dra-imex-controller/computedomain.go
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,8 @@ import (
"k8s.io/client-go/tools/cache"
"k8s.io/klog/v2"

nvapi "github.com/NVIDIA/k8s-dra-driver/api/nvidia.com/resource/v1beta1"
nvinformers "github.com/NVIDIA/k8s-dra-driver/pkg/nvidia.com/informers/externalversions"
nvapi "github.com/NVIDIA/k8s-dra-driver-gpu/api/nvidia.com/resource/v1beta1"
nvinformers "github.com/NVIDIA/k8s-dra-driver-gpu/pkg/nvidia.com/informers/externalversions"
)

type GetComputeDomainFunc func(uid string) (*nvapi.ComputeDomain, error)
Expand Down
4 changes: 2 additions & 2 deletions cmd/nvidia-dra-imex-controller/controller.go
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,8 @@ import (
"context"
"fmt"

"github.com/NVIDIA/k8s-dra-driver/pkg/flags"
"github.com/NVIDIA/k8s-dra-driver/pkg/workqueue"
"github.com/NVIDIA/k8s-dra-driver-gpu/pkg/flags"
"github.com/NVIDIA/k8s-dra-driver-gpu/pkg/workqueue"
)

// ManagerConfig defines the common configuration options shared across all managers.
Expand Down
2 changes: 1 addition & 1 deletion cmd/nvidia-dra-imex-controller/deployment.go
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ import (
"k8s.io/client-go/tools/cache"
"k8s.io/klog/v2"

nvapi "github.com/NVIDIA/k8s-dra-driver/api/nvidia.com/resource/v1beta1"
nvapi "github.com/NVIDIA/k8s-dra-driver-gpu/api/nvidia.com/resource/v1beta1"
)

const (
Expand Down
2 changes: 1 addition & 1 deletion cmd/nvidia-dra-imex-controller/deploymentpods.go
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ import (
"k8s.io/client-go/tools/cache"
"k8s.io/klog/v2"

nvapi "github.com/NVIDIA/k8s-dra-driver/api/nvidia.com/resource/v1beta1"
nvapi "github.com/NVIDIA/k8s-dra-driver-gpu/api/nvidia.com/resource/v1beta1"
)

const (
Expand Down
2 changes: 1 addition & 1 deletion cmd/nvidia-dra-imex-controller/deviceclass.go
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ import (
"k8s.io/client-go/tools/cache"
"k8s.io/klog/v2"

nvapi "github.com/NVIDIA/k8s-dra-driver/api/nvidia.com/resource/v1beta1"
nvapi "github.com/NVIDIA/k8s-dra-driver-gpu/api/nvidia.com/resource/v1beta1"
)

type DeviceClassManager struct {
Expand Down
4 changes: 2 additions & 2 deletions cmd/nvidia-dra-imex-controller/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -38,8 +38,8 @@ import (
_ "k8s.io/component-base/metrics/prometheus/version" // for version metric registration
_ "k8s.io/component-base/metrics/prometheus/workqueue" // register work queues in the default legacy registry

"github.com/NVIDIA/k8s-dra-driver/internal/info"
"github.com/NVIDIA/k8s-dra-driver/pkg/flags"
"github.com/NVIDIA/k8s-dra-driver-gpu/internal/info"
"github.com/NVIDIA/k8s-dra-driver-gpu/pkg/flags"
)

const (
Expand Down
2 changes: 1 addition & 1 deletion cmd/nvidia-dra-imex-controller/resourceclaim.go
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ import (
"k8s.io/client-go/tools/cache"
"k8s.io/klog/v2"

nvapi "github.com/NVIDIA/k8s-dra-driver/api/nvidia.com/resource/v1beta1"
nvapi "github.com/NVIDIA/k8s-dra-driver-gpu/api/nvidia.com/resource/v1beta1"
)

type ResourceClaimManager struct {
Expand Down
2 changes: 1 addition & 1 deletion cmd/nvidia-dra-imex-controller/resourceclaimtemplate.go
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ import (
"k8s.io/client-go/tools/cache"
"k8s.io/klog/v2"

nvapi "github.com/NVIDIA/k8s-dra-driver/api/nvidia.com/resource/v1beta1"
nvapi "github.com/NVIDIA/k8s-dra-driver-gpu/api/nvidia.com/resource/v1beta1"
)

const (
Expand Down
2 changes: 1 addition & 1 deletion cmd/nvidia-dra-imex-plugin/device_state.go
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ import (
"k8s.io/kubernetes/pkg/kubelet/checkpointmanager"
cdiapi "tags.cncf.io/container-device-interface/pkg/cdi"

configapi "github.com/NVIDIA/k8s-dra-driver/api/nvidia.com/resource/v1beta1"
configapi "github.com/NVIDIA/k8s-dra-driver-gpu/api/nvidia.com/resource/v1beta1"
)

const (
Expand Down
2 changes: 1 addition & 1 deletion cmd/nvidia-dra-imex-plugin/driver.go
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ import (
"k8s.io/klog/v2"
drapbv1 "k8s.io/kubelet/pkg/apis/dra/v1beta1"

"github.com/NVIDIA/k8s-dra-driver/pkg/workqueue"
"github.com/NVIDIA/k8s-dra-driver-gpu/pkg/workqueue"
)

var _ drapbv1.DRAPluginServer = &driver{}
Expand Down
4 changes: 2 additions & 2 deletions cmd/nvidia-dra-imex-plugin/imex.go
Original file line number Diff line number Diff line change
Expand Up @@ -36,8 +36,8 @@ import (
cdiapi "tags.cncf.io/container-device-interface/pkg/cdi"
cdispec "tags.cncf.io/container-device-interface/specs-go"

nvapi "github.com/NVIDIA/k8s-dra-driver/api/nvidia.com/resource/v1beta1"
nvinformers "github.com/NVIDIA/k8s-dra-driver/pkg/nvidia.com/informers/externalversions"
nvapi "github.com/NVIDIA/k8s-dra-driver-gpu/api/nvidia.com/resource/v1beta1"
nvinformers "github.com/NVIDIA/k8s-dra-driver-gpu/pkg/nvidia.com/informers/externalversions"
)

const (
Expand Down
4 changes: 2 additions & 2 deletions cmd/nvidia-dra-imex-plugin/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,8 @@ import (

"k8s.io/klog/v2"

"github.com/NVIDIA/k8s-dra-driver/internal/info"
"github.com/NVIDIA/k8s-dra-driver/pkg/flags"
"github.com/NVIDIA/k8s-dra-driver-gpu/internal/info"
"github.com/NVIDIA/k8s-dra-driver-gpu/pkg/flags"
)

const (
Expand Down
2 changes: 1 addition & 1 deletion demo/clusters/gke/create-cluster.sh
Original file line number Diff line number Diff line change
Expand Up @@ -139,4 +139,4 @@ kubectl apply -f https://raw.githubusercontent.com/GoogleCloudPlatform/container
kubectl create namespace nvidia

## Deploy a custom daemonset that prepares a node for use with DRA
kubectl apply -f https://raw.githubusercontent.com/NVIDIA/k8s-dra-driver/3498c9a91cb594af94c9e8d65177b131e380e116/demo/prepare-gke-nodes-for-dra.yaml
kubectl apply -f https://raw.githubusercontent.com/NVIDIA/k8s-dra-driver-gpu/3498c9a91cb594af94c9e8d65177b131e380e116/demo/prepare-gke-nodes-for-dra.yaml
34 changes: 17 additions & 17 deletions deployments/helm/k8s-dra-gpu-driver/templates/_helpers.tpl
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{{/*
Expand the name of the chart.
*/}}
{{- define "k8s-dra-driver.name" -}}
{{- define "k8s-dra-driver-gpu.name" -}}
{{- default .Chart.Name .Values.nameOverride | trunc 63 | trimSuffix "-" }}
{{- end }}

Expand All @@ -10,7 +10,7 @@ Create a default fully qualified app name.
We truncate at 63 chars because some Kubernetes name fields are limited to this (by the DNS naming spec).
If release name contains chart name it will be used as a full name.
*/}}
{{- define "k8s-dra-driver.fullname" -}}
{{- define "k8s-dra-driver-gpu.fullname" -}}
{{- if .Values.fullnameOverride -}}
{{- .Values.fullnameOverride | trunc 63 | trimSuffix "-" -}}
{{- else -}}
Expand All @@ -26,7 +26,7 @@ If release name contains chart name it will be used as a full name.
{{/*
Allow the release namespace to be overridden for multi-namespace deployments in combined charts
*/}}
{{- define "k8s-dra-driver.namespace" -}}
{{- define "k8s-dra-driver-gpu.namespace" -}}
{{- if .Values.namespaceOverride -}}
{{- .Values.namespaceOverride -}}
{{- else -}}
Expand All @@ -37,17 +37,17 @@ Allow the release namespace to be overridden for multi-namespace deployments in
{{/*
Create chart name and version as used by the chart label.
*/}}
{{- define "k8s-dra-driver.chart" -}}
{{- define "k8s-dra-driver-gpu.chart" -}}
{{- $name := default .Chart.Name .Values.nameOverride -}}
{{- printf "%s-%s" $name .Chart.Version | replace "+" "_" | trunc 63 | trimSuffix "-" }}
{{- end }}

{{/*
Common labels
*/}}
{{- define "k8s-dra-driver.labels" -}}
helm.sh/chart: {{ include "k8s-dra-driver.chart" . }}
{{ include "k8s-dra-driver.templateLabels" . }}
{{- define "k8s-dra-driver-gpu.labels" -}}
helm.sh/chart: {{ include "k8s-dra-driver-gpu.chart" . }}
{{ include "k8s-dra-driver-gpu.templateLabels" . }}
{{- if .Chart.AppVersion }}
app.kubernetes.io/version: {{ .Chart.AppVersion | quote }}
{{- end }}
Expand All @@ -57,8 +57,8 @@ app.kubernetes.io/managed-by: {{ .Release.Service }}
{{/*
Template labels
*/}}
{{- define "k8s-dra-driver.templateLabels" -}}
app.kubernetes.io/name: {{ include "k8s-dra-driver.name" . }}
{{- define "k8s-dra-driver-gpu.templateLabels" -}}
app.kubernetes.io/name: {{ include "k8s-dra-driver-gpu.name" . }}
app.kubernetes.io/instance: {{ .Release.Name }}
{{- if .Values.selectorLabelsOverride }}
{{ toYaml .Values.selectorLabelsOverride }}
Expand All @@ -68,27 +68,27 @@ app.kubernetes.io/instance: {{ .Release.Name }}
{{/*
Selector labels
*/}}
{{- define "k8s-dra-driver.selectorLabels" -}}
{{- define "k8s-dra-driver-gpu.selectorLabels" -}}
{{- if .Values.selectorLabelsOverride -}}
{{ toYaml .Values.selectorLabelsOverride }}
{{- else -}}
{{ include "k8s-dra-driver.templateLabels" . }}
{{ include "k8s-dra-driver-gpu.templateLabels" . }}
{{- end }}
{{- end }}

{{/*
Full image name with tag
*/}}
{{- define "k8s-dra-driver.fullimage" -}}
{{- define "k8s-dra-driver-gpu.fullimage" -}}
{{- $tag := printf "v%s" .Chart.AppVersion }}
{{- .Values.image.repository -}}:{{- .Values.image.tag | default $tag -}}
{{- end }}

{{/*
Create the name of the service account to use
*/}}
{{- define "k8s-dra-driver.serviceAccountName" -}}
{{- $name := printf "%s-service-account" (include "k8s-dra-driver.fullname" .) }}
{{- define "k8s-dra-driver-gpu.serviceAccountName" -}}
{{- $name := printf "%s-service-account" (include "k8s-dra-driver-gpu.fullname" .) }}
{{- if .Values.serviceAccount.create }}
{{- default $name .Values.serviceAccount.name }}
{{- else }}
Expand All @@ -99,7 +99,7 @@ Create the name of the service account to use
{{/*
Check for the existence of an element in a list
*/}}
{{- define "k8s-dra-driver.listHas" -}}
{{- define "k8s-dra-driver-gpu.listHas" -}}
{{- $listToCheck := index . 0 }}
{{- $valueToCheck := index . 1 }}

Expand All @@ -115,13 +115,13 @@ Check for the existence of an element in a list
{{/*
Filter a list by a set of valid values
*/}}
{{- define "k8s-dra-driver.filterList" -}}
{{- define "k8s-dra-driver-gpu.filterList" -}}
{{- $listToFilter := index . 0 }}
{{- $validValues := index . 1 }}

{{- $result := list -}}
{{- range $validValues}}
{{- if include "k8s-dra-driver.listHas" (list $listToFilter .) }}
{{- if include "k8s-dra-driver-gpu.listHas" (list $listToFilter .) }}
{{- $result = append $result . }}
{{- end }}
{{- end }}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@
apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRole
metadata:
name: {{ include "k8s-dra-driver.fullname" . }}-cluster-role
namespace: {{ include "k8s-dra-driver.namespace" . }}
name: {{ include "k8s-dra-driver-gpu.fullname" . }}-cluster-role
namespace: {{ include "k8s-dra-driver-gpu.namespace" . }}
rules:
- apiGroups: ["resource.k8s.io"]
resources: ["resourceslices"]
Expand Down
Loading

0 comments on commit 3f55da6

Please sign in to comment.