@@ -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,18 +389,23 @@ 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
408+ server_start_port = self .server_start_port + 3 * node_index
402409 self .server_backend_list .append (f"{ deploy_ip } :{ server_start_port } " )
403410 # nodeid
404411 node_id = f"{ self .service_type } -{ self .env_config .zone } -node{ node_index } "
@@ -417,16 +424,21 @@ def to_properties(self, deploy_ip, node_index: int) -> {}:
417424 props .update (
418425 {constant .ConfigProperities .WEDPR_SERVER_LISTEN_PORT : server_start_port })
419426 # transport listen_port
427+ transport_port = server_start_port + 1
420428 props .update (
421- {constant .ConfigProperities .WEDPR_TRANSPORT_LISTEN_PORT : server_start_port + 1 })
429+ {constant .ConfigProperities .WEDPR_TRANSPORT_LISTEN_PORT : transport_port })
422430 # set the image desc for docker mode
423431 image_desc = self .env_config .get_image_desc_by_service_name (
424432 self .service_type )
425433 if image_desc is not None :
426434 props .update (
427435 {constant .ConfigProperities .WEDPR_IMAGE_DESC : image_desc })
428436 # 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 } "
437+ exposed_port_list = f"-p { server_start_port } :{ server_start_port } -p { transport_port } :{ transport_port } "
438+ # expose the nginx port
439+ if self .service_type == constant .ServiceInfo .wedpr_site_service :
440+ nginx_port = server_start_port + 2
441+ exposed_port_list = f"{ exposed_port_list } -p { nginx_port } :{ nginx_port } "
430442 # default expose 20 ports for jupyter use
431443 # reserver 100 ports for jupyter use
432444 jupyter_start_port = server_start_port + 100
@@ -443,7 +455,7 @@ def to_properties(self, deploy_ip, node_index: int) -> {}:
443455 props .update (
444456 {constant .ConfigProperities .WEDPR_DOCKER_EXPORSE_PORT_LIST : exposed_port_list })
445457 # set the docker name
446- docker_name = f"{ self .service_type } -{ self .env_config .zone } -node{ node_index } "
458+ docker_name = f"{ self .agency } - { self . service_type } -{ self .env_config .zone } -node{ node_index } "
447459 props .update (
448460 {constant .ConfigProperities .WEDPR_DOCKER_NAME : docker_name })
449461 return props
@@ -848,6 +860,7 @@ def get_wedpr_model_properties(self, deploy_ip: str, node_index: int) -> {}:
848860
849861 @staticmethod
850862 def generate_cpp_component_docker_properties (
863+ agency_name : str ,
851864 prefix_path , zone_name : str , service_type : str , env_config ,
852865 exposed_port_list : str , node_index : int ):
853866 props = {}
@@ -884,7 +897,7 @@ def generate_cpp_component_docker_properties(
884897 props .update (
885898 {constant .ConfigProperities .WEDPR_DOCKER_EXPORSE_PORT_LIST : exposed_port_list })
886899 # set the docker name
887- docker_name = f"{ service_type } -{ zone_name } -node{ node_index } "
900+ docker_name = f"{ agency_name } - { service_type } -{ zone_name } -node{ node_index } "
888901 props .update (
889902 {constant .ConfigProperities .WEDPR_DOCKER_NAME : docker_name })
890903 return props
0 commit comments