From e2700b2bbd62514a3594545c9058012e418869d6 Mon Sep 17 00:00:00 2001 From: pablonyx Date: Sat, 28 Dec 2024 20:45:07 -0500 Subject: [PATCH] Remove left over yaml errors (#3527) * remove left over vim command * additional misconfigurations * ensure all regions updated --- backend/alembic/env.py | 4 ++-- backend/onyx/configs/app_configs.py | 2 +- backend/onyx/db/engine.py | 8 ++++---- .../docker_compose/docker-compose.dev.yml | 14 ++++++-------- .../docker_compose/docker-compose.gpu-dev.yml | 17 ++++++++--------- .../docker-compose.prod-no-letsencrypt.yml | 4 ++-- .../docker_compose/docker-compose.prod.yml | 4 ++-- 7 files changed, 25 insertions(+), 28 deletions(-) diff --git a/backend/alembic/env.py b/backend/alembic/env.py index e3911c514..4eeea5c67 100644 --- a/backend/alembic/env.py +++ b/backend/alembic/env.py @@ -4,7 +4,7 @@ from onyx.configs.app_configs import USE_IAM_AUTH from onyx.configs.app_configs import POSTGRES_HOST from onyx.configs.app_configs import POSTGRES_PORT from onyx.configs.app_configs import POSTGRES_USER -from onyx.configs.app_configs import AWS_REGION +from onyx.configs.app_configs import AWS_REGION_NAME from onyx.db.engine import build_connection_string from onyx.db.engine import get_all_tenant_ids from sqlalchemy import event @@ -120,7 +120,7 @@ def provide_iam_token_for_alembic( ) -> None: if USE_IAM_AUTH: # Database connection settings - region = AWS_REGION + region = AWS_REGION_NAME host = POSTGRES_HOST port = POSTGRES_PORT user = POSTGRES_USER diff --git a/backend/onyx/configs/app_configs.py b/backend/onyx/configs/app_configs.py index 99246fb0a..8e8ce606a 100644 --- a/backend/onyx/configs/app_configs.py +++ b/backend/onyx/configs/app_configs.py @@ -146,7 +146,7 @@ POSTGRES_PASSWORD = urllib.parse.quote_plus( POSTGRES_HOST = os.environ.get("POSTGRES_HOST") or "localhost" POSTGRES_PORT = os.environ.get("POSTGRES_PORT") or "5432" POSTGRES_DB = os.environ.get("POSTGRES_DB") or "postgres" -AWS_REGION = os.environ.get("AWS_REGION") or "us-east-2" +AWS_REGION_NAME = os.environ.get("AWS_REGION_NAME") or "us-east-2" POSTGRES_API_SERVER_POOL_SIZE = int( os.environ.get("POSTGRES_API_SERVER_POOL_SIZE") or 40 diff --git a/backend/onyx/db/engine.py b/backend/onyx/db/engine.py index 9cc1ab6df..86519fa34 100644 --- a/backend/onyx/db/engine.py +++ b/backend/onyx/db/engine.py @@ -27,7 +27,7 @@ from sqlalchemy.ext.asyncio import create_async_engine from sqlalchemy.orm import Session from sqlalchemy.orm import sessionmaker -from onyx.configs.app_configs import AWS_REGION +from onyx.configs.app_configs import AWS_REGION_NAME from onyx.configs.app_configs import LOG_POSTGRES_CONN_COUNTS from onyx.configs.app_configs import LOG_POSTGRES_LATENCY from onyx.configs.app_configs import POSTGRES_API_SERVER_POOL_OVERFLOW @@ -273,7 +273,7 @@ async def get_async_connection() -> Any: port = POSTGRES_PORT user = POSTGRES_USER db = POSTGRES_DB - token = get_iam_auth_token(host, port, user, AWS_REGION) + token = get_iam_auth_token(host, port, user, AWS_REGION_NAME) # asyncpg requires 'ssl="require"' if SSL needed return await asyncpg.connect( @@ -315,7 +315,7 @@ def get_sqlalchemy_async_engine() -> AsyncEngine: host = POSTGRES_HOST port = POSTGRES_PORT user = POSTGRES_USER - token = get_iam_auth_token(host, port, user, AWS_REGION) + token = get_iam_auth_token(host, port, user, AWS_REGION_NAME) cparams["password"] = token cparams["ssl"] = ssl_context @@ -525,6 +525,6 @@ def provide_iam_token(dialect: Any, conn_rec: Any, cargs: Any, cparams: Any) -> host = POSTGRES_HOST port = POSTGRES_PORT user = POSTGRES_USER - region = os.getenv("AWS_REGION", "us-east-2") + region = os.getenv("AWS_REGION_NAME", "us-east-2") # Configure for psycopg2 with IAM token configure_psycopg2_iam_auth(cparams, host, port, user, region) diff --git a/deployment/docker_compose/docker-compose.dev.yml b/deployment/docker_compose/docker-compose.dev.yml index 2607bbb1a..f5c5463bd 100644 --- a/deployment/docker_compose/docker-compose.dev.yml +++ b/deployment/docker_compose/docker-compose.dev.yml @@ -50,10 +50,6 @@ services: - GEN_AI_API_KEY=${GEN_AI_API_KEY:-} # if set, allows for the use of the token budget system - TOKEN_BUDGET_GLOBALLY_ENABLED=${TOKEN_BUDGET_GLOBALLY_ENABLED:-} - # Enables the use of bedrock models - - AWS_ACCESS_KEY_ID=${AWS_ACCESS_KEY_ID:-} - - AWS_SECRET_ACCESS_KEY=${AWS_SECRET_ACCESS_KEY:-} - - AWS_REGION_NAME=${AWS_REGION_NAME:-} # Query Options - DOC_TIME_DECAY=${DOC_TIME_DECAY:-} # Recency Bias for search results, decay at 1 / (1 + DOC_TIME_DECAY * x years) - HYBRID_ALPHA=${HYBRID_ALPHA:-} # Hybrid Search Alpha (0 for entirely keyword, 1 for entirely vector) @@ -100,14 +96,16 @@ services: # Chat Configs - HARD_DELETE_CHATS=${HARD_DELETE_CHATS:-} + # Enables the use of bedrock models or IAM Auth + - AWS_ACCESS_KEY_ID=${AWS_ACCESS_KEY_ID:-} + - AWS_SECRET_ACCESS_KEY=${AWS_SECRET_ACCESS_KEY:-} + - AWS_REGION_NAME=${AWS_REGION_NAME:-} + # Enterprise Edition only - ENABLE_PAID_ENTERPRISE_EDITION_FEATURES=${ENABLE_PAID_ENTERPRISE_EDITION_FEATURES:-false} - API_KEY_HASH_ROUNDS=${API_KEY_HASH_ROUNDS:-} # Seeding configuration - USE_IAM_AUTH=${USE_IAM_AUTH:-} - - AWS_REGION=${AWS_REGION-} - - AWS_ACCESS_KEY_ID=${AWS_ACCESS_KEY_ID-} - - AWS_SECRET_ACCESS_KEY=${AWS_SECRET_ACCESS_KEY-} # Uncomment the line below to use if IAM_AUTH is true and you are using iam auth for postgres # volumes: # - ./bundle.pem:/app/bundle.pem:ro @@ -232,7 +230,7 @@ services: # Enterprise Edition stuff - ENABLE_PAID_ENTERPRISE_EDITION_FEATURES=${ENABLE_PAID_ENTERPRISE_EDITION_FEATURES:-false} - USE_IAM_AUTH=${USE_IAM_AUTH:-} - - AWS_REGION=${AWS_REGION-} + - AWS_REGION_NAME=${AWS_REGION_NAME:-} - AWS_ACCESS_KEY_ID=${AWS_ACCESS_KEY_ID-} - AWS_SECRET_ACCESS_KEY=${AWS_SECRET_ACCESS_KEY-} # Uncomment the line below to use if IAM_AUTH is true and you are using iam auth for postgres diff --git a/deployment/docker_compose/docker-compose.gpu-dev.yml b/deployment/docker_compose/docker-compose.gpu-dev.yml index e41e7aa26..6c11efee0 100644 --- a/deployment/docker_compose/docker-compose.gpu-dev.yml +++ b/deployment/docker_compose/docker-compose.gpu-dev.yml @@ -44,10 +44,7 @@ services: - LITELLM_EXTRA_HEADERS=${LITELLM_EXTRA_HEADERS:-} # if set, allows for the use of the token budget system - TOKEN_BUDGET_GLOBALLY_ENABLED=${TOKEN_BUDGET_GLOBALLY_ENABLED:-} - # Enables the use of bedrock models - - AWS_ACCESS_KEY_ID=${AWS_ACCESS_KEY_ID:-} - - AWS_SECRET_ACCESS_KEY=${AWS_SECRET_ACCESS_KEY:-} - - AWS_REGION_NAME=${AWS_REGION_NAME:-} + # Query Options - DOC_TIME_DECAY=${DOC_TIME_DECAY:-} # Recency Bias for search results, decay at 1 / (1 + DOC_TIME_DECAY * x years) - HYBRID_ALPHA=${HYBRID_ALPHA:-} # Hybrid Search Alpha (0 for entirely keyword, 1 for entirely vector) @@ -86,16 +83,18 @@ services: - CELERY_BROKER_POOL_LIMIT=${CELERY_BROKER_POOL_LIMIT:-} - LITELLM_CUSTOM_ERROR_MESSAGE_MAPPINGS=${LITELLM_CUSTOM_ERROR_MESSAGE_MAPPINGS:-} + # Enables the use of bedrock models or IAM Auth + - AWS_ACCESS_KEY_ID=${AWS_ACCESS_KEY_ID:-} + - AWS_SECRET_ACCESS_KEY=${AWS_SECRET_ACCESS_KEY:-} + - AWS_REGION_NAME=${AWS_REGION_NAME:-} + - USE_IAM_AUTH=${USE_IAM_AUTH} + # Chat Configs - HARD_DELETE_CHATS=${HARD_DELETE_CHATS:-} # Enterprise Edition only - API_KEY_HASH_ROUNDS=${API_KEY_HASH_ROUNDS:-} - ENABLE_PAID_ENTERPRISE_EDITION_FEATURES=${ENABLE_PAID_ENTERPRISE_EDITION_FEATURES:-false} - - USE_IAM_AUTH=${USE_IAM_AUTH} - - AWS_REGION=${AWS_REGION-} - - AWS_ACCESS_KEY_ID=${AWS_ACCESS_KEY_ID-} - - AWS_SECRET_ACCESS_KEY=${AWS_SECRET_ACCESS_KEY-} # Uncomment the line below to use if IAM_AUTH is true and you are using iam auth for postgres # volumes: # - ./bundle.pem:/app/bundle.pem:ro @@ -201,7 +200,7 @@ services: - API_KEY_HASH_ROUNDS=${API_KEY_HASH_ROUNDS:-} - ENABLE_PAID_ENTERPRISE_EDITION_FEATURES=${ENABLE_PAID_ENTERPRISE_EDITION_FEATURES:-false} - USE_IAM_AUTH=${USE_IAM_AUTH} - - AWS_REGION=${AWS_REGION-} + - AWS_REGION_NAME=${AWS_REGION_NAME-} - AWS_ACCESS_KEY_ID=${AWS_ACCESS_KEY_ID-} - AWS_SECRET_ACCESS_KEY=${AWS_SECRET_ACCESS_KEY-} # Uncomment the line below to use if IAM_AUTH is true and you are using iam auth for postgres diff --git a/deployment/docker_compose/docker-compose.prod-no-letsencrypt.yml b/deployment/docker_compose/docker-compose.prod-no-letsencrypt.yml index b609e06f7..021b279c7 100644 --- a/deployment/docker_compose/docker-compose.prod-no-letsencrypt.yml +++ b/deployment/docker_compose/docker-compose.prod-no-letsencrypt.yml @@ -23,7 +23,7 @@ services: - REDIS_HOST=cache - MODEL_SERVER_HOST=${MODEL_SERVER_HOST:-inference_model_server} - USE_IAM_AUTH=${USE_IAM_AUTH} - - AWS_REGION=${AWS_REGION-} + - AWS_REGION_NAME=${AWS_REGION_NAME-} - AWS_ACCESS_KEY_ID=${AWS_ACCESS_KEY_ID-} - AWS_SECRET_ACCESS_KEY=${AWS_SECRET_ACCESS_KEY-} # Uncomment the line below to use if IAM_AUTH is true and you are using iam auth for postgres @@ -60,7 +60,7 @@ services: - MODEL_SERVER_HOST=${MODEL_SERVER_HOST:-inference_model_server} - INDEXING_MODEL_SERVER_HOST=${INDEXING_MODEL_SERVER_HOST:-indexing_model_server} - USE_IAM_AUTH=${USE_IAM_AUTH} - - AWS_REGION=${AWS_REGION-} + - AWS_REGION_NAME=${AWS_REGION_NAME-} - AWS_ACCESS_KEY_ID=${AWS_ACCESS_KEY_ID-} - AWS_SECRET_ACCESS_KEY=${AWS_SECRET_ACCESS_KEY-} # Uncomment the line below to use if IAM_AUTH is true and you are using iam auth for postgres diff --git a/deployment/docker_compose/docker-compose.prod.yml b/deployment/docker_compose/docker-compose.prod.yml index d2c8c70be..90a1aa9c1 100644 --- a/deployment/docker_compose/docker-compose.prod.yml +++ b/deployment/docker_compose/docker-compose.prod.yml @@ -24,7 +24,7 @@ services: - REDIS_HOST=cache - MODEL_SERVER_HOST=${MODEL_SERVER_HOST:-inference_model_server} - USE_IAM_AUTH=${USE_IAM_AUTH} - - AWS_REGION=${AWS_REGION-} + - AWS_REGION_NAME=${AWS_REGION_NAME-} - AWS_ACCESS_KEY_ID=${AWS_ACCESS_KEY_ID-} - AWS_SECRET_ACCESS_KEY=${AWS_SECRET_ACCESS_KEY-} # Uncomment the line below to use if IAM_AUTH is true and you are using iam auth for postgres @@ -65,7 +65,7 @@ services: - MODEL_SERVER_HOST=${MODEL_SERVER_HOST:-inference_model_server} - INDEXING_MODEL_SERVER_HOST=${INDEXING_MODEL_SERVER_HOST:-indexing_model_server} - USE_IAM_AUTH=${USE_IAM_AUTH} - - AWS_REGION=${AWS_REGION-} + - AWS_REGION_NAME=${AWS_REGION_NAME-} - AWS_ACCESS_KEY_ID=${AWS_ACCESS_KEY_ID-} - AWS_SECRET_ACCESS_KEY=${AWS_SECRET_ACCESS_KEY-} # Uncomment the line below to use if IAM_AUTH is true and you are using iam auth for postgres