-
Notifications
You must be signed in to change notification settings - Fork 110
Rename demo examples and add per-example documentation #170
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or 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 hidden or 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,31 @@ | ||
| # Demo Examples | ||
|
|
||
| This directory contains example workloads that demonstrate different ways to | ||
| request and configure devices using Dynamic Resource Allocation (DRA). | ||
|
|
||
| Examples prefixed with `basic-` are a good starting point for | ||
| learning about DRA. | ||
|
|
||
| Each example file has detailed comments at the top explaining what it | ||
| demonstrates, what output to expect, and the driver and cluster requirements. | ||
|
|
||
| ## Running Examples | ||
|
|
||
| Each example can be run individually: | ||
|
|
||
| ```bash | ||
| kubectl apply -f demo/<example-name>.yaml | ||
| ``` | ||
|
|
||
| To clean up: | ||
|
|
||
| ```bash | ||
| kubectl delete -f demo/<example-name>.yaml | ||
| ``` | ||
|
|
||
| ## Notes | ||
|
|
||
| - The default Helm chart configures **8 GPUs** per node, which is enough to run | ||
| several examples simultaneously. | ||
| - Each example creates its own namespace, so examples don't interfere with | ||
| each other's resource names. |
This file contains hidden or 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,22 +1,46 @@ | ||
| # One Namespace with admin access label | ||
| # One pod with one container requesting all GPUs with admin access | ||
| # This demo shows the DRA admin access feature with DRA_ADMIN_ACCESS environment variable | ||
| # Example: DRA Admin Access | ||
| # | ||
| # One namespace with admin access label. | ||
| # One pod with one container requesting all GPUs with admin access. | ||
| # This demo shows the DRA admin access feature with DRA_ADMIN_ACCESS | ||
| # environment variable. | ||
| # | ||
| # Key requirements: | ||
| # - The namespace must have the label: | ||
| # resource.kubernetes.io/admin-access: "true" | ||
| # - The request must set adminAccess: true | ||
| # - "allocationMode: All" is used here to access all available GPUs on a Node. | ||
| # Admins typically require access to all devices on a node to perform | ||
| # maintenance or monitoring. | ||
| # | ||
| # Expected: The container has DRA_ADMIN_ACCESS=true and GPU_DEVICE env vars | ||
| # for all available GPUs. Check with: | ||
| # kubectl logs -n admin-access pod0 -c ctr0 | grep DRA_ADMIN_ACCESS | ||
| # kubectl logs -n admin-access pod0 -c ctr0 | grep GPU_DEVICE | ||
|
Comment on lines
+16
to
+19
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Definitely not something we need to do now, but it would be awesome if we could make comments like this drive the e2e tests as well as serve as human-readable documentation. Then we wouldn't need to update the test logic at all when adding an example. |
||
| # | ||
| # Driver requirements: | ||
| # Profile: gpu | ||
| # GPUs: all available on a Node (uses allocationMode: All) | ||
| # | ||
| # Cluster requirements: | ||
| # Kubernetes 1.34+ | ||
| # Feature gate: DRAAdminAccess | ||
|
|
||
| --- | ||
| apiVersion: v1 | ||
| kind: Namespace | ||
| metadata: | ||
| name: gpu-test7 | ||
| name: admin-access | ||
| labels: | ||
| resource.kubernetes.io/admin-access: "true" | ||
| --- | ||
| apiVersion: resource.k8s.io/v1 | ||
| kind: ResourceClaimTemplate | ||
| metadata: | ||
| namespace: gpu-test7 | ||
| namespace: admin-access | ||
| name: multiple-gpus-admin | ||
| spec: | ||
| spec: | ||
| spec: | ||
| devices: | ||
| requests: | ||
| - name: admin-gpu | ||
|
|
@@ -29,7 +53,7 @@ spec: | |
| apiVersion: v1 | ||
| kind: Pod | ||
| metadata: | ||
| namespace: gpu-test7 | ||
| namespace: admin-access | ||
| name: pod0 | ||
| spec: | ||
| containers: | ||
|
|
||
|
willie-yao marked this conversation as resolved.
|
This file contains hidden or 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
|
willie-yao marked this conversation as resolved.
|
This file contains hidden or 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
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm wondering if it makes sense to organize these examples by "profile"? i.e.
demo/admin-access.yaml->demo/gpu/admin-access.yamlAs we add more profiles, that would help users know how to install the driver to run this particular example. On the other hand, more generic features like admin access could work with any profile, so it might become harder to find than in a flat list like this.
Let's not change that right now, but something to consider later.