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 e9a282e
Showing 1 changed file with 13 additions and 5 deletions.
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 e9a282e

Please sign in to comment.