Skip to content

Commit 04375d7

Browse files
committed
Add CI
1 parent deccac7 commit 04375d7

File tree

3 files changed

+124
-1
lines changed

3 files changed

+124
-1
lines changed

.github/workflows/on-pr.yaml

Lines changed: 63 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,63 @@
1+
# Copyright 2025 NVIDIA CORPORATION
2+
# SPDX-License-Identifier: Apache-2.0
3+
4+
name: KAI Scheduler - Pull Request
5+
on:
6+
pull_request:
7+
8+
jobs:
9+
test-build-and-push:
10+
name: Test & Build & Push
11+
runs-on: ubuntu-latest
12+
steps:
13+
- name: Checkout code
14+
uses: actions/checkout@v2
15+
16+
- name: Extract package version
17+
run: |
18+
echo "PACKAGE_VERSION=0.0.0-$(git rev-parse --short HEAD)" >> $GITHUB_ENV
19+
20+
- name: Set up Go
21+
uses: actions/setup-go@v5
22+
with:
23+
go-version: '1.23.4'
24+
25+
- name: Login to NGC Container registry
26+
uses: docker/login-action@v3
27+
with:
28+
registry: nvcr.io
29+
username: $oauthtoken
30+
password: ${{ secrets.NGC_API_KEY }}
31+
32+
- name: Set up Docker Buildx
33+
uses: docker/setup-buildx-action@v3
34+
35+
- name: Set up helm
36+
env:
37+
NGC_API_KEY: ${{ secrets.NGC_API_KEY }}
38+
run: |
39+
helm repo add nvstaging https://helm.ngc.nvidia.com/nvstaging/runai --username=\$oauthtoken --password=$NGC_API_KEY
40+
helm plugin install https://github.com/chartmuseum/helm-push
41+
42+
- name: Run validation
43+
run: make validate
44+
45+
- name: Run tests
46+
run: make test
47+
48+
- name: Docker build & push
49+
run: make build DOCKER_BUILD_PLATFORM=linux/amd64,linux/arm64 VERSION=$PACKAGE_VERSION DOCKER_BUILDX_ADDITIONAL_ARGS=--push
50+
51+
- name: Build helm chart
52+
run: |
53+
helm package ./deployments/kai-scheduler -d ./charts --version $PACKAGE_VERSION
54+
55+
- name: Upload helm chart as an artifact
56+
uses: actions/upload-artifact@v4
57+
with:
58+
name: helm-chart
59+
path: ./charts/*.tgz
60+
61+
- name: Upload helm chart to NGC
62+
run: |
63+
helm cm-push ./charts/kai-scheduler-$PACKAGE_VERSION.tgz nvstaging

.github/workflows/on-release.yaml

Lines changed: 60 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,60 @@
1+
# Copyright 2025 NVIDIA CORPORATION
2+
# SPDX-License-Identifier: Apache-2.0
3+
4+
name: KAI Scheduler - Release
5+
on:
6+
release:
7+
types:
8+
- created
9+
10+
jobs:
11+
test-build-and-push:
12+
name: Test & Build & Push
13+
runs-on: ubuntu-latest
14+
steps:
15+
- name: Checkout code
16+
uses: actions/checkout@v2
17+
18+
- name: Extract package version
19+
run: |
20+
echo "PACKAGE_VERSION=$(GITHUB_REF/refs\/tags\//)" >> $GITHUB_ENV
21+
22+
- name: Set up Go
23+
uses: actions/setup-go@v5
24+
with:
25+
go-version: '1.23.4'
26+
27+
- name: Login to NGC Container registry
28+
uses: docker/login-action@v3
29+
with:
30+
registry: nvcr.io
31+
username: $oauthtoken
32+
password: ${{ secrets.NGC_API_KEY }}
33+
34+
- name: Set up helm
35+
env:
36+
NGC_API_KEY: ${{ secrets.NGC_API_KEY }}
37+
run: |
38+
helm repo add nvstaging https://helm.ngc.nvidia.com/nvstaging/runai --username=\$oauthtoken --password=$NGC_API_KEY
39+
helm plugin install https://github.com/chartmuseum/helm-push
40+
41+
- name: Run tests
42+
run: make test
43+
44+
- name: Docker build & push
45+
run: make build DOCKER_BUILD_PLATFORM=linux/amd64,linux/arm64 VERSION=$PACKAGE_VERSION DOCKER_BUILDX_ADDITIONAL_ARGS=--push
46+
47+
- name: Build helm chart
48+
run: |
49+
helm package ./deployments/kai-scheduler -d ./charts --version $PACKAGE_VERSION
50+
51+
- name: Upload As Release Asset
52+
uses: softprops/action-gh-release@v1
53+
with:
54+
files: charts/*.tgz
55+
env:
56+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
57+
58+
- name: Upload helm chart to NGC
59+
run: |
60+
helm cm-push ./charts/kai-scheduler-$PACKAGE_VERSION.tgz nvstaging

deployments/kai-scheduler/Chart.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33

44
apiVersion: v2
55
name: kai-scheduler
6-
description: Kube AI Scheduler by NVIDIA
6+
description: KAI Scheduler by NVIDIA
77
type: application
88
version: 0.0.0
99
appVersion: "0.0.0"

0 commit comments

Comments
 (0)