diff --git a/arch/tools/cli/core.py b/arch/tools/cli/core.py index dfe1f702..88d75798 100644 --- a/arch/tools/cli/core.py +++ b/arch/tools/cli/core.py @@ -3,8 +3,6 @@ import os import time import sys import glob -import docker -from docker.errors import DockerException from cli.utils import getLogger from cli.consts import ( ARCHGW_DOCKER_NAME, diff --git a/arch/tools/cli/utils.py b/arch/tools/cli/utils.py index 5e82ada5..eeb4516e 100644 --- a/arch/tools/cli/utils.py +++ b/arch/tools/cli/utils.py @@ -4,10 +4,8 @@ import subprocess import sys import yaml import logging -import docker -from docker.errors import DockerException -from cli.consts import ACCESS_LOG_FILES, ARCHGW_DOCKER_IMAGE +from cli.consts import ACCESS_LOG_FILES logging.basicConfig( level=logging.INFO, @@ -24,46 +22,6 @@ def getLogger(name="cli"): log = getLogger(__name__) -def validate_schema(arch_config_file: str) -> None: - try: - try: - client = docker.from_env() - except DockerException as e: - # try setting up the docker host environment variable and retry - update_docker_host_env() - client = docker.from_env() - - container = client.containers.run( - image=ARCHGW_DOCKER_IMAGE, - volumes={ - f"{arch_config_file}": { - "bind": "/app/arch_config.yaml", - "mode": "ro", - }, - }, - entrypoint=["python", "config_generator.py"], - detach=True, - ) - - # Wait for the container to finish and get the exit code - exit_code = container.wait() - - # Check exit code for validation success - if exit_code["StatusCode"] != 0: - # Validation failed (non-zero exit code) - logs = container.logs().decode() # Get container logs for debugging - raise ValueError( - f"Validation failed. Container exited with code {exit_code}.\nLogs:\n{logs}" - ) - - # Successful validation (exit code 0) - log.info("Schema validation successful!") - - except docker.errors.APIError as e: - # Handle container creation error - raise ValueError(f"Failed to create container: {e}") - - def get_llm_provider_access_keys(arch_config_file): with open(arch_config_file, "r") as file: arch_config = file.read()