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-
154Kubernetes 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
0 commit comments