Compute Node Installation Wizard

Compute Node Installation Wizardx# Date:      Fri Dec 1 09:26:55 2023 +0000
This commit is contained in:
streetycat
2023-12-01 09:26:55 +00:00
committed by zhangzhen
parent eb67980537
commit a001706752
5 changed files with 336 additions and 32 deletions
+12 -30
View File
@@ -28,6 +28,7 @@ sys.path.append(directory + '/../../')
import proxy
from aios import *
import local_compute_node_builder
sys.path.append(directory + '/../../component/')
@@ -402,41 +403,22 @@ class AIOS_Shell:
async def handle_node_commands(self, args):
show_text = FormattedText([("class:title", "sub command not support!\n"
"/node add llama $model_name $url\n"
"/node rm llama $model_name $url\n"
"/node add\n"
"/node rm $model_name $url\n"
"/node list\n")])
if len(args) < 1:
return show_text
sub_cmd = args[0]
if sub_cmd == "add":
if len(args) < 2:
return show_text
if args[1] == "llama":
if len(args) < 4:
return show_text
model_name = args[2]
url = args[3]
ComputeNodeConfig.get_instance().add_node("llama", url, model_name)
ComputeNodeConfig.get_instance().save()
node = LocalLlama_ComputeNode(url, model_name)
node.start()
ComputeKernel.get_instance().add_compute_node(node)
else:
return show_text
await local_compute_node_builder.build(session, shell_style)
elif sub_cmd == "rm":
if len(args) < 2:
return show_text
if args[1] == "llama":
if len(args) < 4:
return show_text
model_name = args[2]
url = args[3]
ComputeNodeConfig.get_instance().remove_node("llama", url, model_name)
ComputeNodeConfig.get_instance().save()
else:
if len(args) < 3:
return show_text
model_name = args[1]
url = args[2]
ComputeNodeConfig.get_instance().remove_node("llama", url, model_name)
ComputeNodeConfig.get_instance().save()
elif sub_cmd == "list":
print_formatted_text(ComputeNodeConfig.get_instance().list())
@@ -785,8 +767,8 @@ async def main():
'/set_config $key',
'/enable $feature',
'/disable $feature',
'/node add llama $model_name $url',
'/node rm llama $model_name $url',
'/node add',
'/node rm $model_name $url',
'/node list',
'/show',
'/exit',