INNER CODE UNIT · Python

failure

operatorai/modelstore · modelstore/utils/cli.py:69

def failure(message: str):
    """Echos a message in red"""
    _echo(message, MessageStatus.FAILURE)


def info(message: str):
    """Echos a message in blue"""
    _echo(message, MessageStatus.INFO)


def assert_environ_exists(storage_type: str, keys: dict):
    """Checks that environment variables that are required to use the modelstore CLI
    are set. If not, logs the failure and exits."""
    missing_required_keys = [k for k in keys.get("required", []) if k not in os.environ]
    missing_optional_keys = [k for k in keys.get("optional", []) if k not in os.environ]
    if len(missing_required_keys) != 0:
        failure(
            f"❌ Failed to create {storage_type} modelstore.\nYour environment is missing:"

View source record →

📰 Research Paper
Loading…
⏳ Fetching content…