forked from GoogleCloudPlatform/ai-on-gke
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add Kueue exemplary setup for reservation and DWS (GoogleCloudPlatfor…
- Loading branch information
Showing
2 changed files
with
106 additions
and
0 deletions.
There are no files selected for viewing
73 changes: 73 additions & 0 deletions
73
tutorials-and-examples/workflow-orchestration/dws-examples/dws_and_reservation.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,73 @@ | ||
apiVersion: kueue.x-k8s.io/v1beta1 | ||
kind: ResourceFlavor | ||
metadata: | ||
name: "reservation" | ||
spec: | ||
nodeLabels: | ||
cloud.google.com/gke-nodepool: "reservation-nodepool" # placeholder value | ||
--- | ||
apiVersion: kueue.x-k8s.io/v1beta1 | ||
kind: ResourceFlavor | ||
metadata: | ||
name: "dws" | ||
spec: | ||
nodeLabels: | ||
cloud.google.com/gke-nodepool: "dws-nodepool" # placeholder value | ||
--- | ||
apiVersion: kueue.x-k8s.io/v1beta1 | ||
kind: ClusterQueue | ||
metadata: | ||
name: "cluster-queue" | ||
spec: | ||
namespaceSelector: {} # match all. | ||
resourceGroups: | ||
- coveredResources: ["cpu", "memory", "nvidia.com/gpu"] | ||
flavors: | ||
- name: "reservation" # first we try reservation | ||
resources: | ||
- name: "cpu" | ||
nominalQuota: 9 | ||
- name: "memory" | ||
nominalQuota: 36Gi | ||
- name: "nvidia.com/gpu" | ||
nominalQuota: 9 | ||
- name: "dws" # if reservation is saturated we try dws | ||
resources: | ||
- name: "cpu" | ||
nominalQuota: 10000 # Infinite quota. | ||
- name: "memory" | ||
nominalQuota: 10000Gi # Infinite quota. | ||
- name: "nvidia.com/gpu" | ||
nominalQuota: 10000 # Infinite quota. | ||
admissionChecksStrategy: | ||
admissionChecks: | ||
- name: "dws-prov" | ||
onFlavors: [dws] | ||
--- | ||
apiVersion: kueue.x-k8s.io/v1beta1 | ||
kind: LocalQueue | ||
metadata: | ||
namespace: "default" | ||
name: "user-queue" | ||
spec: | ||
clusterQueue: "cluster-queue" | ||
--- | ||
apiVersion: kueue.x-k8s.io/v1beta1 | ||
kind: AdmissionCheck | ||
metadata: | ||
name: dws-prov | ||
spec: | ||
controllerName: kueue.x-k8s.io/provisioning-request | ||
parameters: | ||
apiGroup: kueue.x-k8s.io | ||
kind: ProvisioningRequestConfig | ||
name: dws-config | ||
--- | ||
apiVersion: kueue.x-k8s.io/v1beta1 | ||
kind: ProvisioningRequestConfig | ||
metadata: | ||
name: dws-config | ||
spec: | ||
provisioningClassName: queued-provisioning.gke.io | ||
managedResources: | ||
- nvidia.com/gpu |
33 changes: 33 additions & 0 deletions
33
tutorials-and-examples/workflow-orchestration/dws-examples/job-without-node-selector.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,33 @@ | ||
apiVersion: batch/v1 | ||
kind: Job | ||
metadata: | ||
generateName: sample-job- | ||
namespace: default | ||
labels: | ||
kueue.x-k8s.io/queue-name: user-queue | ||
annotations: | ||
provreq.kueue.x-k8s.io/maxRunDurationSeconds: "600" | ||
spec: | ||
parallelism: 1 | ||
completions: 1 | ||
suspend: true | ||
template: | ||
spec: | ||
tolerations: | ||
- key: "nvidia.com/gpu" | ||
operator: "Exists" | ||
effect: "NoSchedule" | ||
containers: | ||
- name: dummy-job | ||
image: gcr.io/k8s-staging-perf-tests/sleep:v0.0.3 | ||
args: ["120s"] | ||
resources: | ||
requests: | ||
cpu: "100m" | ||
memory: "100Mi" | ||
nvidia.com/gpu: 1 | ||
limits: | ||
cpu: "100m" | ||
memory: "100Mi" | ||
nvidia.com/gpu: 1 | ||
restartPolicy: Never |