(args)
| 355 | |
| 356 | |
| 357 | def pd_master_start(args): |
| 358 | set_unique_server_name(args) |
| 359 | if args.run_mode != "pd_master": |
| 360 | return |
| 361 | |
| 362 | # when use config_server to support multi pd_master node, we |
| 363 | # need generate unique node id for each pd_master node. |
| 364 | # otherwise, we use the 0 for single pd_master node. |
| 365 | if args.config_server_host and args.config_server_port: |
| 366 | args.pd_node_id = uuid.uuid4().int |
| 367 | else: |
| 368 | args.pd_node_id = 0 |
| 369 | |
| 370 | logger.info(f"use tgi api: {args.use_tgi_api}") |
| 371 | logger.info(f"all start args:{args}") |
| 372 | |
| 373 | can_use_ports = alloc_can_use_network_port(num=1, used_nccl_ports=[args.nccl_port, args.port]) |
| 374 | metric_port = can_use_ports[0] |
| 375 | |
| 376 | args.metric_port = metric_port |
| 377 | |
| 378 | set_env_start_args(args) |
| 379 | |
| 380 | process_manager.start_submodule_processes( |
| 381 | start_funcs=[ |
| 382 | start_metric_manager, |
| 383 | ], |
| 384 | start_args=[(metric_port, args)], |
| 385 | ) |
| 386 | |
| 387 | command = [ |
| 388 | "gunicorn", |
| 389 | "--workers", |
| 390 | "1", |
| 391 | "--worker-class", |
| 392 | "uvicorn.workers.UvicornWorker", |
| 393 | "--bind", |
| 394 | f"{args.host}:{args.port}", |
| 395 | "--log-level", |
| 396 | "info", |
| 397 | "--access-logfile", |
| 398 | "-", |
| 399 | "--error-logfile", |
| 400 | "-", |
| 401 | "--preload", |
| 402 | "lightllm.server.api_http:app", |
| 403 | "--timeout", |
| 404 | f"{get_lightllm_gunicorn_time_out_seconds()}", |
| 405 | "--keep-alive", |
| 406 | f"{get_lightllm_gunicorn_keep_alive()}", |
| 407 | ] |
| 408 | |
| 409 | http_server_process = subprocess.Popen(command) |
| 410 | |
| 411 | if args.health_monitor: |
| 412 | from lightllm.server.health_monitor.manager import start_health_check_process |
| 413 | |
| 414 | process_manager.start_submodule_processes(start_funcs=[start_health_check_process], start_args=[(args,)]) |
no test coverage detected