Skip to content

Commit

Permalink
mount log
Browse files Browse the repository at this point in the history
  • Loading branch information
cyjseagull committed Dec 12, 2024
1 parent c94a6c5 commit 24f74f6
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 8 deletions.
4 changes: 2 additions & 2 deletions wedpr-builder/conf/config-example.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion wedpr-builder/wedpr_builder/common/constant.py
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
18 changes: 13 additions & 5 deletions wedpr-builder/wedpr_builder/config/wedpr_deploy_config.py
Original file line number Diff line number Diff line change
Expand Up @@ -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"})
Expand All @@ -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) -> {}:
Expand All @@ -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
Expand All @@ -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):
Expand All @@ -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):
Expand Down

0 comments on commit 24f74f6

Please sign in to comment.