From 267adf7fbcaa4caaba6fc6cb8f33ceac29086184 Mon Sep 17 00:00:00 2001 From: Adir David Date: Wed, 15 Oct 2025 16:20:12 +0300 Subject: [PATCH 1/4] small fixes in site --- site/_core/schemas/connect.js | 2 +- site/learn/Algorithms.md | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/site/_core/schemas/connect.js b/site/_core/schemas/connect.js index 116bb97..a089ebe 100644 --- a/site/_core/schemas/connect.js +++ b/site/_core/schemas/connect.js @@ -31,7 +31,7 @@ this._socket.on('open', () => { name: 'Python', content: {` -this._socket = new WebSocket(this._url); +this._socket = WebSocket(this._url) this._socket.on('open', () => { log.debug("connected"); });`} diff --git a/site/learn/Algorithms.md b/site/learn/Algorithms.md index 36b47a2..3d5c10e 100644 --- a/site/learn/Algorithms.md +++ b/site/learn/Algorithms.md @@ -498,7 +498,7 @@ Each event has a specific handler, as described below. The initialize event is the first event that HKube sends to your algorithm. The payload of this event includes the pipeline data and the input for your algorithm. You need to store the input in a local variable for later use. -> same input as written in the [descriptor](../learn/input/) +> same input as written in the [descriptor](../input/) ```hkube-tabs # { "hkube": true, "schema": "handle-messages-initialize" } From 6a430c40ed8b607b573030f3d09cc6567945c724 Mon Sep 17 00:00:00 2001 From: Adir David Date: Wed, 15 Oct 2025 17:35:22 +0300 Subject: [PATCH 2/4] added kai object explanation --- site/learn/Kai.md | 80 ++++++++++++++++++++++++++++++++++++++++++ site/learn/Sidecars.md | 2 +- 2 files changed, 81 insertions(+), 1 deletion(-) create mode 100644 site/learn/Kai.md diff --git a/site/learn/Kai.md b/site/learn/Kai.md new file mode 100644 index 0000000..69927d7 --- /dev/null +++ b/site/learn/Kai.md @@ -0,0 +1,80 @@ +--- +title: KAI Integration +sidebarTitle: KAI Integration +layout: ../_core/DocsLayout +category: Learn +sublinks: Configuration, Example +permalink: /learn/kai/ +next: /learn/codeapi/ +--- + +The **KAI Scheduler** lets you control how your algorithms use resources. +It allows assigning algorithms to queues, limiting memory, and sharing GPUs between multiple algorithms to improve efficiency. + +## What is KAI Scheduler? + +**KAI Scheduler** is a Kubernetes component that manages how workloads are scheduled. +It supports advanced features like GPU sharing (using fractions of a GPU) and queue prioritization — allowing multiple algorithms to use the same GPU efficiently. + +You can find the KAI Scheduler source code and installation guide [here](https://github.com/NVIDIA/KAI-Scheduler). + +> **Important:** +> To use this feature, the KAI Scheduler **must be installed and configured** in your cluster. +> It requires **Kubernetes version 1.24.x or higher**. +> Make sure all **prerequisites** mentioned in the [KAI GitHub repository](https://github.com/NVIDIA/KAI-Scheduler) are met before enabling this integration. + +--- + +## Configuration + +KAI-related settings are defined in the `kaiObject` section inside your algorithm specification. +This section allows you to control how the algorithm interacts with the scheduler, including queue assignment, memory allocation, and GPU fraction usage. + +**Example of `kaiObject` configuration:** + +```json +{ + "kaiObject": { + "queue": "gpu-queue", + "memory": "512Mi", + "fraction": 0.5 + } +} +``` + +### **Properties** + +| Field | Type | Description | Required | +| :----------- | :----- | :--------------------------------------------------------- | :------- | +| **queue** | string | Name of the KAI queue to assign the algorithm to. | ✅ Yes | +| **memory** | string | Memory limit for the algorithm (e.g., `"512Mi"`, `"1Gi"`). | ❌ No | +| **fraction** | number | Fraction of GPU usage (e.g., `0.5` for 50% GPU). | ❌ No | + +--- + +## Example + +Below is a minimal algorithm configuration that includes `kaiObject`: + +```json +{ + "name": "gpu-fraction-algorithm", + "algorithmImage": "docker.io/hkubedevtest/my-gpu-algo:latest", + "cpu": 0.5, + "mem": "512Mi", + "gpu": 1, + "kaiObject": { + "queue": "gpu-queue", + "memory": "512Mi", + "fraction": 0.5 + } +} +``` + +In this example: + +* The algorithm requests **one GPU** but sets a **fraction of 0.5**, allowing the GPU to be shared between two algorithms. +* The **queue** defines which KAI-managed queue handles this algorithm. +* The **memory** value specifies an optional memory limit. + +--- diff --git a/site/learn/Sidecars.md b/site/learn/Sidecars.md index 48d319e..85c5339 100644 --- a/site/learn/Sidecars.md +++ b/site/learn/Sidecars.md @@ -5,7 +5,7 @@ layout: ../_core/DocsLayout category: Learn sublinks: Container Configuration, Volumes Usage, Environment Variables, Common Errors, Multiple Sidecars permalink: /learn/sidecars/ -next: /learn/codeapi/ +next: /learn/kai/ --- In HKube, sidecars are additional containers that can be added to an algorithm's pod to perform supplementary tasks alongside the main algorithm container. Sidecars are a powerful way to extend the functionality of your algorithm, such as logging, monitoring, or handling auxiliary tasks. From 595e5c14f87989277398a0702ad7039a72e35fea Mon Sep 17 00:00:00 2001 From: Adir David Date: Sun, 19 Oct 2025 16:18:29 +0300 Subject: [PATCH 3/4] updated the version of k8s to 1.33.4 in the documentation --- site/_core/schemas/install.js | 6 +++--- site/learn/InstallHkube.md | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/site/_core/schemas/install.js b/site/_core/schemas/install.js index 489f005..32dfe3c 100644 --- a/site/_core/schemas/install.js +++ b/site/_core/schemas/install.js @@ -10,7 +10,7 @@ const items = [ --addons registry \ --addons registry-aliases \ --addons storage-provisioner \ - --kubernetes-version=v1.23.5`} + --kubernetes-version=v1.33.4`} }, { @@ -21,7 +21,7 @@ const items = [ --addons=registry ^ --addons=registry-aliases ^ --addons=storage-provisioner ^ - --kubernetes-version=v1.23.5`} + --kubernetes-version=v1.33.4`} }, { @@ -32,7 +32,7 @@ const items = [ --addons=registry \ --addons=registry-aliases \ --addons=storage-provisioner \ - --kubernetes-version=v1.23.5`} + --kubernetes-version=v1.33.4`} }, ]; diff --git a/site/learn/InstallHkube.md b/site/learn/InstallHkube.md index bd30cbc..b4e20b8 100644 --- a/site/learn/InstallHkube.md +++ b/site/learn/InstallHkube.md @@ -53,7 +53,7 @@ Current context is now "default" ### 3. Start Minikube Currently HKube requires at least 4 cpu cores and 6GB of memory, ingress controller, registry, and dynamic storage. -HKube was tested on Kubernetes v1.23.5, so to run it properly, start Minikube with: +HKube was tested on Kubernetes v1.33.4, so to run it properly, start Minikube with: ```hkube-tabs-with-copy # { "hkube": true, "schema": "install" } ``` From e8bb7c21e10fd57908c4981b68d804859d2a1eed Mon Sep 17 00:00:00 2001 From: Adir David Date: Mon, 27 Oct 2025 11:32:23 +0200 Subject: [PATCH 4/4] Added runtime resources limits info --- site/learn/Kai.md | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/site/learn/Kai.md b/site/learn/Kai.md index 69927d7..fddd2a4 100644 --- a/site/learn/Kai.md +++ b/site/learn/Kai.md @@ -21,7 +21,8 @@ You can find the KAI Scheduler source code and installation guide [here](https:/ > **Important:** > To use this feature, the KAI Scheduler **must be installed and configured** in your cluster. > It requires **Kubernetes version 1.24.x or higher**. -> Make sure all **prerequisites** mentioned in the [KAI GitHub repository](https://github.com/NVIDIA/KAI-Scheduler) are met before enabling this integration. +> Make sure all **prerequisites** mentioned in the [KAI GitHub repository](https://github.com/NVIDIA/KAI-Scheduler) are met before enabling this integration. +> If your algorithm tries to use more resources than assigned at runtime, the request will not be strictly limited. ---