mirror of
https://github.com/katanemo/plano.git
synced 2026-04-25 00:36:34 +02:00
use docker cli to communicate to docker sub system (#412)
This commit is contained in:
parent
2f6c4348fd
commit
d0a783cca8
8 changed files with 2159 additions and 248 deletions
|
|
@ -5,11 +5,12 @@ import subprocess
|
|||
import multiprocessing
|
||||
import importlib.metadata
|
||||
from cli import targets
|
||||
from cli.docker_cli import docker_validate_archgw_schema, stream_gateway_logs
|
||||
from cli.utils import (
|
||||
getLogger,
|
||||
get_llm_provider_access_keys,
|
||||
load_env_file_to_dict,
|
||||
validate_schema,
|
||||
stream_access_logs,
|
||||
)
|
||||
from cli.core import (
|
||||
start_arch_modelserver,
|
||||
|
|
@ -17,12 +18,9 @@ from cli.core import (
|
|||
start_arch,
|
||||
stop_arch,
|
||||
download_models_from_hf,
|
||||
stream_access_logs,
|
||||
stream_gateway_logs,
|
||||
)
|
||||
from cli.consts import (
|
||||
KATANEMO_DOCKERHUB_REPO,
|
||||
KATANEMO_LOCAL_MODEL_LIST,
|
||||
SERVICE_NAME_ARCHGW,
|
||||
SERVICE_NAME_MODEL_SERVER,
|
||||
SERVICE_ALL,
|
||||
|
|
@ -174,17 +172,24 @@ def up(file, path, service, foreground):
|
|||
|
||||
log.info(f"Validating {arch_config_file}")
|
||||
|
||||
try:
|
||||
validate_schema(arch_config_file)
|
||||
except Exception as e:
|
||||
log.info(f"Exiting archgw up: validation failed")
|
||||
log.info(f"Error: {str(e)}")
|
||||
(
|
||||
validation_return_code,
|
||||
validation_stdout,
|
||||
validation_stderr,
|
||||
) = docker_validate_archgw_schema(arch_config_file)
|
||||
if validation_return_code != 0:
|
||||
log.info(f"Error: Validation failed. Exiting")
|
||||
log.info(f"Validation stdout: {validation_stdout}")
|
||||
log.info(f"Validation stderr: {validation_stderr}")
|
||||
sys.exit(1)
|
||||
|
||||
log.info("Starting arch model server and arch gateway")
|
||||
|
||||
# Set the ARCH_CONFIG_FILE environment variable
|
||||
env_stage = {}
|
||||
env_stage = {
|
||||
"OTEL_TRACING_HTTP_ENDPOINT": "http://host.docker.internal:4318/v1/traces",
|
||||
"MODEL_SERVER_PORT": os.getenv("MODEL_SERVER_PORT", "51000"),
|
||||
}
|
||||
env = os.environ.copy()
|
||||
# check if access_keys are preesnt in the config file
|
||||
access_keys = get_llm_provider_access_keys(arch_config_file=arch_config_file)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue