Skip to content

Commit

Permalink
update
Browse files Browse the repository at this point in the history
  • Loading branch information
81549361 committed Dec 9, 2024
1 parent 8a2c01b commit 348427e
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion python/sglang/launch_server.py
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,7 @@ def register_service(client,service_name,service_ip,service_port,cluster_name,he
client = nacos.NacosClient(NACOS_SERVER, namespace=NAMESPACE, username=config['nacos']['username'], password=config['nacos']['password'])
SERVICE_NAME = config['nacos']['service_name']
HEALTH_CHECK_INTERVAL = int(config['nacos']['health_check_interval'])
WEIGHT = int(config['nacos']['weight'])
HTTP_PROXY = config.getboolean('server', 'http_proxy')
DOMAIN = config['server']['domain']
PROTOCOL = config['server']['protocol']
Expand All @@ -69,7 +70,6 @@ def register_service(client,service_name,service_ip,service_port,cluster_name,he
parsed_url = urlparse(autodl_url)
SERVICE_IP = parsed_url.hostname
SERVICE_PORT = parsed_url.port
WEIGHT = 1
if not SERVICE_IP or not SERVICE_PORT:
raise RuntimeError("Error: Invalid AutoDLServiceURL format.")

Expand All @@ -79,4 +79,8 @@ def register_service(client,service_name,service_ip,service_port,cluster_name,he

launch_server(server_args)
finally:
try:
client.remove_naming_instance(SERVICE_NAME, SERVICE_IP, SERVICE_PORT, CLUSTER_NAME)
finally:
pass
kill_process_tree(os.getpid(), include_parent=False)

0 comments on commit 348427e

Please sign in to comment.