Skip to content

Commit

Permalink
Add changes to run darwin locally
Browse files Browse the repository at this point in the history
  • Loading branch information
Swati Tiwari authored and swati354 committed Jan 16, 2025
1 parent eb3cd1a commit 2d7d824
Show file tree
Hide file tree
Showing 4 changed files with 55 additions and 36 deletions.
37 changes: 4 additions & 33 deletions backend/danswer/document_index/vespa/app_config/hosts-dev.xml
Original file line number Diff line number Diff line change
@@ -1,36 +1,7 @@
<?xml version="1.0" encoding="utf-8" ?>
<!-- Copyright Vespa.ai. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root. -->
<hosts>
<host name='vespa-configserver-0.vespa-internal.darwin-dev.svc.cluster.local'>
<alias>config0</alias>
<host name="index">
<alias>danswer-node</alias>
</host>
<host name='vespa-configserver-1.vespa-internal.darwin-dev.svc.cluster.local'>
<alias>config1</alias>
</host>
<host name='vespa-configserver-2.vespa-internal.darwin-dev.svc.cluster.local'>
<alias>config2</alias>
</host>
<host name='vespa-admin-0.vespa-internal.darwin-dev.svc.cluster.local'>
<alias>admin0</alias>
</host>
<host name='vespa-feed-container-0.vespa-internal.darwin-dev.svc.cluster.local'>
<alias>feed0</alias>
</host>
<host name='vespa-feed-container-1.vespa-internal.darwin-dev.svc.cluster.local'>
<alias>feed1</alias>
</host>
<host name='vespa-query-container-0.vespa-internal.darwin-dev.svc.cluster.local'>
<alias>query0</alias>
</host>
<host name='vespa-query-container-1.vespa-internal.darwin-dev.svc.cluster.local'>
<alias>query1</alias>
</host>
<host name='vespa-content-0.vespa-internal.darwin-dev.svc.cluster.local'>
<alias>content0</alias>
</host>
<host name='vespa-content-1.vespa-internal.darwin-dev.svc.cluster.local'>
<alias>content1</alias>
</host>
<host name='vespa-content-2.vespa-internal.darwin-dev.svc.cluster.local'>
<alias>content2</alias>
</host>
</hosts>
</hosts>
36 changes: 36 additions & 0 deletions backend/danswer/document_index/vespa/app_config/services-dev.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
<?xml version="1.0" encoding="utf-8" ?>
<services version="1.0">
<container id="default" version="1.0">
<document-api/>
<search/>
<http>
<server id="default" port="8081"/>
</http>
<nodes>
<node hostalias="danswer-node" />
</nodes>
</container>
<content id="danswer_index" version="1.0">
<redundancy>1</redundancy>
<documents>
<!-- <document type="danswer_chunk" mode="index" /> -->
DOCUMENT_REPLACEMENT
</documents>
<nodes>
<node hostalias="danswer-node" distribution-key="0" />
</nodes>
<tuning>
<resource-limits>
<!-- Default is 75% but this can be increased for Dockerized deployments -->
<!-- https://docs.vespa.ai/en/operations/feed-block.html -->
<disk>0.75</disk>
</resource-limits>
</tuning>
<config name="vespa.config.search.summary.juniperrc">
<max_matches>3</max_matches>
<length>750</length>
<surround_max>350</surround_max>
<min_length>300</min_length>
</config>
</content>
</services>
3 changes: 2 additions & 1 deletion backend/danswer/document_index/vespa/index.py
Original file line number Diff line number Diff line change
Expand Up @@ -815,12 +815,13 @@ def ensure_indices_exist(
os.getcwd(), "danswer", "document_index", "vespa", "app_config"
)
schema_file = os.path.join(vespa_schema_path, "schemas", "danswer_chunk.sd")
services_file = os.path.join(vespa_schema_path, "services.xml")
overrides_file = os.path.join(vespa_schema_path, "validation-overrides.xml")
if ENVIRONMENT in "DEV":
hosts_file = os.path.join(vespa_schema_path, "hosts-dev.xml")
services_file = os.path.join(vespa_schema_path, "services-dev.xml")
else:
hosts_file = os.path.join(vespa_schema_path, "hosts.xml")
services_file = os.path.join(vespa_schema_path, "services.xml")

