Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Added 5 examples to demostrate GPU aware scheduling features
This adds more examples for GAS. The tests prints the container names and corresponding GPUs to the logs. Signed-off-by: Valtteri Rantala <vrantala@intel.com>
- Loading branch information
Showing
7 changed files
with
182 additions
and
5 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,13 +1,25 @@ | ||
This folder has a simple example POD which uses kubernetes extended resources | ||
This folder has simple examples which use kubernetes extended resources and other GAS features. | ||
|
||
To deploy, you can run in this folder: | ||
|
||
``` | ||
kubectl apply -f . | ||
kubectl apply -f <test_file_name> | ||
``` | ||
|
||
Then you can check the GPU devices of the first pod in the deployment with: | ||
|
||
``` | ||
kubectl exec -it deploy/bb-example -- ls /dev/dri | ||
``` | ||
kubectl exec -it deploy/<deployment name> -- ls /dev/dri | ||
``` | ||
|
||
Or you can use logs command to check which GPUs the pod is using: | ||
|
||
``` | ||
kubectl logs --all-containders=true <pod name> | ||
``` | ||
|
||
With describe command you can check in which GPUs GAS has scheduled the pods along with the other pod information: | ||
|
||
``` | ||
kubectl describe pods <deployment name> | ||
``` |
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,30 @@ | ||
apiVersion: apps/v1 | ||
kind: Deployment | ||
metadata: | ||
name: allowed-gpu-list-example | ||
spec: | ||
replicas: 1 | ||
selector: | ||
matchLabels: | ||
app: allow-gpu-list-example | ||
template: | ||
metadata: | ||
annotations: | ||
#remember to enable allowlist and/or denylist via command line flags. | ||
#--enableAllowlist true | ||
#--enableDenylist true | ||
gas-allow: card1,card2,card3 | ||
gas-deny: card0 | ||
labels: | ||
app: allow-gpu-list-example | ||
spec: | ||
containers: | ||
- name: &containername allow-gpu-list-example | ||
image: busybox:1.33.1 | ||
env: | ||
- name: MY_CONTAINER_NAME | ||
value: *containername | ||
command: ['sh', '-c', 'echo $MY_CONTAINER_NAME && ls -ltr /dev/dri && sleep 6000'] | ||
resources: | ||
limits: | ||
gpu.intel.com/i915: 1 |
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
25 changes: 25 additions & 0 deletions
25
gpu-aware-scheduling/docs/example/memory_resource_example.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,25 @@ | ||
apiVersion: apps/v1 | ||
kind: Deployment | ||
metadata: | ||
name: memory-resource-example | ||
spec: | ||
replicas: 1 | ||
selector: | ||
matchLabels: | ||
app: memory-resource-example | ||
template: | ||
metadata: | ||
labels: | ||
app: memory-resource-example | ||
spec: | ||
containers: | ||
- name: &containername memory-resource-example | ||
image: busybox:1.33.1 | ||
env: | ||
- name: MY_CONTAINER_NAME | ||
value: *containername | ||
command: ['sh', '-c', 'echo $MY_CONTAINER_NAME && ls -ltr /dev/dri && sleep 6000'] | ||
resources: | ||
limits: | ||
gpu.intel.com/i915: 1 | ||
gpu.intel.com/memory.max: 500M |
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,58 @@ | ||
apiVersion: apps/v1 | ||
kind: Deployment | ||
metadata: | ||
name: same-gpu-example | ||
spec: | ||
replicas: 1 | ||
selector: | ||
matchLabels: | ||
app: same-gpu-example | ||
template: | ||
metadata: | ||
labels: | ||
app: same-gpu-example | ||
annotations: | ||
#List containers that needs to be in same GPU | ||
gas-same-gpu: same-gpu-container1,same-gpu-container3 | ||
spec: | ||
containers: | ||
- name: &container1 same-gpu-container1 | ||
image: busybox:1.33.1 | ||
env: | ||
- name: MY_CONTAINER_NAME | ||
value: *container1 | ||
command: ['sh', '-c', 'echo $MY_CONTAINER_NAME && ls -ltr /dev/dri && sleep 6000'] | ||
resources: | ||
limits: | ||
gpu.intel.com/i915: 1 | ||
gpu.intel.com/millicores: 400 | ||
- name: &container2 same-gpu-container2 | ||
image: busybox:1.33.1 | ||
env: | ||
- name: MY_CONTAINER_NAME | ||
value: *container2 | ||
command: ['sh', '-c', 'echo $MY_CONTAINER_NAME && ls -ltr /dev/dri && sleep 6000'] | ||
resources: | ||
limits: | ||
gpu.intel.com/i915: 1 | ||
gpu.intel.com/millicores: 300 | ||
- name: &container3 same-gpu-container3 | ||
image: busybox:1.33.1 | ||
env: | ||
- name: MY_CONTAINER_NAME | ||
value: *container3 | ||
command: ['sh', '-c', 'echo $MY_CONTAINER_NAME && ls -ltr /dev/dri && sleep 6000'] | ||
resources: | ||
limits: | ||
gpu.intel.com/i915: 1 | ||
gpu.intel.com/millicores: 400 | ||
- name: &container4 same-gpu-container4 | ||
image: busybox:1.33.1 | ||
env: | ||
- name: MY_CONTAINER_NAME | ||
value: *container4 | ||
command: ['sh', '-c', 'echo $MY_CONTAINER_NAME && ls -ltr /dev/dri && sleep 6000'] | ||
resources: | ||
limits: | ||
gpu.intel.com/i915: 1 | ||
gpu.intel.com/millicores: 300 |
25 changes: 25 additions & 0 deletions
25
gpu-aware-scheduling/docs/example/tile_resource_request_example.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,25 @@ | ||
apiVersion: apps/v1 | ||
kind: Deployment | ||
metadata: | ||
name: tile-resource-request-example | ||
spec: | ||
replicas: 1 | ||
selector: | ||
matchLabels: | ||
app: tile-resource-request-example | ||
template: | ||
metadata: | ||
labels: | ||
app: tile-resource-request-example | ||
spec: | ||
containers: | ||
- name: &containername tile-resource-request-example | ||
image: busybox:1.33.1 | ||
env: | ||
- name: MY_CONTAINER_NAME | ||
value: *containername | ||
command: ['sh', '-c', 'echo $MY_CONTAINER_NAME && ls -ltr /dev/dri && sleep 6000'] | ||
resources: | ||
limits: | ||
gpu.intel.com/i915: 1 | ||
gpu.intel.com/tiles: 1 |
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,27 @@ | ||
apiVersion: apps/v1 | ||
kind: Deployment | ||
metadata: | ||
name: xe-link-example | ||
spec: | ||
replicas: 1 | ||
selector: | ||
matchLabels: | ||
app: xe-link-example | ||
template: | ||
metadata: | ||
labels: | ||
app: xe-link-example | ||
annotations: | ||
gas-allocate-xelink: 'true' | ||
spec: | ||
containers: | ||
- name: &containername xe-link-example | ||
image: busybox:1.33.1 | ||
env: | ||
- name: MY_CONTAINER_NAME | ||
value: *containername | ||
command: ['sh', '-c', 'echo $MY_CONTAINER_NAME && ls -ltr /dev/dri && sleep 6000'] | ||
resources: | ||
limits: | ||
gpu.intel.com/i915: 2 | ||
gpu.intel.com/tiles: 2 |