diff --git a/.github/workflows/pr-external-dependency-unit-tests.yml b/.github/workflows/pr-external-dependency-unit-tests.yml index 71907684a65..2f3c74901bf 100644 --- a/.github/workflows/pr-external-dependency-unit-tests.yml +++ b/.github/workflows/pr-external-dependency-unit-tests.yml @@ -78,7 +78,7 @@ jobs: - name: Set up Standard Dependencies run: | cd deployment/docker_compose - docker compose -f docker-compose.dev.yml -p onyx-stack up -d minio relational_db cache index + docker compose up -d minio relational_db cache index - name: Run migrations run: | diff --git a/.github/workflows/pr-integration-tests.yml b/.github/workflows/pr-integration-tests.yml index 78ce660f9f4..d79c03a7ec2 100644 --- a/.github/workflows/pr-integration-tests.yml +++ b/.github/workflows/pr-integration-tests.yml @@ -257,7 +257,7 @@ jobs: IMAGE_TAG=test \ INTEGRATION_TESTS_MODE=true \ CHECK_TTL_MANAGEMENT_TASK_FREQUENCY_IN_HOURS=0.001 \ - docker compose -f docker-compose.dev.yml -p onyx-stack up \ + docker compose up \ relational_db \ index \ cache \ @@ -273,7 +273,7 @@ jobs: run: | echo "Starting wait-for-service script..." - docker logs -f onyx-stack-api_server-1 & + docker logs -f onyx-api_server-1 & start_time=$(date +%s) timeout=300 # 5 minutes in seconds @@ -317,7 +317,7 @@ jobs: retry_wait_seconds: 10 command: | echo "Running integration tests for ${{ matrix.test-dir.path }}..." - docker run --rm --network onyx-stack_default \ + docker run --rm --network onyx_default \ --name test-runner \ -e POSTGRES_HOST=relational_db \ -e POSTGRES_USER=postgres \ @@ -354,13 +354,13 @@ jobs: if: always() run: | cd deployment/docker_compose - docker compose -f docker-compose.dev.yml -p onyx-stack logs --no-color api_server > $GITHUB_WORKSPACE/api_server.log || true + docker compose logs --no-color api_server > $GITHUB_WORKSPACE/api_server.log || true - name: Dump all-container logs (optional) if: always() run: | cd deployment/docker_compose - docker compose -f docker-compose.dev.yml -p onyx-stack logs --no-color > $GITHUB_WORKSPACE/docker-compose.log || true + docker compose logs --no-color > $GITHUB_WORKSPACE/docker-compose.log || true - name: Upload logs if: always() @@ -374,7 +374,7 @@ jobs: if: always() run: | cd deployment/docker_compose - docker compose -f docker-compose.dev.yml -p onyx-stack down -v + docker compose down -v multitenant-tests: @@ -423,7 +423,7 @@ jobs: DISABLE_TELEMETRY=true \ IMAGE_TAG=test \ DEV_MODE=true \ - docker compose -f docker-compose.multitenant-dev.yml -p onyx-stack up \ + docker compose -f docker-compose.multitenant-dev.yml up \ relational_db \ index \ cache \ @@ -438,7 +438,7 @@ jobs: - name: Wait for service to be ready (multi-tenant) run: | echo "Starting wait-for-service script for multi-tenant..." - docker logs -f onyx-stack-api_server-1 & + docker logs -f onyx-api_server-1 & start_time=$(date +%s) timeout=300 while true; do @@ -464,7 +464,7 @@ jobs: - name: Run Multi-Tenant Integration Tests run: | echo "Running multi-tenant integration tests..." - docker run --rm --network onyx-stack_default \ + docker run --rm --network onyx_default \ --name test-runner \ -e POSTGRES_HOST=relational_db \ -e POSTGRES_USER=postgres \ @@ -493,13 +493,13 @@ jobs: if: always() run: | cd deployment/docker_compose - docker compose -f docker-compose.multitenant-dev.yml -p onyx-stack logs --no-color api_server > $GITHUB_WORKSPACE/api_server_multitenant.log || true + docker compose -f docker-compose.multitenant-dev.yml logs --no-color api_server > $GITHUB_WORKSPACE/api_server_multitenant.log || true - name: Dump all-container logs (multi-tenant) if: always() run: | cd deployment/docker_compose - docker compose -f docker-compose.multitenant-dev.yml -p onyx-stack logs --no-color > $GITHUB_WORKSPACE/docker-compose-multitenant.log || true + docker compose -f docker-compose.multitenant-dev.yml logs --no-color > $GITHUB_WORKSPACE/docker-compose-multitenant.log || true - name: Upload logs (multi-tenant) if: always() @@ -512,7 +512,7 @@ jobs: if: always() run: | cd deployment/docker_compose - docker compose -f docker-compose.multitenant-dev.yml -p onyx-stack down -v + docker compose -f docker-compose.multitenant-dev.yml down -v required: runs-on: blacksmith-2vcpu-ubuntu-2404-arm diff --git a/.github/workflows/pr-mit-integration-tests.yml b/.github/workflows/pr-mit-integration-tests.yml index 37c5e3b09a8..3fb853ce32d 100644 --- a/.github/workflows/pr-mit-integration-tests.yml +++ b/.github/workflows/pr-mit-integration-tests.yml @@ -253,7 +253,7 @@ jobs: DISABLE_TELEMETRY=true \ IMAGE_TAG=test \ INTEGRATION_TESTS_MODE=true \ - docker compose -f docker-compose.dev.yml -p onyx-stack up \ + docker compose up \ relational_db \ index \ cache \ @@ -269,7 +269,7 @@ jobs: run: | echo "Starting wait-for-service script..." - docker logs -f onyx-stack-api_server-1 & + docker logs -f onyx-api_server-1 & start_time=$(date +%s) timeout=300 # 5 minutes in seconds @@ -314,7 +314,7 @@ jobs: retry_wait_seconds: 10 command: | echo "Running integration tests for ${{ matrix.test-dir.path }}..." - docker run --rm --network onyx-stack_default \ + docker run --rm --network onyx_default \ --name test-runner \ -e POSTGRES_HOST=relational_db \ -e POSTGRES_USER=postgres \ @@ -351,13 +351,13 @@ jobs: if: always() run: | cd deployment/docker_compose - docker compose -f docker-compose.dev.yml -p onyx-stack logs --no-color api_server > $GITHUB_WORKSPACE/api_server.log || true + docker compose logs --no-color api_server > $GITHUB_WORKSPACE/api_server.log || true - name: Dump all-container logs (optional) if: always() run: | cd deployment/docker_compose - docker compose -f docker-compose.dev.yml -p onyx-stack logs --no-color > $GITHUB_WORKSPACE/docker-compose.log || true + docker compose logs --no-color > $GITHUB_WORKSPACE/docker-compose.log || true - name: Upload logs if: always() @@ -371,7 +371,7 @@ jobs: if: always() run: | cd deployment/docker_compose - docker compose -f docker-compose.dev.yml -p onyx-stack down -v + docker compose down -v required: diff --git a/.github/workflows/pr-playwright-tests.yml b/.github/workflows/pr-playwright-tests.yml index 41bf5d1804e..1a7b8ff2cdf 100644 --- a/.github/workflows/pr-playwright-tests.yml +++ b/.github/workflows/pr-playwright-tests.yml @@ -189,14 +189,14 @@ jobs: REQUIRE_EMAIL_VERIFICATION=false \ DISABLE_TELEMETRY=true \ IMAGE_TAG=test \ - docker compose -f docker-compose.dev.yml -p danswer-stack up -d + docker compose up -d id: start_docker - name: Wait for service to be ready run: | echo "Starting wait-for-service script..." - docker logs -f danswer-stack-api_server-1 & + docker logs -f onyx-api_server-1 & start_time=$(date +%s) timeout=300 # 5 minutes in seconds @@ -244,7 +244,7 @@ jobs: if: success() || failure() run: | cd deployment/docker_compose - docker compose -f docker-compose.dev.yml -p danswer-stack logs > docker-compose.log + docker compose logs > docker-compose.log mv docker-compose.log ${{ github.workspace }}/docker-compose.log - name: Upload logs @@ -257,7 +257,7 @@ jobs: - name: Stop Docker containers run: | cd deployment/docker_compose - docker compose -f docker-compose.dev.yml -p danswer-stack down -v + docker compose down -v # NOTE: Chromatic UI diff testing is currently disabled. # We are using Playwright for local and CI testing without visual regression checks. diff --git a/.github/workflows/pr-python-model-tests.yml b/.github/workflows/pr-python-model-tests.yml index fd04a6bddf3..cd00d1ba499 100644 --- a/.github/workflows/pr-python-model-tests.yml +++ b/.github/workflows/pr-python-model-tests.yml @@ -77,7 +77,7 @@ jobs: REQUIRE_EMAIL_VERIFICATION=false \ DISABLE_TELEMETRY=true \ IMAGE_TAG=test \ - docker compose -f docker-compose.model-server-test.yml -p onyx-stack up -d indexing_model_server + docker compose -f docker-compose.model-server-test.yml up -d indexing_model_server id: start_docker - name: Wait for service to be ready @@ -132,7 +132,7 @@ jobs: if: always() run: | cd deployment/docker_compose - docker compose -f docker-compose.model-server-test.yml -p onyx-stack logs --no-color > $GITHUB_WORKSPACE/docker-compose.log || true + docker compose -f docker-compose.model-server-test.yml logs --no-color > $GITHUB_WORKSPACE/docker-compose.log || true - name: Upload logs if: always() @@ -145,5 +145,5 @@ jobs: if: always() run: | cd deployment/docker_compose - docker compose -f docker-compose.model-server-test.yml -p onyx-stack down -v + docker compose -f docker-compose.model-server-test.yml down -v diff --git a/.vscode/env_template.txt b/.vscode/env_template.txt index 5bb7044bfd5..d3648c85ca0 100644 --- a/.vscode/env_template.txt +++ b/.vscode/env_template.txt @@ -10,7 +10,7 @@ SKIP_WARM_UP=True # Always keep these on for Dev # Logs all model prompts to stdout -LOG_DANSWER_MODEL_INTERACTIONS=True +LOG_ONYX_MODEL_INTERACTIONS=True # More verbose logging LOG_LEVEL=debug @@ -39,8 +39,8 @@ FAST_GEN_AI_MODEL_VERSION=gpt-4o # For Danswer Slack Bot, overrides the UI values so no need to set this up via UI every time # Only needed if using DanswerBot -#DANSWER_BOT_SLACK_APP_TOKEN= -#DANSWER_BOT_SLACK_BOT_TOKEN= +#ONYX_BOT_SLACK_APP_TOKEN= +#ONYX_BOT_SLACK_BOT_TOKEN= # Python stuff diff --git a/.vscode/launch.template.jsonc b/.vscode/launch.template.jsonc index 46aad51fddb..19a8ce0e710 100644 --- a/.vscode/launch.template.jsonc +++ b/.vscode/launch.template.jsonc @@ -111,7 +111,7 @@ "cwd": "${workspaceFolder}/backend", "envFile": "${workspaceFolder}/.vscode/.env", "env": { - "LOG_DANSWER_MODEL_INTERACTIONS": "True", + "LOG_ONYX_MODEL_INTERACTIONS": "True", "LOG_LEVEL": "DEBUG", "PYTHONUNBUFFERED": "1" }, @@ -122,7 +122,7 @@ "consoleTitle": "API Server Console" }, // For the listener to access the Slack API, - // DANSWER_BOT_SLACK_APP_TOKEN & DANSWER_BOT_SLACK_BOT_TOKEN need to be set in .env file located in the root of the project + // ONYX_BOT_SLACK_APP_TOKEN & ONYX_BOT_SLACK_BOT_TOKEN need to be set in .env file located in the root of the project { "name": "Slack Bot", "consoleName": "Slack Bot", @@ -418,7 +418,7 @@ "cwd": "${workspaceFolder}/backend", "envFile": "${workspaceFolder}/.vscode/.env", "env": { - "LOG_DANSWER_MODEL_INTERACTIONS": "True", + "LOG_ONYX_MODEL_INTERACTIONS": "True", "LOG_LEVEL": "DEBUG", "PYTHONUNBUFFERED": "1", "PYTHONPATH": "." diff --git a/AGENTS.md b/AGENTS.md index f182dcedafc..64909cae942 100644 --- a/AGENTS.md +++ b/AGENTS.md @@ -11,7 +11,7 @@ to assume the python venv. `a`. The app can be accessed at `http://localhost:3000`. - You should assume that all Onyx services are running. To verify, you can check the `backend/log` directory to make sure we see logs coming out from the relevant service. -- To connect to the Postgres database, use: `docker exec -it onyx-stack-relational_db-1 psql -U postgres -c ""` +- To connect to the Postgres database, use: `docker exec -it onyx-relational_db-1 psql -U postgres -c ""` - When making calls to the backend, always go through the frontend. E.g. make a call to `http://localhost:3000/api/persona` not `http://localhost:8080/api/persona` - Put ALL db operations under the `backend/onyx/db` / `backend/ee/onyx/db` directories. Don't run queries outside of those directories. diff --git a/CLAUDE.md b/CLAUDE.md index 8c5b20963e2..2d2da2617fe 100644 --- a/CLAUDE.md +++ b/CLAUDE.md @@ -11,7 +11,7 @@ to assume the python venv. `a`. The app can be accessed at `http://localhost:3000`. - You should assume that all Onyx services are running. To verify, you can check the `backend/log` directory to make sure we see logs coming out from the relevant service. -- To connect to the Postgres database, use: `docker exec -it onyx-stack-relational_db-1 psql -U postgres -c ""` +- To connect to the Postgres database, use: `docker exec -it onyx-relational_db-1 psql -U postgres -c ""` - When making calls to the backend, always go through the frontend. E.g. make a call to `http://localhost:3000/api/persona` not `http://localhost:8080/api/persona` - Put ALL db operations under the `backend/onyx/db` / `backend/ee/onyx/db` directories. Don't run queries outside of those directories. diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 276c427c512..11d2bf9a41b 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -175,7 +175,7 @@ You will need Docker installed to run these containers. First navigate to `onyx/deployment/docker_compose`, then start up Postgres/Vespa/Redis/MinIO with: ```bash -docker compose -f docker-compose.dev.yml -p onyx-stack up -d index relational_db cache minio +docker compose up -d index relational_db cache minio ``` (index refers to Vespa, relational_db refers to Postgres, and cache refers to Redis) @@ -257,7 +257,7 @@ You can run the full Onyx application stack from pre-built images including all Navigate to `onyx/deployment/docker_compose` and run: ```bash -docker compose -f docker-compose.dev.yml -p onyx-stack up -d +docker compose up -d ``` After Docker pulls and starts these containers, navigate to `http://localhost:3000` to use Onyx. @@ -265,7 +265,7 @@ After Docker pulls and starts these containers, navigate to `http://localhost:30 If you want to make changes to Onyx and run those changes in Docker, you can also build a local version of the Onyx container images that incorporates your changes like so: ```bash -docker compose -f docker-compose.dev.yml -p onyx-stack up -d --build +docker compose up -d --build ``` diff --git a/backend/ee/onyx/background/celery/tasks/external_group_syncing/tasks.py b/backend/ee/onyx/background/celery/tasks/external_group_syncing/tasks.py index 5a72241353d..2357fd9723a 100644 --- a/backend/ee/onyx/background/celery/tasks/external_group_syncing/tasks.py +++ b/backend/ee/onyx/background/celery/tasks/external_group_syncing/tasks.py @@ -93,7 +93,7 @@ def _is_external_group_sync_due(cc_pair: ConnectorCredentialPair) -> bool: if cc_pair.access_type != AccessType.SYNC: task_logger.error( - f"Recieved non-sync CC Pair {cc_pair.id} for external " + f"Received non-sync CC Pair {cc_pair.id} for external " f"group sync. Actual access type: {cc_pair.access_type}" ) return False diff --git a/backend/ee/onyx/onyxbot/slack/handlers/handle_standard_answers.py b/backend/ee/onyx/onyxbot/slack/handlers/handle_standard_answers.py index 02a68757295..73d562818bc 100644 --- a/backend/ee/onyx/onyxbot/slack/handlers/handle_standard_answers.py +++ b/backend/ee/onyx/onyxbot/slack/handlers/handle_standard_answers.py @@ -8,7 +8,7 @@ from ee.onyx.db.standard_answer import fetch_standard_answer_categories_by_names from ee.onyx.db.standard_answer import find_matching_standard_answers from onyx.configs.constants import MessageType -from onyx.configs.onyxbot_configs import DANSWER_REACT_EMOJI +from onyx.configs.onyxbot_configs import ONYX_BOT_REACT_EMOJI from onyx.db.chat import create_chat_session from onyx.db.chat import create_new_chat_message from onyx.db.chat import get_chat_messages_by_sessions @@ -193,7 +193,7 @@ def _handle_standard_answers( db_session.commit() update_emote_react( - emoji=DANSWER_REACT_EMOJI, + emoji=ONYX_BOT_REACT_EMOJI, channel=message_info.channel_to_respond, message_ts=message_info.msg_to_respond, remove=True, diff --git a/backend/onyx/configs/app_configs.py b/backend/onyx/configs/app_configs.py index 842d0b904dc..686cd371b83 100644 --- a/backend/onyx/configs/app_configs.py +++ b/backend/onyx/configs/app_configs.py @@ -666,8 +666,8 @@ def get_current_tz_offset() -> int: os.environ.get("LOG_ALL_MODEL_INTERACTIONS", "").lower() == "true" ) # Logs Onyx only model interactions like prompts, responses, messages etc. -LOG_DANSWER_MODEL_INTERACTIONS = ( - os.environ.get("LOG_DANSWER_MODEL_INTERACTIONS", "").lower() == "true" +LOG_ONYX_MODEL_INTERACTIONS = ( + os.environ.get("LOG_ONYX_MODEL_INTERACTIONS", "").lower() == "true" ) LOG_INDIVIDUAL_MODEL_TOKENS = ( os.environ.get("LOG_INDIVIDUAL_MODEL_TOKENS", "").lower() == "true" diff --git a/backend/onyx/configs/onyxbot_configs.py b/backend/onyx/configs/onyxbot_configs.py index 5526c4fab6e..343ed571b11 100644 --- a/backend/onyx/configs/onyxbot_configs.py +++ b/backend/onyx/configs/onyxbot_configs.py @@ -3,28 +3,26 @@ ##### # Onyx Slack Bot Configs ##### -DANSWER_BOT_NUM_RETRIES = int(os.environ.get("DANSWER_BOT_NUM_RETRIES", "5")) +ONYX_BOT_NUM_RETRIES = int(os.environ.get("ONYX_BOT_NUM_RETRIES", "5")) # How much of the available input context can be used for thread context MAX_THREAD_CONTEXT_PERCENTAGE = 512 * 2 / 3072 # Number of docs to display in "Reference Documents" -DANSWER_BOT_NUM_DOCS_TO_DISPLAY = int( - os.environ.get("DANSWER_BOT_NUM_DOCS_TO_DISPLAY", "5") -) +ONYX_BOT_NUM_DOCS_TO_DISPLAY = int(os.environ.get("ONYX_BOT_NUM_DOCS_TO_DISPLAY", "5")) # If the LLM fails to answer, Onyx can still show the "Reference Documents" -DANSWER_BOT_DISABLE_DOCS_ONLY_ANSWER = os.environ.get( - "DANSWER_BOT_DISABLE_DOCS_ONLY_ANSWER", "" +ONYX_BOT_DISABLE_DOCS_ONLY_ANSWER = os.environ.get( + "ONYX_BOT_DISABLE_DOCS_ONLY_ANSWER", "" ).lower() not in ["false", ""] # When Onyx is considering a message, what emoji does it react with -DANSWER_REACT_EMOJI = os.environ.get("DANSWER_REACT_EMOJI") or "eyes" +ONYX_BOT_REACT_EMOJI = os.environ.get("ONYX_BOT_REACT_EMOJI") or "eyes" # When User needs more help, what should the emoji be -DANSWER_FOLLOWUP_EMOJI = os.environ.get("DANSWER_FOLLOWUP_EMOJI") or "sos" +ONYX_BOT_FOLLOWUP_EMOJI = os.environ.get("ONYX_BOT_FOLLOWUP_EMOJI") or "sos" # What kind of message should be shown when someone gives an AI answer feedback to OnyxBot # Defaults to Private if not provided or invalid # Private: Only visible to user clicking the feedback # Anonymous: Public but anonymous # Public: Visible with the user name who submitted the feedback -DANSWER_BOT_FEEDBACK_VISIBILITY = ( - os.environ.get("DANSWER_BOT_FEEDBACK_VISIBILITY") or "private" +ONYX_BOT_FEEDBACK_VISIBILITY = ( + os.environ.get("ONYX_BOT_FEEDBACK_VISIBILITY") or "private" ) # Should OnyxBot send an apology message if it's not able to find an answer # That way the user isn't confused as to why OnyxBot reacted but then said nothing @@ -34,40 +32,38 @@ ) # Mostly for debugging purposes but it's for explaining what went wrong # if OnyxBot couldn't find an answer -DANSWER_BOT_DISPLAY_ERROR_MSGS = os.environ.get( - "DANSWER_BOT_DISPLAY_ERROR_MSGS", "" +ONYX_BOT_DISPLAY_ERROR_MSGS = os.environ.get( + "ONYX_BOT_DISPLAY_ERROR_MSGS", "" ).lower() not in [ "false", "", ] # Default is only respond in channels that are included by a slack config set in the UI -DANSWER_BOT_RESPOND_EVERY_CHANNEL = ( - os.environ.get("DANSWER_BOT_RESPOND_EVERY_CHANNEL", "").lower() == "true" +ONYX_BOT_RESPOND_EVERY_CHANNEL = ( + os.environ.get("ONYX_BOT_RESPOND_EVERY_CHANNEL", "").lower() == "true" ) # Maximum Questions Per Minute, Default Uncapped -DANSWER_BOT_MAX_QPM = int(os.environ.get("DANSWER_BOT_MAX_QPM") or 0) or None +ONYX_BOT_MAX_QPM = int(os.environ.get("ONYX_BOT_MAX_QPM") or 0) or None # Maximum time to wait when a question is queued -DANSWER_BOT_MAX_WAIT_TIME = int(os.environ.get("DANSWER_BOT_MAX_WAIT_TIME") or 180) +ONYX_BOT_MAX_WAIT_TIME = int(os.environ.get("ONYX_BOT_MAX_WAIT_TIME") or 180) # Time (in minutes) after which a Slack message is sent to the user to remind him to give feedback. # Set to 0 to disable it (default) -DANSWER_BOT_FEEDBACK_REMINDER = int( - os.environ.get("DANSWER_BOT_FEEDBACK_REMINDER") or 0 -) +ONYX_BOT_FEEDBACK_REMINDER = int(os.environ.get("ONYX_BOT_FEEDBACK_REMINDER") or 0) # Set to True to rephrase the Slack users messages -DANSWER_BOT_REPHRASE_MESSAGE = ( - os.environ.get("DANSWER_BOT_REPHRASE_MESSAGE", "").lower() == "true" +ONYX_BOT_REPHRASE_MESSAGE = ( + os.environ.get("ONYX_BOT_REPHRASE_MESSAGE", "").lower() == "true" ) -# DANSWER_BOT_RESPONSE_LIMIT_PER_TIME_PERIOD is the number of +# ONYX_BOT_RESPONSE_LIMIT_PER_TIME_PERIOD is the number of # responses OnyxBot can send in a given time period. # Set to 0 to disable the limit. -DANSWER_BOT_RESPONSE_LIMIT_PER_TIME_PERIOD = int( - os.environ.get("DANSWER_BOT_RESPONSE_LIMIT_PER_TIME_PERIOD", "5000") +ONYX_BOT_RESPONSE_LIMIT_PER_TIME_PERIOD = int( + os.environ.get("ONYX_BOT_RESPONSE_LIMIT_PER_TIME_PERIOD", "5000") ) -# DANSWER_BOT_RESPONSE_LIMIT_TIME_PERIOD_SECONDS is the number +# ONYX_BOT_RESPONSE_LIMIT_TIME_PERIOD_SECONDS is the number # of seconds until the response limit is reset. -DANSWER_BOT_RESPONSE_LIMIT_TIME_PERIOD_SECONDS = int( - os.environ.get("DANSWER_BOT_RESPONSE_LIMIT_TIME_PERIOD_SECONDS", "86400") +ONYX_BOT_RESPONSE_LIMIT_TIME_PERIOD_SECONDS = int( + os.environ.get("ONYX_BOT_RESPONSE_LIMIT_TIME_PERIOD_SECONDS", "86400") ) diff --git a/backend/onyx/connectors/fireflies/connector.py b/backend/onyx/connectors/fireflies/connector.py index 3ff459b60de..94e91c6d650 100644 --- a/backend/onyx/connectors/fireflies/connector.py +++ b/backend/onyx/connectors/fireflies/connector.py @@ -168,8 +168,8 @@ def _fetch_transcripts( if response.status_code == 204: break - recieved_transcripts = response.json() - parsed_transcripts = recieved_transcripts.get("data", {}).get( + received_transcripts = response.json() + parsed_transcripts = received_transcripts.get("data", {}).get( "transcripts", [] ) diff --git a/backend/onyx/llm/chat_llm.py b/backend/onyx/llm/chat_llm.py index 9af34cfc5a9..392ea7f6cc7 100644 --- a/backend/onyx/llm/chat_llm.py +++ b/backend/onyx/llm/chat_llm.py @@ -27,7 +27,7 @@ from litellm.utils import get_supported_openai_params from onyx.configs.app_configs import BRAINTRUST_ENABLED -from onyx.configs.app_configs import LOG_DANSWER_MODEL_INTERACTIONS +from onyx.configs.app_configs import LOG_ONYX_MODEL_INTERACTIONS from onyx.configs.app_configs import MOCK_LLM_RESPONSE from onyx.configs.chat_configs import QA_TIMEOUT from onyx.configs.model_configs import ( @@ -485,7 +485,7 @@ def _invoke_implementation( timeout_override: int | None = None, max_tokens: int | None = None, ) -> BaseMessage: - if LOG_DANSWER_MODEL_INTERACTIONS: + if LOG_ONYX_MODEL_INTERACTIONS: self.log_model_configs() response = cast( @@ -518,7 +518,7 @@ def _stream_implementation( timeout_override: int | None = None, max_tokens: int | None = None, ) -> Iterator[BaseMessage]: - if LOG_DANSWER_MODEL_INTERACTIONS: + if LOG_ONYX_MODEL_INTERACTIONS: self.log_model_configs() if DISABLE_LITELLM_STREAMING: @@ -572,7 +572,7 @@ def _stream_implementation( if output: self._record_result(prompt, output) - if LOG_DANSWER_MODEL_INTERACTIONS and output: + if LOG_ONYX_MODEL_INTERACTIONS and output: content = output.content or "" if isinstance(output, AIMessage): if content: diff --git a/backend/onyx/llm/interfaces.py b/backend/onyx/llm/interfaces.py index 787c0315ea6..a4290b929ac 100644 --- a/backend/onyx/llm/interfaces.py +++ b/backend/onyx/llm/interfaces.py @@ -9,8 +9,8 @@ from pydantic import BaseModel from onyx.configs.app_configs import DISABLE_GENERATIVE_AI -from onyx.configs.app_configs import LOG_DANSWER_MODEL_INTERACTIONS from onyx.configs.app_configs import LOG_INDIVIDUAL_MODEL_TOKENS +from onyx.configs.app_configs import LOG_ONYX_MODEL_INTERACTIONS from onyx.utils.logger import setup_logger @@ -84,7 +84,7 @@ def log_model_configs(self) -> None: def _precall(self, prompt: LanguageModelInput) -> None: if DISABLE_GENERATIVE_AI: raise Exception("Generative AI is disabled") - if LOG_DANSWER_MODEL_INTERACTIONS: + if LOG_ONYX_MODEL_INTERACTIONS: log_prompt(prompt) @traced(name="invoke llm", type="llm") diff --git a/backend/onyx/onyxbot/slack/blocks.py b/backend/onyx/onyxbot/slack/blocks.py index 729466d9b60..5a806bd404e 100644 --- a/backend/onyx/onyxbot/slack/blocks.py +++ b/backend/onyx/onyxbot/slack/blocks.py @@ -20,7 +20,7 @@ from onyx.configs.app_configs import WEB_DOMAIN from onyx.configs.constants import DocumentSource from onyx.configs.constants import SearchFeedbackType -from onyx.configs.onyxbot_configs import DANSWER_BOT_NUM_DOCS_TO_DISPLAY +from onyx.configs.onyxbot_configs import ONYX_BOT_NUM_DOCS_TO_DISPLAY from onyx.context.search.models import SavedSearchDoc from onyx.db.chat import get_chat_session_by_message_id from onyx.db.engine.sql_engine import get_session_with_current_tenant @@ -253,7 +253,7 @@ def get_restate_blocks( def _build_documents_blocks( documents: list[SavedSearchDoc], message_id: int | None, - num_docs_to_display: int = DANSWER_BOT_NUM_DOCS_TO_DISPLAY, + num_docs_to_display: int = ONYX_BOT_NUM_DOCS_TO_DISPLAY, ) -> list[Block]: header_text = ( "Retrieved Documents" if DISABLE_GENERATIVE_AI else "Reference Documents" @@ -311,7 +311,7 @@ def _build_documents_blocks( def _build_sources_blocks( cited_documents: list[tuple[int, SavedSearchDoc]], - num_docs_to_display: int = DANSWER_BOT_NUM_DOCS_TO_DISPLAY, + num_docs_to_display: int = ONYX_BOT_NUM_DOCS_TO_DISPLAY, ) -> list[Block]: if not cited_documents: return [ diff --git a/backend/onyx/onyxbot/slack/handlers/handle_buttons.py b/backend/onyx/onyxbot/slack/handlers/handle_buttons.py index 74fee3c19a4..29859f03a5d 100644 --- a/backend/onyx/onyxbot/slack/handlers/handle_buttons.py +++ b/backend/onyx/onyxbot/slack/handlers/handle_buttons.py @@ -12,7 +12,7 @@ from onyx.chat.process_message import remove_answer_citations from onyx.configs.constants import MessageType from onyx.configs.constants import SearchFeedbackType -from onyx.configs.onyxbot_configs import DANSWER_FOLLOWUP_EMOJI +from onyx.configs.onyxbot_configs import ONYX_BOT_FOLLOWUP_EMOJI from onyx.connectors.slack.utils import expert_info_from_slack_id from onyx.context.search.models import SavedSearchDoc from onyx.db.chat import get_chat_message @@ -459,7 +459,7 @@ def handle_followup_button( thread_ts = req.payload["container"].get("thread_ts", None) update_emote_react( - emoji=DANSWER_FOLLOWUP_EMOJI, + emoji=ONYX_BOT_FOLLOWUP_EMOJI, channel=channel_id, message_ts=thread_ts, remove=False, @@ -544,7 +544,7 @@ def handle_followup_resolved_button( clicker_name = get_clicker_name(req, client) update_emote_react( - emoji=DANSWER_FOLLOWUP_EMOJI, + emoji=ONYX_BOT_FOLLOWUP_EMOJI, channel=channel_id, message_ts=thread_ts, remove=True, diff --git a/backend/onyx/onyxbot/slack/handlers/handle_message.py b/backend/onyx/onyxbot/slack/handlers/handle_message.py index 8c65ef8fd8d..79e41b52642 100644 --- a/backend/onyx/onyxbot/slack/handlers/handle_message.py +++ b/backend/onyx/onyxbot/slack/handlers/handle_message.py @@ -3,8 +3,8 @@ from slack_sdk import WebClient from slack_sdk.errors import SlackApiError -from onyx.configs.onyxbot_configs import DANSWER_BOT_FEEDBACK_REMINDER -from onyx.configs.onyxbot_configs import DANSWER_REACT_EMOJI +from onyx.configs.onyxbot_configs import ONYX_BOT_FEEDBACK_REMINDER +from onyx.configs.onyxbot_configs import ONYX_BOT_REACT_EMOJI from onyx.db.engine.sql_engine import get_session_with_current_tenant from onyx.db.models import SlackChannelConfig from onyx.db.users import add_slack_user_if_not_exists @@ -39,7 +39,7 @@ def send_msg_ack_to_user(details: SlackMessageInfo, client: WebClient) -> None: return update_emote_react( - emoji=DANSWER_REACT_EMOJI, + emoji=ONYX_BOT_REACT_EMOJI, channel=details.channel_to_respond, message_ts=details.msg_to_respond, remove=False, @@ -52,7 +52,7 @@ def schedule_feedback_reminder( ) -> str | None: logger = setup_logger(extra={SLACK_CHANNEL_ID: details.channel_to_respond}) - if not DANSWER_BOT_FEEDBACK_REMINDER: + if not ONYX_BOT_FEEDBACK_REMINDER: logger.info("Scheduled feedback reminder disabled...") return None @@ -66,7 +66,7 @@ def schedule_feedback_reminder( return None now = datetime.datetime.now() - future = now + datetime.timedelta(minutes=DANSWER_BOT_FEEDBACK_REMINDER) + future = now + datetime.timedelta(minutes=ONYX_BOT_FEEDBACK_REMINDER) try: response = client.chat_scheduleMessage( diff --git a/backend/onyx/onyxbot/slack/handlers/handle_regular_answer.py b/backend/onyx/onyxbot/slack/handlers/handle_regular_answer.py index 3db4ec66e76..0d4f23188e2 100644 --- a/backend/onyx/onyxbot/slack/handlers/handle_regular_answer.py +++ b/backend/onyx/onyxbot/slack/handlers/handle_regular_answer.py @@ -14,11 +14,11 @@ from onyx.chat.process_message import stream_chat_message_objects from onyx.configs.app_configs import DISABLE_GENERATIVE_AI from onyx.configs.constants import DEFAULT_PERSONA_ID -from onyx.configs.onyxbot_configs import DANSWER_BOT_DISABLE_DOCS_ONLY_ANSWER -from onyx.configs.onyxbot_configs import DANSWER_BOT_DISPLAY_ERROR_MSGS -from onyx.configs.onyxbot_configs import DANSWER_BOT_NUM_RETRIES -from onyx.configs.onyxbot_configs import DANSWER_REACT_EMOJI from onyx.configs.onyxbot_configs import MAX_THREAD_CONTEXT_PERCENTAGE +from onyx.configs.onyxbot_configs import ONYX_BOT_DISABLE_DOCS_ONLY_ANSWER +from onyx.configs.onyxbot_configs import ONYX_BOT_DISPLAY_ERROR_MSGS +from onyx.configs.onyxbot_configs import ONYX_BOT_NUM_RETRIES +from onyx.configs.onyxbot_configs import ONYX_BOT_REACT_EMOJI from onyx.context.search.enums import OptionalSearchSetting from onyx.context.search.models import BaseFilters from onyx.context.search.models import RetrievalDetails @@ -70,10 +70,10 @@ def handle_regular_answer( channel: str, logger: OnyxLoggingAdapter, feedback_reminder_id: str | None, - num_retries: int = DANSWER_BOT_NUM_RETRIES, + num_retries: int = ONYX_BOT_NUM_RETRIES, thread_context_percent: float = MAX_THREAD_CONTEXT_PERCENTAGE, - should_respond_with_error_msgs: bool = DANSWER_BOT_DISPLAY_ERROR_MSGS, - disable_docs_only_answer: bool = DANSWER_BOT_DISABLE_DOCS_ONLY_ANSWER, + should_respond_with_error_msgs: bool = ONYX_BOT_DISPLAY_ERROR_MSGS, + disable_docs_only_answer: bool = ONYX_BOT_DISABLE_DOCS_ONLY_ANSWER, ) -> bool: channel_conf = slack_channel_config.channel_config @@ -256,7 +256,7 @@ def _get_slack_answer( # In case of failures, don't keep the reaction there permanently update_emote_react( - emoji=DANSWER_REACT_EMOJI, + emoji=ONYX_BOT_REACT_EMOJI, channel=message_info.channel_to_respond, message_ts=message_info.msg_to_respond, remove=True, @@ -312,7 +312,7 @@ def _get_slack_answer( # Got an answer at this point, can remove reaction and give results if not is_slash_command: # Slash commands don't have reactions update_emote_react( - emoji=DANSWER_REACT_EMOJI, + emoji=ONYX_BOT_REACT_EMOJI, channel=message_info.channel_to_respond, message_ts=message_info.msg_to_respond, remove=True, @@ -340,7 +340,7 @@ def _get_slack_answer( if not answer.answer and disable_docs_only_answer: logger.notice( "Unable to find answer - not responding since the " - "`DANSWER_BOT_DISABLE_DOCS_ONLY_ANSWER` env variable is set" + "`ONYX_BOT_DISABLE_DOCS_ONLY_ANSWER` env variable is set" ) return True diff --git a/backend/onyx/onyxbot/slack/listener.py b/backend/onyx/onyxbot/slack/listener.py index a515ec9f402..d4c6ba4901e 100644 --- a/backend/onyx/onyxbot/slack/listener.py +++ b/backend/onyx/onyxbot/slack/listener.py @@ -31,9 +31,9 @@ from onyx.configs.app_configs import POD_NAMESPACE from onyx.configs.constants import MessageType from onyx.configs.constants import OnyxRedisLocks -from onyx.configs.onyxbot_configs import DANSWER_BOT_REPHRASE_MESSAGE -from onyx.configs.onyxbot_configs import DANSWER_BOT_RESPOND_EVERY_CHANNEL from onyx.configs.onyxbot_configs import NOTIFY_SLACKBOT_NO_ANSWER +from onyx.configs.onyxbot_configs import ONYX_BOT_REPHRASE_MESSAGE +from onyx.configs.onyxbot_configs import ONYX_BOT_RESPOND_EVERY_CHANNEL from onyx.connectors.slack.utils import expert_info_from_slack_id from onyx.context.search.retrieval.search_runner import ( download_nltk_data, @@ -842,7 +842,7 @@ def build_request_details( msg = remove_onyx_bot_tag(tenant_id, msg, client=client.web_client) - if DANSWER_BOT_REPHRASE_MESSAGE: + if ONYX_BOT_REPHRASE_MESSAGE: logger.info(f"Rephrasing Slack message. Original message: {msg}") try: msg = rephrase_slack_message(msg) @@ -943,7 +943,7 @@ def apologize_for_fail( def process_message( req: SocketModeRequest, client: TenantSocketModeClient, - respond_every_channel: bool = DANSWER_BOT_RESPOND_EVERY_CHANNEL, + respond_every_channel: bool = ONYX_BOT_RESPOND_EVERY_CHANNEL, notify_no_answer: bool = NOTIFY_SLACKBOT_NO_ANSWER, ) -> None: tenant_id = get_current_tenant_id() diff --git a/backend/onyx/onyxbot/slack/utils.py b/backend/onyx/onyxbot/slack/utils.py index c673271a57e..4398240eeeb 100644 --- a/backend/onyx/onyxbot/slack/utils.py +++ b/backend/onyx/onyxbot/slack/utils.py @@ -21,15 +21,15 @@ from onyx.configs.app_configs import DISABLE_TELEMETRY from onyx.configs.constants import ID_SEPARATOR from onyx.configs.constants import MessageType -from onyx.configs.onyxbot_configs import DANSWER_BOT_FEEDBACK_VISIBILITY -from onyx.configs.onyxbot_configs import DANSWER_BOT_MAX_QPM -from onyx.configs.onyxbot_configs import DANSWER_BOT_MAX_WAIT_TIME -from onyx.configs.onyxbot_configs import DANSWER_BOT_NUM_RETRIES +from onyx.configs.onyxbot_configs import ONYX_BOT_FEEDBACK_VISIBILITY +from onyx.configs.onyxbot_configs import ONYX_BOT_MAX_QPM +from onyx.configs.onyxbot_configs import ONYX_BOT_MAX_WAIT_TIME +from onyx.configs.onyxbot_configs import ONYX_BOT_NUM_RETRIES from onyx.configs.onyxbot_configs import ( - DANSWER_BOT_RESPONSE_LIMIT_PER_TIME_PERIOD, + ONYX_BOT_RESPONSE_LIMIT_PER_TIME_PERIOD, ) from onyx.configs.onyxbot_configs import ( - DANSWER_BOT_RESPONSE_LIMIT_TIME_PERIOD_SECONDS, + ONYX_BOT_RESPONSE_LIMIT_TIME_PERIOD_SECONDS, ) from onyx.connectors.slack.utils import SlackTextCleaner from onyx.db.engine.sql_engine import get_session_with_current_tenant @@ -53,8 +53,8 @@ slack_token_bot_ids: dict[str, str | None] = {} slack_token_lock = threading.Lock() -_DANSWER_BOT_MESSAGE_COUNT: int = 0 -_DANSWER_BOT_COUNT_START_TIME: float = time.time() +_ONYX_BOT_MESSAGE_COUNT: int = 0 +_ONYX_BOT_COUNT_START_TIME: float = time.time() def get_onyx_bot_auth_ids( @@ -89,22 +89,22 @@ def check_message_limit() -> bool: High traffic at the end of one period and start of another could cause the limit to be exceeded. """ - if DANSWER_BOT_RESPONSE_LIMIT_PER_TIME_PERIOD == 0: + if ONYX_BOT_RESPONSE_LIMIT_PER_TIME_PERIOD <= 0: return True - global _DANSWER_BOT_MESSAGE_COUNT - global _DANSWER_BOT_COUNT_START_TIME - time_since_start = time.time() - _DANSWER_BOT_COUNT_START_TIME - if time_since_start > DANSWER_BOT_RESPONSE_LIMIT_TIME_PERIOD_SECONDS: - _DANSWER_BOT_MESSAGE_COUNT = 0 - _DANSWER_BOT_COUNT_START_TIME = time.time() - if (_DANSWER_BOT_MESSAGE_COUNT + 1) > DANSWER_BOT_RESPONSE_LIMIT_PER_TIME_PERIOD: + global _ONYX_BOT_MESSAGE_COUNT + global _ONYX_BOT_COUNT_START_TIME + time_since_start = time.time() - _ONYX_BOT_COUNT_START_TIME + if time_since_start > ONYX_BOT_RESPONSE_LIMIT_TIME_PERIOD_SECONDS: + _ONYX_BOT_MESSAGE_COUNT = 0 + _ONYX_BOT_COUNT_START_TIME = time.time() + if (_ONYX_BOT_MESSAGE_COUNT + 1) > ONYX_BOT_RESPONSE_LIMIT_PER_TIME_PERIOD: logger.error( - f"OnyxBot has reached the message limit {DANSWER_BOT_RESPONSE_LIMIT_PER_TIME_PERIOD}" - f" for the time period {DANSWER_BOT_RESPONSE_LIMIT_TIME_PERIOD_SECONDS} seconds." + f"OnyxBot has reached the message limit {ONYX_BOT_RESPONSE_LIMIT_PER_TIME_PERIOD}" + f" for the time period {ONYX_BOT_RESPONSE_LIMIT_TIME_PERIOD_SECONDS} seconds." " These limits are configurable in backend/onyx/configs/onyxbot_configs.py" ) return False - _DANSWER_BOT_MESSAGE_COUNT += 1 + _ONYX_BOT_MESSAGE_COUNT += 1 return True @@ -208,7 +208,7 @@ def _build_error_block(error_message: str) -> Block: @retry( - tries=DANSWER_BOT_NUM_RETRIES, + tries=ONYX_BOT_NUM_RETRIES, delay=0.25, backoff=2, logger=cast(logging.Logger, logger), @@ -645,8 +645,8 @@ def slack_usage_report(action: str, sender_id: str | None, client: WebClient) -> class SlackRateLimiter: def __init__(self) -> None: - self.max_qpm: int | None = DANSWER_BOT_MAX_QPM - self.max_wait_time = DANSWER_BOT_MAX_WAIT_TIME + self.max_qpm: int | None = ONYX_BOT_MAX_QPM + self.max_wait_time = ONYX_BOT_MAX_WAIT_TIME self.active_question = 0 self.last_reset_time = time.time() self.waiting_questions: list[int] = [] @@ -706,7 +706,7 @@ def waiter(self, func_randid: int) -> None: def get_feedback_visibility() -> FeedbackVisibility: try: - return FeedbackVisibility(DANSWER_BOT_FEEDBACK_VISIBILITY.lower()) + return FeedbackVisibility(ONYX_BOT_FEEDBACK_VISIBILITY.lower()) except ValueError: return FeedbackVisibility.PRIVATE diff --git a/backend/onyx/tools/tool_implementations/custom/custom_tool.py b/backend/onyx/tools/tool_implementations/custom/custom_tool.py index 4fdb2196900..e193cef2a4b 100644 --- a/backend/onyx/tools/tool_implementations/custom/custom_tool.py +++ b/backend/onyx/tools/tool_implementations/custom/custom_tool.py @@ -206,7 +206,7 @@ def get_args_for_non_tool_calling_llm( # pretend like nothing happened if not parse-able logger.error( - f"Failed to parse args for '{self.name}' tool. Recieved: {args_result_str}" + f"Failed to parse args for '{self.name}' tool. Received: {args_result_str}" ) return None diff --git a/backend/scripts/save_load_state.py b/backend/scripts/save_load_state.py index c8a8167a114..b4efd782e3a 100644 --- a/backend/scripts/save_load_state.py +++ b/backend/scripts/save_load_state.py @@ -104,7 +104,7 @@ def load_vespa(filename: str) -> None: parser.add_argument( "--postgres_container_name", type=str, - default="onyx-stack-relational_db-1", + default="onyx-relational_db-1", help="Name of the postgres container to dump", ) parser.add_argument( diff --git a/backend/tests/daily/connectors/slack/conftest.py b/backend/tests/daily/connectors/slack/conftest.py index 698d1367384..b8f2f8df627 100644 --- a/backend/tests/daily/connectors/slack/conftest.py +++ b/backend/tests/daily/connectors/slack/conftest.py @@ -37,7 +37,7 @@ def slack_connector( @pytest.fixture def slack_credentials_provider() -> OnyxStaticCredentialsProvider: CI_ENV_VAR = "SLACK_BOT_TOKEN" - LOCAL_ENV_VAR = "DANSWER_BOT_SLACK_BOT_TOKEN" + LOCAL_ENV_VAR = "ONYX_BOT_SLACK_BOT_TOKEN" slack_bot_token = os.environ.get(CI_ENV_VAR, os.environ.get(LOCAL_ENV_VAR)) if not slack_bot_token: diff --git a/backend/tests/integration/README.md b/backend/tests/integration/README.md index 5093d87e6e6..323a36fe73c 100644 --- a/backend/tests/integration/README.md +++ b/backend/tests/integration/README.md @@ -34,7 +34,7 @@ navigate to `backend/tests/integration/mock_services` and run docker compose -f docker-compose.mock-it-services.yml -p mock-it-services-stack up -d ``` You will have to modify the networks section of the docker-compose file to `_default` if you brought up the standard -onyx services with a name different from the default `onyx-stack`. +onyx services with a name different from the default `onyx`. ## Guidelines for Writing Integration Tests diff --git a/backend/tests/integration/mock_services/docker-compose.mock-it-services.yml b/backend/tests/integration/mock_services/docker-compose.mock-it-services.yml index 1e28975ee8a..1fa020c656a 100644 --- a/backend/tests/integration/mock_services/docker-compose.mock-it-services.yml +++ b/backend/tests/integration/mock_services/docker-compose.mock-it-services.yml @@ -13,8 +13,8 @@ services: timeout: 5s retries: 5 networks: - - onyx-stack_default + - onyx_default networks: - onyx-stack_default: - name: onyx-stack_default + onyx_default: + name: onyx_default external: true diff --git a/backend/tests/regression/answer_quality/cli_utils.py b/backend/tests/regression/answer_quality/cli_utils.py index 0f0ed6e4018..add3141e77d 100644 --- a/backend/tests/regression/answer_quality/cli_utils.py +++ b/backend/tests/regression/answer_quality/cli_utils.py @@ -149,7 +149,9 @@ def start_docker_compose( print("Starting Docker Compose...") os.chdir(os.path.dirname(__file__)) os.chdir("../../../../deployment/docker_compose/") - command = f"docker compose -f docker-compose.search-testing.yml -p onyx-stack-{env_name} up -d" + command = ( + f"docker compose -f docker-compose.search-testing.yml -p onyx-{env_name} up -d" + ) command += " --build" command += " --force-recreate" @@ -185,7 +187,7 @@ def cleanup_docker(env_name: str) -> None: containers = [json.loads(line) for line in stdout.splitlines()] if not env_name: env_name = datetime.now().strftime("-%Y") - project_name = f"onyx-stack{env_name}" + project_name = f"onyx{env_name}" containers_to_delete = [ c for c in containers if c["Names"].startswith(project_name) ] diff --git a/deployment/README.md b/deployment/README.md index 12fea611c75..1e23b328635 100644 --- a/deployment/README.md +++ b/deployment/README.md @@ -30,18 +30,18 @@ This section is for getting started quickly without setting up GPUs. For deploym 1. To run Onyx, navigate to `docker_compose` directory and run the following: - - `docker compose -f docker-compose.dev.yml -p onyx-stack up -d --pull always --force-recreate` - or run: `docker compose -f docker-compose.dev.yml -p onyx-stack up -d --build --force-recreate` + - `docker compose up -d --pull always --force-recreate` - or run: `docker compose up -d --build --force-recreate` to build from source - Downloading images or packages/requirements may take 15+ minutes depending on your internet connection. 2. To shut down the deployment, run: - - To stop the containers: `docker compose -f docker-compose.dev.yml -p onyx-stack stop` - - To delete the containers: `docker compose -f docker-compose.dev.yml -p onyx-stack down` + - To stop the containers: `docker compose stop` + - To delete the containers: `docker compose down` 3. To completely remove Onyx run: - **WARNING, this will also erase your indexed data and users** - - `docker compose -f docker-compose.dev.yml -p onyx-stack down -v` + - `docker compose down -v` Additional steps for user auth and https if you do want to use Docker Compose for production: diff --git a/deployment/aws_ecs_fargate/cloudformation/services/onyx_nginx_service_template.yaml b/deployment/aws_ecs_fargate/cloudformation/services/onyx_nginx_service_template.yaml index 652a202955f..608c2c59dde 100644 --- a/deployment/aws_ecs_fargate/cloudformation/services/onyx_nginx_service_template.yaml +++ b/deployment/aws_ecs_fargate/cloudformation/services/onyx_nginx_service_template.yaml @@ -39,7 +39,7 @@ Parameters: Default: 1 GitHubConfigUrl: Type: String - Default: "https://raw.githubusercontent.com/onyx-dot-app/onyx/main/deployment/data/nginx/app.conf.template.dev" + Default: "https://raw.githubusercontent.com/onyx-dot-app/onyx/main/deployment/data/nginx/app.conf.template" Description: "URL to the nginx configuration file on GitHub" GitHubRunScriptUrl: Type: String @@ -120,7 +120,7 @@ Resources: Command: - /bin/sh - -c - - dos2unix /etc/nginx/conf.d/run-nginx.sh && /etc/nginx/conf.d/run-nginx.sh app.conf.template.dev + - dos2unix /etc/nginx/conf.d/run-nginx.sh && /etc/nginx/conf.d/run-nginx.sh app.conf.template Environment: - Name: EMAIL Value: "" @@ -157,9 +157,9 @@ Resources: - sh - -c - !Sub | - curl -L ${GitHubConfigUrl} -o /etc/nginx/conf.d/app.conf.template.dev && + curl -L ${GitHubConfigUrl} -o /etc/nginx/conf.d/app.conf.template && curl -L ${GitHubRunScriptUrl} -o /etc/nginx/conf.d/run-nginx.sh && - chmod 644 /etc/nginx/conf.d/app.conf.template.dev && + chmod 644 /etc/nginx/conf.d/app.conf.template && chmod 755 /etc/nginx/conf.d/run-nginx.sh && exit 0 || exit 1 MountPoints: diff --git a/deployment/aws_ecs_fargate/cloudformation/services/onyx_web_server_service_template.yaml b/deployment/aws_ecs_fargate/cloudformation/services/onyx_web_server_service_template.yaml index b1c199eb81c..be852f3008e 100644 --- a/deployment/aws_ecs_fargate/cloudformation/services/onyx_web_server_service_template.yaml +++ b/deployment/aws_ecs_fargate/cloudformation/services/onyx_web_server_service_template.yaml @@ -126,10 +126,6 @@ Resources: HostPort: 3000 Protocol: tcp Environment: - - Name: NEXT_PUBLIC_DISABLE_STREAMING - Value: "false" - - Name: NEXT_PUBLIC_NEW_CHAT_DIRECTS_TO_SAME_PERSONA - Value: "false" - Name: INTERNAL_URL Value: !Sub - "http://${Environment}-onyx-backend-api-server-service.${ImportedNamespace}:8080" diff --git a/deployment/data/nginx/app.conf.template b/deployment/data/nginx/app.conf.template index 036a13d293b..ba98bedc9e8 100644 --- a/deployment/data/nginx/app.conf.template +++ b/deployment/data/nginx/app.conf.template @@ -4,24 +4,6 @@ log_format custom_main '$remote_addr - $remote_user [$time_local] "$request" ' '"$http_user_agent" "$http_x_forwarded_for" ' 'rt=$request_time'; -# Map X-Forwarded-Proto or fallback to $scheme -map $http_x_forwarded_proto $forwarded_proto { - default $http_x_forwarded_proto; - "" $scheme; -} - -# Map X-Forwarded-Host or fallback to $host -map $http_x_forwarded_host $forwarded_host { - default $http_x_forwarded_host; - "" $host; -} - -# Map X-Forwarded-Port or fallback to server port -map $http_x_forwarded_port $forwarded_port { - default $http_x_forwarded_port; - "" $server_port; -} - upstream api_server { # fail_timeout=0 means we always retry an upstream even if it failed # to return a good HTTP response @@ -53,9 +35,9 @@ server { # misc headers proxy_set_header X-Real-IP $remote_addr; proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; - proxy_set_header X-Forwarded-Proto $forwarded_proto; - proxy_set_header X-Forwarded-Host $forwarded_host; - proxy_set_header X-Forwarded-Port $forwarded_port; + proxy_set_header X-Forwarded-Proto $scheme; + proxy_set_header X-Forwarded-Host $host; + proxy_set_header X-Forwarded-Port $server_port; proxy_set_header Host $host; # need to use 1.1 to support chunked transfers @@ -72,49 +54,17 @@ server { # misc headers proxy_set_header X-Real-IP $remote_addr; proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; - proxy_set_header X-Forwarded-Proto $forwarded_proto; - proxy_set_header X-Forwarded-Host $forwarded_host; - proxy_set_header X-Forwarded-Port $forwarded_port; - proxy_set_header Host $host; - - proxy_http_version 1.1; - - # we don't want nginx trying to do something clever with - # redirects, we set the Host: header above already. - proxy_redirect off; - proxy_pass http://web_server; - } - - location /.well-known/acme-challenge/ { - root /var/www/certbot; - } -} - -server { - listen 443 ssl default_server; - - client_max_body_size 5G; # Maximum upload size - - location / { - # misc headers - proxy_set_header X-Real-IP $remote_addr; - proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; - # don't use forwarded schema, host, or port here - this is the entry point proxy_set_header X-Forwarded-Proto $scheme; - proxy_set_header X-Forwarded-Host $host; + proxy_set_header X-Forwarded-Host $host; proxy_set_header X-Forwarded-Port $server_port; proxy_set_header Host $host; proxy_http_version 1.1; - proxy_buffering off; + # we don't want nginx trying to do something clever with # redirects, we set the Host: header above already. proxy_redirect off; - proxy_pass http://localhost:80; + proxy_pass http://web_server; } - ssl_certificate /etc/letsencrypt/live/${DOMAIN}/fullchain.pem; - ssl_certificate_key /etc/letsencrypt/live/${DOMAIN}/privkey.pem; - include /etc/letsencrypt/options-ssl-nginx.conf; - ssl_dhparam /etc/letsencrypt/ssl-dhparams.pem; } diff --git a/deployment/data/nginx/app.conf.template.dev b/deployment/data/nginx/app.conf.template.prod similarity index 53% rename from deployment/data/nginx/app.conf.template.dev rename to deployment/data/nginx/app.conf.template.prod index ba98bedc9e8..036a13d293b 100644 --- a/deployment/data/nginx/app.conf.template.dev +++ b/deployment/data/nginx/app.conf.template.prod @@ -4,6 +4,24 @@ log_format custom_main '$remote_addr - $remote_user [$time_local] "$request" ' '"$http_user_agent" "$http_x_forwarded_for" ' 'rt=$request_time'; +# Map X-Forwarded-Proto or fallback to $scheme +map $http_x_forwarded_proto $forwarded_proto { + default $http_x_forwarded_proto; + "" $scheme; +} + +# Map X-Forwarded-Host or fallback to $host +map $http_x_forwarded_host $forwarded_host { + default $http_x_forwarded_host; + "" $host; +} + +# Map X-Forwarded-Port or fallback to server port +map $http_x_forwarded_port $forwarded_port { + default $http_x_forwarded_port; + "" $server_port; +} + upstream api_server { # fail_timeout=0 means we always retry an upstream even if it failed # to return a good HTTP response @@ -35,9 +53,9 @@ server { # misc headers proxy_set_header X-Real-IP $remote_addr; proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; - proxy_set_header X-Forwarded-Proto $scheme; - proxy_set_header X-Forwarded-Host $host; - proxy_set_header X-Forwarded-Port $server_port; + proxy_set_header X-Forwarded-Proto $forwarded_proto; + proxy_set_header X-Forwarded-Host $forwarded_host; + proxy_set_header X-Forwarded-Port $forwarded_port; proxy_set_header Host $host; # need to use 1.1 to support chunked transfers @@ -54,9 +72,9 @@ server { # misc headers proxy_set_header X-Real-IP $remote_addr; proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; - proxy_set_header X-Forwarded-Proto $scheme; - proxy_set_header X-Forwarded-Host $host; - proxy_set_header X-Forwarded-Port $server_port; + proxy_set_header X-Forwarded-Proto $forwarded_proto; + proxy_set_header X-Forwarded-Host $forwarded_host; + proxy_set_header X-Forwarded-Port $forwarded_port; proxy_set_header Host $host; proxy_http_version 1.1; @@ -67,4 +85,36 @@ server { proxy_pass http://web_server; } + location /.well-known/acme-challenge/ { + root /var/www/certbot; + } +} + +server { + listen 443 ssl default_server; + + client_max_body_size 5G; # Maximum upload size + + location / { + # misc headers + proxy_set_header X-Real-IP $remote_addr; + proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; + # don't use forwarded schema, host, or port here - this is the entry point + proxy_set_header X-Forwarded-Proto $scheme; + proxy_set_header X-Forwarded-Host $host; + proxy_set_header X-Forwarded-Port $server_port; + proxy_set_header Host $host; + + proxy_http_version 1.1; + proxy_buffering off; + # we don't want nginx trying to do something clever with + # redirects, we set the Host: header above already. + proxy_redirect off; + proxy_pass http://localhost:80; + } + + ssl_certificate /etc/letsencrypt/live/${DOMAIN}/fullchain.pem; + ssl_certificate_key /etc/letsencrypt/live/${DOMAIN}/privkey.pem; + include /etc/letsencrypt/options-ssl-nginx.conf; + ssl_dhparam /etc/letsencrypt/ssl-dhparams.pem; } diff --git a/deployment/data/nginx/run-nginx.sh b/deployment/data/nginx/run-nginx.sh index cb80f2ca71d..9639c226a0a 100755 --- a/deployment/data/nginx/run-nginx.sh +++ b/deployment/data/nginx/run-nginx.sh @@ -14,7 +14,7 @@ envsubst '$DOMAIN $SSL_CERT_FILE_NAME $SSL_CERT_KEY_FILE_NAME $ONYX_BACKEND_API_ echo "Waiting for API server to boot up; this may take a minute or two..." echo "If this takes more than ~5 minutes, check the logs of the API server container for errors with the following command:" echo -echo "docker logs onyx-stack-api_server-1" +echo "docker logs onyx-api_server-1" echo while true; do diff --git a/deployment/docker_compose/README.md b/deployment/docker_compose/README.md index c2a95a37c01..93b115289f2 100644 --- a/deployment/docker_compose/README.md +++ b/deployment/docker_compose/README.md @@ -1,44 +1,47 @@ - +# Welcome to Onyx -# Deploying Onyx using Docker Compose +To set up Onyx there are several options, Onyx supports the following for deployment: +1. Quick guided install via the install.sh script +2. Pulling the repo and running `docker compose up -d` from the deployment/docker_compose directory + - Note, it is recommended to copy over the env.template file to .env and edit the necessary values +3. For large scale deployments leveraging Kubernetes, there are two options, Helm or Terraform. -For general information, please read the instructions in this [README](https://github.com/onyx-dot-app/onyx/blob/main/deployment/README.md). +This README focuses on the easiest guided deployment which is via install.sh. -## Deploy in a system without GPU support +**For more detailed guides, please refer to the documentation: https://docs.onyx.app/deployment/overview** -This part is elaborated precisely in this [README](https://github.com/onyx-dot-app/onyx/blob/main/deployment/README.md) in section _Docker Compose_. If you have any questions, please feel free to open an issue or get in touch in slack for support. +## install.sh script -## Deploy in a system with GPU support +``` +curl -fsSL https://raw.githubusercontent.com/onyx-dot-app/onyx/main/deployment/docker_compose/install.sh > install.sh && chmod +x install.sh && ./install.sh +``` -Running Model servers with GPU support while indexing and querying can result in significant improvements in performance. This is highly recommended if you have access to resources. Currently, Onyx offloads embedding model and tokenizers to the GPU VRAM and the size needed depends on chosen embedding model. For example, the embedding model `nomic-ai/nomic-embed-text-v1` takes up about 1GB of VRAM. That means running this model for inference and embedding pipeline would require roughly 2GB of VRAM. +This provides a guided installation of Onyx via Docker Compose. It will deploy the latest version of Onyx +and set up the volumes to ensure data is persisted across deployments or upgrades. -### Setup +The script will create an onyx_data directory, all necessary files for the deployment will be stored in +there. Note that no application critical data is stored in that directory so even if you delete it, the +data needed to restore the app will not be destroyed. -To be able to use NVIDIA runtime, following is mandatory: +The data about chats, users, etc. are instead stored as named Docker Volumes. This is managed by Docker +and where it is stored will depend on your Docker setup. You can always delete these as well by running +the install.sh script with --delete-data. -- proper setup of NVIDIA driver in host system. -- installation of `nvidia-container-toolkit` for passing GPU runtime to containers +To shut down the deployment without deleting, use install.sh --shutdown. -You will find elaborate steps here: +### Upgrading the deployment +Onyx maintains backwards compatibility across all minor versions following SemVer. If following the install.sh script (or through Docker Compose), you can +upgrade it by first bringing down the containers. To do this, use `install.sh --shutdown` +(or `docker compose down` from the directory with the docker-compose.yml file). -#### Installation of NVIDIA Drivers +After the containers are stopped, you can safely upgrade by either re-running the `install.sh` script (if you left the values as default which is latest, +then it will automatically update to latest each time the script is run). If you are more comfortable running docker compose commands, you can also run +commands directly from the directory with the docker-compose.yml file. First verify the version you want in the environment file (see below), +(if using `latest` tag, be sure to run `docker compose pull`) and run `docker compose up` to restart the services on the latest version -Visit the official [NVIDIA drivers page](https://www.nvidia.com/Download/index.aspx) to download and install the proper drivers. Reboot your system once you have done so. +### Environment variables +The Docker Compose files try to look for a .env file in the same directory. The `install.sh` script sets it up from a file called env.template which is +downloaded during the initial setup. Feel free to edit the .env file to customize your deployment. The most important / common changed values are +located near the top of the file. -Alternatively, you can choose to install the driver versions via package managers of your choice in UNIX based systems. - -#### Installation of `nvidia-container-toolkit` - -For GPUs to be accessible to containers, you will need the container toolkit. Please follow [these instructions](https://docs.nvidia.com/datacenter/cloud-native/container-toolkit/latest/install-guide.html) to install the necessary runtime based on your requirement. - -### Launching with GPU - -1. To run Onyx with GPU, navigate to `docker_compose` directory and run the following: - - - `docker compose -f docker-compose.gpu-dev.yml -p onyx-stack up -d --pull always --force-recreate` - or run: `docker compose -f docker-compose.gpu-dev.yml -p onyx-stack up -d --build --force-recreate` - to build from source - - Downloading images or packages/requirements may take 15+ minutes depending on your internet connection. - -2. To shut down the deployment, run: - - To stop the containers: `docker compose -f docker-compose.gpu-dev.yml -p onyx-stack stop` - - To delete the containers: `docker compose -f docker-compose.gpu-dev.yml -p onyx-stack down` +IMAGE_TAG is the version of Onyx to run. It is recommended to leave it as latest to get all updates with each redeployment. diff --git a/deployment/docker_compose/docker-compose.dev.yml b/deployment/docker_compose/docker-compose.dev.yml deleted file mode 100644 index d49ce4855d1..00000000000 --- a/deployment/docker_compose/docker-compose.dev.yml +++ /dev/null @@ -1,504 +0,0 @@ -services: - api_server: - image: onyxdotapp/onyx-backend:${IMAGE_TAG:-latest} - build: - context: ../../backend - dockerfile: Dockerfile - command: > - /bin/sh -c "alembic upgrade head && - echo \"Starting Onyx Api Server\" && - uvicorn onyx.main:app --host 0.0.0.0 --port 8080" - depends_on: - - relational_db - - index - - cache - - inference_model_server - - minio - restart: unless-stopped - ports: - - "8080:8080" - environment: - # Auth Settings - - AUTH_TYPE=${AUTH_TYPE:-disabled} - - SESSION_EXPIRE_TIME_SECONDS=${SESSION_EXPIRE_TIME_SECONDS:-} - - ENCRYPTION_KEY_SECRET=${ENCRYPTION_KEY_SECRET:-} - - VALID_EMAIL_DOMAINS=${VALID_EMAIL_DOMAINS:-} - - GOOGLE_OAUTH_CLIENT_ID=${GOOGLE_OAUTH_CLIENT_ID:-} - - GOOGLE_OAUTH_CLIENT_SECRET=${GOOGLE_OAUTH_CLIENT_SECRET:-} - - REQUIRE_EMAIL_VERIFICATION=${REQUIRE_EMAIL_VERIFICATION:-} - - SMTP_SERVER=${SMTP_SERVER:-} # For sending verification emails, if unspecified then defaults to 'smtp.gmail.com' - - SMTP_PORT=${SMTP_PORT:-587} # For sending verification emails, if unspecified then defaults to '587' - - SMTP_USER=${SMTP_USER:-} - - SMTP_PASS=${SMTP_PASS:-} - - ENABLE_EMAIL_INVITES=${ENABLE_EMAIL_INVITES:-} # If enabled, will send users (using SMTP settings) an email to join the workspace - - EMAIL_FROM=${EMAIL_FROM:-} - - OAUTH_CLIENT_ID=${OAUTH_CLIENT_ID:-} - - OAUTH_CLIENT_SECRET=${OAUTH_CLIENT_SECRET:-} - - OPENID_CONFIG_URL=${OPENID_CONFIG_URL:-} - - TRACK_EXTERNAL_IDP_EXPIRY=${TRACK_EXTERNAL_IDP_EXPIRY:-} - - CORS_ALLOWED_ORIGIN=${CORS_ALLOWED_ORIGIN:-} - - INTEGRATION_TESTS_MODE=${INTEGRATION_TESTS_MODE:-} - # Gen AI Settings - - GEN_AI_MAX_TOKENS=${GEN_AI_MAX_TOKENS:-} - - QA_TIMEOUT=${QA_TIMEOUT:-} - - MAX_CHUNKS_FED_TO_CHAT=${MAX_CHUNKS_FED_TO_CHAT:-} - - DISABLE_LLM_CHOOSE_SEARCH=${DISABLE_LLM_CHOOSE_SEARCH:-} - - DISABLE_LLM_QUERY_REPHRASE=${DISABLE_LLM_QUERY_REPHRASE:-} - - DISABLE_GENERATIVE_AI=${DISABLE_GENERATIVE_AI:-} - - DISABLE_LITELLM_STREAMING=${DISABLE_LITELLM_STREAMING:-} - - LITELLM_EXTRA_HEADERS=${LITELLM_EXTRA_HEADERS:-} - - BING_API_KEY=${BING_API_KEY:-} - - EXA_API_KEY=${EXA_API_KEY:-} - - DISABLE_LLM_DOC_RELEVANCE=${DISABLE_LLM_DOC_RELEVANCE:-} - - 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:-} - # 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) - - EDIT_KEYWORD_QUERY=${EDIT_KEYWORD_QUERY:-} - - MULTILINGUAL_QUERY_EXPANSION=${MULTILINGUAL_QUERY_EXPANSION:-} - - LANGUAGE_HINT=${LANGUAGE_HINT:-} - - LANGUAGE_CHAT_NAMING_HINT=${LANGUAGE_CHAT_NAMING_HINT:-} - - QA_PROMPT_OVERRIDE=${QA_PROMPT_OVERRIDE:-} - - USE_SEMANTIC_KEYWORD_EXPANSIONS_BASIC_SEARCH=${USE_SEMANTIC_KEYWORD_EXPANSIONS_BASIC_SEARCH:-} - # Other services - - POSTGRES_HOST=relational_db - - POSTGRES_DEFAULT_SCHEMA=${POSTGRES_DEFAULT_SCHEMA:-} - - POSTGRES_USE_NULL_POOL=${POSTGRES_USE_NULL_POOL:-} - - POSTGRES_API_SERVER_POOL_SIZE=${POSTGRES_API_SERVER_POOL_SIZE:-} - - POSTGRES_API_SERVER_POOL_OVERFLOW=${POSTGRES_API_SERVER_POOL_OVERFLOW:-} - - POSTGRES_IDLE_SESSIONS_TIMEOUT=${POSTGRES_IDLE_SESSIONS_TIMEOUT:-} - - POSTGRES_POOL_RECYCLE=${POSTGRES_POOL_RECYCLE:-} - - VESPA_HOST=index - - REDIS_HOST=cache - - WEB_DOMAIN=${WEB_DOMAIN:-} # For frontend redirect auth purpose - # MinIO configuration - - S3_ENDPOINT_URL=${S3_ENDPOINT_URL:-http://minio:9000} - - S3_AWS_ACCESS_KEY_ID=${S3_AWS_ACCESS_KEY_ID:-minioadmin} - - S3_AWS_SECRET_ACCESS_KEY=${S3_AWS_SECRET_ACCESS_KEY:-minioadmin} - - S3_FILE_STORE_BUCKET_NAME=${S3_FILE_STORE_BUCKET_NAME:-} - # Don't change the NLP model configs unless you know what you're doing - - EMBEDDING_BATCH_SIZE=${EMBEDDING_BATCH_SIZE:-} - - DOCUMENT_ENCODER_MODEL=${DOCUMENT_ENCODER_MODEL:-} - - DOC_EMBEDDING_DIM=${DOC_EMBEDDING_DIM:-} - - NORMALIZE_EMBEDDINGS=${NORMALIZE_EMBEDDINGS:-} - - ASYM_QUERY_PREFIX=${ASYM_QUERY_PREFIX:-} - - DISABLE_RERANK_FOR_STREAMING=${DISABLE_RERANK_FOR_STREAMING:-} - - MODEL_SERVER_HOST=${MODEL_SERVER_HOST:-inference_model_server} - - MODEL_SERVER_PORT=${MODEL_SERVER_PORT:-} - # Leave this on pretty please? Nothing sensitive is collected! - - DISABLE_TELEMETRY=${DISABLE_TELEMETRY:-} - - LOG_LEVEL=${LOG_LEVEL:-info} # Set to debug to get more fine-grained logs - - LOG_ALL_MODEL_INTERACTIONS=${LOG_ALL_MODEL_INTERACTIONS:-} # LiteLLM Verbose Logging - # Log all of Onyx prompts and interactions with the LLM - - LOG_DANSWER_MODEL_INTERACTIONS=${LOG_DANSWER_MODEL_INTERACTIONS:-} - - LOG_INDIVIDUAL_MODEL_TOKENS=${LOG_INDIVIDUAL_MODEL_TOKENS:-} - # If set to `true` will enable additional logs about Vespa query performance - # (time spent on finding the right docs + time spent fetching summaries from disk) - - LOG_VESPA_TIMING_INFORMATION=${LOG_VESPA_TIMING_INFORMATION:-} - - LOG_ENDPOINT_LATENCY=${LOG_ENDPOINT_LATENCY:-} - - LOG_POSTGRES_LATENCY=${LOG_POSTGRES_LATENCY:-} - - LOG_POSTGRES_CONN_COUNTS=${LOG_POSTGRES_CONN_COUNTS:-} - - CELERY_BROKER_POOL_LIMIT=${CELERY_BROKER_POOL_LIMIT:-} - - LITELLM_CUSTOM_ERROR_MESSAGE_MAPPINGS=${LITELLM_CUSTOM_ERROR_MESSAGE_MAPPINGS:-} - # Egnyte OAuth Configs - - EGNYTE_CLIENT_ID=${EGNYTE_CLIENT_ID:-} - - EGNYTE_CLIENT_SECRET=${EGNYTE_CLIENT_SECRET:-} - - EGNYTE_LOCALHOST_OVERRIDE=${EGNYTE_LOCALHOST_OVERRIDE:-} - # Lienar OAuth Configs - - LINEAR_CLIENT_ID=${LINEAR_CLIENT_ID:-} - - LINEAR_CLIENT_SECRET=${LINEAR_CLIENT_SECRET:-} - - # Demo purposes - - MOCK_CONNECTOR_FILE_PATH=${MOCK_CONNECTOR_FILE_PATH:-} - - # Analytics Configs - - SENTRY_DSN=${SENTRY_DSN:-} - - # Chat Configs - - HARD_DELETE_CHATS=${HARD_DELETE_CHATS:-} - - # Show extra/uncommon connectors - - SHOW_EXTRA_CONNECTORS=${SHOW_EXTRA_CONNECTORS:-true} - - # 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:-} - - ONYX_QUERY_HISTORY_TYPE=${ONYX_QUERY_HISTORY_TYPE:-} - - # Vespa Language Forcing - # See: https://docs.vespa.ai/en/linguistics.html - - VESPA_LANGUAGE_OVERRIDE=${VESPA_LANGUAGE_OVERRIDE:-} - - # 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 - extra_hosts: - - "host.docker.internal:host-gateway" - logging: - driver: json-file - options: - max-size: "50m" - max-file: "6" - # optional, only for debugging purposes - volumes: - - api_server_logs:/var/log/onyx - - background: - image: onyxdotapp/onyx-backend:${IMAGE_TAG:-latest} - build: - context: ../../backend - dockerfile: Dockerfile - command: > - /bin/sh -c " - if [ -f /etc/ssl/certs/custom-ca.crt ]; then - update-ca-certificates; - fi && - /usr/bin/supervisord -c /etc/supervisor/conf.d/supervisord.conf" - depends_on: - - relational_db - - index - - cache - - inference_model_server - - indexing_model_server - restart: unless-stopped - environment: - - ENCRYPTION_KEY_SECRET=${ENCRYPTION_KEY_SECRET:-} - - JWT_PUBLIC_KEY_URL=${JWT_PUBLIC_KEY_URL:-} # used for JWT authentication of users via API - # Gen AI Settings (Needed by OnyxBot) - - GEN_AI_MAX_TOKENS=${GEN_AI_MAX_TOKENS:-} - - QA_TIMEOUT=${QA_TIMEOUT:-} - - MAX_CHUNKS_FED_TO_CHAT=${MAX_CHUNKS_FED_TO_CHAT:-} - - DISABLE_LLM_CHOOSE_SEARCH=${DISABLE_LLM_CHOOSE_SEARCH:-} - - DISABLE_LLM_QUERY_REPHRASE=${DISABLE_LLM_QUERY_REPHRASE:-} - - DISABLE_GENERATIVE_AI=${DISABLE_GENERATIVE_AI:-} - - GENERATIVE_MODEL_ACCESS_CHECK_FREQ=${GENERATIVE_MODEL_ACCESS_CHECK_FREQ:-} - - DISABLE_LITELLM_STREAMING=${DISABLE_LITELLM_STREAMING:-} - - LITELLM_EXTRA_HEADERS=${LITELLM_EXTRA_HEADERS:-} - - GEN_AI_API_KEY=${GEN_AI_API_KEY:-} - - BING_API_KEY=${BING_API_KEY:-} - - EXA_API_KEY=${EXA_API_KEY:-} - # 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) - - EDIT_KEYWORD_QUERY=${EDIT_KEYWORD_QUERY:-} - - MULTILINGUAL_QUERY_EXPANSION=${MULTILINGUAL_QUERY_EXPANSION:-} - - LANGUAGE_HINT=${LANGUAGE_HINT:-} - - LANGUAGE_CHAT_NAMING_HINT=${LANGUAGE_CHAT_NAMING_HINT:-} - - QA_PROMPT_OVERRIDE=${QA_PROMPT_OVERRIDE:-} - # Other Services - - POSTGRES_HOST=relational_db - - POSTGRES_USER=${POSTGRES_USER:-} - - POSTGRES_PASSWORD=${POSTGRES_PASSWORD:-} - - DB_READONLY_USER=${DB_READONLY_USER:-} - - DB_READONLY_PASSWORD=${DB_READONLY_PASSWORD:-} - - POSTGRES_DB=${POSTGRES_DB:-} - - POSTGRES_DEFAULT_SCHEMA=${POSTGRES_DEFAULT_SCHEMA:-} - - POSTGRES_USE_NULL_POOL=${POSTGRES_USE_NULL_POOL:-} - - VESPA_HOST=index - - REDIS_HOST=cache - - WEB_DOMAIN=${WEB_DOMAIN:-} # For frontend redirect auth purpose for OAuth2 connectors - # MinIO configuration - - S3_ENDPOINT_URL=${S3_ENDPOINT_URL:-http://minio:9000} - - S3_AWS_ACCESS_KEY_ID=${S3_AWS_ACCESS_KEY_ID:-minioadmin} - - S3_AWS_SECRET_ACCESS_KEY=${S3_AWS_SECRET_ACCESS_KEY:-minioadmin} - - S3_FILE_STORE_BUCKET_NAME=${S3_FILE_STORE_BUCKET_NAME:-} - # Don't change the NLP model configs unless you know what you're doing - - DOCUMENT_ENCODER_MODEL=${DOCUMENT_ENCODER_MODEL:-} - - DOC_EMBEDDING_DIM=${DOC_EMBEDDING_DIM:-} - - NORMALIZE_EMBEDDINGS=${NORMALIZE_EMBEDDINGS:-} - - ASYM_QUERY_PREFIX=${ASYM_QUERY_PREFIX:-} # Needed by OnyxBot - - ASYM_PASSAGE_PREFIX=${ASYM_PASSAGE_PREFIX:-} - - MODEL_SERVER_HOST=${MODEL_SERVER_HOST:-inference_model_server} - - MODEL_SERVER_PORT=${MODEL_SERVER_PORT:-} - - INDEXING_MODEL_SERVER_HOST=${INDEXING_MODEL_SERVER_HOST:-indexing_model_server} - # Indexing Configs - - VESPA_SEARCHER_THREADS=${VESPA_SEARCHER_THREADS:-} - - ENABLED_CONNECTOR_TYPES=${ENABLED_CONNECTOR_TYPES:-} - - DISABLE_INDEX_UPDATE_ON_SWAP=${DISABLE_INDEX_UPDATE_ON_SWAP:-} - - DASK_JOB_CLIENT_ENABLED=${DASK_JOB_CLIENT_ENABLED:-} - - CONTINUE_ON_CONNECTOR_FAILURE=${CONTINUE_ON_CONNECTOR_FAILURE:-} - - EXPERIMENTAL_CHECKPOINTING_ENABLED=${EXPERIMENTAL_CHECKPOINTING_ENABLED:-} - - CONFLUENCE_CONNECTOR_LABELS_TO_SKIP=${CONFLUENCE_CONNECTOR_LABELS_TO_SKIP:-} - - JIRA_CONNECTOR_LABELS_TO_SKIP=${JIRA_CONNECTOR_LABELS_TO_SKIP:-} - - WEB_CONNECTOR_VALIDATE_URLS=${WEB_CONNECTOR_VALIDATE_URLS:-} - - JIRA_SERVER_API_VERSION=${JIRA_SERVER_API_VERSION:-} - - JIRA_CLOUD_API_VERSION=${JIRA_CLOUD_API_VERSION:-} - - GONG_CONNECTOR_START_TIME=${GONG_CONNECTOR_START_TIME:-} - - NOTION_CONNECTOR_ENABLE_RECURSIVE_PAGE_LOOKUP=${NOTION_CONNECTOR_ENABLE_RECURSIVE_PAGE_LOOKUP:-} - - GITHUB_CONNECTOR_BASE_URL=${GITHUB_CONNECTOR_BASE_URL:-} - - MAX_DOCUMENT_CHARS=${MAX_DOCUMENT_CHARS:-} - - MAX_FILE_SIZE_BYTES=${MAX_FILE_SIZE_BYTES:-} - # Egnyte OAuth Configs - - EGNYTE_CLIENT_ID=${EGNYTE_CLIENT_ID:-} - - EGNYTE_CLIENT_SECRET=${EGNYTE_CLIENT_SECRET:-} - - EGNYTE_LOCALHOST_OVERRIDE=${EGNYTE_LOCALHOST_OVERRIDE:-} - # Lienar OAuth Configs - - LINEAR_CLIENT_ID=${LINEAR_CLIENT_ID:-} - - LINEAR_CLIENT_SECRET=${LINEAR_CLIENT_SECRET:-} - # Celery Configs (defaults are set in the supervisord.conf file. - # prefer doing that to have one source of defaults) - - CELERY_WORKER_DOCFETCHING_CONCURRENCY=${CELERY_WORKER_DOCFETCHING_CONCURRENCY:-} - - CELERY_WORKER_DOCPROCESSING_CONCURRENCY=${CELERY_WORKER_DOCPROCESSING_CONCURRENCY:-} - - CELERY_WORKER_LIGHT_CONCURRENCY=${CELERY_WORKER_LIGHT_CONCURRENCY:-} - - CELERY_WORKER_LIGHT_PREFETCH_MULTIPLIER=${CELERY_WORKER_LIGHT_PREFETCH_MULTIPLIER:-} - - # Onyx SlackBot Configs - - DANSWER_BOT_DISABLE_DOCS_ONLY_ANSWER=${DANSWER_BOT_DISABLE_DOCS_ONLY_ANSWER:-} - - DANSWER_BOT_FEEDBACK_VISIBILITY=${DANSWER_BOT_FEEDBACK_VISIBILITY:-} - - DANSWER_BOT_DISPLAY_ERROR_MSGS=${DANSWER_BOT_DISPLAY_ERROR_MSGS:-} - - DANSWER_BOT_RESPOND_EVERY_CHANNEL=${DANSWER_BOT_RESPOND_EVERY_CHANNEL:-} - - DANSWER_BOT_DISABLE_COT=${DANSWER_BOT_DISABLE_COT:-} # Currently unused - - NOTIFY_SLACKBOT_NO_ANSWER=${NOTIFY_SLACKBOT_NO_ANSWER:-} - - DANSWER_BOT_MAX_QPM=${DANSWER_BOT_MAX_QPM:-} - - DANSWER_BOT_MAX_WAIT_TIME=${DANSWER_BOT_MAX_WAIT_TIME:-} - # Logging - # Leave this on pretty please? Nothing sensitive is collected! - - DISABLE_TELEMETRY=${DISABLE_TELEMETRY:-} - - LOG_LEVEL=${LOG_LEVEL:-info} # Set to debug to get more fine-grained logs - - LOG_ALL_MODEL_INTERACTIONS=${LOG_ALL_MODEL_INTERACTIONS:-} # LiteLLM Verbose Logging - # Log all of Onyx prompts and interactions with the LLM - - LOG_DANSWER_MODEL_INTERACTIONS=${LOG_DANSWER_MODEL_INTERACTIONS:-} - - LOG_INDIVIDUAL_MODEL_TOKENS=${LOG_INDIVIDUAL_MODEL_TOKENS:-} - - LOG_VESPA_TIMING_INFORMATION=${LOG_VESPA_TIMING_INFORMATION:-} - - # Analytics Configs - - SENTRY_DSN=${SENTRY_DSN:-} - - # Enterprise Edition stuff - - ENABLE_PAID_ENTERPRISE_EDITION_FEATURES=${ENABLE_PAID_ENTERPRISE_EDITION_FEATURES:-false} - - USE_IAM_AUTH=${USE_IAM_AUTH:-} - - AWS_REGION_NAME=${AWS_REGION_NAME:-} - - AWS_ACCESS_KEY_ID=${AWS_ACCESS_KEY_ID-} - - AWS_SECRET_ACCESS_KEY=${AWS_SECRET_ACCESS_KEY-} - # primarily for testing - - CHECK_TTL_MANAGEMENT_TASK_FREQUENCY_IN_HOURS=${CHECK_TTL_MANAGEMENT_TASK_FREQUENCY_IN_HOURS:-} - # 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 - extra_hosts: - - "host.docker.internal:host-gateway" - # optional, only for debugging purposes - volumes: - - background_logs:/var/log/onyx - logging: - driver: json-file - options: - max-size: "50m" - max-file: "6" - # Uncomment the following lines if you need to include a custom CA certificate - # This section enables the use of a custom CA certificate - # If present, the custom CA certificate is mounted as a volume - # The container checks for its existence and updates the system's CA certificates - # This allows for secure communication with services using custom SSL certificates - # Optional volume mount for CA certificate - # volumes: - # # Maps to the CA_CERT_PATH environment variable in the Dockerfile - # - ${CA_CERT_PATH:-./custom-ca.crt}:/etc/ssl/certs/custom-ca.crt:ro - - web_server: - image: onyxdotapp/onyx-web-server:${IMAGE_TAG:-latest} - build: - context: ../../web - dockerfile: Dockerfile - args: - - NEXT_PUBLIC_DISABLE_STREAMING=${NEXT_PUBLIC_DISABLE_STREAMING:-false} - - NEXT_PUBLIC_NEW_CHAT_DIRECTS_TO_SAME_PERSONA=${NEXT_PUBLIC_NEW_CHAT_DIRECTS_TO_SAME_PERSONA:-false} - - NEXT_PUBLIC_POSITIVE_PREDEFINED_FEEDBACK_OPTIONS=${NEXT_PUBLIC_POSITIVE_PREDEFINED_FEEDBACK_OPTIONS:-} - - NEXT_PUBLIC_NEGATIVE_PREDEFINED_FEEDBACK_OPTIONS=${NEXT_PUBLIC_NEGATIVE_PREDEFINED_FEEDBACK_OPTIONS:-} - - NEXT_PUBLIC_DISABLE_LOGOUT=${NEXT_PUBLIC_DISABLE_LOGOUT:-} - - NEXT_PUBLIC_DEFAULT_SIDEBAR_OPEN=${NEXT_PUBLIC_DEFAULT_SIDEBAR_OPEN:-} - - NEXT_PUBLIC_FORGOT_PASSWORD_ENABLED=${NEXT_PUBLIC_FORGOT_PASSWORD_ENABLED:-} - # Enterprise Edition only - - NEXT_PUBLIC_THEME=${NEXT_PUBLIC_THEME:-} - # DO NOT TURN ON unless you have EXPLICIT PERMISSION from Onyx. - - NEXT_PUBLIC_DO_NOT_USE_TOGGLE_OFF_DANSWER_POWERED=${NEXT_PUBLIC_DO_NOT_USE_TOGGLE_OFF_DANSWER_POWERED:-false} - - NODE_OPTIONS=${NODE_OPTIONS:-"--max-old-space-size=4096"} - depends_on: - - api_server - restart: unless-stopped - environment: - - INTERNAL_URL=http://api_server:8080 - - WEB_DOMAIN=${WEB_DOMAIN:-} - - THEME_IS_DARK=${THEME_IS_DARK:-} - - DISABLE_LLM_DOC_RELEVANCE=${DISABLE_LLM_DOC_RELEVANCE:-} - - # Enterprise Edition only - - ENABLE_PAID_ENTERPRISE_EDITION_FEATURES=${ENABLE_PAID_ENTERPRISE_EDITION_FEATURES:-false} - - NEXT_PUBLIC_CUSTOM_REFRESH_URL=${NEXT_PUBLIC_CUSTOM_REFRESH_URL:-} - - inference_model_server: - image: onyxdotapp/onyx-model-server:${IMAGE_TAG:-latest} - build: - context: ../../backend - dockerfile: Dockerfile.model_server - command: > - /bin/sh -c "if [ \"${DISABLE_MODEL_SERVER:-false}\" = \"True\" ]; then - echo 'Skipping service...'; - exit 0; - else - exec uvicorn model_server.main:app --host 0.0.0.0 --port 9000; - fi" - restart: unless-stopped - environment: - - MIN_THREADS_ML_MODELS=${MIN_THREADS_ML_MODELS:-} - # Set to debug to get more fine-grained logs - - LOG_LEVEL=${LOG_LEVEL:-info} - - # Analytics Configs - - SENTRY_DSN=${SENTRY_DSN:-} - volumes: - # Not necessary, this is just to reduce download time during startup - - model_cache_huggingface:/app/.cache/huggingface/ - # optional, only for debugging purposes - - inference_model_server_logs:/var/log/onyx - logging: - driver: json-file - options: - max-size: "50m" - max-file: "6" - - indexing_model_server: - image: onyxdotapp/onyx-model-server:${IMAGE_TAG:-latest} - build: - context: ../../backend - dockerfile: Dockerfile.model_server - command: > - /bin/sh -c "if [ \"${DISABLE_MODEL_SERVER:-false}\" = \"True\" ]; then - echo 'Skipping service...'; - exit 0; - else - exec uvicorn model_server.main:app --host 0.0.0.0 --port 9000; - fi" - restart: unless-stopped - environment: - - INDEX_BATCH_SIZE=${INDEX_BATCH_SIZE:-} - - MIN_THREADS_ML_MODELS=${MIN_THREADS_ML_MODELS:-} - - INDEXING_ONLY=True - # Set to debug to get more fine-grained logs - - LOG_LEVEL=${LOG_LEVEL:-info} - - CLIENT_EMBEDDING_TIMEOUT=${CLIENT_EMBEDDING_TIMEOUT:-} - - # Analytics Configs - - SENTRY_DSN=${SENTRY_DSN:-} - volumes: - # Not necessary, this is just to reduce download time during startup - - indexing_huggingface_model_cache:/app/.cache/huggingface/ - # optional, only for debugging purposes - - indexing_model_server_logs:/var/log/onyx - logging: - driver: json-file - options: - max-size: "50m" - max-file: "6" - - relational_db: - image: postgres:15.2-alpine - shm_size: 1g - command: -c 'max_connections=250' - restart: unless-stopped - environment: - - POSTGRES_USER=${POSTGRES_USER:-postgres} - - POSTGRES_PASSWORD=${POSTGRES_PASSWORD:-password} - - DB_READONLY_USER=${DB_READONLY_USER:-} - - DB_READONLY_PASSWORD=${DB_READONLY_PASSWORD:-} - ports: - - "5432:5432" - volumes: - - db_volume:/var/lib/postgresql/data - - # This container name cannot have an underscore in it due to Vespa expectations of the URL - index: - image: vespaengine/vespa:8.526.15 - restart: unless-stopped - environment: - - VESPA_SKIP_UPGRADE_CHECK=true - ports: - - "19071:19071" - - "8081:8081" - volumes: - - vespa_volume:/opt/vespa/var - logging: - driver: json-file - options: - max-size: "50m" - max-file: "6" - - nginx: - image: nginx:1.23.4-alpine - restart: unless-stopped - # nginx will immediately crash with `nginx: [emerg] host not found in upstream` - # if api_server / web_server are not up - depends_on: - - api_server - - web_server - environment: - - DOMAIN=localhost - ports: - - "80:80" - - "3000:80" # allow for localhost:3000 usage, since that is the norm - volumes: - - ../data/nginx:/etc/nginx/conf.d - logging: - driver: json-file - options: - max-size: "50m" - max-file: "6" - # The specified script waits for the api_server to start up. - # Without this we've seen issues where nginx shows no error logs but - # does not recieve any traffic - # NOTE: we have to use dos2unix to remove Carriage Return chars from the file - # in order to make this work on both Unix-like systems and windows - command: > - /bin/sh -c "dos2unix /etc/nginx/conf.d/run-nginx.sh - && /etc/nginx/conf.d/run-nginx.sh app.conf.template.dev" - - cache: - image: redis:7.4-alpine - restart: unless-stopped - ports: - - "6379:6379" - # docker silently mounts /data even without an explicit volume mount, which enables - # persistence. explicitly setting save and appendonly forces ephemeral behavior. - command: redis-server --save "" --appendonly no - - minio: - image: minio/minio:latest - restart: unless-stopped - ports: - - "9004:9000" - - "9005:9001" - environment: - MINIO_ROOT_USER: ${MINIO_ROOT_USER:-minioadmin} - MINIO_ROOT_PASSWORD: ${MINIO_ROOT_PASSWORD:-minioadmin} - # Note: we've seen the default bucket creation logic not work in some cases - MINIO_DEFAULT_BUCKETS: ${S3_FILE_STORE_BUCKET_NAME:-onyx-file-store-bucket} - volumes: - - minio_data:/data - command: server /data --console-address ":9001" - healthcheck: - test: ["CMD", "curl", "-f", "http://localhost:9000/minio/health/live"] - interval: 30s - timeout: 20s - retries: 3 - -volumes: - db_volume: - vespa_volume: # Created by the container itself - minio_data: - - model_cache_huggingface: - indexing_huggingface_model_cache: - # for logs that we don't want to lose on container restarts - api_server_logs: - background_logs: - inference_model_server_logs: - indexing_model_server_logs: diff --git a/deployment/docker_compose/docker-compose.gpu-dev.yml b/deployment/docker_compose/docker-compose.gpu-dev.yml deleted file mode 100644 index 1fc55793261..00000000000 --- a/deployment/docker_compose/docker-compose.gpu-dev.yml +++ /dev/null @@ -1,446 +0,0 @@ -services: - api_server: - image: onyxdotapp/onyx-backend:${IMAGE_TAG:-latest} - build: - context: ../../backend - dockerfile: Dockerfile - command: > - /bin/sh -c "alembic upgrade head && - echo \"Starting Onyx Api Server\" && - uvicorn onyx.main:app --host 0.0.0.0 --port 8080" - depends_on: - - relational_db - - index - - cache - - inference_model_server - - minio - restart: unless-stopped - ports: - - "8080:8080" - environment: - # Auth Settings - - AUTH_TYPE=${AUTH_TYPE:-disabled} - - SESSION_EXPIRE_TIME_SECONDS=${SESSION_EXPIRE_TIME_SECONDS:-} - - ENCRYPTION_KEY_SECRET=${ENCRYPTION_KEY_SECRET:-} - - VALID_EMAIL_DOMAINS=${VALID_EMAIL_DOMAINS:-} - - GOOGLE_OAUTH_CLIENT_ID=${GOOGLE_OAUTH_CLIENT_ID:-} - - GOOGLE_OAUTH_CLIENT_SECRET=${GOOGLE_OAUTH_CLIENT_SECRET:-} - - REQUIRE_EMAIL_VERIFICATION=${REQUIRE_EMAIL_VERIFICATION:-} - - SMTP_SERVER=${SMTP_SERVER:-} # For sending verification emails, if unspecified then defaults to 'smtp.gmail.com' - - SMTP_PORT=${SMTP_PORT:-587} # For sending verification emails, if unspecified then defaults to '587' - - SMTP_USER=${SMTP_USER:-} - - SMTP_PASS=${SMTP_PASS:-} - - EMAIL_FROM=${EMAIL_FROM:-} - - TRACK_EXTERNAL_IDP_EXPIRY=${TRACK_EXTERNAL_IDP_EXPIRY:-} - - CORS_ALLOWED_ORIGIN=${CORS_ALLOWED_ORIGIN:-} - # Gen AI Settings - - GEN_AI_MAX_TOKENS=${GEN_AI_MAX_TOKENS:-} - - QA_TIMEOUT=${QA_TIMEOUT:-} - - MAX_CHUNKS_FED_TO_CHAT=${MAX_CHUNKS_FED_TO_CHAT:-} - - DISABLE_LLM_DOC_RELEVANCE=${DISABLE_LLM_DOC_RELEVANCE:-} - - DISABLE_LLM_CHOOSE_SEARCH=${DISABLE_LLM_CHOOSE_SEARCH:-} - - DISABLE_LLM_QUERY_REPHRASE=${DISABLE_LLM_QUERY_REPHRASE:-} - - DISABLE_GENERATIVE_AI=${DISABLE_GENERATIVE_AI:-} - - DISABLE_LITELLM_STREAMING=${DISABLE_LITELLM_STREAMING:-} - - 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:-} - - # 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) - - EDIT_KEYWORD_QUERY=${EDIT_KEYWORD_QUERY:-} - - MULTILINGUAL_QUERY_EXPANSION=${MULTILINGUAL_QUERY_EXPANSION:-} - - LANGUAGE_HINT=${LANGUAGE_HINT:-} - - LANGUAGE_CHAT_NAMING_HINT=${LANGUAGE_CHAT_NAMING_HINT:-} - - QA_PROMPT_OVERRIDE=${QA_PROMPT_OVERRIDE:-} - # Other services - - POSTGRES_HOST=relational_db - - VESPA_HOST=index - - REDIS_HOST=cache - - WEB_DOMAIN=${WEB_DOMAIN:-} # For frontend redirect auth purpose - # MinIO configuration - - S3_ENDPOINT_URL=${S3_ENDPOINT_URL:-http://minio:9000} - - S3_AWS_ACCESS_KEY_ID=${S3_AWS_ACCESS_KEY_ID:-minioadmin} - - S3_AWS_SECRET_ACCESS_KEY=${S3_AWS_SECRET_ACCESS_KEY:-minioadmin} - - S3_FILE_STORE_BUCKET_NAME=${S3_FILE_STORE_BUCKET_NAME:-} - # Don't change the NLP model configs unless you know what you're doing - - EMBEDDING_BATCH_SIZE=${EMBEDDING_BATCH_SIZE:-} - - DOCUMENT_ENCODER_MODEL=${DOCUMENT_ENCODER_MODEL:-} - - DOC_EMBEDDING_DIM=${DOC_EMBEDDING_DIM:-} - - NORMALIZE_EMBEDDINGS=${NORMALIZE_EMBEDDINGS:-} - - ASYM_QUERY_PREFIX=${ASYM_QUERY_PREFIX:-} - - DISABLE_RERANK_FOR_STREAMING=${DISABLE_RERANK_FOR_STREAMING:-} - - MODEL_SERVER_HOST=${MODEL_SERVER_HOST:-inference_model_server} - - MODEL_SERVER_PORT=${MODEL_SERVER_PORT:-} - - VESPA_REQUEST_TIMEOUT=${VESPA_REQUEST_TIMEOUT:-} - # We do not recommend changing this value - - SYSTEM_RECURSION_LIMIT=${SYSTEM_RECURSION_LIMIT:-} - # Leave this on pretty please? Nothing sensitive is collected! - - DISABLE_TELEMETRY=${DISABLE_TELEMETRY:-} - - LOG_LEVEL=${LOG_LEVEL:-info} # Set to debug to get more fine-grained logs - - LOG_ALL_MODEL_INTERACTIONS=${LOG_ALL_MODEL_INTERACTIONS:-} # LiteLLM Verbose Logging - # Log all of Onyx prompts and interactions with the LLM - - LOG_DANSWER_MODEL_INTERACTIONS=${LOG_DANSWER_MODEL_INTERACTIONS:-} - # If set to `true` will enable additional logs about Vespa query performance - # (time spent on finding the right docs + time spent fetching summaries from disk) - - LOG_VESPA_TIMING_INFORMATION=${LOG_VESPA_TIMING_INFORMATION:-} - - 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:-} - - # Show extra/uncommon connectors - - SHOW_EXTRA_CONNECTORS=${SHOW_EXTRA_CONNECTORS:-true} - - # Vespa Language Forcing - # See: https://docs.vespa.ai/en/linguistics.html - - VESPA_LANGUAGE_OVERRIDE=${VESPA_LANGUAGE_OVERRIDE:-} - - # Enterprise Edition only - - API_KEY_HASH_ROUNDS=${API_KEY_HASH_ROUNDS:-} - - ENABLE_PAID_ENTERPRISE_EDITION_FEATURES=${ENABLE_PAID_ENTERPRISE_EDITION_FEATURES:-false} - - ONYX_QUERY_HISTORY_TYPE=${ONYX_QUERY_HISTORY_TYPE:-} - # 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 - extra_hosts: - - "host.docker.internal:host-gateway" - logging: - driver: json-file - options: - max-size: "50m" - max-file: "6" - volumes: - # optional, only for debugging purposes - - api_server_logs:/var/log/onyx - - background: - image: onyxdotapp/onyx-backend:${IMAGE_TAG:-latest} - build: - context: ../../backend - dockerfile: Dockerfile - command: /usr/bin/supervisord - depends_on: - - relational_db - - index - - cache - - inference_model_server - - indexing_model_server - restart: unless-stopped - environment: - - ENCRYPTION_KEY_SECRET=${ENCRYPTION_KEY_SECRET:-} - # Gen AI Settings (Needed by OnyxBot) - - GEN_AI_MAX_TOKENS=${GEN_AI_MAX_TOKENS:-} - - QA_TIMEOUT=${QA_TIMEOUT:-} - - MAX_CHUNKS_FED_TO_CHAT=${MAX_CHUNKS_FED_TO_CHAT:-} - - DISABLE_LLM_DOC_RELEVANCE=${DISABLE_LLM_DOC_RELEVANCE:-} - - DISABLE_LLM_CHOOSE_SEARCH=${DISABLE_LLM_CHOOSE_SEARCH:-} - - DISABLE_LLM_QUERY_REPHRASE=${DISABLE_LLM_QUERY_REPHRASE:-} - - DISABLE_GENERATIVE_AI=${DISABLE_GENERATIVE_AI:-} - - GENERATIVE_MODEL_ACCESS_CHECK_FREQ=${GENERATIVE_MODEL_ACCESS_CHECK_FREQ:-} - - DISABLE_LITELLM_STREAMING=${DISABLE_LITELLM_STREAMING:-} - - LITELLM_EXTRA_HEADERS=${LITELLM_EXTRA_HEADERS:-} - - EXA_API_KEY=${EXA_API_KEY:-} - # 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) - - EDIT_KEYWORD_QUERY=${EDIT_KEYWORD_QUERY:-} - - MULTILINGUAL_QUERY_EXPANSION=${MULTILINGUAL_QUERY_EXPANSION:-} - - LANGUAGE_HINT=${LANGUAGE_HINT:-} - - LANGUAGE_CHAT_NAMING_HINT=${LANGUAGE_CHAT_NAMING_HINT:-} - - QA_PROMPT_OVERRIDE=${QA_PROMPT_OVERRIDE:-} - # Other Services - - POSTGRES_HOST=relational_db - - POSTGRES_USER=${POSTGRES_USER:-} - - POSTGRES_PASSWORD=${POSTGRES_PASSWORD:-} - - DB_READONLY_USER=${DB_READONLY_USER:-} - - DB_READONLY_PASSWORD=${DB_READONLY_PASSWORD:-} - - POSTGRES_DB=${POSTGRES_DB:-} - - VESPA_HOST=index - - REDIS_HOST=cache - - WEB_DOMAIN=${WEB_DOMAIN:-} # For frontend redirect auth purpose for OAuth2 connectors - # MinIO configuration - - S3_ENDPOINT_URL=${S3_ENDPOINT_URL:-http://minio:9000} - - S3_AWS_ACCESS_KEY_ID=${S3_AWS_ACCESS_KEY_ID:-minioadmin} - - S3_AWS_SECRET_ACCESS_KEY=${S3_AWS_SECRET_ACCESS_KEY:-minioadmin} - - S3_FILE_STORE_BUCKET_NAME=${S3_FILE_STORE_BUCKET_NAME:-} - # Don't change the NLP model configs unless you know what you're doing - - DOCUMENT_ENCODER_MODEL=${DOCUMENT_ENCODER_MODEL:-} - - DOC_EMBEDDING_DIM=${DOC_EMBEDDING_DIM:-} - - NORMALIZE_EMBEDDINGS=${NORMALIZE_EMBEDDINGS:-} - - ASYM_QUERY_PREFIX=${ASYM_QUERY_PREFIX:-} # Needed by OnyxBot - - ASYM_PASSAGE_PREFIX=${ASYM_PASSAGE_PREFIX:-} - - MODEL_SERVER_HOST=${MODEL_SERVER_HOST:-inference_model_server} - - MODEL_SERVER_PORT=${MODEL_SERVER_PORT:-} - - INDEXING_MODEL_SERVER_HOST=${INDEXING_MODEL_SERVER_HOST:-indexing_model_server} - # Indexing Configs - - VESPA_SEARCHER_THREADS=${VESPA_SEARCHER_THREADS:-} - - ENABLED_CONNECTOR_TYPES=${ENABLED_CONNECTOR_TYPES:-} - - DISABLE_INDEX_UPDATE_ON_SWAP=${DISABLE_INDEX_UPDATE_ON_SWAP:-} - - DASK_JOB_CLIENT_ENABLED=${DASK_JOB_CLIENT_ENABLED:-} - - CONTINUE_ON_CONNECTOR_FAILURE=${CONTINUE_ON_CONNECTOR_FAILURE:-} - - EXPERIMENTAL_CHECKPOINTING_ENABLED=${EXPERIMENTAL_CHECKPOINTING_ENABLED:-} - - CONFLUENCE_CONNECTOR_LABELS_TO_SKIP=${CONFLUENCE_CONNECTOR_LABELS_TO_SKIP:-} - - JIRA_CONNECTOR_LABELS_TO_SKIP=${JIRA_CONNECTOR_LABELS_TO_SKIP:-} - - WEB_CONNECTOR_VALIDATE_URLS=${WEB_CONNECTOR_VALIDATE_URLS:-} - - JIRA_CLOUD_API_VERSION=${JIRA_CLOUD_API_VERSION:-} - - JIRA_SERVER_API_VERSION=${JIRA_SERVER_API_VERSION:-} - - GONG_CONNECTOR_START_TIME=${GONG_CONNECTOR_START_TIME:-} - - NOTION_CONNECTOR_ENABLE_RECURSIVE_PAGE_LOOKUP=${NOTION_CONNECTOR_ENABLE_RECURSIVE_PAGE_LOOKUP:-} - - GITHUB_CONNECTOR_BASE_URL=${GITHUB_CONNECTOR_BASE_URL:-} - # Onyx SlackBot Configs - - DANSWER_BOT_DISABLE_DOCS_ONLY_ANSWER=${DANSWER_BOT_DISABLE_DOCS_ONLY_ANSWER:-} - - DANSWER_BOT_FEEDBACK_VISIBILITY=${DANSWER_BOT_FEEDBACK_VISIBILITY:-} - - DANSWER_BOT_DISPLAY_ERROR_MSGS=${DANSWER_BOT_DISPLAY_ERROR_MSGS:-} - - DANSWER_BOT_RESPOND_EVERY_CHANNEL=${DANSWER_BOT_RESPOND_EVERY_CHANNEL:-} - - DANSWER_BOT_DISABLE_COT=${DANSWER_BOT_DISABLE_COT:-} # Currently unused - - NOTIFY_SLACKBOT_NO_ANSWER=${NOTIFY_SLACKBOT_NO_ANSWER:-} - - DANSWER_BOT_MAX_QPM=${DANSWER_BOT_MAX_QPM:-} - - DANSWER_BOT_MAX_WAIT_TIME=${DANSWER_BOT_MAX_WAIT_TIME:-} - # Logging - # Leave this on pretty please? Nothing sensitive is collected! - - DISABLE_TELEMETRY=${DISABLE_TELEMETRY:-} - - LOG_LEVEL=${LOG_LEVEL:-info} # Set to debug to get more fine-grained logs - - LOG_ALL_MODEL_INTERACTIONS=${LOG_ALL_MODEL_INTERACTIONS:-} # LiteLLM Verbose Logging - # Log all of Onyx prompts and interactions with the LLM - - LOG_DANSWER_MODEL_INTERACTIONS=${LOG_DANSWER_MODEL_INTERACTIONS:-} - - LOG_VESPA_TIMING_INFORMATION=${LOG_VESPA_TIMING_INFORMATION:-} - # Celery Configs (defaults are set in the supervisord.conf file. - # prefer doing that to have one source of defaults) - - CELERY_WORKER_DOCFETCHING_CONCURRENCY=${CELERY_WORKER_DOCFETCHING_CONCURRENCY:-} - - CELERY_WORKER_DOCPROCESSING_CONCURRENCY=${CELERY_WORKER_DOCPROCESSING_CONCURRENCY:-} - - CELERY_WORKER_LIGHT_CONCURRENCY=${CELERY_WORKER_LIGHT_CONCURRENCY:-} - - CELERY_WORKER_LIGHT_PREFETCH_MULTIPLIER=${CELERY_WORKER_LIGHT_PREFETCH_MULTIPLIER:-} - - # 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_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 - # volumes: - # - ./bundle.pem:/app/bundle.pem:ro - extra_hosts: - - "host.docker.internal:host-gateway" - # optional, only for debugging purposes - volumes: - - background_logs:/var/log/onyx - logging: - driver: json-file - options: - max-size: "50m" - max-file: "6" - - web_server: - image: onyxdotapp/onyx-web-server:${IMAGE_TAG:-latest} - build: - context: ../../web - dockerfile: Dockerfile - args: - - NEXT_PUBLIC_DISABLE_STREAMING=${NEXT_PUBLIC_DISABLE_STREAMING:-false} - - NEXT_PUBLIC_NEW_CHAT_DIRECTS_TO_SAME_PERSONA=${NEXT_PUBLIC_NEW_CHAT_DIRECTS_TO_SAME_PERSONA:-false} - - NEXT_PUBLIC_POSITIVE_PREDEFINED_FEEDBACK_OPTIONS=${NEXT_PUBLIC_POSITIVE_PREDEFINED_FEEDBACK_OPTIONS:-} - - NEXT_PUBLIC_NEGATIVE_PREDEFINED_FEEDBACK_OPTIONS=${NEXT_PUBLIC_NEGATIVE_PREDEFINED_FEEDBACK_OPTIONS:-} - - NEXT_PUBLIC_DISABLE_LOGOUT=${NEXT_PUBLIC_DISABLE_LOGOUT:-} - - NEXT_PUBLIC_DEFAULT_SIDEBAR_OPEN=${NEXT_PUBLIC_DEFAULT_SIDEBAR_OPEN:-} - - NEXT_PUBLIC_THEME=${NEXT_PUBLIC_THEME:-} - depends_on: - - api_server - restart: unless-stopped - environment: - - INTERNAL_URL=http://api_server:8080 - - WEB_DOMAIN=${WEB_DOMAIN:-} - - THEME_IS_DARK=${THEME_IS_DARK:-} - - # Enterprise Edition only - - ENABLE_PAID_ENTERPRISE_EDITION_FEATURES=${ENABLE_PAID_ENTERPRISE_EDITION_FEATURES:-false} - - inference_model_server: - image: onyxdotapp/onyx-model-server:${IMAGE_TAG:-latest} - # for GPU support, please read installation guidelines in the README.md - # bare minimum to get this working is to install nvidia-container-toolkit - deploy: - resources: - reservations: - devices: - - driver: nvidia - count: all - capabilities: [gpu] - build: - context: ../../backend - dockerfile: Dockerfile.model_server - command: > - /bin/sh -c "if [ \"${DISABLE_MODEL_SERVER:-false}\" = \"True\" ]; then - echo 'Skipping service...'; - exit 0; - else - exec uvicorn model_server.main:app --host 0.0.0.0 --port 9000; - fi" - restart: on-failure - environment: - - INDEX_BATCH_SIZE=${INDEX_BATCH_SIZE:-} - - MIN_THREADS_ML_MODELS=${MIN_THREADS_ML_MODELS:-} - # Set to debug to get more fine-grained logs - - LOG_LEVEL=${LOG_LEVEL:-info} - - CLIENT_EMBEDDING_TIMEOUT=${CLIENT_EMBEDDING_TIMEOUT:-} - volumes: - # Not necessary, this is just to reduce download time during startup - - model_cache_huggingface:/app/.cache/huggingface/ - # optional, only for debugging purposes - - inference_model_server_logs:/var/log/onyx - logging: - driver: json-file - options: - max-size: "50m" - max-file: "6" - - indexing_model_server: - image: onyxdotapp/onyx-model-server:${IMAGE_TAG:-latest} - build: - context: ../../backend - dockerfile: Dockerfile.model_server - # for GPU support, please read installation guidelines in the README.md - # bare minimum to get this working is to install nvidia-container-toolkit - deploy: - resources: - reservations: - devices: - - driver: nvidia - count: all - capabilities: [gpu] - command: > - /bin/sh -c "if [ \"${DISABLE_MODEL_SERVER:-false}\" = \"True\" ]; then - echo 'Skipping service...'; - exit 0; - else - exec uvicorn model_server.main:app --host 0.0.0.0 --port 9000; - fi" - restart: on-failure - environment: - - MIN_THREADS_ML_MODELS=${MIN_THREADS_ML_MODELS:-} - - INDEXING_ONLY=True - # Set to debug to get more fine-grained logs - - LOG_LEVEL=${LOG_LEVEL:-info} - - VESPA_SEARCHER_THREADS=${VESPA_SEARCHER_THREADS:-1} - volumes: - # Not necessary, this is just to reduce download time during startup - - indexing_huggingface_model_cache:/app/.cache/huggingface/ - # optional, only for debugging purposes - - indexing_model_server_logs:/var/log/onyx - logging: - driver: json-file - options: - max-size: "50m" - max-file: "6" - - relational_db: - image: postgres:15.2-alpine - shm_size: 1g - command: -c 'max_connections=250' - restart: unless-stopped - environment: - - POSTGRES_USER=${POSTGRES_USER:-postgres} - - POSTGRES_PASSWORD=${POSTGRES_PASSWORD:-password} - - DB_READONLY_USER=${DB_READONLY_USER:-} - - DB_READONLY_PASSWORD=${DB_READONLY_PASSWORD:-} - ports: - - "5432:5432" - volumes: - - db_volume:/var/lib/postgresql/data - - # This container name cannot have an underscore in it due to Vespa expectations of the URL - index: - image: vespaengine/vespa:8.526.15 - restart: unless-stopped - environment: - - VESPA_SKIP_UPGRADE_CHECK=true - ports: - - "19071:19071" - - "8081:8081" - volumes: - - vespa_volume:/opt/vespa/var - logging: - driver: json-file - options: - max-size: "50m" - max-file: "6" - - nginx: - image: nginx:1.23.4-alpine - restart: unless-stopped - # nginx will immediately crash with `nginx: [emerg] host not found in upstream` - # if api_server / web_server are not up - depends_on: - - api_server - - web_server - environment: - - DOMAIN=localhost - ports: - - "80:80" - - "3000:80" # allow for localhost:3000 usage, since that is the norm - volumes: - - ../data/nginx:/etc/nginx/conf.d - logging: - driver: json-file - options: - max-size: "50m" - max-file: "6" - # The specified script waits for the api_server to start up. - # Without this we've seen issues where nginx shows no error logs but - # does not recieve any traffic - # NOTE: we have to use dos2unix to remove Carriage Return chars from the file - # in order to make this work on both Unix-like systems and windows - command: > - /bin/sh -c "dos2unix /etc/nginx/conf.d/run-nginx.sh - && /etc/nginx/conf.d/run-nginx.sh app.conf.template.dev" - - minio: - image: minio/minio:latest - restart: unless-stopped - ports: - - "9004:9000" - - "9005:9001" - environment: - MINIO_ROOT_USER: ${MINIO_ROOT_USER:-minioadmin} - MINIO_ROOT_PASSWORD: ${MINIO_ROOT_PASSWORD:-minioadmin} - MINIO_DEFAULT_BUCKETS: ${S3_FILE_STORE_BUCKET_NAME:-onyx-file-store-bucket} - volumes: - - minio_data:/data - command: server /data --console-address ":9001" - healthcheck: - test: ["CMD", "curl", "-f", "http://localhost:9000/minio/health/live"] - interval: 30s - timeout: 20s - retries: 3 - - cache: - image: redis:7.4-alpine - restart: unless-stopped - ports: - - "6379:6379" - # docker silently mounts /data even without an explicit volume mount, which enables - # persistence. explicitly setting save and appendonly forces ephemeral behavior. - command: redis-server --save "" --appendonly no - -volumes: - db_volume: - vespa_volume: - minio_data: - # Created by the container itself - model_cache_huggingface: - indexing_huggingface_model_cache: - # for logs that we don't want to lose on container restarts - api_server_logs: - background_logs: - inference_model_server_logs: - indexing_model_server_logs: diff --git a/deployment/docker_compose/docker-compose.model-server-test.yml b/deployment/docker_compose/docker-compose.model-server-test.yml index 36ada0603af..59c0a6b5111 100644 --- a/deployment/docker_compose/docker-compose.model-server-test.yml +++ b/deployment/docker_compose/docker-compose.model-server-test.yml @@ -1,3 +1,5 @@ +name: onyx + services: indexing_model_server: image: onyxdotapp/onyx-model-server:${IMAGE_TAG:-latest} diff --git a/deployment/docker_compose/docker-compose.multitenant-dev.yml b/deployment/docker_compose/docker-compose.multitenant-dev.yml index c027fc9d7be..6d8a53a7f73 100644 --- a/deployment/docker_compose/docker-compose.multitenant-dev.yml +++ b/deployment/docker_compose/docker-compose.multitenant-dev.yml @@ -1,3 +1,5 @@ +name: onyx + services: api_server: image: onyxdotapp/onyx-backend:${IMAGE_TAG:-latest} @@ -65,7 +67,6 @@ services: - MULTILINGUAL_QUERY_EXPANSION=${MULTILINGUAL_QUERY_EXPANSION:-} - LANGUAGE_HINT=${LANGUAGE_HINT:-} - LANGUAGE_CHAT_NAMING_HINT=${LANGUAGE_CHAT_NAMING_HINT:-} - - QA_PROMPT_OVERRIDE=${QA_PROMPT_OVERRIDE:-} # Other services - POSTGRES_HOST=relational_db - POSTGRES_DEFAULT_SCHEMA=${POSTGRES_DEFAULT_SCHEMA:-} @@ -87,7 +88,7 @@ services: - MODEL_SERVER_HOST=${MODEL_SERVER_HOST:-inference_model_server} - MODEL_SERVER_PORT=${MODEL_SERVER_PORT:-} - LOG_ALL_MODEL_INTERACTIONS=${LOG_ALL_MODEL_INTERACTIONS:-} - - LOG_DANSWER_MODEL_INTERACTIONS=${LOG_DANSWER_MODEL_INTERACTIONS:-} + - LOG_ONYX_MODEL_INTERACTIONS=${LOG_ONYX_MODEL_INTERACTIONS:-} - LOG_INDIVIDUAL_MODEL_TOKENS=${LOG_INDIVIDUAL_MODEL_TOKENS:-} - LOG_VESPA_TIMING_INFORMATION=${LOG_VESPA_TIMING_INFORMATION:-} - LOG_ENDPOINT_LATENCY=${LOG_ENDPOINT_LATENCY:-} @@ -177,7 +178,6 @@ services: - MULTILINGUAL_QUERY_EXPANSION=${MULTILINGUAL_QUERY_EXPANSION:-} - LANGUAGE_HINT=${LANGUAGE_HINT:-} - LANGUAGE_CHAT_NAMING_HINT=${LANGUAGE_CHAT_NAMING_HINT:-} - - QA_PROMPT_OVERRIDE=${QA_PROMPT_OVERRIDE:-} # Other Services - POSTGRES_HOST=relational_db - POSTGRES_USER=${POSTGRES_USER:-} @@ -235,21 +235,20 @@ services: - CELERY_WORKER_LIGHT_PREFETCH_MULTIPLIER=${CELERY_WORKER_LIGHT_PREFETCH_MULTIPLIER:-} # Onyx SlackBot Configs - - DANSWER_BOT_DISABLE_DOCS_ONLY_ANSWER=${DANSWER_BOT_DISABLE_DOCS_ONLY_ANSWER:-} - - DANSWER_BOT_FEEDBACK_VISIBILITY=${DANSWER_BOT_FEEDBACK_VISIBILITY:-} - - DANSWER_BOT_DISPLAY_ERROR_MSGS=${DANSWER_BOT_DISPLAY_ERROR_MSGS:-} - - DANSWER_BOT_RESPOND_EVERY_CHANNEL=${DANSWER_BOT_RESPOND_EVERY_CHANNEL:-} - - DANSWER_BOT_DISABLE_COT=${DANSWER_BOT_DISABLE_COT:-} # Currently unused + - ONYX_BOT_DISABLE_DOCS_ONLY_ANSWER=${ONYX_BOT_DISABLE_DOCS_ONLY_ANSWER:-} + - ONYX_BOT_FEEDBACK_VISIBILITY=${ONYX_BOT_FEEDBACK_VISIBILITY:-} + - ONYX_BOT_DISPLAY_ERROR_MSGS=${ONYX_BOT_DISPLAY_ERROR_MSGS:-} + - ONYX_BOT_RESPOND_EVERY_CHANNEL=${ONYX_BOT_RESPOND_EVERY_CHANNEL:-} - NOTIFY_SLACKBOT_NO_ANSWER=${NOTIFY_SLACKBOT_NO_ANSWER:-} - - DANSWER_BOT_MAX_QPM=${DANSWER_BOT_MAX_QPM:-} - - DANSWER_BOT_MAX_WAIT_TIME=${DANSWER_BOT_MAX_WAIT_TIME:-} + - ONYX_BOT_MAX_QPM=${ONYX_BOT_MAX_QPM:-} + - ONYX_BOT_MAX_WAIT_TIME=${ONYX_BOT_MAX_WAIT_TIME:-} # Logging # Leave this on pretty please? Nothing sensitive is collected! - DISABLE_TELEMETRY=${DISABLE_TELEMETRY:-} - LOG_LEVEL=${LOG_LEVEL:-info} # Set to debug to get more fine-grained logs - LOG_ALL_MODEL_INTERACTIONS=${LOG_ALL_MODEL_INTERACTIONS:-} # LiteLLM Verbose Logging # Log all of Onyx prompts and interactions with the LLM - - LOG_DANSWER_MODEL_INTERACTIONS=${LOG_DANSWER_MODEL_INTERACTIONS:-} + - LOG_ONYX_MODEL_INTERACTIONS=${LOG_ONYX_MODEL_INTERACTIONS:-} - LOG_INDIVIDUAL_MODEL_TOKENS=${LOG_INDIVIDUAL_MODEL_TOKENS:-} - LOG_VESPA_TIMING_INFORMATION=${LOG_VESPA_TIMING_INFORMATION:-} @@ -288,8 +287,6 @@ services: context: ../../web dockerfile: Dockerfile args: - - NEXT_PUBLIC_DISABLE_STREAMING=${NEXT_PUBLIC_DISABLE_STREAMING:-false} - - NEXT_PUBLIC_NEW_CHAT_DIRECTS_TO_SAME_PERSONA=${NEXT_PUBLIC_NEW_CHAT_DIRECTS_TO_SAME_PERSONA:-false} - NEXT_PUBLIC_POSITIVE_PREDEFINED_FEEDBACK_OPTIONS=${NEXT_PUBLIC_POSITIVE_PREDEFINED_FEEDBACK_OPTIONS:-} - NEXT_PUBLIC_NEGATIVE_PREDEFINED_FEEDBACK_OPTIONS=${NEXT_PUBLIC_NEGATIVE_PREDEFINED_FEEDBACK_OPTIONS:-} - NEXT_PUBLIC_DISABLE_LOGOUT=${NEXT_PUBLIC_DISABLE_LOGOUT:-} @@ -432,10 +429,10 @@ services: # in order to make this work on both Unix-like systems and windows command: > /bin/sh -c "dos2unix /etc/nginx/conf.d/run-nginx.sh - && /etc/nginx/conf.d/run-nginx.sh app.conf.template.dev" + && /etc/nginx/conf.d/run-nginx.sh app.conf.template" minio: - image: minio/minio:latest + image: minio/minio:RELEASE.2025-07-23T15-54-02Z-cpuv1 restart: unless-stopped ports: - "9004:9000" diff --git a/deployment/docker_compose/docker-compose.prod-cloud.yml b/deployment/docker_compose/docker-compose.prod-cloud.yml index bc5b3de9354..e242dfc5059 100644 --- a/deployment/docker_compose/docker-compose.prod-cloud.yml +++ b/deployment/docker_compose/docker-compose.prod-cloud.yml @@ -1,3 +1,5 @@ +name: onyx + services: api_server: image: onyxdotapp/onyx-backend:${IMAGE_TAG:-latest} @@ -15,8 +17,6 @@ services: - inference_model_server - minio restart: unless-stopped - env_file: - - .env environment: - AUTH_TYPE=${AUTH_TYPE:-oidc} - POSTGRES_HOST=relational_db @@ -48,8 +48,6 @@ services: - inference_model_server - indexing_model_server restart: unless-stopped - env_file: - - .env environment: - AUTH_TYPE=${AUTH_TYPE:-oidc} - POSTGRES_HOST=relational_db @@ -75,8 +73,6 @@ services: context: ../../web dockerfile: Dockerfile args: - - NEXT_PUBLIC_DISABLE_STREAMING=${NEXT_PUBLIC_DISABLE_STREAMING:-false} - - NEXT_PUBLIC_NEW_CHAT_DIRECTS_TO_SAME_PERSONA=${NEXT_PUBLIC_NEW_CHAT_DIRECTS_TO_SAME_PERSONA:-false} - NEXT_PUBLIC_POSITIVE_PREDEFINED_FEEDBACK_OPTIONS=${NEXT_PUBLIC_POSITIVE_PREDEFINED_FEEDBACK_OPTIONS:-} - NEXT_PUBLIC_NEGATIVE_PREDEFINED_FEEDBACK_OPTIONS=${NEXT_PUBLIC_NEGATIVE_PREDEFINED_FEEDBACK_OPTIONS:-} - NEXT_PUBLIC_DISABLE_LOGOUT=${NEXT_PUBLIC_DISABLE_LOGOUT:-} @@ -85,8 +81,6 @@ services: depends_on: - api_server restart: unless-stopped - env_file: - - .env environment: - INTERNAL_URL=http://api_server:8080 logging: @@ -101,8 +95,6 @@ services: command: -c 'max_connections=250' restart: unless-stopped # POSTGRES_USER and POSTGRES_PASSWORD should be set in .env file - env_file: - - .env volumes: - db_volume:/var/lib/postgresql/data logging: @@ -212,7 +204,7 @@ services: # in order to make this work on both Unix-like systems and windows command: > /bin/sh -c "dos2unix /etc/nginx/conf.d/run-nginx.sh - && /etc/nginx/conf.d/run-nginx.sh app.conf.template" + && /etc/nginx/conf.d/run-nginx.sh app.conf.template.prod" env_file: - .env.nginx @@ -231,7 +223,7 @@ services: entrypoint: "/bin/sh -c 'trap exit TERM; while :; do certbot renew; sleep 12h & wait $${!}; done;'" minio: - image: minio/minio:latest + image: minio/minio:RELEASE.2025-07-23T15-54-02Z-cpuv1 restart: unless-stopped environment: MINIO_ROOT_USER: ${MINIO_ROOT_USER:-minioadmin} diff --git a/deployment/docker_compose/docker-compose.prod-no-letsencrypt.yml b/deployment/docker_compose/docker-compose.prod-no-letsencrypt.yml index 8703386461c..642dd012387 100644 --- a/deployment/docker_compose/docker-compose.prod-no-letsencrypt.yml +++ b/deployment/docker_compose/docker-compose.prod-no-letsencrypt.yml @@ -1,3 +1,5 @@ +name: onyx + services: api_server: image: onyxdotapp/onyx-backend:${IMAGE_TAG:-latest} @@ -15,8 +17,6 @@ services: - inference_model_server - minio restart: unless-stopped - env_file: - - .env environment: - AUTH_TYPE=${AUTH_TYPE:-oidc} - POSTGRES_HOST=relational_db @@ -59,8 +59,6 @@ services: - inference_model_server - indexing_model_server restart: unless-stopped - env_file: - - .env environment: - AUTH_TYPE=${AUTH_TYPE:-oidc} - POSTGRES_HOST=relational_db @@ -95,8 +93,6 @@ services: context: ../../web dockerfile: Dockerfile args: - - NEXT_PUBLIC_DISABLE_STREAMING=${NEXT_PUBLIC_DISABLE_STREAMING:-false} - - NEXT_PUBLIC_NEW_CHAT_DIRECTS_TO_SAME_PERSONA=${NEXT_PUBLIC_NEW_CHAT_DIRECTS_TO_SAME_PERSONA:-false} - NEXT_PUBLIC_POSITIVE_PREDEFINED_FEEDBACK_OPTIONS=${NEXT_PUBLIC_POSITIVE_PREDEFINED_FEEDBACK_OPTIONS:-} - NEXT_PUBLIC_NEGATIVE_PREDEFINED_FEEDBACK_OPTIONS=${NEXT_PUBLIC_NEGATIVE_PREDEFINED_FEEDBACK_OPTIONS:-} - NEXT_PUBLIC_DISABLE_LOGOUT=${NEXT_PUBLIC_DISABLE_LOGOUT:-} @@ -105,8 +101,6 @@ services: depends_on: - api_server restart: unless-stopped - env_file: - - .env environment: - INTERNAL_URL=http://api_server:8080 logging: @@ -179,8 +173,6 @@ services: command: -c 'max_connections=250' restart: unless-stopped # POSTGRES_USER and POSTGRES_PASSWORD should be set in .env file - env_file: - - .env volumes: - db_volume:/var/lib/postgresql/data logging: @@ -232,12 +224,12 @@ services: # in order to make this work on both Unix-like systems and windows command: > /bin/sh -c "dos2unix /etc/nginx/conf.d/run-nginx.sh - && /etc/nginx/conf.d/run-nginx.sh app.conf.template.no-letsencrypt" + && /etc/nginx/conf.d/run-nginx.sh app.conf.template.prod.no-letsencrypt" env_file: - .env.nginx minio: - image: minio/minio:latest + image: minio/minio:RELEASE.2025-07-23T15-54-02Z-cpuv1 restart: unless-stopped environment: MINIO_ROOT_USER: ${MINIO_ROOT_USER:-minioadmin} diff --git a/deployment/docker_compose/docker-compose.prod.yml b/deployment/docker_compose/docker-compose.prod.yml index 0905f9bd4ad..ab92f8b5ff4 100644 --- a/deployment/docker_compose/docker-compose.prod.yml +++ b/deployment/docker_compose/docker-compose.prod.yml @@ -1,3 +1,5 @@ +name: onyx + services: api_server: image: onyxdotapp/onyx-backend:${IMAGE_TAG:-latest} @@ -16,8 +18,6 @@ services: - minio - inference_model_server restart: unless-stopped - env_file: - - .env environment: - AUTH_TYPE=${AUTH_TYPE:-oidc} - POSTGRES_HOST=relational_db @@ -63,8 +63,6 @@ services: - inference_model_server - indexing_model_server restart: unless-stopped - env_file: - - .env environment: - AUTH_TYPE=${AUTH_TYPE:-oidc} - POSTGRES_HOST=relational_db @@ -107,8 +105,6 @@ services: context: ../../web dockerfile: Dockerfile args: - - NEXT_PUBLIC_DISABLE_STREAMING=${NEXT_PUBLIC_DISABLE_STREAMING:-false} - - NEXT_PUBLIC_NEW_CHAT_DIRECTS_TO_SAME_PERSONA=${NEXT_PUBLIC_NEW_CHAT_DIRECTS_TO_SAME_PERSONA:-false} - NEXT_PUBLIC_POSITIVE_PREDEFINED_FEEDBACK_OPTIONS=${NEXT_PUBLIC_POSITIVE_PREDEFINED_FEEDBACK_OPTIONS:-} - NEXT_PUBLIC_NEGATIVE_PREDEFINED_FEEDBACK_OPTIONS=${NEXT_PUBLIC_NEGATIVE_PREDEFINED_FEEDBACK_OPTIONS:-} - NEXT_PUBLIC_DISABLE_LOGOUT=${NEXT_PUBLIC_DISABLE_LOGOUT:-} @@ -117,8 +113,6 @@ services: depends_on: - api_server restart: unless-stopped - env_file: - - .env environment: - INTERNAL_URL=http://api_server:8080 logging: @@ -133,8 +127,6 @@ services: command: -c 'max_connections=250' restart: unless-stopped # POSTGRES_USER and POSTGRES_PASSWORD should be set in .env file - env_file: - - .env volumes: - db_volume:/var/lib/postgresql/data logging: @@ -248,7 +240,7 @@ services: # in order to make this work on both Unix-like systems and windows command: > /bin/sh -c "dos2unix /etc/nginx/conf.d/run-nginx.sh - && /etc/nginx/conf.d/run-nginx.sh app.conf.template" + && /etc/nginx/conf.d/run-nginx.sh app.conf.template.prod" env_file: - .env.nginx @@ -267,7 +259,7 @@ services: entrypoint: "/bin/sh -c 'trap exit TERM; while :; do certbot renew; sleep 12h & wait $${!}; done;'" minio: - image: minio/minio:latest + image: minio/minio:RELEASE.2025-07-23T15-54-02Z-cpuv1 restart: unless-stopped environment: MINIO_ROOT_USER: ${MINIO_ROOT_USER:-minioadmin} diff --git a/deployment/docker_compose/docker-compose.search-testing.yml b/deployment/docker_compose/docker-compose.search-testing.yml index 1dea586a7f8..aa95234317e 100644 --- a/deployment/docker_compose/docker-compose.search-testing.yml +++ b/deployment/docker_compose/docker-compose.search-testing.yml @@ -1,3 +1,5 @@ +name: onyx + services: api_server: image: onyxdotapp/onyx-backend:${IMAGE_TAG:-latest} @@ -87,8 +89,6 @@ services: context: ../../web dockerfile: Dockerfile args: - - NEXT_PUBLIC_DISABLE_STREAMING=${NEXT_PUBLIC_DISABLE_STREAMING:-false} - - NEXT_PUBLIC_NEW_CHAT_DIRECTS_TO_SAME_PERSONA=${NEXT_PUBLIC_NEW_CHAT_DIRECTS_TO_SAME_PERSONA:-false} - NEXT_PUBLIC_POSITIVE_PREDEFINED_FEEDBACK_OPTIONS=${NEXT_PUBLIC_POSITIVE_PREDEFINED_FEEDBACK_OPTIONS:-} - NEXT_PUBLIC_NEGATIVE_PREDEFINED_FEEDBACK_OPTIONS=${NEXT_PUBLIC_NEGATIVE_PREDEFINED_FEEDBACK_OPTIONS:-} - NEXT_PUBLIC_DISABLE_LOGOUT=${NEXT_PUBLIC_DISABLE_LOGOUT:-} @@ -217,10 +217,10 @@ services: # in order to make this work on both Unix-like systems and windows command: > /bin/sh -c "dos2unix /etc/nginx/conf.d/run-nginx.sh - && /etc/nginx/conf.d/run-nginx.sh app.conf.template.dev" + && /etc/nginx/conf.d/run-nginx.sh app.conf.template" minio: - image: minio/minio:latest + image: minio/minio:RELEASE.2025-07-23T15-54-02Z-cpuv1 restart: unless-stopped ports: - "9004:9000" diff --git a/deployment/docker_compose/docker-compose.yml b/deployment/docker_compose/docker-compose.yml new file mode 100644 index 00000000000..e9528d3aa97 --- /dev/null +++ b/deployment/docker_compose/docker-compose.yml @@ -0,0 +1,346 @@ +# ============================================================================= +# ONYX DOCKER COMPOSE +# ============================================================================= +# This is the default configuration for Onyx. This file is fairly configurable, +# also see env.template for possible settings. +# +# PRODUCTION DEPLOYMENT CHECKLIST: +# To convert this setup to a production deployment following best practices, +# follow the checklist below. Note that there are other ways to secure the Onyx +# deployment so these are not strictly necessary for all teams. +# +# 1. SECURITY HARDENING: +# - Remove all port exposures except nginx (80/443) +# - Comment out ports for: api_server, relational_db, index, cache, minio +# +# 2. SSL/TLS SETUP: +# - Uncomment the certbot service (see below) +# - Add SSL certificate volumes to nginx service +# - Change nginx command from app.conf.template to app.conf.template.prod +# +# 3. ENVIRONMENT CONFIGURATION: +# - Replace env_file with explicit environment variables +# +# 4. AUTHENTICATION: +# - Select an authentication method like Basic, Google OAuth, OIDC, or SAML +# +# 5. CA CERTIFICATES: +# - Uncomment custom CA certificate volumes if needed +# +# 6. DOMAIN CONFIGURATION: +# - Set proper DOMAIN environment variable for nginx +# - Configure DNS and SSL certificates +# +# For a complete production setup, refer to docker-compose.prod.yml +# ============================================================================= + +name: onyx + +services: + api_server: + image: onyxdotapp/onyx-backend:${IMAGE_TAG:-latest} + build: + context: ../../backend + dockerfile: Dockerfile + command: > + /bin/sh -c "alembic upgrade head && + echo \"Starting Onyx Api Server\" && + uvicorn onyx.main:app --host 0.0.0.0 --port 8080" + depends_on: + - relational_db + - index + - cache + - inference_model_server + - minio + restart: unless-stopped + # PRODUCTION: Remove this port exposure for security (only nginx should be accessible) + ports: + - "8080:8080" + environment: + # Auth Settings + - AUTH_TYPE=${AUTH_TYPE:-basic} + - POSTGRES_HOST=${POSTGRES_HOST:-relational_db} + - VESPA_HOST=${VESPA_HOST:-index} + - REDIS_HOST=${REDIS_HOST:-cache} + - MODEL_SERVER_HOST=${MODEL_SERVER_HOST:-inference_model_server} + - S3_ENDPOINT_URL=${S3_ENDPOINT_URL:-http://minio:9000} + - S3_AWS_ACCESS_KEY_ID=${S3_AWS_ACCESS_KEY_ID:-minioadmin} + - S3_AWS_SECRET_ACCESS_KEY=${S3_AWS_SECRET_ACCESS_KEY:-minioadmin} + # PRODUCTION: 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 + extra_hosts: + - "host.docker.internal:host-gateway" + logging: + driver: json-file + options: + max-size: "50m" + max-file: "6" + # Optional, only for debugging purposes + volumes: + - api_server_logs:/var/log/onyx + + background: + image: onyxdotapp/onyx-backend:${IMAGE_TAG:-latest} + build: + context: ../../backend + dockerfile: Dockerfile + command: > + /bin/sh -c " + if [ -f /etc/ssl/certs/custom-ca.crt ]; then + update-ca-certificates; + fi && + /usr/bin/supervisord -c /etc/supervisor/conf.d/supervisord.conf" + depends_on: + - relational_db + - index + - cache + - inference_model_server + - indexing_model_server + restart: unless-stopped + environment: + - POSTGRES_HOST=${POSTGRES_HOST:-relational_db} + - VESPA_HOST=${VESPA_HOST:-index} + - REDIS_HOST=${REDIS_HOST:-cache} + - MODEL_SERVER_HOST=${MODEL_SERVER_HOST:-inference_model_server} + - INDEXING_MODEL_SERVER_HOST=${INDEXING_MODEL_SERVER_HOST:-indexing_model_server} + - S3_ENDPOINT_URL=${S3_ENDPOINT_URL:-http://minio:9000} + - S3_AWS_ACCESS_KEY_ID=${S3_AWS_ACCESS_KEY_ID:-minioadmin} + - S3_AWS_SECRET_ACCESS_KEY=${S3_AWS_SECRET_ACCESS_KEY:-minioadmin} + # PRODUCTION: 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 + extra_hosts: + - "host.docker.internal:host-gateway" + # Optional, only for debugging purposes + volumes: + - background_logs:/var/log/onyx + logging: + driver: json-file + options: + max-size: "50m" + max-file: "6" + # PRODUCTION: Uncomment the following lines if you need to include a custom CA certificate + # This section enables the use of a custom CA certificate + # If present, the custom CA certificate is mounted as a volume + # The container checks for its existence and updates the system's CA certificates + # This allows for secure communication with services using custom SSL certificates + # Optional volume mount for CA certificate + # volumes: + # # Maps to the CA_CERT_PATH environment variable in the Dockerfile + # - ${CA_CERT_PATH:-./custom-ca.crt}:/etc/ssl/certs/custom-ca.crt:ro + + web_server: + image: onyxdotapp/onyx-web-server:${IMAGE_TAG:-latest} + build: + context: ../../web + dockerfile: Dockerfile + args: + - NEXT_PUBLIC_POSITIVE_PREDEFINED_FEEDBACK_OPTIONS=${NEXT_PUBLIC_POSITIVE_PREDEFINED_FEEDBACK_OPTIONS:-} + - NEXT_PUBLIC_NEGATIVE_PREDEFINED_FEEDBACK_OPTIONS=${NEXT_PUBLIC_NEGATIVE_PREDEFINED_FEEDBACK_OPTIONS:-} + - NEXT_PUBLIC_DISABLE_LOGOUT=${NEXT_PUBLIC_DISABLE_LOGOUT:-} + - NEXT_PUBLIC_DEFAULT_SIDEBAR_OPEN=${NEXT_PUBLIC_DEFAULT_SIDEBAR_OPEN:-} + - NEXT_PUBLIC_FORGOT_PASSWORD_ENABLED=${NEXT_PUBLIC_FORGOT_PASSWORD_ENABLED:-} + # Enterprise Edition only + - NEXT_PUBLIC_THEME=${NEXT_PUBLIC_THEME:-} + # DO NOT TURN ON unless you have EXPLICIT PERMISSION from Onyx. + - NEXT_PUBLIC_DO_NOT_USE_TOGGLE_OFF_DANSWER_POWERED=${NEXT_PUBLIC_DO_NOT_USE_TOGGLE_OFF_DANSWER_POWERED:-false} + - NODE_OPTIONS=${NODE_OPTIONS:-"--max-old-space-size=4096"} + depends_on: + - api_server + restart: unless-stopped + environment: + - INTERNAL_URL=${INTERNAL_URL:-http://api_server:8080} + + inference_model_server: + image: onyxdotapp/onyx-model-server:${IMAGE_TAG:-latest} + build: + context: ../../backend + dockerfile: Dockerfile.model_server + # GPU Support: Uncomment the following lines to enable GPU support + # Requires nvidia-container-toolkit to be installed on the host + # deploy: + # resources: + # reservations: + # devices: + # - driver: nvidia + # count: all + # capabilities: [gpu] + command: > + /bin/sh -c "if [ \"${DISABLE_MODEL_SERVER:-false}\" = \"True\" ]; then + echo 'Skipping service...'; + exit 0; + else + exec uvicorn model_server.main:app --host 0.0.0.0 --port 9000; + fi" + restart: unless-stopped + volumes: + # Not necessary, this is just to reduce download time during startup + - model_cache_huggingface:/app/.cache/huggingface/ + # Optional, only for debugging purposes + - inference_model_server_logs:/var/log/onyx + logging: + driver: json-file + options: + max-size: "50m" + max-file: "6" + + indexing_model_server: + image: onyxdotapp/onyx-model-server:${IMAGE_TAG:-latest} + build: + context: ../../backend + dockerfile: Dockerfile.model_server + # GPU Support: Uncomment the following lines to enable GPU support + # Requires nvidia-container-toolkit to be installed on the host + # deploy: + # resources: + # reservations: + # devices: + # - driver: nvidia + # count: all + # capabilities: [gpu] + command: > + /bin/sh -c "if [ \"${DISABLE_MODEL_SERVER:-false}\" = \"True\" ]; then + echo 'Skipping service...'; + exit 0; + else + exec uvicorn model_server.main:app --host 0.0.0.0 --port 9000; + fi" + restart: unless-stopped + environment: + - INDEXING_ONLY=True + volumes: + # Not necessary, this is just to reduce download time during startup + - indexing_huggingface_model_cache:/app/.cache/huggingface/ + # Optional, only for debugging purposes + - indexing_model_server_logs:/var/log/onyx + logging: + driver: json-file + options: + max-size: "50m" + max-file: "6" + + relational_db: + image: postgres:15.2-alpine + shm_size: 1g + command: -c 'max_connections=250' + restart: unless-stopped + # PRODUCTION: Override the defaults by passing in the environment variables + environment: + - POSTGRES_USER=${POSTGRES_USER:-postgres} + - POSTGRES_PASSWORD=${POSTGRES_PASSWORD:-password} + # PRODUCTION: Remove this port exposure for security (database should only be accessible internally) + ports: + - "5432:5432" + volumes: + - db_volume:/var/lib/postgresql/data + + # This container name cannot have an underscore in it due to Vespa expectations of the URL + index: + image: vespaengine/vespa:8.526.15 + restart: unless-stopped + environment: + - VESPA_SKIP_UPGRADE_CHECK=${VESPA_SKIP_UPGRADE_CHECK:-true} + # PRODUCTION: Remove these port exposures for security (Vespa should only be accessible internally) + ports: + - "19071:19071" + - "8081:8081" + volumes: + - vespa_volume:/opt/vespa/var + logging: + driver: json-file + options: + max-size: "50m" + max-file: "6" + + nginx: + image: nginx:1.23.4-alpine + restart: unless-stopped + # nginx will immediately crash with `nginx: [emerg] host not found in upstream` + # if api_server / web_server are not up + depends_on: + - api_server + - web_server + environment: + - DOMAIN=localhost + ports: + - "80:80" + - "3000:80" # allow for localhost:3000 usage, since that is the norm + volumes: + - ../data/nginx:/etc/nginx/conf.d + # PRODUCTION: Add SSL certificate volumes for HTTPS support: + # - ../data/certbot/conf:/etc/letsencrypt + # - ../data/certbot/www:/var/www/certbot + logging: + driver: json-file + options: + max-size: "50m" + max-file: "6" + # The specified script waits for the api_server to start up. + # Without this we've seen issues where nginx shows no error logs but + # does not receive any traffic + # NOTE: we have to use dos2unix to remove Carriage Return chars from the file + # in order to make this work on both Unix-like systems and windows + # PRODUCTION: Change to app.conf.template.prod for production nginx config + command: > + /bin/sh -c "dos2unix /etc/nginx/conf.d/run-nginx.sh + && /etc/nginx/conf.d/run-nginx.sh app.conf.template" + + cache: + image: redis:7.4-alpine + restart: unless-stopped + # PRODUCTION: Remove this port exposure for security (Redis should only be accessible internally) + ports: + - "6379:6379" + # docker silently mounts /data even without an explicit volume mount, which enables + # persistence. explicitly setting save and appendonly forces ephemeral behavior. + command: redis-server --save "" --appendonly no + + minio: + image: minio/minio:RELEASE.2025-07-23T15-54-02Z-cpuv1 + restart: unless-stopped + # PRODUCTION: Remove these port exposures for security (MinIO should only be accessible internally) + ports: + - "9004:9000" + - "9005:9001" + environment: + MINIO_ROOT_USER: ${MINIO_ROOT_USER:-minioadmin} + MINIO_ROOT_PASSWORD: ${MINIO_ROOT_PASSWORD:-minioadmin} + # Note: we've seen the default bucket creation logic not work in some cases + MINIO_DEFAULT_BUCKETS: ${S3_FILE_STORE_BUCKET_NAME:-onyx-file-store-bucket} + volumes: + - minio_data:/data + command: server /data --console-address ":9001" + healthcheck: + test: ["CMD", "curl", "-f", "http://localhost:9000/minio/health/live"] + interval: 30s + timeout: 20s + retries: 3 + + # PRODUCTION: Uncomment the following certbot service for SSL certificate management + # certbot: + # image: certbot/certbot + # restart: unless-stopped + # volumes: + # - ../data/certbot/conf:/etc/letsencrypt + # - ../data/certbot/www:/var/www/certbot + # logging: + # driver: json-file + # options: + # max-size: "50m" + # max-file: "6" + # entrypoint: "/bin/sh -c 'trap exit TERM; while :; do certbot renew; sleep 12h & wait $${!}; done;'" + +volumes: + # Necessary for persisting data for use + db_volume: + vespa_volume: # Created by the container itself + minio_data: + # Caches to prevent re-downloading models, not strictly necessary + model_cache_huggingface: + indexing_huggingface_model_cache: + # Logs preserved across container restarts + api_server_logs: + background_logs: + inference_model_server_logs: + indexing_model_server_logs: diff --git a/deployment/docker_compose/env.template b/deployment/docker_compose/env.template new file mode 100644 index 00000000000..f3d48fc856b --- /dev/null +++ b/deployment/docker_compose/env.template @@ -0,0 +1,213 @@ +# Copy this file to .env so it's picked up by the docker compose yaml files +# Uncomment the values you would like to set +# No edits necessary, works out of the box + + +################################################################################ +## COMMONLY MODIFIED CONFIGURATIONS +################################################################################ +## Version of Onyx to deploy, default is latest (main built nightly) +IMAGE_TAG=latest + +## Auth Settings +### https://docs.onyx.app/deployment/authentication +AUTH_TYPE=disabled +# SESSION_EXPIRE_TIME_SECONDS= +### Recommend to set this for security +# ENCRYPTION_KEY_SECRET= +### Optional +# API_KEY_HASH_ROUNDS= +### You can add a comma separated list of domains like onyx.app, only those domains will be allowed to signup/log in +# VALID_EMAIL_DOMAINS= + +## Internet Search (currently no UI config for this yet) +# EXA_API_KEY= + +## Chat Configuration +# HARD_DELETE_CHATS= + +## Base URL for redirects +# WEB_DOMAIN= + +## Enterprise Features, requires a paid plan and licenses +ENABLE_PAID_ENTERPRISE_EDITION_FEATURES=false + + +################################################################################ +## SERVICES CONFIGURATIONS +################################################################################ +## Database Configuration +POSTGRES_USER=postgres +POSTGRES_PASSWORD=password +# POSTGRES_DB= +# POSTGRES_DEFAULT_SCHEMA= +# POSTGRES_USE_NULL_POOL= +# POSTGRES_API_SERVER_POOL_SIZE= +# POSTGRES_API_SERVER_POOL_OVERFLOW +# POSTGRES_IDLE_SESSIONS_TIMEOUT= +# POSTGRES_POOL_RECYCLE= +# DB_READONLY_USER= +# DB_READONLY_PASSWORD= + +## MinIO/S3 Configuration +S3_ENDPOINT_URL=http://minio:9000 +S3_AWS_ACCESS_KEY_ID=minioadmin +S3_AWS_SECRET_ACCESS_KEY=minioadmin +S3_FILE_STORE_BUCKET_NAME=onyx-file-store-bucket +MINIO_ROOT_USER=minioadmin +MINIO_ROOT_PASSWORD=minioadmin + +## Celery Configuration +# CELERY_BROKER_POOL_LIMIT= +# CELERY_WORKER_DOCFETCHING_CONCURRENCY= +# CELERY_WORKER_DOCPROCESSING_CONCURRENCY= +# CELERY_WORKER_LIGHT_CONCURRENCY= +# CELERY_WORKER_LIGHT_PREFETCH_MULTIPLIER= + +## AWS Configuration +# AWS_ACCESS_KEY_ID= +# AWS_SECRET_ACCESS_KEY= +# AWS_REGION_NAME= +# USE_IAM_AUTH= + + +################################################################################ +## DEVELOPER, DEBUGGING, AND LOGGING +################################################################################ +## Logging and Telemetry +LOG_LEVEL=info +LOG_ALL_MODEL_INTERACTIONS=False +LOG_ONYX_MODEL_INTERACTIONS=False +LOG_INDIVIDUAL_MODEL_TOKENS=False +# LOG_VESPA_TIMING_INFORMATION= +# LOG_ENDPOINT_LATENCY= +# LOG_POSTGRES_LATENCY= +# LOG_POSTGRES_CONN_COUNTS= +# DISABLE_TELEMETRY= + +## Feature Flags +# SHOW_EXTRA_CONNECTORS=true +# DISABLE_MODEL_SERVER=false + +## Analytics +# SENTRY_DSN= + +## Demo/Testing +# MOCK_CONNECTOR_FILE_PATH= + + +################################################################################ +## ADVANCED CONFIGURATIONS +################################################################################ +## SlackBot Configuration +# ONYX_BOT_DISABLE_DOCS_ONLY_ANSWER= +# ONYX_BOT_FEEDBACK_VISIBILITY= +# ONYX_BOT_DISPLAY_ERROR_MSGS= +# ONYX_BOT_RESPOND_EVERY_CHANNEL= +# NOTIFY_SLACKBOT_NO_ANSWER= +# ONYX_BOT_MAX_QPM= +# ONYX_BOT_MAX_WAIT_TIME= + +## Advanced Auth Settings +# GOOGLE_OAUTH_CLIENT_ID= +# GOOGLE_OAUTH_CLIENT_SECRET= +# REQUIRE_EMAIL_VERIFICATION= +# SMTP_SERVER= +# SMTP_PORT= +# SMTP_USER= +# SMTP_PASS= +# ENABLE_EMAIL_INVITES= +# EMAIL_FROM= +# OAUTH_CLIENT_ID= +# OAUTH_CLIENT_SECRET= +# OPENID_CONFIG_URL= +# TRACK_EXTERNAL_IDP_EXPIRY= +# CORS_ALLOWED_ORIGIN= +# INTEGRATION_TESTS_MODE= +# JWT_PUBLIC_KEY_URL= + +## Gen AI Settings +# GEN_AI_MAX_TOKENS= +# QA_TIMEOUT= +# MAX_CHUNKS_FED_TO_CHAT= +# DISABLE_LLM_CHOOSE_SEARCH= +# DISABLE_LLM_QUERY_REPHRASE= +# DISABLE_GENERATIVE_AI= +# DISABLE_LITELLM_STREAMING= +# LITELLM_EXTRA_HEADERS= +# DISABLE_LLM_DOC_RELEVANCE= +# GEN_AI_API_KEY= +# TOKEN_BUDGET_GLOBALLY_ENABLED= +# GENERATIVE_MODEL_ACCESS_CHECK_FREQ= +# LITELLM_CUSTOM_ERROR_MESSAGE_MAPPINGS= + +## Query Options +# DOC_TIME_DECAY= +# HYBRID_ALPHA= +# EDIT_KEYWORD_QUERY= +# MULTILINGUAL_QUERY_EXPANSION= +# LANGUAGE_HINT= +# LANGUAGE_CHAT_NAMING_HINT= +# USE_SEMANTIC_KEYWORD_EXPANSIONS_BASIC_SEARCH= + +## Model Configuration +# EMBEDDING_BATCH_SIZE= +# DOCUMENT_ENCODER_MODEL= +# DOC_EMBEDDING_DIM= +# NORMALIZE_EMBEDDINGS= +# ASYM_QUERY_PREFIX= +# ASYM_PASSAGE_PREFIX= +# DISABLE_RERANK_FOR_STREAMING= +# MODEL_SERVER_PORT= +# INDEX_BATCH_SIZE= +# MIN_THREADS_ML_MODELS= +# CLIENT_EMBEDDING_TIMEOUT= + +## Indexing Configuration +# VESPA_SEARCHER_THREADS= +# ENABLED_CONNECTOR_TYPES= +# DISABLE_INDEX_UPDATE_ON_SWAP= +# DASK_JOB_CLIENT_ENABLED= +# CONTINUE_ON_CONNECTOR_FAILURE= +# EXPERIMENTAL_CHECKPOINTING_ENABLED= +# CONFLUENCE_CONNECTOR_LABELS_TO_SKIP= +# JIRA_CONNECTOR_LABELS_TO_SKIP= +# WEB_CONNECTOR_VALIDATE_URLS= +# JIRA_SERVER_API_VERSION= +# JIRA_CLOUD_API_VERSION= +# GONG_CONNECTOR_START_TIME= +# NOTION_CONNECTOR_ENABLE_RECURSIVE_PAGE_LOOKUP= +# GITHUB_CONNECTOR_BASE_URL= +# MAX_DOCUMENT_CHARS= +# MAX_FILE_SIZE_BYTES= + +## OAuth Connector Configs +# EGNYTE_CLIENT_ID= +# EGNYTE_CLIENT_SECRET= +# EGNYTE_LOCALHOST_OVERRIDE= +# LINEAR_CLIENT_ID= +# LINEAR_CLIENT_SECRET= + +## Miscellaneous +# ONYX_QUERY_HISTORY_TYPE= +# CHECK_TTL_MANAGEMENT_TASK_FREQUENCY_IN_HOURS= +# VESPA_LANGUAGE_OVERRIDE= + +## Frontend Configs +# THEME_IS_DARK= +# NEXT_PUBLIC_POSITIVE_PREDEFINED_FEEDBACK_OPTIONS= +# NEXT_PUBLIC_NEGATIVE_PREDEFINED_FEEDBACK_OPTIONS= +# NEXT_PUBLIC_DISABLE_LOGOUT= +# NEXT_PUBLIC_DEFAULT_SIDEBAR_OPEN= +# NEXT_PUBLIC_FORGOT_PASSWORD_ENABLED= +# NEXT_PUBLIC_THEME= +# NEXT_PUBLIC_DO_NOT_USE_TOGGLE_OFF_DANSWER_POWERED= +# NEXT_PUBLIC_CUSTOM_REFRESH_URL= + +## Pointer to services +POSTGRES_HOST=relational_db +VESPA_HOST=index +REDIS_HOST=cache +MODEL_SERVER_HOST=inference_model_server +INDEXING_MODEL_SERVER_HOST=indexing_model_server +INTERNAL_URL=http://api_server:8080 diff --git a/deployment/docker_compose/init-letsencrypt.sh b/deployment/docker_compose/init-letsencrypt.sh index acbb65863b1..bbc67bd146b 100755 --- a/deployment/docker_compose/init-letsencrypt.sh +++ b/deployment/docker_compose/init-letsencrypt.sh @@ -52,7 +52,7 @@ fi echo "### Creating dummy certificate for $domains ..." path="/etc/letsencrypt/live/$domains" mkdir -p "$data_path/conf/live/$domains" -$COMPOSE_CMD -f docker-compose.prod.yml run --name onyx-stack --rm --entrypoint "\ +$COMPOSE_CMD -f docker-compose.prod.yml run --name onyx --rm --entrypoint "\ openssl req -x509 -nodes -newkey rsa:$rsa_key_size -days 1\ -keyout '$path/privkey.pem' \ -out '$path/fullchain.pem' \ @@ -61,7 +61,7 @@ echo echo "### Starting nginx ..." -$COMPOSE_CMD -f docker-compose.prod.yml -p onyx-stack up --force-recreate -d nginx +$COMPOSE_CMD -f docker-compose.prod.yml up --force-recreate -d nginx echo echo "Waiting for nginx to be ready, this may take a minute..." @@ -79,7 +79,7 @@ while true; do done echo "### Deleting dummy certificate for $domains ..." -$COMPOSE_CMD -f docker-compose.prod.yml run --name onyx-stack --rm --entrypoint "\ +$COMPOSE_CMD -f docker-compose.prod.yml run --name onyx --rm --entrypoint "\ rm -Rf /etc/letsencrypt/live/$domains && \ rm -Rf /etc/letsencrypt/archive/$domains && \ rm -Rf /etc/letsencrypt/renewal/$domains.conf" certbot @@ -102,7 +102,7 @@ esac # Enable staging mode if needed if [ $staging != "0" ]; then staging_arg="--staging"; fi -$COMPOSE_CMD -f docker-compose.prod.yml run --name onyx-stack --rm --entrypoint "\ +$COMPOSE_CMD -f docker-compose.prod.yml run --name onyx --rm --entrypoint "\ certbot certonly --webroot -w /var/www/certbot \ $staging_arg \ $email_arg \ @@ -113,7 +113,7 @@ $COMPOSE_CMD -f docker-compose.prod.yml run --name onyx-stack --rm --entrypoint echo echo "### Renaming certificate directory if needed ..." -$COMPOSE_CMD -f docker-compose.prod.yml run --name onyx-stack --rm --entrypoint "\ +$COMPOSE_CMD -f docker-compose.prod.yml run --name onyx --rm --entrypoint "\ sh -c 'for domain in $domains; do \ numbered_dir=\$(find /etc/letsencrypt/live -maxdepth 1 -type d -name \"\$domain-00*\" | sort -r | head -n1); \ if [ -n \"\$numbered_dir\" ]; then \ @@ -122,4 +122,4 @@ $COMPOSE_CMD -f docker-compose.prod.yml run --name onyx-stack --rm --entrypoint done'" certbot echo "### Reloading nginx ..." -$COMPOSE_CMD -f docker-compose.prod.yml -p onyx-stack up --force-recreate -d +$COMPOSE_CMD -f docker-compose.prod.yml up --force-recreate -d diff --git a/deployment/docker_compose/install.sh b/deployment/docker_compose/install.sh new file mode 100755 index 00000000000..c4f9037b5bd --- /dev/null +++ b/deployment/docker_compose/install.sh @@ -0,0 +1,689 @@ +#!/bin/bash + +set -e + +# Parse command line arguments +SHUTDOWN_MODE=false +DELETE_DATA_MODE=false + +while [[ $# -gt 0 ]]; do + case $1 in + --shutdown) + SHUTDOWN_MODE=true + shift + ;; + --delete-data) + DELETE_DATA_MODE=true + shift + ;; + --help|-h) + echo "Onyx Installation Script" + echo "" + echo "Usage: $0 [OPTIONS]" + echo "" + echo "Options:" + echo " --shutdown Stop (pause) Onyx containers" + echo " --delete-data Remove all Onyx data (containers, volumes, and files)" + echo " --help, -h Show this help message" + echo "" + echo "Examples:" + echo " $0 # Install Onyx" + echo " $0 --shutdown # Pause Onyx services" + echo " $0 --delete-data # Completely remove Onyx and all data" + exit 0 + ;; + *) + echo "Unknown option: $1" + echo "Use --help for usage information" + exit 1 + ;; + esac +done + +# Colors for output +RED='\033[0;31m' +GREEN='\033[0;32m' +YELLOW='\033[1;33m' +BLUE='\033[0;34m' +BOLD='\033[1m' +NC='\033[0m' # No Color + +# Step counter variables +CURRENT_STEP=0 +TOTAL_STEPS=8 + +# Print colored output +print_success() { + echo -e "${GREEN}✓${NC} $1" +} + +print_error() { + echo -e "${RED}✗${NC} $1" +} + +print_info() { + echo -e "${YELLOW}ℹ${NC} $1" +} + +print_step() { + CURRENT_STEP=$((CURRENT_STEP + 1)) + echo "" + echo -e "${BLUE}${BOLD}=== $1 - Step ${CURRENT_STEP}/${TOTAL_STEPS} ===${NC}" + echo "" +} + +print_warning() { + echo -e "${YELLOW}⚠${NC} $1" +} + +# Handle shutdown mode +if [ "$SHUTDOWN_MODE" = true ]; then + echo "" + echo -e "${BLUE}${BOLD}=== Shutting down Onyx ===${NC}" + echo "" + + if [ -d "onyx_data/deployment" ]; then + print_info "Stopping Onyx containers..." + cd onyx_data/deployment + + # Check if docker-compose.yml exists + if [ -f "docker-compose.yml" ]; then + # Determine compose command + if docker compose version &> /dev/null; then + COMPOSE_CMD="docker compose" + elif command -v docker-compose &> /dev/null; then + COMPOSE_CMD="docker-compose" + else + print_error "Docker Compose not found. Cannot stop containers." + exit 1 + fi + + # Stop containers (without removing them) + $COMPOSE_CMD -f docker-compose.yml stop + print_success "Onyx containers stopped (paused)" + else + print_warning "docker-compose.yml not found in onyx_data/deployment" + fi + + cd ../.. + else + print_warning "Onyx data directory not found. Nothing to shutdown." + fi + + echo "" + print_success "Onyx shutdown complete!" + exit 0 +fi + +# Handle delete data mode +if [ "$DELETE_DATA_MODE" = true ]; then + echo "" + echo -e "${RED}${BOLD}=== WARNING: This will permanently delete all Onyx data ===${NC}" + echo "" + print_warning "This action will remove:" + echo " • All Onyx containers and volumes" + echo " • All downloaded files and configurations" + echo " • All user data and documents" + echo "" + read -p "Are you sure you want to continue? Type 'DELETE' to confirm: " -r + echo "" + + if [ "$REPLY" != "DELETE" ]; then + print_info "Operation cancelled." + exit 0 + fi + + print_info "Removing Onyx containers and volumes..." + + if [ -d "onyx_data/deployment" ]; then + cd onyx_data/deployment + + # Check if docker-compose.yml exists + if [ -f "docker-compose.yml" ]; then + # Determine compose command + if docker compose version &> /dev/null; then + COMPOSE_CMD="docker compose" + elif command -v docker-compose &> /dev/null; then + COMPOSE_CMD="docker-compose" + else + print_error "Docker Compose not found. Cannot remove containers." + exit 1 + fi + + # Stop and remove containers with volumes + $COMPOSE_CMD -f docker-compose.yml down -v + print_success "Onyx containers and volumes removed" + fi + + cd ../.. + fi + + print_info "Removing data directories..." + if [ -d "onyx_data" ]; then + rm -rf onyx_data + print_success "Data directories removed" + else + print_warning "No onyx_data directory found" + fi + + echo "" + print_success "All Onyx data has been permanently deleted!" + exit 0 +fi + +# ASCII Art Banner +echo "" +echo -e "${BLUE}${BOLD}" +echo " ____ " +echo " / __ \ " +echo "| | | |_ __ _ ___ __ " +echo "| | | | '_ \| | | \ \/ / " +echo "| |__| | | | | |_| |> < " +echo " \____/|_| |_|\__, /_/\_\ " +echo " __/ | " +echo " |___/ " +echo -e "${NC}" +echo "Welcome to Onyx Installation Script" +echo "====================================" +echo "" + +# User acknowledgment section +echo -e "${YELLOW}${BOLD}This script will:${NC}" +echo "1. Download deployment files for Onyx into a new 'onyx_data' directory" +echo "2. Check your system resources (Docker, memory, disk space)" +echo "3. Guide you through deployment options (version, authentication)" +echo "" + +# Only prompt for acknowledgment if running interactively +if [ -t 0 ]; then + echo -e "${YELLOW}${BOLD}Please acknowledge and press Enter to continue...${NC}" + read -r + echo "" +else + echo -e "${YELLOW}${BOLD}Running in non-interactive mode - proceeding automatically...${NC}" + echo "" +fi + +# GitHub repo base URL - using docker-compose-easy branch +GITHUB_RAW_URL="https://raw.githubusercontent.com/onyx-dot-app/onyx/main/deployment/docker_compose" + +# Check system requirements +print_step "Verifying Docker installation" + +# Check Docker +if ! command -v docker &> /dev/null; then + print_error "Docker is not installed. Please install Docker first." + echo "Visit: https://docs.docker.com/get-docker/" + exit 1 +fi +DOCKER_VERSION=$(docker --version | grep -oE '[0-9]+\.[0-9]+\.[0-9]+' | head -1) +print_success "Docker $DOCKER_VERSION is installed" + +# Check Docker Compose +if docker compose version &> /dev/null; then + COMPOSE_VERSION=$(docker compose version | grep -oE '[0-9]+\.[0-9]+\.[0-9]+' | head -1) + COMPOSE_CMD="docker compose" + print_success "Docker Compose $COMPOSE_VERSION is installed (plugin)" +elif command -v docker-compose &> /dev/null; then + COMPOSE_VERSION=$(docker-compose --version | grep -oE '[0-9]+\.[0-9]+\.[0-9]+' | head -1) + COMPOSE_CMD="docker-compose" + print_success "Docker Compose $COMPOSE_VERSION is installed (standalone)" +else + print_error "Docker Compose is not installed. Please install Docker Compose first." + echo "Visit: https://docs.docker.com/compose/install/" + exit 1 +fi + +# Check Docker daemon +if ! docker info &> /dev/null; then + print_error "Docker daemon is not running. Please start Docker." + exit 1 +fi +print_success "Docker daemon is running" + +# Check Docker resources +print_step "Verifying Docker resources" + +# Get Docker system info +DOCKER_INFO=$(docker system info 2>/dev/null) + +# Try to get memory allocation (method varies by platform) +if [[ "$OSTYPE" == "darwin"* ]]; then + # macOS - Docker Desktop + if command -v jq &> /dev/null && [ -f ~/Library/Group\ Containers/group.com.docker/settings.json ]; then + MEMORY_MB=$(cat ~/Library/Group\ Containers/group.com.docker/settings.json 2>/dev/null | jq '.memoryMiB // 0' 2>/dev/null || echo "0") + else + # Try to get from docker system info + MEMORY_BYTES=$(docker system info 2>/dev/null | grep -i "total memory" | grep -oE '[0-9]+\.[0-9]+' | head -1) + if [ -n "$MEMORY_BYTES" ]; then + # Convert from GiB to MB (multiply by 1024) + MEMORY_MB=$(echo "$MEMORY_BYTES * 1024" | bc 2>/dev/null | cut -d. -f1) + if [ -z "$MEMORY_MB" ]; then + MEMORY_MB="0" + fi + else + MEMORY_MB="0" + fi + fi +else + # Linux - Native Docker + MEMORY_KB=$(grep MemTotal /proc/meminfo | grep -oE '[0-9]+' || echo "0") + MEMORY_MB=$((MEMORY_KB / 1024)) +fi + +# Convert to GB for display +if [ "$MEMORY_MB" -gt 0 ]; then + MEMORY_GB=$((MEMORY_MB / 1024)) + print_info "Docker memory allocation: ~${MEMORY_GB}GB" +else + print_warning "Could not determine Docker memory allocation" + MEMORY_MB=0 +fi + +# Check disk space (different commands for macOS vs Linux) +if [[ "$OSTYPE" == "darwin"* ]]; then + # macOS uses -g for GB + DISK_AVAILABLE=$(df -g . | awk 'NR==2 {print $4}') +else + # Linux uses -BG for GB + DISK_AVAILABLE=$(df -BG . | awk 'NR==2 {print $4}' | sed 's/G//') +fi +print_info "Available disk space: ${DISK_AVAILABLE}GB" + +# Resource requirements check +RESOURCE_WARNING=false +if [ "$MEMORY_MB" -gt 0 ] && [ "$MEMORY_MB" -lt 16384 ]; then + print_warning "Docker has less than 16GB RAM allocated (found: ~${MEMORY_GB}GB)" + RESOURCE_WARNING=true +fi + +if [ "$DISK_AVAILABLE" -lt 50 ]; then + print_warning "Less than 50GB disk space available (found: ${DISK_AVAILABLE}GB)" + RESOURCE_WARNING=true +fi + +if [ "$RESOURCE_WARNING" = true ]; then + echo "" + print_warning "Onyx recommends at least 16GB RAM and 50GB disk space for optimal performance." + echo "" + read -p "Do you want to continue anyway? (y/N): " -n 1 -r + echo "" + if [[ ! $REPLY =~ ^[Yy]$ ]]; then + print_info "Installation cancelled. Please allocate more resources and try again." + exit 1 + fi + print_info "Proceeding with installation despite resource limitations..." +fi + +# Create directory structure +print_step "Creating directory structure" +if [ -d "onyx_data" ]; then + print_info "Directory structure already exists" + print_success "Using existing onyx_data directory" +else + mkdir -p onyx_data/deployment + mkdir -p onyx_data/data/nginx/local + print_success "Directory structure created" +fi + +# Download all required files +print_step "Downloading Onyx configuration files" +print_info "This step downloads all necessary configuration files from GitHub..." +echo "" +print_info "Downloading the following files:" +echo " • docker-compose.yml - Main Docker Compose configuration" +echo " • env.template - Environment variables template" +echo " • nginx/app.conf.template - Nginx web server configuration" +echo " • nginx/run-nginx.sh - Nginx startup script" +echo " • README.md - Documentation and setup instructions" +echo "" + +# Download Docker Compose file +COMPOSE_FILE="onyx_data/deployment/docker-compose.yml" +print_info "Downloading docker-compose.yml..." +if curl -fsSL -o "$COMPOSE_FILE" "${GITHUB_RAW_URL}/docker-compose.yml" 2>/dev/null; then + print_success "Docker Compose file downloaded successfully" +else + print_error "Failed to download Docker Compose file" + print_info "Please ensure you have internet connection and try again" + exit 1 +fi + +# Download env.template file +ENV_TEMPLATE="onyx_data/deployment/env.template" +print_info "Downloading env.template..." +if curl -fsSL -o "$ENV_TEMPLATE" "${GITHUB_RAW_URL}/env.template" 2>/dev/null; then + print_success "Environment template downloaded successfully" +else + print_error "Failed to download env.template" + print_info "Please ensure you have internet connection and try again" + exit 1 +fi + +# Download nginx config files +NGINX_BASE_URL="https://raw.githubusercontent.com/onyx-dot-app/onyx/main/deployment/data/nginx" + +# Download app.conf.template +NGINX_CONFIG="onyx_data/data/nginx/app.conf.template" +print_info "Downloading nginx configuration template..." +if curl -fsSL -o "$NGINX_CONFIG" "$NGINX_BASE_URL/app.conf.template" 2>/dev/null; then + print_success "Nginx configuration template downloaded" +else + print_error "Failed to download nginx configuration template" + print_info "Please ensure you have internet connection and try again" + exit 1 +fi + +# Download run-nginx.sh script +NGINX_RUN_SCRIPT="onyx_data/data/nginx/run-nginx.sh" +print_info "Downloading nginx startup script..." +if curl -fsSL -o "$NGINX_RUN_SCRIPT" "$NGINX_BASE_URL/run-nginx.sh" 2>/dev/null; then + chmod +x "$NGINX_RUN_SCRIPT" + print_success "Nginx startup script downloaded and made executable" +else + print_error "Failed to download nginx startup script" + print_info "Please ensure you have internet connection and try again" + exit 1 +fi + +# Download README file +README_FILE="onyx_data/README.md" +print_info "Downloading README.md..." +if curl -fsSL -o "$README_FILE" "${GITHUB_RAW_URL}/README.md" 2>/dev/null; then + print_success "README.md downloaded successfully" +else + print_error "Failed to download README.md" + print_info "Please ensure you have internet connection and try again" + exit 1 +fi + +# Create empty local directory marker (if needed) +touch "onyx_data/data/nginx/local/.gitkeep" +print_success "All configuration files downloaded successfully" + +# Set up deployment configuration +print_step "Setting up deployment configs" +ENV_FILE="onyx_data/deployment/.env" + +# Check if services are already running +if [ -d "onyx_data/deployment" ] && [ -f "onyx_data/deployment/docker-compose.yml" ]; then + cd onyx_data/deployment + + # Determine compose command + if docker compose version &> /dev/null; then + COMPOSE_CMD="docker compose" + elif command -v docker-compose &> /dev/null; then + COMPOSE_CMD="docker-compose" + else + COMPOSE_CMD="" + fi + + if [ -n "$COMPOSE_CMD" ]; then + # Check if any containers are running + RUNNING_CONTAINERS=$($COMPOSE_CMD -f docker-compose.yml ps -q 2>/dev/null | wc -l) + if [ "$RUNNING_CONTAINERS" -gt 0 ]; then + print_error "Onyx services are currently running!" + echo "" + print_info "To make configuration changes, you must first shut down the services." + echo "" + print_info "Please run the following command to shut down Onyx:" + echo -e " ${BOLD}./install.sh --shutdown${NC}" + echo "" + print_info "Then run this script again to make your changes." + exit 1 + fi + fi + + cd ../.. +fi + +if [ -f "$ENV_FILE" ]; then + print_info "Existing .env file found. What would you like to do?" + echo "" + echo "• Press Enter to restart with current configuration" + echo "• Type 'update' to update to a newer version" + echo "" + read -p "Choose an option [default: restart]: " -r + echo "" + + if [ "$REPLY" = "update" ]; then + print_info "Update selected. Which tag would you like to deploy?" + echo "" + echo "• Press Enter for latest (recommended)" + echo "• Type a specific tag (e.g., v0.1.0)" + echo "" + read -p "Enter tag [default: latest]: " -r VERSION + echo "" + + if [ -z "$VERSION" ]; then + VERSION="latest" + print_info "Selected: Latest version" + else + print_info "Selected: $VERSION" + fi + + # Update .env file with new version + print_info "Updating configuration for version $VERSION..." + if grep -q "^IMAGE_TAG=" "$ENV_FILE"; then + # Update existing IMAGE_TAG line + sed -i.bak "s/^IMAGE_TAG=.*/IMAGE_TAG=$VERSION/" "$ENV_FILE" + else + # Add IMAGE_TAG line if it doesn't exist + echo "IMAGE_TAG=$VERSION" >> "$ENV_FILE" + fi + print_success "Updated IMAGE_TAG to $VERSION in .env file" + print_success "Configuration updated for upgrade" + else + print_info "Keeping existing configuration..." + print_success "Will restart with current settings" + fi +else + print_info "No existing .env file found. Setting up new deployment..." + echo "" + + # Ask for version + print_info "Which tag would you like to deploy?" + echo "" + echo "• Press Enter for latest (recommended)" + echo "• Type a specific tag (e.g., v0.1.0)" + echo "" + read -p "Enter tag [default: latest]: " -r VERSION + echo "" + + if [ -z "$VERSION" ]; then + VERSION="latest" + print_info "Selected: Latest tag" + else + print_info "Selected: $VERSION" + fi + + # Ask for authentication schema + echo "" + print_info "Which authentication schema would you like to set up?" + echo "" + echo "1) Basic - Username/password authentication" + echo "2) No Auth - Open access (development/testing)" + echo "" + read -p "Choose an option (1-2) [default 1]: " -r AUTH_CHOICE + echo "" + + case "${AUTH_CHOICE:-1}" in + 1) + AUTH_SCHEMA="basic" + print_info "Selected: Basic authentication" + ;; + 2) + AUTH_SCHEMA="disabled" + print_info "Selected: No authentication" + ;; + *) + AUTH_SCHEMA="basic" + print_info "Invalid choice, using basic authentication" + ;; + esac + + # Create .env file from template + print_info "Creating .env file with your selections..." + cp "$ENV_TEMPLATE" "$ENV_FILE" + + # Update IMAGE_TAG with selected version + print_info "Setting IMAGE_TAG to $VERSION..." + sed -i.bak "s/^IMAGE_TAG=.*/IMAGE_TAG=$VERSION/" "$ENV_FILE" + print_success "IMAGE_TAG set to $VERSION" + + # Configure authentication settings based on selection + if [ "$AUTH_SCHEMA" = "disabled" ]; then + # Disable authentication in .env file + sed -i.bak 's/^AUTH_TYPE=.*/AUTH_TYPE=disabled/' "$ENV_FILE" 2>/dev/null || true + print_success "Authentication disabled in configuration" + else + # Enable basic authentication + sed -i.bak 's/^AUTH_TYPE=.*/AUTH_TYPE=basic/' "$ENV_FILE" 2>/dev/null || true + print_success "Basic authentication enabled in configuration" + fi + + print_success ".env file created with your preferences" + echo "" + print_info "IMPORTANT: The .env file has been configured with your selections." + print_info "You can customize it later for:" + echo " • Advanced authentication (OAuth, SAML, etc.)" + echo " • AI model configuration" + echo " • Domain settings (for production)" + echo "" +fi + +# Pull Docker images with reduced output +print_step "Pulling Docker images" +print_info "This may take several minutes depending on your internet connection..." +echo "" +print_info "Downloading Docker images (this may take a while)..." +cd onyx_data/deployment && $COMPOSE_CMD -f docker-compose.yml pull --quiet && cd ../.. +print_success "Docker images downloaded successfully" + +# Start services +print_step "Starting Onyx services" +print_info "Launching containers..." +echo "" +cd onyx_data/deployment && $COMPOSE_CMD -f docker-compose.yml up -d && cd ../.. + +# Monitor container startup +print_step "Verifying container health" +print_info "Waiting for containers to initialize (10 seconds)..." + +# Progress bar for waiting +for i in {1..10}; do + printf "\r[%-10s] %d%%" $(printf '#%.0s' $(seq 1 $((i*10/10)))) $((i*100/10)) + sleep 1 +done +echo "" +echo "" + +# Check for restart loops +print_info "Checking container health status..." +RESTART_ISSUES=false +CONTAINERS=$(cd onyx_data/deployment && $COMPOSE_CMD -f docker-compose.yml ps -q) + +for CONTAINER in $CONTAINERS; do + CONTAINER_NAME=$(docker inspect --format '{{.Name}}' "$CONTAINER" | sed 's/^\/\|^onyx_data_deployment_//g') + RESTART_COUNT=$(docker inspect --format '{{.RestartCount}}' "$CONTAINER") + STATUS=$(docker inspect --format '{{.State.Status}}' "$CONTAINER") + + if [ "$STATUS" = "running" ]; then + if [ "$RESTART_COUNT" -gt 2 ]; then + print_error "$CONTAINER_NAME is in a restart loop (restarted $RESTART_COUNT times)" + RESTART_ISSUES=true + else + print_success "$CONTAINER_NAME is healthy" + fi + elif [ "$STATUS" = "restarting" ]; then + print_error "$CONTAINER_NAME is stuck restarting" + RESTART_ISSUES=true + else + print_warning "$CONTAINER_NAME status: $STATUS" + fi +done + +echo "" + +if [ "$RESTART_ISSUES" = true ]; then + print_error "Some containers are experiencing issues!" + echo "" + print_info "Please check the logs for more information:" + echo " cd onyx_data/deployment && $COMPOSE_CMD -f docker-compose.yml logs" + echo "" + print_info "If the issue persists, please contact: founders@onyx.app" + echo "Include the output of the logs command in your message." + exit 1 +fi + +# Health check function +check_onyx_health() { + local max_attempts=600 # 10 minutes * 60 attempts per minute (every 1 second) + local attempt=1 + + print_info "Checking Onyx service health..." + echo "Containers are healthy, waiting for database migrations and service initialization to finish." + echo "" + + while [ $attempt -le $max_attempts ]; do + # Check for successful HTTP responses (200, 301, 302, etc.) + local http_code=$(curl -s -o /dev/null -w "%{http_code}" http://localhost:3000) + if echo "$http_code" | grep -qE "^(200|301|302|303|307|308)$"; then + return 0 + fi + + # Show animated progress with time elapsed + local elapsed=$((attempt)) + local minutes=$((elapsed / 60)) + local seconds=$((elapsed % 60)) + + # Create animated dots with fixed spacing (cycle through 1-3 dots) + local dots="" + case $((attempt % 3)) in + 0) dots=". " ;; + 1) dots=".. " ;; + 2) dots="..." ;; + esac + + # Clear line and show progress with fixed spacing + printf "\r\033[KChecking Onyx service%s (%dm %ds elapsed)" "$dots" "$minutes" "$seconds" + + sleep 1 + attempt=$((attempt + 1)) + done + + echo "" # New line after the progress line + return 1 +} + +# Success message +print_step "Installation Complete!" +print_success "All containers are running successfully!" +echo "" + +# Run health check +if check_onyx_health; then + echo "" + echo -e "${GREEN}${BOLD}━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━${NC}" + echo -e "${GREEN}${BOLD} 🎉 Onyx service is ready! 🎉${NC}" + echo -e "${GREEN}${BOLD}━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━${NC}" +else + print_warning "Health check timed out after 10 minutes" + print_info "Containers are running, but the web service may still be initializing (or something went wrong)" + echo "" + echo -e "${YELLOW}${BOLD}━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━${NC}" + echo -e "${YELLOW}${BOLD} ⚠️ Onyx containers are running ⚠️${NC}" + echo -e "${YELLOW}${BOLD}━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━${NC}" +fi +echo "" +print_info "Access Onyx at:" +echo -e " ${BOLD}http://localhost:3000${NC}" +echo "" +print_info "If authentication is enabled, you can create your admin account here:" +echo " • Visit http://localhost:3000/auth/signup to create your admin account" +echo " • The first user created will automatically have admin privileges" +echo "" +print_info "Refer to the README in the onyx_data directory for more information." +echo "" +print_info "For help or issues, contact: founders@onyx.app" +echo "" diff --git a/deployment/helm/charts/onyx/Chart.yaml b/deployment/helm/charts/onyx/Chart.yaml index af54c725536..cbc00132e1f 100644 --- a/deployment/helm/charts/onyx/Chart.yaml +++ b/deployment/helm/charts/onyx/Chart.yaml @@ -1,5 +1,5 @@ apiVersion: v2 -name: onyx-stack +name: onyx description: A Helm chart for Kubernetes home: https://www.onyx.app/ sources: diff --git a/deployment/helm/charts/onyx/templates/_helpers.tpl b/deployment/helm/charts/onyx/templates/_helpers.tpl index b0b1e95280a..092cf2be0a8 100644 --- a/deployment/helm/charts/onyx/templates/_helpers.tpl +++ b/deployment/helm/charts/onyx/templates/_helpers.tpl @@ -1,7 +1,7 @@ {{/* Expand the name of the chart. */}} -{{- define "onyx-stack.name" -}} +{{- define "onyx.name" -}} {{- default .Chart.Name .Values.nameOverride | trunc 63 | trimSuffix "-" }} {{- end }} @@ -10,7 +10,7 @@ Create a default fully qualified app name. We truncate at 63 chars because some Kubernetes name fields are limited to this (by the DNS naming spec). If release name contains chart name it will be used as a full name. */}} -{{- define "onyx-stack.fullname" -}} +{{- define "onyx.fullname" -}} {{- if .Values.fullnameOverride }} {{- .Values.fullnameOverride | trunc 63 | trimSuffix "-" }} {{- else }} @@ -26,16 +26,16 @@ If release name contains chart name it will be used as a full name. {{/* Create chart name and version as used by the chart label. */}} -{{- define "onyx-stack.chart" -}} +{{- define "onyx.chart" -}} {{- printf "%s-%s" .Chart.Name .Chart.Version | replace "+" "_" | trunc 63 | trimSuffix "-" }} {{- end }} {{/* Common labels */}} -{{- define "onyx-stack.labels" -}} -helm.sh/chart: {{ include "onyx-stack.chart" . }} -{{ include "onyx-stack.selectorLabels" . }} +{{- define "onyx.labels" -}} +helm.sh/chart: {{ include "onyx.chart" . }} +{{ include "onyx.selectorLabels" . }} {{- if .Chart.AppVersion }} app.kubernetes.io/version: {{ .Chart.AppVersion | quote }} {{- end }} @@ -45,17 +45,17 @@ app.kubernetes.io/managed-by: {{ .Release.Service }} {{/* Selector labels */}} -{{- define "onyx-stack.selectorLabels" -}} -app.kubernetes.io/name: {{ include "onyx-stack.name" . }} +{{- define "onyx.selectorLabels" -}} +app.kubernetes.io/name: {{ include "onyx.name" . }} app.kubernetes.io/instance: {{ .Release.Name }} {{- end }} {{/* Create the name of the service account to use */}} -{{- define "onyx-stack.serviceAccountName" -}} +{{- define "onyx.serviceAccountName" -}} {{- if .Values.serviceAccount.create }} -{{- default (include "onyx-stack.fullname" .) .Values.serviceAccount.name }} +{{- default (include "onyx.fullname" .) .Values.serviceAccount.name }} {{- else }} {{- default "default" .Values.serviceAccount.name }} {{- end }} @@ -64,21 +64,21 @@ Create the name of the service account to use {{/* Set secret name */}} -{{- define "onyx-stack.secretName" -}} +{{- define "onyx.secretName" -}} {{- default .secretName .existingSecret }} {{- end }} {{/* Create env vars from secrets */}} -{{- define "onyx-stack.envSecrets" -}} +{{- define "onyx.envSecrets" -}} {{- range $secretSuffix, $secretContent := .Values.auth }} {{- if and (ne $secretContent.enabled false) ($secretContent.secretKeys) }} {{- range $name, $key := $secretContent.secretKeys }} - name: {{ $name | upper | replace "-" "_" | quote }} valueFrom: secretKeyRef: - name: {{ include "onyx-stack.secretName" $secretContent }} + name: {{ include "onyx.secretName" $secretContent }} key: {{ default $name $key }} {{- end }} {{- end }} diff --git a/deployment/helm/charts/onyx/templates/api-deployment.yaml b/deployment/helm/charts/onyx/templates/api-deployment.yaml index 5a03cdf100f..a7f2873fb99 100644 --- a/deployment/helm/charts/onyx/templates/api-deployment.yaml +++ b/deployment/helm/charts/onyx/templates/api-deployment.yaml @@ -2,16 +2,16 @@ apiVersion: apps/v1 kind: Deployment metadata: - name: {{ include "onyx-stack.fullname" . }}-api-server + name: {{ include "onyx.fullname" . }}-api-server labels: - {{- include "onyx-stack.labels" . | nindent 4 }} + {{- include "onyx.labels" . | nindent 4 }} spec: {{- if not .Values.api.autoscaling.enabled }} replicas: {{ .Values.api.replicaCount }} {{- end }} selector: matchLabels: - {{- include "onyx-stack.selectorLabels" . | nindent 6 }} + {{- include "onyx.selectorLabels" . | nindent 6 }} {{- if .Values.api.deploymentLabels }} {{- toYaml .Values.api.deploymentLabels | nindent 6 }} {{- end }} @@ -23,7 +23,7 @@ spec: {{- toYaml . | nindent 8 }} {{- end }} labels: - {{- include "onyx-stack.labels" . | nindent 8 }} + {{- include "onyx.labels" . | nindent 8 }} {{- with .Values.api.podLabels }} {{- toYaml . | nindent 8 }} {{- end }} @@ -32,7 +32,7 @@ spec: imagePullSecrets: {{- toYaml . | nindent 8 }} {{- end }} - serviceAccountName: {{ include "onyx-stack.serviceAccountName" . }} + serviceAccountName: {{ include "onyx.serviceAccountName" . }} securityContext: {{- toYaml .Values.api.podSecurityContext | nindent 8 }} {{- with .Values.api.nodeSelector }} @@ -62,7 +62,7 @@ spec: - configMapRef: name: {{ .Values.config.envConfigMapName }} env: - {{- include "onyx-stack.envSecrets" . | nindent 12}} + {{- include "onyx.envSecrets" . | nindent 12}} {{- with .Values.api.volumeMounts }} volumeMounts: {{- toYaml . | nindent 12 }} diff --git a/deployment/helm/charts/onyx/templates/api-scaledobject.yaml b/deployment/helm/charts/onyx/templates/api-scaledobject.yaml index e536b7b722e..dac8814f2d0 100644 --- a/deployment/helm/charts/onyx/templates/api-scaledobject.yaml +++ b/deployment/helm/charts/onyx/templates/api-scaledobject.yaml @@ -2,14 +2,14 @@ apiVersion: keda.sh/v1alpha1 kind: ScaledObject metadata: - name: {{ include "onyx-stack.fullname" . }}-api + name: {{ include "onyx.fullname" . }}-api labels: - {{- include "onyx-stack.labels" . | nindent 4 }} + {{- include "onyx.labels" . | nindent 4 }} spec: scaleTargetRef: apiVersion: apps/v1 kind: Deployment - name: {{ include "onyx-stack.fullname" . }}-api-server + name: {{ include "onyx.fullname" . }}-api-server minReplicaCount: {{ .Values.api.autoscaling.minReplicas | default 1 }} maxReplicaCount: {{ .Values.api.autoscaling.maxReplicas | default 10 }} pollingInterval: {{ .Values.api.autoscaling.pollingInterval | default 30 }} diff --git a/deployment/helm/charts/onyx/templates/api-service.yaml b/deployment/helm/charts/onyx/templates/api-service.yaml index 1e4ba2c073b..35a60828e64 100644 --- a/deployment/helm/charts/onyx/templates/api-service.yaml +++ b/deployment/helm/charts/onyx/templates/api-service.yaml @@ -2,9 +2,9 @@ apiVersion: v1 kind: Service metadata: # INTERNAL_URL env variable depends on this, don't change without changing INTERNAL_URL - name: {{ include "onyx-stack.fullname" . }}-api-service + name: {{ include "onyx.fullname" . }}-api-service labels: - {{- include "onyx-stack.labels" . | nindent 4 }} + {{- include "onyx.labels" . | nindent 4 }} {{- if .Values.api.deploymentLabels }} {{- toYaml .Values.api.deploymentLabels | nindent 4 }} {{- end }} @@ -16,7 +16,7 @@ spec: protocol: TCP name: {{ .Values.api.service.portName }} selector: - {{- include "onyx-stack.selectorLabels" . | nindent 4 }} + {{- include "onyx.selectorLabels" . | nindent 4 }} {{- if .Values.api.deploymentLabels }} {{- toYaml .Values.api.deploymentLabels | nindent 4 }} {{- end }} diff --git a/deployment/helm/charts/onyx/templates/auth-secrets.yaml b/deployment/helm/charts/onyx/templates/auth-secrets.yaml index 7d4e13fd6c3..e608a8ab84d 100644 --- a/deployment/helm/charts/onyx/templates/auth-secrets.yaml +++ b/deployment/helm/charts/onyx/templates/auth-secrets.yaml @@ -7,7 +7,7 @@ apiVersion: v1 kind: Secret metadata: - name: {{ include "onyx-stack.secretName" $secretContent }} + name: {{ include "onyx.secretName" $secretContent }} type: Opaque stringData: {{- range $name, $value := $secretContent.values }} diff --git a/deployment/helm/charts/onyx/templates/celery-beat.yaml b/deployment/helm/charts/onyx/templates/celery-beat.yaml index cd98ec37587..71bfb94deb2 100644 --- a/deployment/helm/charts/onyx/templates/celery-beat.yaml +++ b/deployment/helm/charts/onyx/templates/celery-beat.yaml @@ -2,14 +2,14 @@ apiVersion: apps/v1 kind: Deployment metadata: - name: {{ include "onyx-stack.fullname" . }}-celery-beat + name: {{ include "onyx.fullname" . }}-celery-beat labels: - {{- include "onyx-stack.labels" . | nindent 4 }} + {{- include "onyx.labels" . | nindent 4 }} spec: replicas: {{ .Values.celery_beat.replicaCount }} selector: matchLabels: - {{- include "onyx-stack.selectorLabels" . | nindent 6 }} + {{- include "onyx.selectorLabels" . | nindent 6 }} {{- if .Values.celery_beat.deploymentLabels }} {{- toYaml .Values.celery_beat.deploymentLabels | nindent 6 }} {{- end }} @@ -21,7 +21,7 @@ spec: {{- toYaml . | nindent 8 }} {{- end }} labels: - {{- include "onyx-stack.labels" . | nindent 8 }} + {{- include "onyx.labels" . | nindent 8 }} {{- with .Values.celery_beat.podLabels }} {{- toYaml . | nindent 8 }} {{- end }} @@ -30,7 +30,7 @@ spec: imagePullSecrets: {{- toYaml . | nindent 8 }} {{- end }} - serviceAccountName: {{ include "onyx-stack.serviceAccountName" . }} + serviceAccountName: {{ include "onyx.serviceAccountName" . }} securityContext: {{- toYaml .Values.celery_shared.podSecurityContext | nindent 8 }} {{- with .Values.celery_beat.nodeSelector }} @@ -57,7 +57,7 @@ spec: - configMapRef: name: {{ .Values.config.envConfigMapName }} env: - {{- include "onyx-stack.envSecrets" . | nindent 12}} + {{- include "onyx.envSecrets" . | nindent 12}} {{- with .Values.celery_beat.volumeMounts }} volumeMounts: {{- toYaml . | nindent 12 }} diff --git a/deployment/helm/charts/onyx/templates/celery-worker-docfetching-scaledobject.yaml b/deployment/helm/charts/onyx/templates/celery-worker-docfetching-scaledobject.yaml index e3b392269c9..314b83780b7 100644 --- a/deployment/helm/charts/onyx/templates/celery-worker-docfetching-scaledobject.yaml +++ b/deployment/helm/charts/onyx/templates/celery-worker-docfetching-scaledobject.yaml @@ -2,14 +2,14 @@ apiVersion: keda.sh/v1alpha1 kind: ScaledObject metadata: - name: {{ include "onyx-stack.fullname" . }}-celery-worker-docfetching + name: {{ include "onyx.fullname" . }}-celery-worker-docfetching labels: - {{- include "onyx-stack.labels" . | nindent 4 }} + {{- include "onyx.labels" . | nindent 4 }} spec: scaleTargetRef: apiVersion: apps/v1 kind: Deployment - name: {{ include "onyx-stack.fullname" . }}-celery-worker-docfetching + name: {{ include "onyx.fullname" . }}-celery-worker-docfetching minReplicaCount: {{ .Values.celery_worker_docfetching.autoscaling.minReplicas | default 1 }} maxReplicaCount: {{ .Values.celery_worker_docfetching.autoscaling.maxReplicas | default 20 }} pollingInterval: {{ .Values.celery_worker_docfetching.autoscaling.pollingInterval | default 30 }} diff --git a/deployment/helm/charts/onyx/templates/celery-worker-docfetching.yaml b/deployment/helm/charts/onyx/templates/celery-worker-docfetching.yaml index 0a5ba4a774c..e51f28e9684 100644 --- a/deployment/helm/charts/onyx/templates/celery-worker-docfetching.yaml +++ b/deployment/helm/charts/onyx/templates/celery-worker-docfetching.yaml @@ -2,16 +2,16 @@ apiVersion: apps/v1 kind: Deployment metadata: - name: {{ include "onyx-stack.fullname" . }}-celery-worker-docfetching + name: {{ include "onyx.fullname" . }}-celery-worker-docfetching labels: - {{- include "onyx-stack.labels" . | nindent 4 }} + {{- include "onyx.labels" . | nindent 4 }} spec: {{- if not .Values.celery_worker_docfetching.autoscaling.enabled }} replicas: {{ .Values.celery_worker_docfetching.replicaCount }} {{- end }} selector: matchLabels: - {{- include "onyx-stack.selectorLabels" . | nindent 6 }} + {{- include "onyx.selectorLabels" . | nindent 6 }} {{- if .Values.celery_worker_docfetching.deploymentLabels }} {{- toYaml .Values.celery_worker_docfetching.deploymentLabels | nindent 6 }} {{- end }} @@ -23,7 +23,7 @@ spec: {{- toYaml . | nindent 8 }} {{- end }} labels: - {{- include "onyx-stack.labels" . | nindent 8 }} + {{- include "onyx.labels" . | nindent 8 }} {{- with .Values.celery_worker_docfetching.podLabels }} {{- toYaml . | nindent 8 }} {{- end }} @@ -32,7 +32,7 @@ spec: imagePullSecrets: {{- toYaml . | nindent 8 }} {{- end }} - serviceAccountName: {{ include "onyx-stack.serviceAccountName" . }} + serviceAccountName: {{ include "onyx.serviceAccountName" . }} securityContext: {{- toYaml .Values.celery_shared.podSecurityContext | nindent 8 }} {{- with .Values.celery_worker_docfetching.nodeSelector }} @@ -65,7 +65,7 @@ spec: - configMapRef: name: {{ .Values.config.envConfigMapName }} env: - {{- include "onyx-stack.envSecrets" . | nindent 12}} + {{- include "onyx.envSecrets" . | nindent 12}} {{- with .Values.celery_worker_docfetching.volumeMounts }} volumeMounts: {{- toYaml . | nindent 12 }} diff --git a/deployment/helm/charts/onyx/templates/celery-worker-docprocessing-scaledobject.yaml b/deployment/helm/charts/onyx/templates/celery-worker-docprocessing-scaledobject.yaml index 36bd016bd50..f4e2dd9bc4e 100644 --- a/deployment/helm/charts/onyx/templates/celery-worker-docprocessing-scaledobject.yaml +++ b/deployment/helm/charts/onyx/templates/celery-worker-docprocessing-scaledobject.yaml @@ -2,14 +2,14 @@ apiVersion: keda.sh/v1alpha1 kind: ScaledObject metadata: - name: {{ include "onyx-stack.fullname" . }}-celery-worker-docprocessing + name: {{ include "onyx.fullname" . }}-celery-worker-docprocessing labels: - {{- include "onyx-stack.labels" . | nindent 4 }} + {{- include "onyx.labels" . | nindent 4 }} spec: scaleTargetRef: apiVersion: apps/v1 kind: Deployment - name: {{ include "onyx-stack.fullname" . }}-celery-worker-docprocessing + name: {{ include "onyx.fullname" . }}-celery-worker-docprocessing minReplicaCount: {{ .Values.celery_worker_docprocessing.autoscaling.minReplicas | default 1 }} maxReplicaCount: {{ .Values.celery_worker_docprocessing.autoscaling.maxReplicas | default 10 }} pollingInterval: {{ .Values.celery_worker_docprocessing.autoscaling.pollingInterval | default 30 }} diff --git a/deployment/helm/charts/onyx/templates/celery-worker-docprocessing.yaml b/deployment/helm/charts/onyx/templates/celery-worker-docprocessing.yaml index 9727ce75058..5a5fffe3059 100644 --- a/deployment/helm/charts/onyx/templates/celery-worker-docprocessing.yaml +++ b/deployment/helm/charts/onyx/templates/celery-worker-docprocessing.yaml @@ -2,16 +2,16 @@ apiVersion: apps/v1 kind: Deployment metadata: - name: {{ include "onyx-stack.fullname" . }}-celery-worker-docprocessing + name: {{ include "onyx.fullname" . }}-celery-worker-docprocessing labels: - {{- include "onyx-stack.labels" . | nindent 4 }} + {{- include "onyx.labels" . | nindent 4 }} spec: {{- if not .Values.celery_worker_docprocessing.autoscaling.enabled }} replicas: {{ .Values.celery_worker_docprocessing.replicaCount }} {{- end }} selector: matchLabels: - {{- include "onyx-stack.selectorLabels" . | nindent 6 }} + {{- include "onyx.selectorLabels" . | nindent 6 }} {{- if .Values.celery_worker_docprocessing.deploymentLabels }} {{- toYaml .Values.celery_worker_docprocessing.deploymentLabels | nindent 6 }} {{- end }} @@ -23,7 +23,7 @@ spec: {{- toYaml . | nindent 8 }} {{- end }} labels: - {{- include "onyx-stack.labels" . | nindent 8 }} + {{- include "onyx.labels" . | nindent 8 }} {{- with .Values.celery_worker_docprocessing.podLabels }} {{- toYaml . | nindent 8 }} {{- end }} @@ -32,7 +32,7 @@ spec: imagePullSecrets: {{- toYaml . | nindent 8 }} {{- end }} - serviceAccountName: {{ include "onyx-stack.serviceAccountName" . }} + serviceAccountName: {{ include "onyx.serviceAccountName" . }} securityContext: {{- toYaml .Values.celery_shared.podSecurityContext | nindent 8 }} {{- with .Values.celery_worker_docprocessing.nodeSelector }} @@ -67,7 +67,7 @@ spec: env: - name: ENABLE_MULTIPASS_INDEXING value: "{{ .Values.celery_worker_docprocessing.enableMiniChunk }}" - {{- include "onyx-stack.envSecrets" . | nindent 12}} + {{- include "onyx.envSecrets" . | nindent 12}} {{- with .Values.celery_worker_docprocessing.volumeMounts }} volumeMounts: {{- toYaml . | nindent 12 }} diff --git a/deployment/helm/charts/onyx/templates/celery-worker-heavy-scaledobject.yaml b/deployment/helm/charts/onyx/templates/celery-worker-heavy-scaledobject.yaml index bd3c882189c..b77a5757433 100644 --- a/deployment/helm/charts/onyx/templates/celery-worker-heavy-scaledobject.yaml +++ b/deployment/helm/charts/onyx/templates/celery-worker-heavy-scaledobject.yaml @@ -2,14 +2,14 @@ apiVersion: keda.sh/v1alpha1 kind: ScaledObject metadata: - name: {{ include "onyx-stack.fullname" . }}-celery-worker-heavy + name: {{ include "onyx.fullname" . }}-celery-worker-heavy labels: - {{- include "onyx-stack.labels" . | nindent 4 }} + {{- include "onyx.labels" . | nindent 4 }} spec: scaleTargetRef: apiVersion: apps/v1 kind: Deployment - name: {{ include "onyx-stack.fullname" . }}-celery-worker-heavy + name: {{ include "onyx.fullname" . }}-celery-worker-heavy minReplicaCount: {{ .Values.celery_worker_heavy.autoscaling.minReplicas | default 1 }} maxReplicaCount: {{ .Values.celery_worker_heavy.autoscaling.maxReplicas | default 10 }} pollingInterval: {{ .Values.celery_worker_heavy.autoscaling.pollingInterval | default 30 }} diff --git a/deployment/helm/charts/onyx/templates/celery-worker-heavy.yaml b/deployment/helm/charts/onyx/templates/celery-worker-heavy.yaml index 3b4f55f3eda..78a7a42d2d8 100644 --- a/deployment/helm/charts/onyx/templates/celery-worker-heavy.yaml +++ b/deployment/helm/charts/onyx/templates/celery-worker-heavy.yaml @@ -2,16 +2,16 @@ apiVersion: apps/v1 kind: Deployment metadata: - name: {{ include "onyx-stack.fullname" . }}-celery-worker-heavy + name: {{ include "onyx.fullname" . }}-celery-worker-heavy labels: - {{- include "onyx-stack.labels" . | nindent 4 }} + {{- include "onyx.labels" . | nindent 4 }} spec: {{- if not .Values.celery_worker_heavy.autoscaling.enabled }} replicas: {{ .Values.celery_worker_heavy.replicaCount }} {{- end }} selector: matchLabels: - {{- include "onyx-stack.selectorLabels" . | nindent 6 }} + {{- include "onyx.selectorLabels" . | nindent 6 }} {{- if .Values.celery_worker_heavy.deploymentLabels }} {{- toYaml .Values.celery_worker_heavy.deploymentLabels | nindent 6 }} {{- end }} @@ -23,7 +23,7 @@ spec: {{- toYaml . | nindent 8 }} {{- end }} labels: - {{- include "onyx-stack.labels" . | nindent 8 }} + {{- include "onyx.labels" . | nindent 8 }} {{- with .Values.celery_worker_heavy.podLabels }} {{- toYaml . | nindent 8 }} {{- end }} @@ -32,7 +32,7 @@ spec: imagePullSecrets: {{- toYaml . | nindent 8 }} {{- end }} - serviceAccountName: {{ include "onyx-stack.serviceAccountName" . }} + serviceAccountName: {{ include "onyx.serviceAccountName" . }} securityContext: {{- toYaml .Values.celery_shared.podSecurityContext | nindent 8 }} {{- with .Values.celery_worker_heavy.nodeSelector }} @@ -62,7 +62,7 @@ spec: - configMapRef: name: {{ .Values.config.envConfigMapName }} env: - {{- include "onyx-stack.envSecrets" . | nindent 12}} + {{- include "onyx.envSecrets" . | nindent 12}} {{- with .Values.celery_worker_heavy.volumeMounts }} volumeMounts: {{- toYaml . | nindent 12 }} diff --git a/deployment/helm/charts/onyx/templates/celery-worker-light-scaledobject.yaml b/deployment/helm/charts/onyx/templates/celery-worker-light-scaledobject.yaml index 691374ec8ea..43aa3c623cb 100644 --- a/deployment/helm/charts/onyx/templates/celery-worker-light-scaledobject.yaml +++ b/deployment/helm/charts/onyx/templates/celery-worker-light-scaledobject.yaml @@ -2,14 +2,14 @@ apiVersion: keda.sh/v1alpha1 kind: ScaledObject metadata: - name: {{ include "onyx-stack.fullname" . }}-celery-worker-light + name: {{ include "onyx.fullname" . }}-celery-worker-light labels: - {{- include "onyx-stack.labels" . | nindent 4 }} + {{- include "onyx.labels" . | nindent 4 }} spec: scaleTargetRef: apiVersion: apps/v1 kind: Deployment - name: {{ include "onyx-stack.fullname" . }}-celery-worker-light + name: {{ include "onyx.fullname" . }}-celery-worker-light minReplicaCount: {{ .Values.celery_worker_light.autoscaling.minReplicas | default 1 }} maxReplicaCount: {{ .Values.celery_worker_light.autoscaling.maxReplicas | default 10 }} pollingInterval: {{ .Values.celery_worker_light.autoscaling.pollingInterval | default 30 }} diff --git a/deployment/helm/charts/onyx/templates/celery-worker-light.yaml b/deployment/helm/charts/onyx/templates/celery-worker-light.yaml index 3027d2b3374..eb2d6b21cf6 100644 --- a/deployment/helm/charts/onyx/templates/celery-worker-light.yaml +++ b/deployment/helm/charts/onyx/templates/celery-worker-light.yaml @@ -2,16 +2,16 @@ apiVersion: apps/v1 kind: Deployment metadata: - name: {{ include "onyx-stack.fullname" . }}-celery-worker-light + name: {{ include "onyx.fullname" . }}-celery-worker-light labels: - {{- include "onyx-stack.labels" . | nindent 4 }} + {{- include "onyx.labels" . | nindent 4 }} spec: {{- if not .Values.celery_worker_light.autoscaling.enabled }} replicas: {{ .Values.celery_worker_light.replicaCount }} {{- end }} selector: matchLabels: - {{- include "onyx-stack.selectorLabels" . | nindent 6 }} + {{- include "onyx.selectorLabels" . | nindent 6 }} {{- if .Values.celery_worker_light.deploymentLabels }} {{- toYaml .Values.celery_worker_light.deploymentLabels | nindent 6 }} {{- end }} @@ -23,7 +23,7 @@ spec: {{- toYaml . | nindent 8 }} {{- end }} labels: - {{- include "onyx-stack.labels" . | nindent 8 }} + {{- include "onyx.labels" . | nindent 8 }} {{- with .Values.celery_worker_light.podLabels }} {{- toYaml . | nindent 8 }} {{- end }} @@ -32,7 +32,7 @@ spec: imagePullSecrets: {{- toYaml . | nindent 8 }} {{- end }} - serviceAccountName: {{ include "onyx-stack.serviceAccountName" . }} + serviceAccountName: {{ include "onyx.serviceAccountName" . }} securityContext: {{- toYaml .Values.celery_shared.podSecurityContext | nindent 8 }} {{- with .Values.celery_worker_light.nodeSelector }} @@ -62,7 +62,7 @@ spec: - configMapRef: name: {{ .Values.config.envConfigMapName }} env: - {{- include "onyx-stack.envSecrets" . | nindent 12}} + {{- include "onyx.envSecrets" . | nindent 12}} {{- with .Values.celery_worker_light.volumeMounts }} volumeMounts: {{- toYaml . | nindent 12 }} diff --git a/deployment/helm/charts/onyx/templates/celery-worker-monitoring-scaledobject.yaml b/deployment/helm/charts/onyx/templates/celery-worker-monitoring-scaledobject.yaml index c2d14d92f95..94497eba632 100644 --- a/deployment/helm/charts/onyx/templates/celery-worker-monitoring-scaledobject.yaml +++ b/deployment/helm/charts/onyx/templates/celery-worker-monitoring-scaledobject.yaml @@ -2,14 +2,14 @@ apiVersion: keda.sh/v1alpha1 kind: ScaledObject metadata: - name: {{ include "onyx-stack.fullname" . }}-celery-worker-monitoring + name: {{ include "onyx.fullname" . }}-celery-worker-monitoring labels: - {{- include "onyx-stack.labels" . | nindent 4 }} + {{- include "onyx.labels" . | nindent 4 }} spec: scaleTargetRef: apiVersion: apps/v1 kind: Deployment - name: {{ include "onyx-stack.fullname" . }}-celery-worker-monitoring + name: {{ include "onyx.fullname" . }}-celery-worker-monitoring minReplicaCount: {{ .Values.celery_worker_monitoring.autoscaling.minReplicas | default 1 }} maxReplicaCount: {{ .Values.celery_worker_monitoring.autoscaling.maxReplicas | default 10 }} pollingInterval: {{ .Values.celery_worker_monitoring.autoscaling.pollingInterval | default 30 }} diff --git a/deployment/helm/charts/onyx/templates/celery-worker-monitoring.yaml b/deployment/helm/charts/onyx/templates/celery-worker-monitoring.yaml index e86638327a8..6329ce61bf4 100644 --- a/deployment/helm/charts/onyx/templates/celery-worker-monitoring.yaml +++ b/deployment/helm/charts/onyx/templates/celery-worker-monitoring.yaml @@ -2,16 +2,16 @@ apiVersion: apps/v1 kind: Deployment metadata: - name: {{ include "onyx-stack.fullname" . }}-celery-worker-monitoring + name: {{ include "onyx.fullname" . }}-celery-worker-monitoring labels: - {{- include "onyx-stack.labels" . | nindent 4 }} + {{- include "onyx.labels" . | nindent 4 }} spec: {{- if not .Values.celery_worker_monitoring.autoscaling.enabled }} replicas: {{ .Values.celery_worker_monitoring.replicaCount }} {{- end }} selector: matchLabels: - {{- include "onyx-stack.selectorLabels" . | nindent 6 }} + {{- include "onyx.selectorLabels" . | nindent 6 }} {{- if .Values.celery_worker_monitoring.deploymentLabels }} {{- toYaml .Values.celery_worker_monitoring.deploymentLabels | nindent 6 }} {{- end }} @@ -23,7 +23,7 @@ spec: {{- toYaml . | nindent 8 }} {{- end }} labels: - {{- include "onyx-stack.labels" . | nindent 8 }} + {{- include "onyx.labels" . | nindent 8 }} {{- with .Values.celery_worker_monitoring.podLabels }} {{- toYaml . | nindent 8 }} {{- end }} @@ -32,7 +32,7 @@ spec: imagePullSecrets: {{- toYaml . | nindent 8 }} {{- end }} - serviceAccountName: {{ include "onyx-stack.serviceAccountName" . }} + serviceAccountName: {{ include "onyx.serviceAccountName" . }} securityContext: {{- toYaml .Values.celery_shared.podSecurityContext | nindent 8 }} {{- with .Values.celery_worker_monitoring.nodeSelector }} @@ -62,7 +62,7 @@ spec: - configMapRef: name: {{ .Values.config.envConfigMapName }} env: - {{- include "onyx-stack.envSecrets" . | nindent 12}} + {{- include "onyx.envSecrets" . | nindent 12}} {{- with .Values.celery_worker_monitoring.volumeMounts }} volumeMounts: {{- toYaml . | nindent 12 }} diff --git a/deployment/helm/charts/onyx/templates/celery-worker-primary-scaledobject.yaml b/deployment/helm/charts/onyx/templates/celery-worker-primary-scaledobject.yaml index 7f272c6f212..4575585c70c 100644 --- a/deployment/helm/charts/onyx/templates/celery-worker-primary-scaledobject.yaml +++ b/deployment/helm/charts/onyx/templates/celery-worker-primary-scaledobject.yaml @@ -2,14 +2,14 @@ apiVersion: keda.sh/v1alpha1 kind: ScaledObject metadata: - name: {{ include "onyx-stack.fullname" . }}-celery-worker-primary + name: {{ include "onyx.fullname" . }}-celery-worker-primary labels: - {{- include "onyx-stack.labels" . | nindent 4 }} + {{- include "onyx.labels" . | nindent 4 }} spec: scaleTargetRef: apiVersion: apps/v1 kind: Deployment - name: {{ include "onyx-stack.fullname" . }}-celery-worker-primary + name: {{ include "onyx.fullname" . }}-celery-worker-primary minReplicaCount: {{ .Values.celery_worker_primary.autoscaling.minReplicas | default 1 }} maxReplicaCount: {{ .Values.celery_worker_primary.autoscaling.maxReplicas | default 10 }} pollingInterval: {{ .Values.celery_worker_primary.autoscaling.pollingInterval | default 30 }} diff --git a/deployment/helm/charts/onyx/templates/celery-worker-primary.yaml b/deployment/helm/charts/onyx/templates/celery-worker-primary.yaml index cccfb645253..5967be3e03c 100644 --- a/deployment/helm/charts/onyx/templates/celery-worker-primary.yaml +++ b/deployment/helm/charts/onyx/templates/celery-worker-primary.yaml @@ -2,16 +2,16 @@ apiVersion: apps/v1 kind: Deployment metadata: - name: {{ include "onyx-stack.fullname" . }}-celery-worker-primary + name: {{ include "onyx.fullname" . }}-celery-worker-primary labels: - {{- include "onyx-stack.labels" . | nindent 4 }} + {{- include "onyx.labels" . | nindent 4 }} spec: {{- if not .Values.celery_worker_primary.autoscaling.enabled }} replicas: {{ .Values.celery_worker_primary.replicaCount }} {{- end }} selector: matchLabels: - {{- include "onyx-stack.selectorLabels" . | nindent 6 }} + {{- include "onyx.selectorLabels" . | nindent 6 }} {{- if .Values.celery_worker_primary.deploymentLabels }} {{- toYaml .Values.celery_worker_primary.deploymentLabels | nindent 6 }} {{- end }} @@ -23,7 +23,7 @@ spec: {{- toYaml . | nindent 8 }} {{- end }} labels: - {{- include "onyx-stack.labels" . | nindent 8 }} + {{- include "onyx.labels" . | nindent 8 }} {{- with .Values.celery_worker_primary.podLabels }} {{- toYaml . | nindent 8 }} {{- end }} @@ -32,7 +32,7 @@ spec: imagePullSecrets: {{- toYaml . | nindent 8 }} {{- end }} - serviceAccountName: {{ include "onyx-stack.serviceAccountName" . }} + serviceAccountName: {{ include "onyx.serviceAccountName" . }} securityContext: {{- toYaml .Values.celery_shared.podSecurityContext | nindent 8 }} {{- with .Values.celery_worker_primary.nodeSelector }} @@ -62,7 +62,7 @@ spec: - configMapRef: name: {{ .Values.config.envConfigMapName }} env: - {{- include "onyx-stack.envSecrets" . | nindent 12}} + {{- include "onyx.envSecrets" . | nindent 12}} {{- with .Values.celery_worker_primary.volumeMounts }} volumeMounts: {{- toYaml . | nindent 12 }} diff --git a/deployment/helm/charts/onyx/templates/celery-worker-user-files-indexing-scaledobject.yaml b/deployment/helm/charts/onyx/templates/celery-worker-user-files-indexing-scaledobject.yaml index 68fd8bb47b6..4ff51b7137c 100644 --- a/deployment/helm/charts/onyx/templates/celery-worker-user-files-indexing-scaledobject.yaml +++ b/deployment/helm/charts/onyx/templates/celery-worker-user-files-indexing-scaledobject.yaml @@ -2,14 +2,14 @@ apiVersion: keda.sh/v1alpha1 kind: ScaledObject metadata: - name: {{ include "onyx-stack.fullname" . }}-celery-worker-user-files-indexing + name: {{ include "onyx.fullname" . }}-celery-worker-user-files-indexing labels: - {{- include "onyx-stack.labels" . | nindent 4 }} + {{- include "onyx.labels" . | nindent 4 }} spec: scaleTargetRef: apiVersion: apps/v1 kind: Deployment - name: {{ include "onyx-stack.fullname" . }}-celery-worker-user-files-indexing + name: {{ include "onyx.fullname" . }}-celery-worker-user-files-indexing minReplicaCount: {{ .Values.celery_worker_user_files_indexing.autoscaling.minReplicas | default 1 }} maxReplicaCount: {{ .Values.celery_worker_user_files_indexing.autoscaling.maxReplicas | default 10 }} pollingInterval: {{ .Values.celery_worker_user_files_indexing.autoscaling.pollingInterval | default 30 }} diff --git a/deployment/helm/charts/onyx/templates/celery-worker-user-files-indexing.yaml b/deployment/helm/charts/onyx/templates/celery-worker-user-files-indexing.yaml index 26225571692..c6e546e443a 100644 --- a/deployment/helm/charts/onyx/templates/celery-worker-user-files-indexing.yaml +++ b/deployment/helm/charts/onyx/templates/celery-worker-user-files-indexing.yaml @@ -2,16 +2,16 @@ apiVersion: apps/v1 kind: Deployment metadata: - name: {{ include "onyx-stack.fullname" . }}-celery-worker-user-files-indexing + name: {{ include "onyx.fullname" . }}-celery-worker-user-files-indexing labels: - {{- include "onyx-stack.labels" . | nindent 4 }} + {{- include "onyx.labels" . | nindent 4 }} spec: {{- if not .Values.celery_worker_user_files_indexing.autoscaling.enabled }} replicas: {{ .Values.celery_worker_user_files_indexing.replicaCount }} {{- end }} selector: matchLabels: - {{- include "onyx-stack.selectorLabels" . | nindent 6 }} + {{- include "onyx.selectorLabels" . | nindent 6 }} {{- if .Values.celery_worker_user_files_indexing.deploymentLabels }} {{- toYaml .Values.celery_worker_user_files_indexing.deploymentLabels | nindent 6 }} {{- end }} @@ -23,7 +23,7 @@ spec: {{- toYaml . | nindent 8 }} {{- end }} labels: - {{- include "onyx-stack.labels" . | nindent 8 }} + {{- include "onyx.labels" . | nindent 8 }} {{- with .Values.celery_worker_user_files_indexing.podLabels }} {{- toYaml . | nindent 8 }} {{- end }} @@ -32,7 +32,7 @@ spec: imagePullSecrets: {{- toYaml . | nindent 8 }} {{- end }} - serviceAccountName: {{ include "onyx-stack.serviceAccountName" . }} + serviceAccountName: {{ include "onyx.serviceAccountName" . }} securityContext: {{- toYaml .Values.celery_shared.podSecurityContext | nindent 8 }} {{- with .Values.celery_worker_user_files_indexing.nodeSelector }} @@ -62,7 +62,7 @@ spec: - configMapRef: name: {{ .Values.config.envConfigMapName }} env: - {{- include "onyx-stack.envSecrets" . | nindent 12}} + {{- include "onyx.envSecrets" . | nindent 12}} {{- with .Values.celery_worker_user_files_indexing.volumeMounts }} volumeMounts: {{- toYaml . | nindent 12 }} diff --git a/deployment/helm/charts/onyx/templates/configmap.yaml b/deployment/helm/charts/onyx/templates/configmap.yaml index ca8e2bb0ec3..670b52002f2 100755 --- a/deployment/helm/charts/onyx/templates/configmap.yaml +++ b/deployment/helm/charts/onyx/templates/configmap.yaml @@ -3,9 +3,9 @@ kind: ConfigMap metadata: name: {{ .Values.config.envConfigMapName }} labels: - {{- include "onyx-stack.labels" . | nindent 4 }} + {{- include "onyx.labels" . | nindent 4 }} data: - INTERNAL_URL: "http://{{ include "onyx-stack.fullname" . }}-api-service:{{ .Values.api.service.port | default 8080 }}" + INTERNAL_URL: "http://{{ include "onyx.fullname" . }}-api-service:{{ .Values.api.service.port | default 8080 }}" {{- if .Values.postgresql.enabled }} POSTGRES_HOST: {{ .Release.Name }}-postgresql {{- end }} @@ -15,8 +15,8 @@ data: {{- if .Values.redis.enabled }} REDIS_HOST: {{ .Release.Name }}-redis-master {{- end }} - MODEL_SERVER_HOST: "{{ include "onyx-stack.fullname" . }}-inference-model-service" - INDEXING_MODEL_SERVER_HOST: "{{ include "onyx-stack.fullname" . }}-indexing-model-service" + MODEL_SERVER_HOST: "{{ include "onyx.fullname" . }}-inference-model-service" + INDEXING_MODEL_SERVER_HOST: "{{ include "onyx.fullname" . }}-indexing-model-service" {{- range $key, $value := .Values.configMap }} {{- if not (empty $value) }} {{ $key }}: "{{ $value }}" diff --git a/deployment/helm/charts/onyx/templates/indexing-model-deployment.yaml b/deployment/helm/charts/onyx/templates/indexing-model-deployment.yaml index 21b479dc6f4..dfe4fdd215b 100644 --- a/deployment/helm/charts/onyx/templates/indexing-model-deployment.yaml +++ b/deployment/helm/charts/onyx/templates/indexing-model-deployment.yaml @@ -2,14 +2,14 @@ apiVersion: apps/v1 kind: Deployment metadata: - name: {{ include "onyx-stack.fullname" . }}-indexing-model + name: {{ include "onyx.fullname" . }}-indexing-model labels: - {{- include "onyx-stack.labels" . | nindent 4 }} + {{- include "onyx.labels" . | nindent 4 }} spec: replicas: {{ .Values.indexCapability.replicaCount }} selector: matchLabels: - {{- include "onyx-stack.selectorLabels" . | nindent 6 }} + {{- include "onyx.selectorLabels" . | nindent 6 }} {{- if .Values.indexCapability.deploymentLabels }} {{- toYaml .Values.indexCapability.deploymentLabels | nindent 6 }} {{- end }} @@ -21,7 +21,7 @@ spec: {{- toYaml . | nindent 8 }} {{- end }} labels: - {{- include "onyx-stack.labels" . | nindent 8 }} + {{- include "onyx.labels" . | nindent 8 }} {{- with .Values.indexCapability.podLabels }} {{- toYaml . | nindent 8 }} {{- end }} @@ -49,7 +49,7 @@ spec: env: - name: INDEXING_ONLY value: "{{ default "True" .Values.indexCapability.indexingOnly }}" - {{- include "onyx-stack.envSecrets" . | nindent 10}} + {{- include "onyx.envSecrets" . | nindent 10}} {{- if .Values.indexCapability.securityContext }} securityContext: {{- toYaml .Values.indexCapability.securityContext | nindent 10 }} diff --git a/deployment/helm/charts/onyx/templates/indexing-model-service.yaml b/deployment/helm/charts/onyx/templates/indexing-model-service.yaml index 59bb3fbfa43..b086f152899 100644 --- a/deployment/helm/charts/onyx/templates/indexing-model-service.yaml +++ b/deployment/helm/charts/onyx/templates/indexing-model-service.yaml @@ -1,12 +1,12 @@ apiVersion: v1 kind: Service metadata: - name: {{ include "onyx-stack.fullname" . }}-indexing-model-service + name: {{ include "onyx.fullname" . }}-indexing-model-service labels: - {{- include "onyx-stack.labels" . | nindent 4 }} + {{- include "onyx.labels" . | nindent 4 }} spec: selector: - {{- include "onyx-stack.selectorLabels" . | nindent 4 }} + {{- include "onyx.selectorLabels" . | nindent 4 }} {{- if .Values.indexCapability.deploymentLabels }} {{- toYaml .Values.indexCapability.deploymentLabels | nindent 4 }} {{- end }} diff --git a/deployment/helm/charts/onyx/templates/inference-model-deployment.yaml b/deployment/helm/charts/onyx/templates/inference-model-deployment.yaml index a6bc0697e31..d25d7520003 100644 --- a/deployment/helm/charts/onyx/templates/inference-model-deployment.yaml +++ b/deployment/helm/charts/onyx/templates/inference-model-deployment.yaml @@ -2,7 +2,7 @@ apiVersion: apps/v1 kind: Deployment metadata: - name: {{ include "onyx-stack.fullname" . }}-inference-model + name: {{ include "onyx.fullname" . }}-inference-model labels: {{- range .Values.inferenceCapability.labels }} {{ .key }}: {{ .value }} @@ -44,7 +44,7 @@ spec: - configMapRef: name: {{ .Values.config.envConfigMapName }} env: - {{- include "onyx-stack.envSecrets" . | nindent 12}} + {{- include "onyx.envSecrets" . | nindent 12}} {{- if .Values.inferenceCapability.securityContext }} securityContext: {{- toYaml .Values.inferenceCapability.securityContext | nindent 10 }} diff --git a/deployment/helm/charts/onyx/templates/inference-model-service.yaml b/deployment/helm/charts/onyx/templates/inference-model-service.yaml index 6a0eb203d13..e03c926f78d 100644 --- a/deployment/helm/charts/onyx/templates/inference-model-service.yaml +++ b/deployment/helm/charts/onyx/templates/inference-model-service.yaml @@ -1,7 +1,7 @@ apiVersion: v1 kind: Service metadata: - name: {{ include "onyx-stack.fullname" . }}-inference-model-service + name: {{ include "onyx.fullname" . }}-inference-model-service spec: type: {{ .Values.inferenceCapability.service.type }} ports: diff --git a/deployment/helm/charts/onyx/templates/ingress-api.yaml b/deployment/helm/charts/onyx/templates/ingress-api.yaml index 9349d9527fb..f320293177b 100644 --- a/deployment/helm/charts/onyx/templates/ingress-api.yaml +++ b/deployment/helm/charts/onyx/templates/ingress-api.yaml @@ -2,12 +2,12 @@ apiVersion: networking.k8s.io/v1 kind: Ingress metadata: - name: {{ include "onyx-stack.fullname" . }}-ingress-api + name: {{ include "onyx.fullname" . }}-ingress-api annotations: kubernetes.io/ingress.class: nginx nginx.ingress.kubernetes.io/rewrite-target: /$2 nginx.ingress.kubernetes.io/use-regex: "true" - cert-manager.io/cluster-issuer: {{ include "onyx-stack.fullname" . }}-letsencrypt + cert-manager.io/cluster-issuer: {{ include "onyx.fullname" . }}-letsencrypt spec: rules: - host: {{ .Values.ingress.api.host }} @@ -17,11 +17,11 @@ spec: pathType: Prefix backend: service: - name: {{ include "onyx-stack.fullname" . }}-api-service + name: {{ include "onyx.fullname" . }}-api-service port: number: {{ .Values.api.service.servicePort }} tls: - hosts: - {{ .Values.ingress.api.host }} - secretName: {{ include "onyx-stack.fullname" . }}-ingress-api-tls + secretName: {{ include "onyx.fullname" . }}-ingress-api-tls {{- end }} \ No newline at end of file diff --git a/deployment/helm/charts/onyx/templates/ingress-webserver.yaml b/deployment/helm/charts/onyx/templates/ingress-webserver.yaml index 079085311ad..bc4738768ff 100644 --- a/deployment/helm/charts/onyx/templates/ingress-webserver.yaml +++ b/deployment/helm/charts/onyx/templates/ingress-webserver.yaml @@ -2,10 +2,10 @@ apiVersion: networking.k8s.io/v1 kind: Ingress metadata: - name: {{ include "onyx-stack.fullname" . }}-ingress-webserver + name: {{ include "onyx.fullname" . }}-ingress-webserver annotations: kubernetes.io/ingress.class: nginx - cert-manager.io/cluster-issuer: {{ include "onyx-stack.fullname" . }}-letsencrypt + cert-manager.io/cluster-issuer: {{ include "onyx.fullname" . }}-letsencrypt kubernetes.io/tls-acme: "true" spec: rules: @@ -16,11 +16,11 @@ spec: pathType: Prefix backend: service: - name: {{ include "onyx-stack.fullname" . }}-webserver + name: {{ include "onyx.fullname" . }}-webserver port: number: {{ .Values.webserver.service.servicePort }} tls: - hosts: - {{ .Values.ingress.webserver.host }} - secretName: {{ include "onyx-stack.fullname" . }}-ingress-webserver-tls + secretName: {{ include "onyx.fullname" . }}-ingress-webserver-tls {{- end }} \ No newline at end of file diff --git a/deployment/helm/charts/onyx/templates/lets-encrypt.yaml b/deployment/helm/charts/onyx/templates/lets-encrypt.yaml index b21f9b14842..a543ff02072 100644 --- a/deployment/helm/charts/onyx/templates/lets-encrypt.yaml +++ b/deployment/helm/charts/onyx/templates/lets-encrypt.yaml @@ -2,7 +2,7 @@ apiVersion: cert-manager.io/v1 kind: ClusterIssuer metadata: - name: {{ include "onyx-stack.fullname" . }}-letsencrypt + name: {{ include "onyx.fullname" . }}-letsencrypt spec: acme: # The ACME server URL @@ -11,7 +11,7 @@ spec: email: {{ .Values.letsencrypt.email }} # Name of a secret used to store the ACME account private key privateKeySecretRef: - name: {{ include "onyx-stack.fullname" . }}-letsencrypt + name: {{ include "onyx.fullname" . }}-letsencrypt # Enable the HTTP-01 challenge provider solvers: - http01: diff --git a/deployment/helm/charts/onyx/templates/nginx-conf.yaml b/deployment/helm/charts/onyx/templates/nginx-conf.yaml index cf0cca2de69..191f49ae7cc 100644 --- a/deployment/helm/charts/onyx/templates/nginx-conf.yaml +++ b/deployment/helm/charts/onyx/templates/nginx-conf.yaml @@ -5,11 +5,11 @@ metadata: data: nginx.conf: | upstream api_server { - server {{ include "onyx-stack.fullname" . }}-api-service:{{ .Values.api.service.servicePort }} fail_timeout=0; + server {{ include "onyx.fullname" . }}-api-service:{{ .Values.api.service.servicePort }} fail_timeout=0; } upstream web_server { - server {{ include "onyx-stack.fullname" . }}-webserver:{{ .Values.webserver.service.servicePort }} fail_timeout=0; + server {{ include "onyx.fullname" . }}-webserver:{{ .Values.webserver.service.servicePort }} fail_timeout=0; } server { diff --git a/deployment/helm/charts/onyx/templates/serviceaccount.yaml b/deployment/helm/charts/onyx/templates/serviceaccount.yaml index 72a8567a5fb..4e1c8f4c1c0 100644 --- a/deployment/helm/charts/onyx/templates/serviceaccount.yaml +++ b/deployment/helm/charts/onyx/templates/serviceaccount.yaml @@ -2,9 +2,9 @@ apiVersion: v1 kind: ServiceAccount metadata: - name: {{ include "onyx-stack.serviceAccountName" . }} + name: {{ include "onyx.serviceAccountName" . }} labels: - {{- include "onyx-stack.labels" . | nindent 4 }} + {{- include "onyx.labels" . | nindent 4 }} {{- with .Values.serviceAccount.annotations }} annotations: {{- toYaml . | nindent 4 }} diff --git a/deployment/helm/charts/onyx/templates/slackbot.yaml b/deployment/helm/charts/onyx/templates/slackbot.yaml index 30b3e2a4609..3fbb0168bf8 100644 --- a/deployment/helm/charts/onyx/templates/slackbot.yaml +++ b/deployment/helm/charts/onyx/templates/slackbot.yaml @@ -2,13 +2,13 @@ apiVersion: apps/v1 kind: Deployment metadata: - name: {{ include "onyx-stack.fullname" . }}-slackbot + name: {{ include "onyx.fullname" . }}-slackbot labels: - {{- include "onyx-stack.labels" . | nindent 4 }} + {{- include "onyx.labels" . | nindent 4 }} spec: selector: matchLabels: - {{- include "onyx-stack.selectorLabels" . | nindent 6 }} + {{- include "onyx.selectorLabels" . | nindent 6 }} {{- if .Values.slackbot.deploymentLabels }} {{- toYaml .Values.slackbot.deploymentLabels | nindent 6 }} {{- end }} @@ -20,7 +20,7 @@ spec: {{- toYaml . | nindent 8 }} {{- end }} labels: - {{- include "onyx-stack.labels" . | nindent 8 }} + {{- include "onyx.labels" . | nindent 8 }} {{- with .Values.slackbot.podLabels }} {{- toYaml . | nindent 8 }} {{- end }} @@ -29,7 +29,7 @@ spec: imagePullSecrets: {{- toYaml . | nindent 8 }} {{- end }} - serviceAccountName: {{ include "onyx-stack.serviceAccountName" . }} + serviceAccountName: {{ include "onyx.serviceAccountName" . }} securityContext: {{- toYaml .Values.slackbot.podSecurityContext | nindent 8 }} {{- with .Values.slackbot.nodeSelector }} @@ -49,7 +49,7 @@ spec: - configMapRef: name: {{ .Values.config.envConfigMapName }} env: - {{- include "onyx-stack.envSecrets" . | nindent 12}} + {{- include "onyx.envSecrets" . | nindent 12}} {{- with .Values.slackbot.volumeMounts }} volumeMounts: {{- toYaml . | nindent 12 }} diff --git a/deployment/helm/charts/onyx/templates/tests/test-connection.yaml b/deployment/helm/charts/onyx/templates/tests/test-connection.yaml index 6adf77177c4..86cfadb21d4 100644 --- a/deployment/helm/charts/onyx/templates/tests/test-connection.yaml +++ b/deployment/helm/charts/onyx/templates/tests/test-connection.yaml @@ -2,9 +2,9 @@ apiVersion: v1 kind: Pod metadata: - name: "{{ include "onyx-stack.fullname" . }}-test-connection" + name: "{{ include "onyx.fullname" . }}-test-connection" labels: - {{- include "onyx-stack.labels" . | nindent 4 }} + {{- include "onyx.labels" . | nindent 4 }} annotations: "helm.sh/hook": test "helm.sh/hook-delete-policy": hook-succeeded,before-hook-creation @@ -17,7 +17,7 @@ spec: - -c args: - | - SVC="{{ include "onyx-stack.fullname" . }}-webserver" + SVC="{{ include "onyx.fullname" . }}-webserver" PORT="{{ .Values.webserver.service.servicePort }}" URL="http://${SVC}:${PORT}/" for i in $(seq 1 40); do diff --git a/deployment/helm/charts/onyx/templates/webserver-deployment.yaml b/deployment/helm/charts/onyx/templates/webserver-deployment.yaml index e08bb082c99..4ec82e949c6 100644 --- a/deployment/helm/charts/onyx/templates/webserver-deployment.yaml +++ b/deployment/helm/charts/onyx/templates/webserver-deployment.yaml @@ -2,16 +2,16 @@ apiVersion: apps/v1 kind: Deployment metadata: - name: {{ include "onyx-stack.fullname" . }}-web-server + name: {{ include "onyx.fullname" . }}-web-server labels: - {{- include "onyx-stack.labels" . | nindent 4 }} + {{- include "onyx.labels" . | nindent 4 }} spec: {{- if not .Values.webserver.autoscaling.enabled }} replicas: {{ .Values.webserver.replicaCount }} {{- end }} selector: matchLabels: - {{- include "onyx-stack.selectorLabels" . | nindent 6 }} + {{- include "onyx.selectorLabels" . | nindent 6 }} {{- if .Values.webserver.deploymentLabels }} {{- toYaml .Values.webserver.deploymentLabels | nindent 6 }} {{- end }} @@ -23,7 +23,7 @@ spec: {{- toYaml . | nindent 8 }} {{- end }} labels: - {{- include "onyx-stack.labels" . | nindent 8 }} + {{- include "onyx.labels" . | nindent 8 }} {{- with .Values.webserver.podLabels }} {{- toYaml . | nindent 8 }} {{- end }} @@ -32,7 +32,7 @@ spec: imagePullSecrets: {{- toYaml . | nindent 8 }} {{- end }} - serviceAccountName: {{ include "onyx-stack.serviceAccountName" . }} + serviceAccountName: {{ include "onyx.serviceAccountName" . }} securityContext: {{- toYaml .Values.webserver.podSecurityContext | nindent 8 }} {{- with .Values.webserver.nodeSelector }} @@ -55,7 +55,7 @@ spec: - configMapRef: name: {{ .Values.config.envConfigMapName }} env: - {{- include "onyx-stack.envSecrets" . | nindent 12}} + {{- include "onyx.envSecrets" . | nindent 12}} {{- with .Values.webserver.volumeMounts }} volumeMounts: {{- toYaml . | nindent 12 }} diff --git a/deployment/helm/charts/onyx/templates/webserver-scaledobject.yaml b/deployment/helm/charts/onyx/templates/webserver-scaledobject.yaml index 1bec0dbc0ae..1acfb189307 100644 --- a/deployment/helm/charts/onyx/templates/webserver-scaledobject.yaml +++ b/deployment/helm/charts/onyx/templates/webserver-scaledobject.yaml @@ -2,14 +2,14 @@ apiVersion: keda.sh/v1alpha1 kind: ScaledObject metadata: - name: {{ include "onyx-stack.fullname" . }}-web-server + name: {{ include "onyx.fullname" . }}-web-server labels: - {{- include "onyx-stack.labels" . | nindent 4 }} + {{- include "onyx.labels" . | nindent 4 }} spec: scaleTargetRef: apiVersion: apps/v1 kind: Deployment - name: {{ include "onyx-stack.fullname" . }}-web-server + name: {{ include "onyx.fullname" . }}-web-server minReplicaCount: {{ .Values.webserver.autoscaling.minReplicas }} maxReplicaCount: {{ .Values.webserver.autoscaling.maxReplicas }} pollingInterval: {{ .Values.webserver.autoscaling.pollingInterval | default 30 }} diff --git a/deployment/helm/charts/onyx/templates/webserver-service.yaml b/deployment/helm/charts/onyx/templates/webserver-service.yaml index f7d62c0ca4f..fce528cbabb 100644 --- a/deployment/helm/charts/onyx/templates/webserver-service.yaml +++ b/deployment/helm/charts/onyx/templates/webserver-service.yaml @@ -1,9 +1,9 @@ apiVersion: v1 kind: Service metadata: - name: {{ include "onyx-stack.fullname" . }}-webserver + name: {{ include "onyx.fullname" . }}-webserver labels: - {{- include "onyx-stack.labels" . | nindent 4 }} + {{- include "onyx.labels" . | nindent 4 }} {{- if .Values.webserver.deploymentLabels }} {{- toYaml .Values.webserver.deploymentLabels | nindent 4 }} {{- end }} @@ -15,7 +15,7 @@ spec: protocol: TCP name: http selector: - {{- include "onyx-stack.selectorLabels" . | nindent 4 }} + {{- include "onyx.selectorLabels" . | nindent 4 }} {{- if .Values.webserver.deploymentLabels }} {{- toYaml .Values.webserver.deploymentLabels | nindent 4 }} {{- end }} diff --git a/deployment/helm/charts/onyx/templates_disabled/api-hpa.yaml b/deployment/helm/charts/onyx/templates_disabled/api-hpa.yaml index 9f97d20428b..8ef154e7232 100644 --- a/deployment/helm/charts/onyx/templates_disabled/api-hpa.yaml +++ b/deployment/helm/charts/onyx/templates_disabled/api-hpa.yaml @@ -2,14 +2,14 @@ apiVersion: autoscaling/v2 kind: HorizontalPodAutoscaler metadata: - name: {{ include "onyx-stack.fullname" . }}-api + name: {{ include "onyx.fullname" . }}-api labels: - {{- include "onyx-stack.labels" . | nindent 4 }} + {{- include "onyx.labels" . | nindent 4 }} spec: scaleTargetRef: apiVersion: apps/v1 kind: Deployment - name: {{ include "onyx-stack.fullname" . }} + name: {{ include "onyx.fullname" . }} minReplicas: {{ .Values.api.autoscaling.minReplicas }} maxReplicas: {{ .Values.api.autoscaling.maxReplicas }} metrics: diff --git a/deployment/helm/charts/onyx/templates_disabled/background-deployment.yaml b/deployment/helm/charts/onyx/templates_disabled/background-deployment.yaml index cc42e29ad56..8a86e8a2f35 100644 --- a/deployment/helm/charts/onyx/templates_disabled/background-deployment.yaml +++ b/deployment/helm/charts/onyx/templates_disabled/background-deployment.yaml @@ -1,16 +1,16 @@ apiVersion: apps/v1 kind: Deployment metadata: - name: {{ include "onyx-stack.fullname" . }}-background + name: {{ include "onyx.fullname" . }}-background labels: - {{- include "onyx-stack.labels" . | nindent 4 }} + {{- include "onyx.labels" . | nindent 4 }} spec: {{- if not .Values.background.autoscaling.enabled }} replicas: {{ .Values.background.replicaCount }} {{- end }} selector: matchLabels: - {{- include "onyx-stack.selectorLabels" . | nindent 6 }} + {{- include "onyx.selectorLabels" . | nindent 6 }} {{- if .Values.background.deploymentLabels }} {{- toYaml .Values.background.deploymentLabels | nindent 6 }} {{- end }} @@ -21,7 +21,7 @@ spec: {{- toYaml . | nindent 8 }} {{- end }} labels: - {{- include "onyx-stack.labels" . | nindent 8 }} + {{- include "onyx.labels" . | nindent 8 }} {{- with .Values.background.podLabels }} {{- toYaml . | nindent 8 }} {{- end }} @@ -30,7 +30,7 @@ spec: imagePullSecrets: {{- toYaml . | nindent 8 }} {{- end }} - serviceAccountName: {{ include "onyx-stack.serviceAccountName" . }} + serviceAccountName: {{ include "onyx.serviceAccountName" . }} securityContext: {{- toYaml .Values.background.podSecurityContext | nindent 8 }} containers: @@ -48,4 +48,4 @@ spec: env: - name: ENABLE_MULTIPASS_INDEXING value: "{{ .Values.background.enableMiniChunk }}" - {{- include "onyx-stack.envSecrets" . | nindent 12}} + {{- include "onyx.envSecrets" . | nindent 12}} diff --git a/deployment/helm/charts/onyx/templates_disabled/background-hpa.yaml b/deployment/helm/charts/onyx/templates_disabled/background-hpa.yaml index b49ccc99ab5..33e1a48cc4f 100644 --- a/deployment/helm/charts/onyx/templates_disabled/background-hpa.yaml +++ b/deployment/helm/charts/onyx/templates_disabled/background-hpa.yaml @@ -2,14 +2,14 @@ apiVersion: autoscaling/v2 kind: HorizontalPodAutoscaler metadata: - name: {{ include "onyx-stack.fullname" . }}-background + name: {{ include "onyx.fullname" . }}-background labels: - {{- include "onyx-stack.labels" . | nindent 4 }} + {{- include "onyx.labels" . | nindent 4 }} spec: scaleTargetRef: apiVersion: apps/v1 kind: Deployment - name: {{ include "onyx-stack.fullname" . }} + name: {{ include "onyx.fullname" . }} minReplicas: {{ .Values.background.autoscaling.minReplicas }} maxReplicas: {{ .Values.background.autoscaling.maxReplicas }} metrics: diff --git a/deployment/helm/charts/onyx/templates_disabled/onyx-secret.yaml b/deployment/helm/charts/onyx/templates_disabled/onyx-secret.yaml index d05ca25642b..8159f167551 100644 --- a/deployment/helm/charts/onyx/templates_disabled/onyx-secret.yaml +++ b/deployment/helm/charts/onyx/templates_disabled/onyx-secret.yaml @@ -2,7 +2,7 @@ apiVersion: v1 kind: Secret metadata: - name: {{ include "onyx-stack.secretName" . }} + name: {{ include "onyx.secretName" . }} type: Opaque stringData: {{- range $name, $value := .Values.auth.secrets }} diff --git a/deployment/helm/charts/onyx/templates_disabled/webserver-hpa.yaml b/deployment/helm/charts/onyx/templates_disabled/webserver-hpa.yaml index 97db98ffe0d..c92dd67f3ea 100644 --- a/deployment/helm/charts/onyx/templates_disabled/webserver-hpa.yaml +++ b/deployment/helm/charts/onyx/templates_disabled/webserver-hpa.yaml @@ -2,14 +2,14 @@ apiVersion: autoscaling/v2 kind: HorizontalPodAutoscaler metadata: - name: {{ include "onyx-stack.fullname" . }}-webserver + name: {{ include "onyx.fullname" . }}-webserver labels: - {{- include "onyx-stack.labels" . | nindent 4 }} + {{- include "onyx.labels" . | nindent 4 }} spec: scaleTargetRef: apiVersion: apps/v1 kind: Deployment - name: {{ include "onyx-stack.fullname" . }} + name: {{ include "onyx.fullname" . }} minReplicas: {{ .Values.webserver.autoscaling.minReplicas }} maxReplicas: {{ .Values.webserver.autoscaling.maxReplicas }} metrics: diff --git a/deployment/helm/charts/onyx/values.yaml b/deployment/helm/charts/onyx/values.yaml index 4b30222380b..f6ee3e93823 100644 --- a/deployment/helm/charts/onyx/values.yaml +++ b/deployment/helm/charts/onyx/values.yaml @@ -1,4 +1,4 @@ -# Default values for onyx-stack. +# Default values for onyx. # This is a YAML-formatted file. # Declare variables to be passed into your templates. @@ -824,7 +824,6 @@ configMap: MULTILINGUAL_QUERY_EXPANSION: "" LANGUAGE_HINT: "" LANGUAGE_CHAT_NAMING_HINT: "" - QA_PROMPT_OVERRIDE: "" # Internet Search Tool BING_API_KEY: "" EXA_API_KEY: "" @@ -854,17 +853,16 @@ configMap: CELERY_WORKER_LIGHT_CONCURRENCY: "" CELERY_WORKER_LIGHT_PREFETCH_MULTIPLIER: "" # OnyxBot SlackBot Configs - DANSWER_BOT_DISABLE_DOCS_ONLY_ANSWER: "" - DANSWER_BOT_DISPLAY_ERROR_MSGS: "" - DANSWER_BOT_RESPOND_EVERY_CHANNEL: "" - DANSWER_BOT_DISABLE_COT: "" + ONYX_BOT_DISABLE_DOCS_ONLY_ANSWER: "" + ONYX_BOT_DISPLAY_ERROR_MSGS: "" + ONYX_BOT_RESPOND_EVERY_CHANNEL: "" NOTIFY_SLACKBOT_NO_ANSWER: "" # Logging # Optional Telemetry, please keep it on (nothing sensitive is collected)? <3 DISABLE_TELEMETRY: "" LOG_LEVEL: "" LOG_ALL_MODEL_INTERACTIONS: "" - LOG_DANSWER_MODEL_INTERACTIONS: "" + LOG_ONYX_MODEL_INTERACTIONS: "" LOG_VESPA_TIMING_INFORMATION: "" # Shared or Non-backend Related WEB_DOMAIN: "http://localhost:3000" diff --git a/web/Dockerfile b/web/Dockerfile index ee060ebd9f1..031ece80ec0 100644 --- a/web/Dockerfile +++ b/web/Dockerfile @@ -33,11 +33,7 @@ ENV NEXT_TELEMETRY_DISABLED=1 # Environment variables must be present at build time # https://github.com/vercel/next.js/discussions/14030 # NOTE: if you add something here, make sure to add it to the runner as well -ARG NEXT_PUBLIC_DISABLE_STREAMING -ENV NEXT_PUBLIC_DISABLE_STREAMING=${NEXT_PUBLIC_DISABLE_STREAMING} -ARG NEXT_PUBLIC_NEW_CHAT_DIRECTS_TO_SAME_PERSONA -ENV NEXT_PUBLIC_NEW_CHAT_DIRECTS_TO_SAME_PERSONA=${NEXT_PUBLIC_NEW_CHAT_DIRECTS_TO_SAME_PERSONA} ARG NEXT_PUBLIC_POSITIVE_PREDEFINED_FEEDBACK_OPTIONS ENV NEXT_PUBLIC_POSITIVE_PREDEFINED_FEEDBACK_OPTIONS=${NEXT_PUBLIC_POSITIVE_PREDEFINED_FEEDBACK_OPTIONS} @@ -119,11 +115,7 @@ COPY --from=builder --chown=nextjs:nodejs /app/.next/static ./.next/static # Environment variables must be redefined at run time # NOTE: if you add something here, make sure to add it to the builder as well -ARG NEXT_PUBLIC_DISABLE_STREAMING -ENV NEXT_PUBLIC_DISABLE_STREAMING=${NEXT_PUBLIC_DISABLE_STREAMING} -ARG NEXT_PUBLIC_NEW_CHAT_DIRECTS_TO_SAME_PERSONA -ENV NEXT_PUBLIC_NEW_CHAT_DIRECTS_TO_SAME_PERSONA=${NEXT_PUBLIC_NEW_CHAT_DIRECTS_TO_SAME_PERSONA} # allow user to specify custom feedback options ARG NEXT_PUBLIC_POSITIVE_PREDEFINED_FEEDBACK_OPTIONS diff --git a/web/src/lib/constants.ts b/web/src/lib/constants.ts index 6079ee188f3..401a23f07be 100644 --- a/web/src/lib/constants.ts +++ b/web/src/lib/constants.ts @@ -11,8 +11,6 @@ export const HEADER_HEIGHT = "h-16"; export const SUB_HEADER = "h-12"; export const INTERNAL_URL = process.env.INTERNAL_URL || "http://127.0.0.1:8080"; -export const NEXT_PUBLIC_DISABLE_STREAMING = - process.env.NEXT_PUBLIC_DISABLE_STREAMING?.toLowerCase() === "true"; export const NEXT_PUBLIC_DO_NOT_USE_TOGGLE_OFF_DANSWER_POWERED = process.env.NEXT_PUBLIC_DO_NOT_USE_TOGGLE_OFF_DANSWER_POWERED?.toLowerCase() ===