Skip to content

Commit 4e740a6

Browse files
committed
docs: update README to v0.1.1 and extract usage to USAGE.md
- Bump install snippet to v0.1.1 - Remove WIP warning (module has stable releases) - Move Usage section to USAGE.md, link from README
1 parent 5e3304f commit 4e740a6

2 files changed

Lines changed: 49 additions & 57 deletions

File tree

README.md

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

22

33
# KAI Scheduler API
4-
5-
> [!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-
>
12-
> For now, consume it through KAI Scheduler unless you are prepared to track breaking changes closely.
13-
14-
154
Kubernetes API types and utilities for GPU-aware batch scheduling with KAI Scheduler.
165

176
## Overview
@@ -26,56 +15,12 @@ This module provides the API definitions, generated clients, and utilities for w
2615
## Installation
2716

2817
```bash
29-
go get github.com/kai-scheduler/api@v0.1.0
18+
go get github.com/kai-scheduler/api@v0.1.1
3019
```
3120

3221
## Usage
3322

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-
```
23+
See [USAGE.md](USAGE.md) for code examples covering Queue resources, PodGroups, and GPU utilities.
7924

8025
## CRD Manifests
8126

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)