Skip to content

Commit

Permalink
Kaito deployment & ux updates (#1001)
Browse files Browse the repository at this point in the history
Co-authored-by: tejhan-diallo <[email protected]>
  • Loading branch information
tejhan and tejhan-diallo authored Oct 18, 2024
1 parent 022e2a7 commit da9288b
Show file tree
Hide file tree
Showing 24 changed files with 1,598 additions and 194 deletions.
2 changes: 2 additions & 0 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

17 changes: 15 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -312,6 +312,10 @@
"command": "aks.aksKaitoGenerateYaml",
"title": "Create Kaito Workspace"
},
{
"command": "aks.aksKaitoCreateCRD",
"title": "Create Kaito Workspace"
},
{
"command": "aks.aksKaito",
"title": "Install Kaito"
Expand Down Expand Up @@ -413,6 +417,11 @@
"submenu": "aks.networkTroubleshootingSubMenu",
"when": "view == kubernetes.cloudExplorer && viewItem =~ /aks\\.cluster/i",
"group": "9@3"
},
{
"submenu": "aks.kaitoInstallSubMenu",
"when": "view == kubernetes.cloudExplorer && viewItem =~ /aks\\.cluster/i",
"group": "9@3"
}
],
"aks.createClusterSubMenu": [
Expand All @@ -427,11 +436,11 @@
],
"aks.kaitoInstallSubMenu": [
{
"command": "aks.aksKaitoGenerateYaml",
"command": "aks.aksKaito",
"group": "navigation"
},
{
"command": "aks.aksKaito",
"command": "aks.aksKaitoCreateCRD",
"group": "navigation"
}
],
Expand Down Expand Up @@ -534,6 +543,10 @@
{
"id": "aks.networkTroubleshootingSubMenu",
"label": "Troubleshoot Network Health"
},
{
"id": "aks.kaitoInstallSubMenu",
"label": "Deploy a LLM with KAITO (Beta)"
}
]
},
Expand Down
120 changes: 60 additions & 60 deletions resources/kaitollmconfig/kaitollmconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,14 +9,14 @@
"falcon-40b"
],
"llama2": [
"llama2-7b",
"llama2-13b",
"llama2-70b"
"llama-2-7b",
"llama-2-13b",
"llama-2-70b"
],
"llma2chat": [
"llama2-7b-chat",
"llama2-13b-chat",
"llama2-70b-chat"
"llama2chat": [
"llama-2-7b-chat",
"llama-2-13b-chat",
"llama-2-70b-chat"
],
"mistral": [
"mistral-7b-instruct",
Expand All @@ -36,121 +36,121 @@
{
"family": "falcon",
"modelName": "falcon-7b-instruct",
"kaitoVersion": "1.0",
"kaitoVersion": "v0.0.1+",
"minimumGpu": "Standard_NC12s_v3",
"modelSource": "https://huggingface.co/tiiuae/falcon-7b-instruct/commit/cf4b3c42ce2fdfe24f753f0f0d179202fea59c99"
"modelSource": "https://huggingface.co/tiiuae/falcon-7b-instruct"
},
{
"family": "falcon",
"modelName": "falcon-7b",
"kaitoVersion": "1.0",
"kaitoVersion": "v0.0.1+",
"minimumGpu": "Standard_NC12s_v3",
"modelSource": "https://huggingface.co/tiiuae/falcon-7b/commit/898df1396f35e447d5fe44e0a3ccaaaa69f30d36"
"modelSource": "https://huggingface.co/tiiuae/falcon-7b"
},
{
"family": "falcon",
"modelName": "falcon-40b-instruct",
"kaitoVersion": "1.0",
"minimumGpu": "Standard_NC12s_v3",
"modelSource": "https://huggingface.co/tiiuae/falcon-40b-instruct/commit/ecb78d97ac356d098e79f0db222c9ce7c5d9ee5f"
"kaitoVersion": "v0.0.1+",
"minimumGpu": "Standard_NC96ads_A100_v4",
"modelSource": "https://huggingface.co/tiiuae/falcon-40b-instruct"
},
{
"family": "falcon",
"modelName": "falcon-40b",
"kaitoVersion": "1.0",
"minimumGpu": "Standard_NC12s_v3",
"modelSource": "https://huggingface.co/tiiuae/falcon-40b/commit/4a70170c215b36a3cce4b4253f6d0612bb7d4146"
"kaitoVersion": "v0.0.1+",
"minimumGpu": "Standard_NC96ads_A100_v4",
"modelSource": "https://huggingface.co/tiiuae/falcon-40b"
},
{
"family": "llama2",
"modelName": "llama2-7b",
"kaitoVersion": "1.0",
"modelName": "llama-2-7b",
"kaitoVersion": "v0.0.1+",
"minimumGpu": "Standard_NC12s_v3",
"modelSource": "https://huggingface.co/meta-llama"
"modelSource": "https://huggingface.co/meta-llama/Llama-2-7b"
},
{
"family": "llama2",
"modelName": "llama2-13b",
"kaitoVersion": "1.0",
"modelName": "llama-2-13b",
"kaitoVersion": "v0.0.1+",
"minimumGpu": "Standard_NC12s_v3",
"modelSource": "https://huggingface.co/meta-llama"
"modelSource": "https://huggingface.co/meta-llama/Llama-2-13b"
},
{
"family": "llama2",
"modelName": "llama2-70b",
"kaitoVersion": "1.0",
"minimumGpu": "Standard_NC12s_v3",
"modelSource": "https://huggingface.co/meta-llama"
"modelName": "llama-2-70b",
"kaitoVersion": "v0.0.1+",
"minimumGpu": "Standard_NC96ads_A100_v4",
"modelSource": "https://huggingface.co/meta-llama/Llama-2-70b"
},
{
"family": "llma2chat",
"modelName": "llama2-7b-chat",
"kaitoVersion": "1.0",
"family": "llama2chat",
"modelName": "llama-2-7b-chat",
"kaitoVersion": "v0.0.1+",
"minimumGpu": "Standard_NC12s_v3",
"modelSource": "https://huggingface.co/meta-llama"
"modelSource": "https://huggingface.co/meta-llama/Llama-2-7b-chat"
},
{
"family": "llma2chat",
"modelName": "llama2-13b-chat",
"kaitoVersion": "1.0",
"family": "llama2chat",
"modelName": "llama-2-13b-chat",
"kaitoVersion": "v0.0.1+",
"minimumGpu": "Standard_NC12s_v3",
"modelSource": "https://huggingface.co/meta-llama"
"modelSource": "https://huggingface.co/meta-llama/Llama-2-13b-chat"
},
{
"family": "llma2chat",
"modelName": "llama2-70b-chat",
"kaitoVersion": "1.0",
"minimumGpu": "Standard_NC12s_v3",
"modelSource": "https://huggingface.co/meta-llama"
"family": "llama2chat",
"modelName": "llama-2-70b-chat",
"kaitoVersion": "v0.0.1+",
"minimumGpu": "Standard_NC96ads_A100_v4",
"modelSource": "https://huggingface.co/meta-llama/Llama-2-70b-chat"
},
{
"family": "mistral",
"modelName": "mistral-7b-instruct",
"kaitoVersion": "1.0",
"kaitoVersion": "v0.2.0+",
"minimumGpu": "Standard_NC12s_v3",
"modelSource": "https://huggingface.co/mistralai/Mistral-7B-Instruct-v0.3/commit/0417f4babd26db0b5ed07c1d0bc85658ab526ea3"
"modelSource": "https://huggingface.co/mistralai/Mistral-7B-Instruct-v0.3"
},
{
"family": "mistral",
"modelName": "mistral-7b",
"kaitoVersion": "1.0",
"kaitoVersion": "v0.2.0+",
"minimumGpu": "Standard_NC12s_v3",
"modelSource": "https://huggingface.co/mistralai/Mistral-7B-v0.3/commit/c882233d224d27b727b3d9299b12a9aab9dda6f7"
"modelSource": "https://huggingface.co/mistralai/Mistral-7B-v0.3"
},
{
"family": "phi-2",
"modelName": "phi-2",
"kaitoVersion": "1.0",
"minimumGpu": "Standard_NC12s_v3",
"modelSource": "https://huggingface.co/microsoft/phi-2/commit/b10c3eba545ad279e7208ee3a5d644566f001670"
"kaitoVersion": "v0.2.0+",
"minimumGpu": "Standard_NC6s_v3",
"modelSource": "https://huggingface.co/microsoft/phi-2"
},
{
"family": "phi-3",
"family": "phi-3",
"modelName": "phi-3-mini-4k-instruct",
"kaitoVersion": "1.0",
"minimumGpu": "Standard_NC12s_v3",
"modelSource": "https://huggingface.co/microsoft/Phi-3-mini-4k-instruct/commit/d269012bea6fbe38ce7752c8940fea010eea3383"
"kaitoVersion": "v0.3.0+",
"minimumGpu": "Standard_NC6s_v3",
"modelSource": "https://huggingface.co/microsoft/Phi-3-mini-4k-instruct"
},
{
"family": "phi-3",
"modelName": "phi-3-mini-128k-instruct",
"kaitoVersion": "1.0",
"minimumGpu": "Standard_NC12s_v3",
"modelSource": "https://huggingface.co/microsoft/Phi-3-mini-128k-instruct/commit/5be6479b4bc06a081e8f4c6ece294241ccd32dec"
"kaitoVersion": "v0.3.0+",
"minimumGpu": "Standard_NC6s_v3",
"modelSource": "https://huggingface.co/microsoft/Phi-3-mini-128k-instruct"
},
{
"family": "phi-3",
"modelName": "phi-3-medium-4k-instruct",
"kaitoVersion": "1.0",
"minimumGpu": "Standard_NC12s_v3",
"modelSource": "https://huggingface.co/microsoft/Phi-3-medium-4k-instruct/commit/d194e4e74ffad5a5e193e26af25bcfc80c7f1ffc"
"kaitoVersion": "v0.3.0+",
"minimumGpu": "Standard_NC24ads_A100_v4",
"modelSource": "https://huggingface.co/microsoft/Phi-3-medium-4k-instruct"
},
{
"family": "phi-3",
"modelName": "phi-3-medium-128k-instruct",
"kaitoVersion": "1.0",
"minimumGpu": "Standard_NC12s_v3",
"modelSource": "https://huggingface.co/microsoft/Phi-3-medium-128k-instruct/commit/cae1d42b5577398fd1be9f0746052562ae552886"
"kaitoVersion": "v0.3.0+",
"minimumGpu": "Standard_NC24ads_A100_v4",
"modelSource": "https://huggingface.co/microsoft/Phi-3-medium-128k-instruct"
}
],
"docref": "https://github.com/Azure/kaito/blob/main/presets/models/supported_models.yaml"
Expand Down
4 changes: 2 additions & 2 deletions src/commands/aksKaito/aksKaito.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,13 +12,12 @@ export default async function aksKaito(_context: IActionContext, target: unknown
const cloudExplorer = await k8s.extension.cloudExplorer.v1;
const clusterExplorer = await k8s.extension.clusterExplorer.v1;
const kubectl = await k8s.extension.kubectl.v1;

const maintarget = target;
const sessionProvider = await getReadySessionProvider();
if (failed(sessionProvider)) {
vscode.window.showErrorMessage(sessionProvider.error);
return;
}

if (!cloudExplorer.available) {
vscode.window.showWarningMessage(`Cloud explorer is unavailable.`);
return;
Expand Down Expand Up @@ -79,6 +78,7 @@ export default async function aksKaito(_context: IActionContext, target: unknown
filterKaitoPodNames.succeeded ? filterKaitoPodNames.result : [],
kubectl,
kubeConfigFile.filePath,
maintarget,
);

panel.show(dataProvider);
Expand Down
87 changes: 87 additions & 0 deletions src/commands/aksKaito/aksKaitoCreateCRD.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,87 @@
import { IActionContext } from "@microsoft/vscode-azext-utils";
import * as vscode from "vscode";
import * as tmpfile from "../utils/tempfile";
import * as k8s from "vscode-kubernetes-tools-api";
import { getKubernetesClusterInfo } from "../utils/clusters";
import { getReadySessionProvider } from "../../auth/azureAuth";
import { KaitoModelsPanelDataProvider } from "../../panels/KaitoModelsPanel";
import { KaitoModelsPanel } from "../../panels/KaitoModelsPanel";
import { filterPodName, getAksClusterTreeNode } from "../utils/clusters";
import { failed } from "../utils/errorable";
import { getExtension, longRunning } from "../utils/host";

export default async function aksKaitoCreateCRD(_context: IActionContext, target: unknown): Promise<void> {
const cloudExplorer = await k8s.extension.cloudExplorer.v1;
const clusterExplorer = await k8s.extension.clusterExplorer.v1;
const kubectl = await k8s.extension.kubectl.v1;

const sessionProvider = await getReadySessionProvider();
if (failed(sessionProvider)) {
vscode.window.showErrorMessage(sessionProvider.error);
return;
}

const clusterNode = getAksClusterTreeNode(target, cloudExplorer);
if (failed(clusterNode)) {
vscode.window.showErrorMessage(clusterNode.error);
return;
}

const extension = getExtension();
if (failed(extension)) {
vscode.window.showErrorMessage(extension.error);
return;
}

if (!kubectl.available) {
vscode.window.showWarningMessage(`Kubectl is unavailable.`);
return;
}

if (!cloudExplorer.available) {
vscode.window.showWarningMessage(`Cloud explorer is unavailable.`);
return;
}

if (!clusterExplorer.available) {
vscode.window.showWarningMessage(`Cluster explorer is unavailable.`);
return;
}

const clusterName = clusterNode.result.name;
const armId = clusterNode.result.armId;
const subscriptionId = clusterNode.result.subscriptionId;
const resourceGroupName = clusterNode.result.resourceGroupName;
const filterKaitoPodNames = await longRunning(`Checking if KAITO is installed.`, () => {
return filterPodName(sessionProvider.result, kubectl, subscriptionId, resourceGroupName, clusterName, "kaito-");
});

if (failed(filterKaitoPodNames)) {
vscode.window.showErrorMessage(filterKaitoPodNames.error);
return;
}

if (filterKaitoPodNames.result.length === 0) {
vscode.window.showInformationMessage(
`Please install Kaito for cluster ${clusterName}. \n \n Kaito Workspace generation is only enabled when kaito is installed. Skipping generation.`,
);
return;
}
const clusterInfo = await getKubernetesClusterInfo(sessionProvider.result, target, cloudExplorer, clusterExplorer);
if (failed(clusterInfo)) {
vscode.window.showErrorMessage(clusterInfo.error);
return;
}
const kubeConfigFile = await tmpfile.createTempFile(clusterInfo.result.kubeconfigYaml, "yaml");

const panel = new KaitoModelsPanel(extension.result.extensionUri);
const dataProvider = new KaitoModelsPanelDataProvider(
clusterName,
subscriptionId,
resourceGroupName,
armId,
kubectl,
kubeConfigFile.filePath,
);
panel.show(dataProvider);
}
2 changes: 1 addition & 1 deletion src/commands/aksKaito/akskaitoGenerateYaml.ts
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@ function listKaitoSUpportedModel() {
const modelList = [
kaitoSupporterModel.modelsupported.falcon,
kaitoSupporterModel.modelsupported.llama2,
kaitoSupporterModel.modelsupported.llma2chat,
kaitoSupporterModel.modelsupported.llama2chat,
kaitoSupporterModel.modelsupported.mistral,
kaitoSupporterModel.modelsupported["phi-2"],
kaitoSupporterModel.modelsupported["phi-3"],
Expand Down
Loading

0 comments on commit da9288b

Please sign in to comment.