Skip to content

Commit 6383264

Browse files
committed
docs: update README to v0.1.1 and extract usage to USAGE.md
- Bump install snippet to v0.1.1 - Move Usage section to USAGE.md, link from README Signed-off-by: SiorMeir <msior@nvidia.com>
1 parent 5e3304f commit 6383264

3 files changed

Lines changed: 58 additions & 54 deletions

File tree

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
kind: Changed
2+
body: Move Usage section from README to USAGE.md and bump install snippet to v0.1.1.
3+
custom:
4+
Issue: "12"
5+
Author: SiorMeir

README.md

Lines changed: 6 additions & 54 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,13 @@
11

22

33
# KAI Scheduler API
4-
54
> [!WARNING]
6-
> 🚧 **Work in progress** 🚧
7-
>
8-
> This module is still under active development 🛠️.
9-
>
10-
> APIs may change without notice, and it is not yet recommended for direct production use ⚠️.
11-
>
5+
> 🚧 **Work in progress** 🚧
6+
>
7+
> This module is still under active development. APIs may change without notice and direct production use is not yet recommended.
8+
>
129
> For now, consume it through KAI Scheduler unless you are prepared to track breaking changes closely.
1310
14-
1511
Kubernetes API types and utilities for GPU-aware batch scheduling with KAI Scheduler.
1612

1713
## Overview
@@ -26,56 +22,12 @@ This module provides the API definitions, generated clients, and utilities for w
2622
## Installation
2723

2824
```bash
29-
go get github.com/kai-scheduler/api@v0.1.0
25+
go get github.com/kai-scheduler/api@v0.1.1
3026
```
3127

3228
## Usage
3329

34-
### Working with Queue Resources
35-
36-
```go
37-
import (
38-
queuev2 "github.com/kai-scheduler/api/scheduling/v2"
39-
"github.com/kai-scheduler/api/client/clientset/versioned"
40-
)
41-
42-
// Create a clientset
43-
config, _ := rest.InClusterConfig()
44-
client, _ := versioned.NewForConfig(config)
45-
46-
// List queues
47-
queues, _ := client.SchedulingV2().Queues().List(context.TODO(), metav1.ListOptions{})
48-
```
49-
50-
### Working with PodGroups
51-
52-
```go
53-
import (
54-
podgroupv2alpha2 "github.com/kai-scheduler/api/scheduling/v2alpha2"
55-
"github.com/kai-scheduler/api/utilities/podgroup"
56-
)
57-
58-
// Calculate preemptibility from priority
59-
preemptibility := podgroup.CalculatePreemptibility("", int32(50))
60-
// Returns v2alpha2.Preemptible (priority < 100 = preemptible)
61-
```
62-
63-
### GPU Resource Utilities
64-
65-
```go
66-
import (
67-
"github.com/kai-scheduler/api/utilities/resources"
68-
)
69-
70-
// Check if pod requests GPU fractions
71-
if resources.RequestsGPUFraction(pod) {
72-
fraction := resources.GetGPUFraction(pod)
73-
memory := resources.GetGPUMemory(pod)
74-
}
75-
76-
// Extract DRA GPU resources
77-
gpuResources, _ := resources.ExtractDRAGPUResources(ctx, pod, k8sClient)
78-
```
30+
See [USAGE.md](USAGE.md) for code examples covering Queue resources, PodGroups, and GPU utilities.
7931

8032
## CRD Manifests
8133

USAGE.md

Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
# Usage
2+
3+
## Working with Queue Resources
4+
5+
```go
6+
import (
7+
queuev2 "github.com/kai-scheduler/api/scheduling/v2"
8+
"github.com/kai-scheduler/api/client/clientset/versioned"
9+
)
10+
11+
// Create a clientset
12+
config, _ := rest.InClusterConfig()
13+
client, _ := versioned.NewForConfig(config)
14+
15+
// List queues
16+
queues, _ := client.SchedulingV2().Queues().List(context.TODO(), metav1.ListOptions{})
17+
```
18+
19+
## Working with PodGroups
20+
21+
```go
22+
import (
23+
podgroupv2alpha2 "github.com/kai-scheduler/api/scheduling/v2alpha2"
24+
"github.com/kai-scheduler/api/utilities/podgroup"
25+
)
26+
27+
// Calculate preemptibility from priority
28+
preemptibility := podgroup.CalculatePreemptibility("", int32(50))
29+
// Returns v2alpha2.Preemptible (priority < 100 = preemptible)
30+
```
31+
32+
## GPU Resource Utilities
33+
34+
```go
35+
import (
36+
"github.com/kai-scheduler/api/utilities/resources"
37+
)
38+
39+
// Check if pod requests GPU fractions
40+
if resources.RequestsGPUFraction(pod) {
41+
fraction := resources.GetGPUFraction(pod)
42+
memory := resources.GetGPUMemory(pod)
43+
}
44+
45+
// Extract DRA GPU resources
46+
gpuResources, _ := resources.ExtractDRAGPUResources(ctx, pod, k8sClient)
47+
```

0 commit comments

Comments
 (0)