From 24f74f664ca0938435a2d69895db1ba76d320339 Mon Sep 17 00:00:00 2001 From: cyjseagull Date: Fri, 13 Dec 2024 01:00:27 +0800 Subject: [PATCH] mount log --- wedpr-builder/conf/config-example.toml | 4 ++-- wedpr-builder/wedpr_builder/common/constant.py | 2 +- .../config/wedpr_deploy_config.py | 18 +++++++++++++----- 3 files changed, 16 insertions(+), 8 deletions(-) diff --git a/wedpr-builder/conf/config-example.toml b/wedpr-builder/conf/config-example.toml index f9217065..50ccd0e9 100644 --- a/wedpr-builder/conf/config-example.toml +++ b/wedpr-builder/conf/config-example.toml @@ -85,7 +85,7 @@ wedpr_api_token = "" home = "/user/wedpr/agency0" name_node = "127.0.0.1" name_node_port = 9000 - webfs_port = 50700 + webfs_port = 50070 token = "" # enable auth or not, default is false enable_krb5_auth = false @@ -223,7 +223,7 @@ wedpr_api_token = "" home = "/user/wedpr/agency1" name_node = "127.0.0.1" name_node_port = 9000 - webfs_port = 50700 + webfs_port = 50070 token = "" # enable auth or not, default is false enable_krb5_auth = false diff --git a/wedpr-builder/wedpr_builder/common/constant.py b/wedpr-builder/wedpr_builder/common/constant.py index 62d469c1..bcda3ba9 100644 --- a/wedpr-builder/wedpr_builder/common/constant.py +++ b/wedpr-builder/wedpr_builder/common/constant.py @@ -83,7 +83,7 @@ class ConfigInfo: wedpr_pir_docker_dir = "wedpr-pir" wedpr_site_docker_dir = "wedpr-site" wedpr_mpc_docker_dir = "wedpr-mpc-service" - wedpr_model_docker_dir = "wedpr-model" + wedpr_model_docker_dir = "wedpr-model/ppc_model" wedpr_gateway_service_dir = "wedpr-gateway-service" wedpr_node_service_dir = "wedpr-pro-node-service" diff --git a/wedpr-builder/wedpr_builder/config/wedpr_deploy_config.py b/wedpr-builder/wedpr_builder/config/wedpr_deploy_config.py index 9806d6d3..b58ef4a3 100644 --- a/wedpr-builder/wedpr_builder/config/wedpr_deploy_config.py +++ b/wedpr-builder/wedpr_builder/config/wedpr_deploy_config.py @@ -945,7 +945,7 @@ def generate_cpp_component_docker_properties( {constant.ConfigProperities.WEDPR_DOCKER_NAME: docker_name}) return props - def __generate_java_service_docker_properties__(self, prefix_path) -> {}: + def __generate_java_service_docker_properties__(self, prefix_path, mount_log: bool = False) -> {}: props = {} # the config mount info props.update({constant.ConfigProperities.WEDPR_CONFIG_DIR: "conf"}) @@ -956,6 +956,13 @@ def __generate_java_service_docker_properties__(self, prefix_path) -> {}: props.update({constant.ConfigProperities.WEDPR_LOG_DIR: "logs"}) props.update({constant.ConfigProperities.DOCKER_LOG_PATH: constant.ConfigInfo.get_docker_path(f"{prefix_path}/logs")}) + if mount_log: + local_log_path = "${SHELL_FOLDER}/log" + docker_log_path = constant.ConfigInfo.get_docker_path( + f"{prefix_path}/log") + extra_mount_info = f"-v {local_log_path}:{docker_log_path}" + props.update( + {constant.ConfigProperities.EXTENDED_MOUNT_CONF: extra_mount_info}) return props def get_wedpr_site_properties(self, deploy_ip: str, node_index: int) -> {}: @@ -978,11 +985,12 @@ def get_wedpr_site_properties(self, deploy_ip: str, node_index: int) -> {}: # the hdfs config props.update(self.hdfs_storage_config.to_properties()) props.update(self.__generate_java_service_docker_properties__( - constant.ConfigInfo.wedpr_site_docker_dir)) + constant.ConfigInfo.wedpr_site_docker_dir, True)) # add nginx configuration mount local_mount_path = '${SHELL_FOLDER}/conf/nginx.conf' remote_mount_path = "/etc/nginx/nginx.conf" - extended_mount_conf = f" -v {local_mount_path}:{remote_mount_path}" + extended_mount_conf = f" -v {local_mount_path}:{remote_mount_path} " \ + f"{props.get(constant.ConfigProperities.EXTENDED_MOUNT_CONF)}" props.update( {constant.ConfigProperities.EXTENDED_MOUNT_CONF: extended_mount_conf}) return props @@ -1000,7 +1008,7 @@ def get_jupyter_worker_properties(self, deploy_ip: str, node_index: int) -> {}: props.update(self.jupyter_worker_config.to_properties( deploy_ip, node_index)) props.update(self.__generate_java_service_docker_properties__( - constant.ConfigInfo.wedpr_worker_docker_dir)) + constant.ConfigInfo.wedpr_worker_docker_dir, False)) return props def get_pir_properties(self, deploy_ip: str, node_index: int): @@ -1019,7 +1027,7 @@ def get_pir_properties(self, deploy_ip: str, node_index: int): # the hdfs config props.update(self.hdfs_storage_config.to_properties()) props.update(self.__generate_java_service_docker_properties__( - constant.ConfigInfo.wedpr_pir_docker_dir)) + constant.ConfigInfo.wedpr_pir_docker_dir, True)) return props def get_mpc_properties(self, deploy_ip: str, node_index: int):