From a9da1906cf38fe07e563f8f027e2a2743e3df7fb Mon Sep 17 00:00:00 2001 From: rkuo-danswer Date: Thu, 6 Mar 2025 09:52:46 -0800 Subject: [PATCH] Hotfix/always build model server (#4215) * k * minor nit * oauth router went missing? * Revert "k" This reverts commit 687122911dd59347e15ce80dbaa07d673771b22e. * revert to always building model server --------- Co-authored-by: pablonyx Co-authored-by: Richard Kuo (Danswer) --- ...ild-push-model-server-container-on-tag.yml | 49 ++++++++++++------- backend/ee/onyx/main.py | 4 +- backend/onyx/main.py | 2 + web/src/app/admin/settings/SettingsForm.tsx | 33 +++++++------ 4 files changed, 52 insertions(+), 36 deletions(-) diff --git a/.github/workflows/docker-build-push-model-server-container-on-tag.yml b/.github/workflows/docker-build-push-model-server-container-on-tag.yml index c1595e26c..126dd7d07 100644 --- a/.github/workflows/docker-build-push-model-server-container-on-tag.yml +++ b/.github/workflows/docker-build-push-model-server-container-on-tag.yml @@ -12,29 +12,40 @@ env: BUILDKIT_PROGRESS: plain jobs: - # 1) Preliminary job to check if the changed files are relevant + +# Bypassing this for now as the idea of not building is glitching +# releases and builds that depends on everything being tagged in docker +# 1) Preliminary job to check if the changed files are relevant +# check_model_server_changes: +# runs-on: ubuntu-latest +# outputs: +# changed: ${{ steps.check.outputs.changed }} +# steps: +# - name: Checkout code +# uses: actions/checkout@v4 +# +# - name: Check if relevant files changed +# id: check +# run: | +# # Default to "false" +# echo "changed=false" >> $GITHUB_OUTPUT +# +# # Compare the previous commit (github.event.before) to the current one (github.sha) +# # If any file in backend/model_server/** or backend/Dockerfile.model_server is changed, +# # set changed=true +# if git diff --name-only ${{ github.event.before }} ${{ github.sha }} \ +# | grep -E '^backend/model_server/|^backend/Dockerfile.model_server'; then +# echo "changed=true" >> $GITHUB_OUTPUT +# fi + check_model_server_changes: runs-on: ubuntu-latest outputs: - changed: ${{ steps.check.outputs.changed }} + changed: "true" steps: - - name: Checkout code - uses: actions/checkout@v4 - - - name: Check if relevant files changed - id: check - run: | - # Default to "false" - echo "changed=false" >> $GITHUB_OUTPUT - - # Compare the previous commit (github.event.before) to the current one (github.sha) - # If any file in backend/model_server/** or backend/Dockerfile.model_server is changed, - # set changed=true - if git diff --name-only ${{ github.event.before }} ${{ github.sha }} \ - | grep -E '^backend/model_server/|^backend/Dockerfile.model_server'; then - echo "changed=true" >> $GITHUB_OUTPUT - fi - + - name: Bypass check and set output + run: echo "changed=true" >> $GITHUB_ENV + build-amd64: needs: [check_model_server_changes] if: needs.check_model_server_changes.outputs.changed == 'true' diff --git a/backend/ee/onyx/main.py b/backend/ee/onyx/main.py index 7d7278bb2..6cf06b3a5 100644 --- a/backend/ee/onyx/main.py +++ b/backend/ee/onyx/main.py @@ -15,7 +15,7 @@ from ee.onyx.server.enterprise_settings.api import ( ) from ee.onyx.server.manage.standard_answer import router as standard_answer_router from ee.onyx.server.middleware.tenant_tracking import add_tenant_id_middleware -from ee.onyx.server.oauth.api import router as oauth_router +from ee.onyx.server.oauth.api import router as ee_oauth_router from ee.onyx.server.query_and_chat.chat_backend import ( router as chat_router, ) @@ -128,7 +128,7 @@ def get_application() -> FastAPI: include_router_with_global_prefix_prepended(application, query_router) include_router_with_global_prefix_prepended(application, chat_router) include_router_with_global_prefix_prepended(application, standard_answer_router) - include_router_with_global_prefix_prepended(application, oauth_router) + include_router_with_global_prefix_prepended(application, ee_oauth_router) # Enterprise-only global settings include_router_with_global_prefix_prepended( diff --git a/backend/onyx/main.py b/backend/onyx/main.py index 003e26fb2..e783055ee 100644 --- a/backend/onyx/main.py +++ b/backend/onyx/main.py @@ -51,6 +51,7 @@ from onyx.server.documents.cc_pair import router as cc_pair_router from onyx.server.documents.connector import router as connector_router from onyx.server.documents.credential import router as credential_router from onyx.server.documents.document import router as document_router +from onyx.server.documents.standard_oauth import router as standard_oauth_router from onyx.server.features.document_set.api import router as document_set_router from onyx.server.features.folder.api import router as folder_router from onyx.server.features.input_prompt.api import ( @@ -322,6 +323,7 @@ def get_application() -> FastAPI: ) include_router_with_global_prefix_prepended(application, long_term_logs_router) include_router_with_global_prefix_prepended(application, api_key_router) + include_router_with_global_prefix_prepended(application, standard_oauth_router) if AUTH_TYPE == AuthType.DISABLED: # Server logs this during auth setup verification step diff --git a/web/src/app/admin/settings/SettingsForm.tsx b/web/src/app/admin/settings/SettingsForm.tsx index d0023a0b9..f6c09bfc7 100644 --- a/web/src/app/admin/settings/SettingsForm.tsx +++ b/web/src/app/admin/settings/SettingsForm.tsx @@ -290,21 +290,24 @@ export function SettingsForm() { id="chatRetentionInput" placeholder="Infinite Retention" /> - - +
+ + +
)}