@@ -151,6 +151,7 @@ def __init__(self, config, section_name: str):
151151 self .config , section_name , "sequencer_contract_address" , None , True )
152152
153153 def __repr__ (self ):
154+
154155 return f"**BlockchainConfig: blockchain_group: { self .blockchain_group } , " \
155156 f"blockchain_peers: [{ ',' .join (self .blockchain_peers )} ], " \
156157 f"blockchain_cert_path: { self .blockchain_cert_path } **\n "
@@ -170,9 +171,10 @@ def to_properties(self) -> {}:
170171 constant .ConfigProperities .WEDPR_SEQUENCER_CONTRACT_ADDRESS :
171172 self .sequencer_contract_address })
172173 # the blockchain peers
173- blockchain_peers_info = ',' .join (map (str , self .blockchain_peers ))
174+ quoted_peers = [f'"{ peer } "' for peer in self .blockchain_peers ]
175+ blockchain_peers_info = ',' .join (map (str , quoted_peers ))
174176 properties .update ({constant .ConfigProperities .BLOCKCHAIN_PEERS :
175- f" [{ blockchain_peers_info } ]" })
177+ f' [{ blockchain_peers_info } ]' })
176178 return properties
177179
178180
@@ -387,19 +389,25 @@ def __repr__(self):
387389 f"server_start_port: { self .server_start_port } ," \
388390 f"service_type: { self .service_type } \n **"
389391
390- def to_nginx_properties (self ):
392+ def get_nginx_listen_port (self , node_index ):
393+ return self .server_start_port + 3 * node_index + 2
394+
395+ def to_nginx_properties (self , nginx_listen_port ):
391396 props = {}
392397 nginx_backend_setting = ""
393398 for backend in self .server_backend_list :
394399 nginx_backend_setting = f"{ nginx_backend_setting } { backend } ;\\ n\\ t"
395400 props .update ({constant .ConfigProperities .NGINX_BACKEND_SERVER_LIST :
396401 nginx_backend_setting })
402+ props .update (
403+ {constant .ConfigProperities .NGINX_PORT : nginx_listen_port })
397404 return props
398405
399406 def to_properties (self , deploy_ip , node_index : int ) -> {}:
400407 props = {}
401- server_start_port = self .server_start_port + 2 * node_index
402- self .server_backend_list .append (f"{ deploy_ip } :{ server_start_port } " )
408+ server_start_port = self .server_start_port + 3 * node_index
409+ self .server_backend_list .append (
410+ f"server { deploy_ip } :{ server_start_port } " )
403411 # nodeid
404412 node_id = f"{ self .service_type } -{ self .env_config .zone } -node{ node_index } "
405413 props .update ({constant .ConfigProperities .WEDPR_NODE_ID : node_id })
@@ -417,16 +425,21 @@ def to_properties(self, deploy_ip, node_index: int) -> {}:
417425 props .update (
418426 {constant .ConfigProperities .WEDPR_SERVER_LISTEN_PORT : server_start_port })
419427 # transport listen_port
428+ transport_port = server_start_port + 1
420429 props .update (
421- {constant .ConfigProperities .WEDPR_TRANSPORT_LISTEN_PORT : server_start_port + 1 })
430+ {constant .ConfigProperities .WEDPR_TRANSPORT_LISTEN_PORT : transport_port })
422431 # set the image desc for docker mode
423432 image_desc = self .env_config .get_image_desc_by_service_name (
424433 self .service_type )
425434 if image_desc is not None :
426435 props .update (
427436 {constant .ConfigProperities .WEDPR_IMAGE_DESC : image_desc })
428437 # set the exposed port
429- exposed_port_list = f"-p { server_start_port } :{ server_start_port } -p { server_start_port + 1 } :{ server_start_port + 1 } "
438+ exposed_port_list = f"-p { server_start_port } :{ server_start_port } -p { transport_port } :{ transport_port } "
439+ # expose the nginx port
440+ if self .service_type == constant .ServiceInfo .wedpr_site_service :
441+ nginx_port = server_start_port + 2
442+ exposed_port_list = f"{ exposed_port_list } -p { nginx_port } :{ nginx_port } "
430443 # default expose 20 ports for jupyter use
431444 # reserver 100 ports for jupyter use
432445 jupyter_start_port = server_start_port + 100
@@ -443,7 +456,7 @@ def to_properties(self, deploy_ip, node_index: int) -> {}:
443456 props .update (
444457 {constant .ConfigProperities .WEDPR_DOCKER_EXPORSE_PORT_LIST : exposed_port_list })
445458 # set the docker name
446- docker_name = f"{ self .service_type } -{ self .env_config .zone } -node{ node_index } "
459+ docker_name = f"{ self .agency } - { self . service_type } -{ self .env_config .zone } -node{ node_index } "
447460 props .update (
448461 {constant .ConfigProperities .WEDPR_DOCKER_NAME : docker_name })
449462 return props
@@ -848,6 +861,7 @@ def get_wedpr_model_properties(self, deploy_ip: str, node_index: int) -> {}:
848861
849862 @staticmethod
850863 def generate_cpp_component_docker_properties (
864+ agency_name : str ,
851865 prefix_path , zone_name : str , service_type : str , env_config ,
852866 exposed_port_list : str , node_index : int ):
853867 props = {}
@@ -884,7 +898,7 @@ def generate_cpp_component_docker_properties(
884898 props .update (
885899 {constant .ConfigProperities .WEDPR_DOCKER_EXPORSE_PORT_LIST : exposed_port_list })
886900 # set the docker name
887- docker_name = f"{ service_type } -{ zone_name } -node{ node_index } "
901+ docker_name = f"{ agency_name } - { service_type } -{ zone_name } -node{ node_index } "
888902 props .update (
889903 {constant .ConfigProperities .WEDPR_DOCKER_NAME : docker_name })
890904 return props
0 commit comments