Skip to content

Commit

Permalink
GKE DWS examples (#127)
Browse files Browse the repository at this point in the history
  • Loading branch information
mwielgus authored Nov 29, 2023
1 parent f4f2606 commit ae2c699
Show file tree
Hide file tree
Showing 4 changed files with 11,784 additions and 0 deletions.
11 changes: 11 additions & 0 deletions gke-dws-examples/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
# Dynamic Workload Scheduler examples

The repository contains examples on how to use DWS in GKE. More information about DWS is
available [here](https://cloud.google.com/kubernetes-engine/docs/how-to/provisioningrequest).

Files included:

* kueue-manifests.yaml - [Kueue](https://kueue.sigs.k8s.io/) configuration files with ProvisioningRequest and DWS support enabled.
* dws-queue.yaml - Kueue's Cluster and Local queues with ProvisioningRequest and DWS support enabled.
* job.yaml - Sample job that requires GPU and uses DWS-enabled queue.

53 changes: 53 additions & 0 deletions gke-dws-examples/dws-queues.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
apiVersion: kueue.x-k8s.io/v1beta1
kind: ResourceFlavor
metadata:
name: "default-flavor"
---
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
---
apiVersion: kueue.x-k8s.io/v1beta1
kind: ClusterQueue
metadata:
name: "dws-cluster-queue"
spec:
namespaceSelector: {}
resourceGroups:
- coveredResources: ["cpu", "memory", "nvidia.com/gpu"]
flavors:
- name: "default-flavor"
resources:
- name: "cpu"
nominalQuota: 10000 # Infinite quota.
- name: "memory"
nominalQuota: 10000Gi # Infinite quota.
- name: "nvidia.com/gpu"
nominalQuota: 10000 # Infinite quota.
admissionChecks:
- dws-prov
---
apiVersion: kueue.x-k8s.io/v1beta1
kind: LocalQueue
metadata:
namespace: "default"
name: "dws-local-queue"
spec:
clusterQueue: "dws-cluster-queue"
---
33 changes: 33 additions & 0 deletions gke-dws-examples/job.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
apiVersion: batch/v1
kind: Job
metadata:
name: sample-job
namespace: default
labels:
kueue.x-k8s.io/queue-name: dws-local-queue
spec:
parallelism: 1
completions: 1
suspend: true
template:
spec:
nodeSelector:
cloud.google.com/gke-nodepool: dws-nodepool
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
Loading

0 comments on commit ae2c699

Please sign in to comment.