[Feature] Setting number of apiserver workers automatically (#3794)

Co-authored-by: Jiang-Jia-Jun <jiangjiajun@baidu.com>
This commit is contained in:
Jiang-Jia-Jun
2025-09-02 17:19:07 +08:00
committed by GitHub
parent a86b35ab49
commit d1d063e4af
3 changed files with 22 additions and 2 deletions

View File

@@ -27,6 +27,7 @@ import sys
import tarfile
import time
from datetime import datetime
from importlib.metadata import PackageNotFoundError, distribution
from logging.handlers import BaseRotatingHandler
from pathlib import Path
from typing import Literal, TypeVar, Union
@@ -668,6 +669,14 @@ def import_from_path(module_name: str, file_path: Union[str, os.PathLike]):
return module
def is_package_installed(package_name):
try:
distribution(package_name)
return True
except PackageNotFoundError:
return False
def version():
"""
Prints the contents of the version.txt file located in the parent directory of this script.