Skip to content

Commit 96b5f88

Browse files
authored
Helm Chart for Kube-AI-Scheduler (#8)
* Helm chart * Copy CRDs mechanism * Github workflow build helm chart
1 parent 0122e86 commit 96b5f88

File tree

7 files changed

+490
-2
lines changed

7 files changed

+490
-2
lines changed

.github/workflows/on-pr.yaml

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,4 +16,15 @@ jobs:
1616
go-version: '1.23.4'
1717

1818
- name: Run validation
19-
run: make validate
19+
run: make validate
20+
21+
- name: Build helm chart
22+
run: |
23+
VERSION=$(git rev-parse --short HEAD)
24+
helm package ./deployments/kube-ai-scheduler -d ./charts --version 0.0.0-$VERSION
25+
26+
- name: Upload helm chart as an artifact
27+
uses: actions/upload-artifact@v4
28+
with:
29+
name: helm-chart
30+
path: ./charts/*.tgz

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
11
bin/
22
.idea/
3+
charts/
34
cover.out

Makefile

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ $(LOCALBIN):
88
CONTROLLER_GEN ?= $(LOCALBIN)/controller-gen
99

1010
.PHONY: validate
11-
validate: generate manifests clients
11+
validate: generate manifests clients copy-crds
1212
git diff --exit-code
1313

1414
.PHONY: generate
@@ -18,11 +18,21 @@ generate: controller-gen ## Generate code containing DeepCopy, DeepCopyInto, and
1818
.PHONY: manifests
1919
manifests: controller-gen ## Generate ClusterRole and CustomResourceDefinition objects.
2020
$(CONTROLLER_GEN) crd:allowDangerousTypes=true,generateEmbeddedObjectMeta=true paths="./pkg/apis/..." output:crd:artifacts:config=config/crd/bases
21+
@echo "**********************************************************"
22+
@echo "* NOTE! *"
23+
@echo "* Whenever you change pkg/apis/ structures, make sure to *"
24+
@echo "* copy them to engine-chart repo. *"
25+
@echo "* run: 'make copy-crds' *"
26+
@echo "**********************************************************"
2127

2228
.PHONY: clients
2329
clients: ## Generate clients.
2430
hack/update-client.sh
2531

32+
.PHONY: copy-crds
33+
copy-crds:
34+
cp -r config/crd/bases/* deployments/kube-ai-scheduler/crds/
35+
2636
.PHONY: controller-gen
2737
controller-gen: $(CONTROLLER_GEN) ## Download controller-gen locally if necessary.
2838
$(CONTROLLER_GEN): $(LOCALBIN)
Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
# Patterns to ignore when building packages.
2+
# This supports shell glob matching, relative path matching, and
3+
# negation (prefixed with !). Only one pattern per line.
4+
.DS_Store
5+
# Common VCS dirs
6+
.git/
7+
.gitignore
8+
.bzr/
9+
.bzrignore
10+
.hg/
11+
.hgignore
12+
.svn/
13+
# Common backup files
14+
*.swp
15+
*.bak
16+
*.tmp
17+
*.orig
18+
*~
19+
# Various IDEs
20+
.project
21+
.idea/
22+
*.tmproj
23+
.vscode/
24+
25+
script/
26+
deploy/
27+
helm-charts/*
28+
subcharts/*
29+
linux-amd64/*
30+
helm-*.tar.gz
31+
operator-sdk
32+
stable-index/*
33+
.*
34+
*.iml
35+
.circleci/
36+
.github/
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
apiVersion: v2
2+
name: kube-ai-scheduler
3+
description: Kube AI Scheduler by NVIDIA
4+
type: application
5+
version: 0.0.0
6+
appVersion: "0.0.0"
Lines changed: 95 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,95 @@
1+
---
2+
apiVersion: apiextensions.k8s.io/v1
3+
kind: CustomResourceDefinition
4+
metadata:
5+
annotations:
6+
controller-gen.kubebuilder.io/version: v0.16.1
7+
name: bindrequests.scheduling.run.ai
8+
spec:
9+
group: scheduling.run.ai
10+
names:
11+
kind: BindRequest
12+
listKind: BindRequestList
13+
plural: bindrequests
14+
singular: bindrequest
15+
scope: Namespaced
16+
versions:
17+
- name: v1alpha2
18+
schema:
19+
openAPIV3Schema:
20+
description: BindRequest is the Schema for the bindrequests API
21+
properties:
22+
apiVersion:
23+
description: |-
24+
APIVersion defines the versioned schema of this representation of an object.
25+
Servers should convert recognized schemas to the latest internal value, and
26+
may reject unrecognized values.
27+
More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources
28+
type: string
29+
kind:
30+
description: |-
31+
Kind is a string value representing the REST resource this object represents.
32+
Servers may infer this from the endpoint the client submits requests to.
33+
Cannot be updated.
34+
In CamelCase.
35+
More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds
36+
type: string
37+
metadata:
38+
type: object
39+
spec:
40+
description: BindRequestSpec defines the desired state of BindRequest
41+
properties:
42+
backoffLimit:
43+
description: BackoffLimit is the number of retries before giving up
44+
format: int32
45+
type: integer
46+
podName:
47+
description: PodName is the name of the pod to bind
48+
type: string
49+
receivedGPU:
50+
description: ReceivedGPU is the amount of GPUs that were received
51+
properties:
52+
count:
53+
description: Count is the amount of GPUs devices that were received
54+
type: integer
55+
portion:
56+
description: |-
57+
This is the portion size that the pod will receive from each connected gpu device
58+
This is a serialized float that should be written as a decimal point number.
59+
type: string
60+
type: object
61+
receivedResourceType:
62+
description: ReceivedResourceType is the type of the resource that
63+
was received [Regular/Fraction]
64+
type: string
65+
selectedGPUGroups:
66+
description: |-
67+
SelectedGPUGroups is the name of the selected GPU groups for fractional GPU resources.
68+
Only if the RecievedResourceType is "Fraction"
69+
items:
70+
type: string
71+
type: array
72+
selectedNode:
73+
description: SelectedNode is the name of the selected node the pod
74+
should be bound to
75+
type: string
76+
type: object
77+
status:
78+
description: BindRequestStatus defines the observed state of BindRequest
79+
properties:
80+
failedAttempts:
81+
description: FailedAttempts is the number of failed attempts
82+
format: int32
83+
type: integer
84+
phase:
85+
description: Phase is the current phase of the bindrequest. [Pending/Succeeded/Failed]
86+
type: string
87+
reason:
88+
description: Reason is the reason for the current phase
89+
type: string
90+
type: object
91+
type: object
92+
served: true
93+
storage: true
94+
subresources:
95+
status: {}

0 commit comments

Comments
 (0)