-
Notifications
You must be signed in to change notification settings - Fork 15
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
22 changed files
with
778 additions
and
479 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
77 changes: 77 additions & 0 deletions
77
deploy/fake-gpu-operator/templates/device-plugin/_helpers.tpl
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,77 @@ | ||
{{- define "fake-gpu-operator.device-plugin.common.metadata.labels" -}} | ||
app: device-plugin | ||
{{- end -}} | ||
|
||
{{- define "fake-gpu-operator.device-plugin.common.metadata.annotations" -}} | ||
openshift.io/scc: hostmount-anyuid | ||
{{- end -}} | ||
|
||
{{- define "fake-gpu-operator.device-plugin.common.metadata.name" -}} | ||
device-plugin | ||
{{- end -}} | ||
|
||
{{- define "fake-gpu-operator.device-plugin.common.podSelector" }} | ||
matchLabels: | ||
app: device-plugin | ||
component: device-plugin | ||
{{- end }} | ||
|
||
{{- define "fake-gpu-operator.device-plugin.common.podTemplate.metadata" }} | ||
annotations: | ||
checksum/initialTopology: {{ include (print $.Template.BasePath "/topology-cm.yml") . | sha256sum }} | ||
labels: | ||
app: device-plugin | ||
component: device-plugin | ||
{{- end }} | ||
|
||
{{- define "fake-gpu-operator.device-plugin.common.podTemplate.spec" }} | ||
containers: | ||
- image: "{{ .Values.devicePlugin.image.repository }}:{{ .Values.devicePlugin.image.tag }}" | ||
imagePullPolicy: "{{ .Values.devicePlugin.image.pullPolicy }}" | ||
resources: | ||
{{- toYaml .Values.devicePlugin.resources | nindent 12 }} | ||
env: | ||
- name: NODE_NAME | ||
valueFrom: | ||
fieldRef: | ||
fieldPath: spec.nodeName | ||
- name: TOPOLOGY_CM_NAME | ||
value: topology | ||
- name: TOPOLOGY_CM_NAMESPACE | ||
value: "{{ .Release.Namespace }}" | ||
name: nvidia-device-plugin-ctr | ||
securityContext: | ||
privileged: true | ||
terminationMessagePath: /dev/termination-log | ||
terminationMessagePolicy: File | ||
volumeMounts: | ||
- mountPath: /runai/bin | ||
name: runai-bin-directory | ||
- mountPath: /runai/shared | ||
name: runai-shared-directory | ||
- mountPath: /var/lib/kubelet/device-plugins | ||
name: device-plugin | ||
dnsPolicy: ClusterFirst | ||
restartPolicy: Always | ||
serviceAccountName: nvidia-device-plugin | ||
terminationGracePeriodSeconds: 30 | ||
tolerations: | ||
- effect: NoSchedule | ||
key: nvidia.com/gpu | ||
operator: Exists | ||
imagePullSecrets: | ||
- name: gcr-secret | ||
volumes: | ||
- hostPath: | ||
path: /var/lib/kubelet/device-plugins | ||
type: "" | ||
name: device-plugin | ||
- hostPath: | ||
path: /var/lib/runai/bin | ||
type: DirectoryOrCreate | ||
name: runai-bin-directory | ||
- hostPath: | ||
path: /var/lib/runai/shared | ||
type: DirectoryOrCreate | ||
name: runai-shared-directory | ||
{{- end }} |
69 changes: 5 additions & 64 deletions
69
deploy/fake-gpu-operator/templates/device-plugin/daemonset.yml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,75 +1,16 @@ | ||
apiVersion: apps/v1 | ||
kind: DaemonSet | ||
metadata: | ||
{{- if .Values.environment.openshift }} | ||
annotations: | ||
openshift.io/scc: hostmount-anyuid | ||
{{- end }} | ||
name: {{ include "fake-gpu-operator.device-plugin.common.metadata.name" . }} | ||
labels: | ||
app: device-plugin | ||
name: device-plugin | ||
{{- include "fake-gpu-operator.device-plugin.common.metadata.labels" . | nindent 4 }} | ||
spec: | ||
selector: | ||
matchLabels: | ||
app: device-plugin | ||
component: device-plugin | ||
{{- include "fake-gpu-operator.device-plugin.common.podSelector" . | nindent 4 }} | ||
template: | ||
metadata: | ||
annotations: | ||
checksum/initialTopology: {{ include (print $.Template.BasePath "/topology-cm.yml") . | sha256sum }} | ||
labels: | ||
app: device-plugin | ||
component: device-plugin | ||
{{- include "fake-gpu-operator.device-plugin.common.podTemplate.metadata" . | nindent 6 }} | ||
spec: | ||
containers: | ||
- image: "{{ .Values.devicePlugin.image.repository }}:{{ .Values.devicePlugin.image.tag }}" | ||
imagePullPolicy: "{{ .Values.devicePlugin.image.pullPolicy }}" | ||
resources: | ||
{{- toYaml .Values.devicePlugin.resources | nindent 12 }} | ||
env: | ||
- name: NODE_NAME | ||
valueFrom: | ||
fieldRef: | ||
fieldPath: spec.nodeName | ||
- name: TOPOLOGY_CM_NAME | ||
value: topology | ||
- name: TOPOLOGY_CM_NAMESPACE | ||
value: "{{ .Release.Namespace }}" | ||
imagePullPolicy: Always | ||
name: nvidia-device-plugin-ctr | ||
securityContext: | ||
privileged: true | ||
terminationMessagePath: /dev/termination-log | ||
terminationMessagePolicy: File | ||
volumeMounts: | ||
- mountPath: /runai/bin | ||
name: runai-bin-directory | ||
- mountPath: /runai/shared | ||
name: runai-shared-directory | ||
- mountPath: /var/lib/kubelet/device-plugins | ||
name: device-plugin | ||
dnsPolicy: ClusterFirst | ||
{{- include "fake-gpu-operator.device-plugin.common.podTemplate.spec" . | nindent 6 }} | ||
nodeSelector: | ||
nvidia.com/gpu.deploy.device-plugin: "true" | ||
restartPolicy: Always | ||
serviceAccountName: nvidia-device-plugin | ||
terminationGracePeriodSeconds: 30 | ||
tolerations: | ||
- effect: NoSchedule | ||
key: nvidia.com/gpu | ||
operator: Exists | ||
imagePullSecrets: | ||
- name: gcr-secret | ||
volumes: | ||
- hostPath: | ||
path: /var/lib/kubelet/device-plugins | ||
type: "" | ||
name: device-plugin | ||
- hostPath: | ||
path: /var/lib/runai/bin | ||
type: DirectoryOrCreate | ||
name: runai-bin-directory | ||
- hostPath: | ||
path: /var/lib/runai/shared | ||
type: DirectoryOrCreate | ||
name: runai-shared-directory |
16 changes: 16 additions & 0 deletions
16
deploy/fake-gpu-operator/templates/device-plugin/deployment-template.yaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
apiVersion: apps/v1 | ||
kind: Deployment | ||
metadata: | ||
name: {{ include "fake-gpu-operator.device-plugin.common.metadata.name" . }} | ||
labels: | ||
{{- include "fake-gpu-operator.device-plugin.common.metadata.labels" . | nindent 4 }} | ||
run.ai/fake-node-deployment-template: "true" | ||
spec: | ||
replicas: 0 | ||
selector: | ||
{{- include "fake-gpu-operator.device-plugin.common.podSelector" . | nindent 4 }} | ||
template: | ||
metadata: | ||
{{- include "fake-gpu-operator.device-plugin.common.podTemplate.metadata" . | nindent 6 }} | ||
spec: | ||
{{- include "fake-gpu-operator.device-plugin.common.podTemplate.spec" . | nindent 6 }} |
61 changes: 61 additions & 0 deletions
61
deploy/fake-gpu-operator/templates/status-exporter/_helpers.tpl
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,61 @@ | ||
{{- define "fake-gpu-operator.status-exporter.common.metadata.labels" -}} | ||
app: nvidia-dcgm-exporter | ||
component: status-exporter | ||
app.kubernetes.io/name: nvidia-container-toolkit | ||
{{- end -}} | ||
|
||
{{- define "fake-gpu-operator.status-exporter.common.metadata.name" -}} | ||
nvidia-dcgm-exporter | ||
{{- end -}} | ||
|
||
{{- define "fake-gpu-operator.status-exporter.common.podSelector" -}} | ||
matchLabels: | ||
app: nvidia-dcgm-exporter | ||
{{- end -}} | ||
|
||
{{- define "fake-gpu-operator.status-exporter.common.podTemplate.metadata" -}} | ||
labels: | ||
app: nvidia-dcgm-exporter | ||
app.kubernetes.io/name: nvidia-container-toolkit | ||
{{- end -}} | ||
|
||
{{- define "fake-gpu-operator.status-exporter.common.podTemplate.spec" -}} | ||
containers: | ||
- image: "{{ .Values.statusExporter.image.repository }}:{{ .Values.statusExporter.image.tag }}" | ||
imagePullPolicy: "{{ .Values.statusExporter.image.pullPolicy }}" | ||
resources: | ||
{{- toYaml .Values.statusExporter.resources | nindent 8 }} | ||
name: nvidia-dcgm-exporter | ||
env: | ||
- name: NODE_NAME | ||
valueFrom: | ||
fieldRef: | ||
fieldPath: spec.nodeName | ||
- name: TOPOLOGY_CM_NAME | ||
value: topology | ||
- name: TOPOLOGY_CM_NAMESPACE | ||
value: "{{ .Release.Namespace }}" | ||
- name: TOPOLOGY_MAX_EXPORT_INTERVAL | ||
value: "{{ .Values.statusExporter.topologyMaxExportInterval }}" | ||
ports: | ||
- containerPort: 9400 | ||
name: http | ||
volumeMounts: | ||
- mountPath: /runai/proc | ||
name: runai-proc-directory | ||
restartPolicy: Always | ||
schedulerName: default-scheduler | ||
serviceAccount: status-exporter | ||
serviceAccountName: status-exporter | ||
tolerations: | ||
- effect: NoSchedule | ||
key: nvidia.com/gpu | ||
operator: Exists | ||
imagePullSecrets: | ||
- name: gcr-secret | ||
volumes: | ||
- name: runai-proc-directory | ||
hostPath: | ||
path: /var/lib/runai/proc | ||
type: DirectoryOrCreate | ||
{{- end -}} |
62 changes: 6 additions & 56 deletions
62
deploy/fake-gpu-operator/templates/status-exporter/daemonset.yaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,66 +1,16 @@ | ||
apiVersion: apps/v1 | ||
kind: DaemonSet | ||
metadata: | ||
name: {{ include "fake-gpu-operator.status-exporter.common.metadata.name" . }} | ||
labels: | ||
app: nvidia-dcgm-exporter | ||
component: status-exporter | ||
# this label would make the deployment pod to mimic the container-toolkit, on top of mimicking the dcgm-exporter. | ||
app.kubernetes.io/name: nvidia-container-toolkit | ||
name: nvidia-dcgm-exporter | ||
|
||
{{- include "fake-gpu-operator.status-exporter.common.metadata.labels" . | nindent 4 }} | ||
spec: | ||
selector: | ||
matchLabels: | ||
app: nvidia-dcgm-exporter | ||
{{- include "fake-gpu-operator.status-exporter.common.podSelector" . | nindent 4 }} | ||
template: | ||
metadata: | ||
creationTimestamp: null | ||
labels: | ||
app: nvidia-dcgm-exporter | ||
app.kubernetes.io/name: nvidia-container-toolkit | ||
{{- include "fake-gpu-operator.status-exporter.common.podTemplate.metadata" . | nindent 6 }} | ||
spec: | ||
containers: | ||
- image: "{{ .Values.statusExporter.image.repository }}:{{ .Values.statusExporter.image.tag }}" | ||
imagePullPolicy: "{{ .Values.statusExporter.image.pullPolicy }}" | ||
resources: | ||
{{- toYaml .Values.statusExporter.resources | nindent 12 }} | ||
name: nvidia-dcgm-exporter | ||
env: | ||
- name: NODE_NAME | ||
valueFrom: | ||
fieldRef: | ||
fieldPath: spec.nodeName | ||
- name: TOPOLOGY_CM_NAME | ||
value: topology | ||
- name: TOPOLOGY_CM_NAMESPACE | ||
value: "{{ .Release.Namespace }}" | ||
- name: TOPOLOGY_MAX_EXPORT_INTERVAL | ||
value: "{{ .Values.statusExporter.topologyMaxExportInterval }}" | ||
ports: | ||
- containerPort: 9400 | ||
name: http | ||
volumeMounts: | ||
- mountPath: /runai/proc | ||
name: runai-proc-directory | ||
{{- include "fake-gpu-operator.status-exporter.common.podTemplate.spec" . | nindent 6 }} | ||
nodeSelector: | ||
nvidia.com/gpu.deploy.dcgm-exporter: "true" | ||
restartPolicy: Always | ||
schedulerName: default-scheduler | ||
serviceAccount: status-exporter | ||
serviceAccountName: status-exporter | ||
tolerations: | ||
- effect: NoSchedule | ||
key: nvidia.com/gpu | ||
operator: Exists | ||
imagePullSecrets: | ||
- name: gcr-secret | ||
volumes: | ||
- name: runai-proc-directory | ||
hostPath: | ||
path: /var/lib/runai/proc | ||
type: DirectoryOrCreate | ||
updateStrategy: | ||
rollingUpdate: | ||
maxSurge: 0 | ||
maxUnavailable: 1 | ||
type: RollingUpdate | ||
nvidia.com/gpu.deploy.dcgm-exporter: "true" |
16 changes: 16 additions & 0 deletions
16
deploy/fake-gpu-operator/templates/status-exporter/deployment-template.yaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
apiVersion: apps/v1 | ||
kind: Deployment | ||
metadata: | ||
name: {{ include "fake-gpu-operator.status-exporter.common.metadata.name" . }} | ||
labels: | ||
{{- include "fake-gpu-operator.status-exporter.common.metadata.labels" . | nindent 4 }} | ||
run.ai/fake-node-deployment-template: "true" | ||
spec: | ||
replicas: 0 | ||
selector: | ||
{{- include "fake-gpu-operator.status-exporter.common.podSelector" . | nindent 4 }} | ||
template: | ||
metadata: | ||
{{- include "fake-gpu-operator.status-exporter.common.podTemplate.metadata" . | nindent 6 }} | ||
spec: | ||
{{- include "fake-gpu-operator.status-exporter.common.podTemplate.spec" . | nindent 6 }} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -12,6 +12,7 @@ rules: | |
- get | ||
- list | ||
- watch | ||
- patch | ||
- apiGroups: | ||
- "" | ||
resources: | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
16 changes: 16 additions & 0 deletions
16
deploy/fake-gpu-operator/templates/status-updater/role.yaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
apiVersion: rbac.authorization.k8s.io/v1 | ||
kind: Role | ||
metadata: | ||
name: fake-status-updater | ||
rules: | ||
- apiGroups: | ||
- apps | ||
resources: | ||
- deployments | ||
verbs: | ||
- update | ||
- list | ||
- get | ||
- watch | ||
- create | ||
- delete |
Oops, something went wrong.