From 6ecb12f9e385ed819433c0246e1ce3c35cdf81b5 Mon Sep 17 00:00:00 2001 From: Lwy_Robb Date: Sun, 7 Dec 2025 20:07:19 +0800 Subject: [PATCH] feature: support scheduler deploy --- deploy/process/config.sh | 7 +++++-- deploy/process/deploy.sh | 12 +++++++++++- deploy/process/health_check.sh | 2 +- 3 files changed, 17 insertions(+), 4 deletions(-) diff --git a/deploy/process/config.sh b/deploy/process/config.sh index caf6a13..381a661 100644 --- a/deploy/process/config.sh +++ b/deploy/process/config.sh @@ -44,7 +44,7 @@ ds_spill_enable:,ds_spill_directory:,ds_spill_size_limit:,\ ds_rpc_thread_num:,ds_node_timeout_s:,ds_node_dead_timeout_s:,\ ds_heartbeat_interval_ms:,ds_client_dead_timeout_s:,ds_max_client_num:,ds_memory_reclamation_time_second:,\ ds_arena_per_tenant:,ds_enable_fallocate:,ds_enable_huge_tlb:,ds_enable_thp:,\ -enable_faas_frontend:,faas_frontend_http_port:,faas_frontend_grpc_port:,\ +enable_faas_frontend:,faas_frontend_http_port:,faas_frontend_grpc_port:,enable_function_scheduler:,\ function_agent_port:,function_proxy_port:,\ function_proxy_grpc_port:,global_scheduler_port:,runtime_init_port:,\ function_agent_litebus_thread:,function_master_litebus_thread:,function_proxy_litebus_thread:,\ @@ -234,6 +234,7 @@ readonly JEMALLOC_LIB_PATH=$(readlink -m "${BASE_DIR}/../../function_system/lib/ ENABLE_FAAS_FRONTEND="false" FAAS_FRONTEND_HTTP_PORT=8888 FAAS_FRONTEND_GRPC_PORT=31223 +ENABLE_FUNCTION_SCHEDULER="false" # Data System Configuration DS_MASTER_IP="" DS_MASTER_PORT=12123 @@ -441,6 +442,7 @@ function usage() { echo -e " --enable_faas_frontend enable faasfrontend, options:true/false (default false)" echo -e " --faas_frontend_http_port faas frontend http port (default 8888)" echo -e " --faas_frontend_grpc_port faas frontend grpc port (default 31223)" + echo -e " --enable_function_scheduler enable function scheduler, options:true/false (default false)" echo -e " --schedule_relaxed enable the relaxed scheduling policy. When the relaxed number of available nodes or pods is selected, the scheduling progress exits without traversing all nodes or pods.(default 1)" echo -e " --max_priority schedule max priority (default 0)" echo -e " --enable_preemption enable schedule preemption while higher priority, only valid while max_priority > 0 (default false)" @@ -585,6 +587,7 @@ function parse_opt() { --enable_faas_frontend) ENABLE_FAAS_FRONTEND=$2 && shift 2 ;; --faas_frontend_http_port) FAAS_FRONTEND_HTTP_PORT=$2 && port_policy_table["faas_frontend_http_port"]="FIX" && shift 2 ;; --faas_frontend_grpc_port) FAAS_FRONTEND_GRPC_PORT=$2 && port_policy_table["faas_frontend_grpc_port"]="FIX" && shift 2 ;; + --enable_function_scheduler) ENABLE_FUNCTION_SCHEDULER=$2 && shift 2 ;; --min_instance_cpu_size) MIN_INSTANCE_CPU_SIZE=$2 && shift 2 ;; --min_instance_memory_size) MIN_INSTANCE_MEMORY_SIZE=$2 && shift 2 ;; --max_instance_cpu_size) MAX_INSTANCE_CPU_SIZE=$2 && shift 2 ;; @@ -1416,7 +1419,7 @@ function export_config() { # collector export ENABLE_COLLECTOR COLLECTOR_PORT # faas - export ENABLE_FAAS_FRONTEND FAAS_FRONTEND_HTTP_PORT FAAS_FRONTEND_GRPC_PORT + export ENABLE_FAAS_FRONTEND FAAS_FRONTEND_HTTP_PORT FAAS_FRONTEND_GRPC_PORT ENABLE_FUNCTION_SCHEDULER } function main() { diff --git a/deploy/process/deploy.sh b/deploy/process/deploy.sh index 230c684..e0bbfbb 100644 --- a/deploy/process/deploy.sh +++ b/deploy/process/deploy.sh @@ -513,6 +513,14 @@ function start_faas_frontend() { check_and_set_component_checklist "faas_frontend" $FAAS_FRONTEND_PID } +function start_function_scheduler() { + if [ "X${ENABLE_FUNCTION_SCHEDULER}" != "Xtrue" ] && [ "X${ENABLE_FUNCTION_SCHEDULER}" != "XTRUE" ]; then + return 0 + fi + install_function_system "function_scheduler" + check_and_set_component_checklist "function_scheduler" $SCHEDULER_PID +} + function start_dashboard() { if [ "X${ENABLE_DASHBOARD}" != "Xtrue" ] && [ "X${ENABLE_DASHBOARD}" != "XTRUE" ]; then return 0 @@ -661,7 +669,7 @@ function restart_component() { restart_agent_runtime_accessor fi ;; - function_master|ds_master|collector|faas_frontend|dashboard) + function_master|ds_master|collector|faas_frontend|dashboard|function_scheduler) restart_module "$1" ;; etcd) @@ -680,6 +688,7 @@ function restart_component() { terminate_process ${pid_table["collector"]} terminate_process ${pid_table["dashboard"]} terminate_process ${pid_table["faas_frontend"]} + terminate_process ${pid_table["function_scheduler"]} start_control_plane ;; *) @@ -895,6 +904,7 @@ function main() { fi start_function_agent start_faas_frontend + start_function_scheduler start_dashboard start_collector # check all component is working, if not, restart with change port(for control plane only restart). diff --git a/deploy/process/health_check.sh b/deploy/process/health_check.sh index 7c2a9a7..d0f8fb0 100644 --- a/deploy/process/health_check.sh +++ b/deploy/process/health_check.sh @@ -46,7 +46,7 @@ function health_check() { dashboard|collector) dashboard_health_check "$2" ;; - faas_frontend) + faas_frontend|function_scheduler) faas_frontend_health_check "$2" ;; metaservice) -- Gitee