@@ -867,10 +867,12 @@ def to_properties(self) -> {}:
867867 {constant .ConfigProperities .WEDPR_API_TOKEN : self .wedpr_api_token })
868868 # EXTENDED_MOUNT_CONF default is empty string
869869 props .update ({constant .ConfigProperities .EXTENDED_MOUNT_CONF : "" })
870+ props .update ({constant .ConfigProperities .DOCKER_CMD : "" })
870871 return props
871872
872873 def get_wedpr_model_properties (self , deploy_ip : str , node_index : int ) -> {}:
873874 props = self .to_properties ()
875+ prefix_path = constant .ConfigInfo .wedpr_model_docker_dir
874876 # the zone config
875877 props .update (self .env_config .to_properties ())
876878 # the sql config
@@ -884,21 +886,25 @@ def get_wedpr_model_properties(self, deploy_ip: str, node_index: int) -> {}:
884886 props .update (
885887 {constant .ConfigProperities .WEDPR_CONFIG_DIR : "application.yml" })
886888 props .update (
887- {constant .ConfigProperities .DOCKER_CONF_PATH : constant .ConfigInfo .get_docker_path ("model /application.yml" )})
889+ {constant .ConfigProperities .DOCKER_CONF_PATH : constant .ConfigInfo .get_docker_path (f" { prefix_path } /application.yml" )})
888890 # the extended mount info
889891 local_path = "${SHELL_FOLDER}/logging.conf"
890- docker_path = constant .ConfigInfo .get_docker_path ("model/logging.conf" )
892+ docker_path = constant .ConfigInfo .get_docker_path (os .path .join (
893+ prefix_path , "logging.conf" ))
891894 extended_mount_info = f" -v { local_path } :{ docker_path } "
892895 local_path = "${SHELL_FOLDER}/wedpr_sdk_log_config.ini"
893896 docker_path = constant .ConfigInfo .get_docker_path (
894- "model/ wedpr_sdk_log_config.ini" )
897+ os . path . join ( prefix_path , " wedpr_sdk_log_config.ini") )
895898 extended_mount_info = f"{ extended_mount_info } -v { local_path } :{ docker_path } "
899+ # set the working directory
900+ working_dir = constant .ConfigInfo .get_docker_path (prefix_path )
901+ extended_mount_info = f"{ extended_mount_info } -w { working_dir } "
896902 props .update (
897903 {constant .ConfigProperities .EXTENDED_MOUNT_CONF : extended_mount_info })
898904 # set the log mount information
899905 props .update ({constant .ConfigProperities .WEDPR_LOG_DIR : "logs" })
900906 props .update ({constant .ConfigProperities .DOCKER_LOG_PATH :
901- constant .ConfigInfo .get_docker_path ("model /logs" )})
907+ constant .ConfigInfo .get_docker_path (f" { constant . ConfigInfo . wedpr_model_docker_dir } /logs" )})
902908 return props
903909
904910 @staticmethod
@@ -907,26 +913,20 @@ def generate_cpp_component_docker_properties(
907913 prefix_path , zone_name : str , service_type : str , env_config ,
908914 exposed_port_list : str , node_index : int ):
909915 props = {}
910- # the config mount info
916+ # the config mount info: mount the whole directory
911917 props .update (
912- {constant .ConfigProperities .WEDPR_CONFIG_DIR : "config.ini " })
913- path = constant .ConfigInfo .get_docker_path (f"{ prefix_path } /config.ini " )
918+ {constant .ConfigProperities .WEDPR_CONFIG_DIR : "" })
919+ path = constant .ConfigInfo .get_docker_path (f"{ prefix_path } /" )
914920 props .update (
915921 {constant .ConfigProperities .DOCKER_CONF_PATH : path })
916- # set the extended mont config
917- local_mount_dir = '${SHELL_FOLDER}/conf'
918- remote_mount_dir = constant .ConfigInfo .get_docker_path (
919- f"{ prefix_path } /conf" )
920- extended_mount_conf = f" -v { local_mount_dir } :{ remote_mount_dir } "
921- # nodes.json for gateway service
922- if service_type == constant .ServiceInfo .gateway_service_type :
923- node_connection_file = "nodes.json"
924- local_mount_dir = '${SHELL_FOLDER}/%s' % node_connection_file
925- remote_mount_dir = constant .ConfigInfo .get_docker_path (
926- f"{ prefix_path } /{ node_connection_file } " )
927- extended_mount_conf = f"{ extended_mount_conf } -v { local_mount_dir } :{ remote_mount_dir } "
922+ # set the working directory
923+ working_dir = constant .ConfigInfo .get_docker_path (f"{ prefix_path } " )
924+ extended_mount_conf = f" -w { working_dir } "
928925 props .update (
929926 {constant .ConfigProperities .EXTENDED_MOUNT_CONF : extended_mount_conf })
927+ # specify the cmd
928+ props .update (
929+ {constant .ConfigProperities .DOCKER_CMD : f"{ constant .ConfigInfo .cpp_component_cmd } " })
930930 # specify the log path to mount
931931 props .update ({constant .ConfigProperities .WEDPR_LOG_DIR : "log" })
932932 props .update ({constant .ConfigProperities .DOCKER_LOG_PATH :
@@ -1032,16 +1032,24 @@ def get_mpc_properties(self, deploy_ip: str, node_index: int):
10321032 # the config mount info
10331033 docker_prefix_path = constant .ConfigInfo .wedpr_mpc_docker_dir
10341034 props .update (
1035- {constant .ConfigProperities .WEDPR_CONFIG_DIR : "config.ini " })
1035+ {constant .ConfigProperities .WEDPR_CONFIG_DIR : "" })
10361036 path = constant .ConfigInfo .get_docker_path (
1037- f"{ docker_prefix_path } /config.ini " )
1037+ f"{ docker_prefix_path } " )
10381038 props .update (
10391039 {constant .ConfigProperities .DOCKER_CONF_PATH : path })
10401040
10411041 # specify the log path to mount
10421042 props .update ({constant .ConfigProperities .WEDPR_LOG_DIR : "log" })
10431043 props .update ({constant .ConfigProperities .DOCKER_LOG_PATH :
10441044 constant .ConfigInfo .get_docker_path (f"{ docker_prefix_path } /log" )})
1045+ # specify the extended mount info
1046+ working_directory = constant .ConfigInfo .get_docker_path (
1047+ docker_prefix_path )
1048+ props .update (
1049+ {constant .ConfigProperities .EXTENDED_MOUNT_CONF : f" -w { working_directory } " })
1050+ # specify the docker command
1051+ props .update (
1052+ {constant .ConfigProperities .DOCKER_CMD : constant .ConfigInfo .cpp_component_cmd })
10451053 return props
10461054
10471055 def __update_dml__ (self , sql , dml_file_path , use_double_quote = False ):
0 commit comments