with open(services_file, "r") as services_f:
services_template = services_f.read()
Expand Down
15 changes: 13 additions & 2 deletions deployment/docker_compose/docker-compose.dev.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,10 @@ services:
ports:
- "8080:8080"
environment:
- ENVIRONMENT=${ENVIRONMENT:-DEV}
# Auth Settings
- AUTH_TYPE=${AUTH_TYPE:-disabled}
- SESSION_EXPIRE_TIME_SECONDS=${SESSION_EXPIRE_TIME_SECONDS:-86400}
- SESSION_EXPIRE_TIME_SECONDS=${SESSION_EXPIRE_TIME_SECONDS:-86400}
- ENCRYPTION_KEY_SECRET=${ENCRYPTION_KEY_SECRET:-}
- VALID_EMAIL_DOMAINS=${VALID_EMAIL_DOMAINS:-}
- GOOGLE_OAUTH_CLIENT_ID=${GOOGLE_OAUTH_CLIENT_ID:-}
Expand Down Expand Up @@ -72,6 +73,7 @@ services:
# Other services
- POSTGRES_HOST=relational_db
- VESPA_HOST=index
- VESPA_FEED_PORT=${VESPA_FEED_PORT:-}
- WEB_DOMAIN=${WEB_DOMAIN:-} # For frontend redirect auth purpose
# Don't change the NLP model configs unless you know what you're doing
- DOCUMENT_ENCODER_MODEL=${DOCUMENT_ENCODER_MODEL:-}
Expand Down Expand Up @@ -119,6 +121,7 @@ services:
- indexing_model_server
restart: always
environment:
- ENVIRONMENT=${ENVIRONMENT:-DEV}
- ENCRYPTION_KEY_SECRET=${ENCRYPTION_KEY_SECRET:-}
# Gen AI Settings (Needed by DanswerBot)
- GEN_AI_MODEL_PROVIDER=${GEN_AI_MODEL_PROVIDER:-}
Expand Down Expand Up @@ -157,6 +160,9 @@ services:
- POSTGRES_PASSWORD=${POSTGRES_PASSWORD:-}
- POSTGRES_DB=${POSTGRES_DB:-}
- VESPA_HOST=index
- VESPA_PORT=${VESPA_PORT:-}
- VESPA_FEED_PORT=${VESPA_FEED_PORT:-}
- VESPA_FEED_HOST=${VESPA_FEED_HOST:-}
- WEB_DOMAIN=${WEB_DOMAIN:-} # For frontend redirect auth purpose for OAuth2 connectors
# Don't change the NLP model configs unless you know what you're doing
- DOCUMENT_ENCODER_MODEL=${DOCUMENT_ENCODER_MODEL:-}
Expand Down Expand Up @@ -231,6 +237,7 @@ services:
- api_server
restart: always
environment:
- ENVIRONMENT=${ENVIRONMENT:-DEV}
- INTERNAL_URL=http://api_server:8080
- WEB_DOMAIN=${WEB_DOMAIN:-}
- THEME_IS_DARK=${THEME_IS_DARK:-}
Expand All @@ -240,7 +247,7 @@ services:


inference_model_server:
image: danswer/danswer-model-server:latest
image: danswer/danswer-model-server:v0.4.28
build:
context: ../../backend
dockerfile: Dockerfile.model_server
Expand All @@ -253,6 +260,7 @@ services:
fi"
restart: on-failure
environment:
- ENVIRONMENT=${ENVIRONMENT:-DEV}
- MIN_THREADS_ML_MODELS=${MIN_THREADS_ML_MODELS:-}
# Set to debug to get more fine-grained logs
- LOG_LEVEL=${LOG_LEVEL:-info}
Expand Down Expand Up @@ -280,6 +288,7 @@ services:
fi"
restart: on-failure
environment:
- ENVIRONMENT=${ENVIRONMENT:-DEV}
- MIN_THREADS_ML_MODELS=${MIN_THREADS_ML_MODELS:-}
- INDEXING_ONLY=True
# Set to debug to get more fine-grained logs
Expand All @@ -297,6 +306,7 @@ services:
image: postgres:15.2-alpine
restart: always
environment:
- ENVIRONMENT=${ENVIRONMENT:-DEV}
- POSTGRES_USER=${POSTGRES_USER:-postgres}
- POSTGRES_PASSWORD=${POSTGRES_PASSWORD:-password}
ports:
Expand Down Expand Up @@ -330,6 +340,7 @@ services:
- api_server
- web_server
environment:
- ENVIRONMENT=${ENVIRONMENT:-DEV}
- DOMAIN=localhost
ports:
- "80:80"
Expand Down

0 comments on commit 2d7d824

Please sign in to comment.