mirror of
https://github.com/danswer-ai/danswer.git
synced 2025-09-20 13:05:49 +02:00
Add environment variable for setting vespa search threads (#2400)
This commit is contained in:
@@ -93,3 +93,5 @@ BING_API_KEY = os.environ.get("BING_API_KEY") or None
|
|||||||
|
|
||||||
# Enable in-house model for detecting connector-based filtering in queries
|
# Enable in-house model for detecting connector-based filtering in queries
|
||||||
ENABLE_CONNECTOR_CLASSIFIER = os.environ.get("ENABLE_CONNECTOR_CLASSIFIER", False)
|
ENABLE_CONNECTOR_CLASSIFIER = os.environ.get("ENABLE_CONNECTOR_CLASSIFIER", False)
|
||||||
|
|
||||||
|
VESPA_SEARCHER_THREADS = int(os.environ.get("VESPA_SEARCHER_THREADS") or 2)
|
||||||
|
@@ -26,6 +26,17 @@
|
|||||||
<disk>0.75</disk>
|
<disk>0.75</disk>
|
||||||
</resource-limits>
|
</resource-limits>
|
||||||
</tuning>
|
</tuning>
|
||||||
|
<engine>
|
||||||
|
<proton>
|
||||||
|
<tuning>
|
||||||
|
<searchnode>
|
||||||
|
<requestthreads>
|
||||||
|
<persearch>SEARCH_THREAD_NUMBER</persearch>
|
||||||
|
</requestthreads>
|
||||||
|
</searchnode>
|
||||||
|
</tuning>
|
||||||
|
</proton>
|
||||||
|
</engine>
|
||||||
<config name="vespa.config.search.summary.juniperrc">
|
<config name="vespa.config.search.summary.juniperrc">
|
||||||
<max_matches>3</max_matches>
|
<max_matches>3</max_matches>
|
||||||
<length>750</length>
|
<length>750</length>
|
||||||
@@ -33,4 +44,4 @@
|
|||||||
<min_length>300</min_length>
|
<min_length>300</min_length>
|
||||||
</config>
|
</config>
|
||||||
</content>
|
</content>
|
||||||
</services>
|
</services>
|
@@ -16,6 +16,7 @@ import requests
|
|||||||
from danswer.configs.chat_configs import DOC_TIME_DECAY
|
from danswer.configs.chat_configs import DOC_TIME_DECAY
|
||||||
from danswer.configs.chat_configs import NUM_RETURNED_HITS
|
from danswer.configs.chat_configs import NUM_RETURNED_HITS
|
||||||
from danswer.configs.chat_configs import TITLE_CONTENT_RATIO
|
from danswer.configs.chat_configs import TITLE_CONTENT_RATIO
|
||||||
|
from danswer.configs.chat_configs import VESPA_SEARCHER_THREADS
|
||||||
from danswer.configs.constants import KV_REINDEX_KEY
|
from danswer.configs.constants import KV_REINDEX_KEY
|
||||||
from danswer.document_index.interfaces import DocumentIndex
|
from danswer.document_index.interfaces import DocumentIndex
|
||||||
from danswer.document_index.interfaces import DocumentInsertionRecord
|
from danswer.document_index.interfaces import DocumentInsertionRecord
|
||||||
@@ -52,6 +53,7 @@ from danswer.document_index.vespa_constants import DOCUMENT_REPLACEMENT_PAT
|
|||||||
from danswer.document_index.vespa_constants import DOCUMENT_SETS
|
from danswer.document_index.vespa_constants import DOCUMENT_SETS
|
||||||
from danswer.document_index.vespa_constants import HIDDEN
|
from danswer.document_index.vespa_constants import HIDDEN
|
||||||
from danswer.document_index.vespa_constants import NUM_THREADS
|
from danswer.document_index.vespa_constants import NUM_THREADS
|
||||||
|
from danswer.document_index.vespa_constants import SEARCH_THREAD_NUMBER_PAT
|
||||||
from danswer.document_index.vespa_constants import VESPA_APPLICATION_ENDPOINT
|
from danswer.document_index.vespa_constants import VESPA_APPLICATION_ENDPOINT
|
||||||
from danswer.document_index.vespa_constants import VESPA_DIM_REPLACEMENT_PAT
|
from danswer.document_index.vespa_constants import VESPA_DIM_REPLACEMENT_PAT
|
||||||
from danswer.document_index.vespa_constants import VESPA_TIMEOUT
|
from danswer.document_index.vespa_constants import VESPA_TIMEOUT
|
||||||
@@ -134,6 +136,10 @@ class VespaIndex(DocumentIndex):
|
|||||||
|
|
||||||
doc_lines = _create_document_xml_lines(schema_names)
|
doc_lines = _create_document_xml_lines(schema_names)
|
||||||
services = services_template.replace(DOCUMENT_REPLACEMENT_PAT, doc_lines)
|
services = services_template.replace(DOCUMENT_REPLACEMENT_PAT, doc_lines)
|
||||||
|
services = services.replace(
|
||||||
|
SEARCH_THREAD_NUMBER_PAT, str(VESPA_SEARCHER_THREADS)
|
||||||
|
)
|
||||||
|
|
||||||
kv_store = get_dynamic_config_store()
|
kv_store = get_dynamic_config_store()
|
||||||
|
|
||||||
needs_reindexing = False
|
needs_reindexing = False
|
||||||
|
@@ -7,6 +7,7 @@ from danswer.configs.constants import SOURCE_TYPE
|
|||||||
VESPA_DIM_REPLACEMENT_PAT = "VARIABLE_DIM"
|
VESPA_DIM_REPLACEMENT_PAT = "VARIABLE_DIM"
|
||||||
DANSWER_CHUNK_REPLACEMENT_PAT = "DANSWER_CHUNK_NAME"
|
DANSWER_CHUNK_REPLACEMENT_PAT = "DANSWER_CHUNK_NAME"
|
||||||
DOCUMENT_REPLACEMENT_PAT = "DOCUMENT_REPLACEMENT"
|
DOCUMENT_REPLACEMENT_PAT = "DOCUMENT_REPLACEMENT"
|
||||||
|
SEARCH_THREAD_NUMBER_PAT = "SEARCH_THREAD_NUMBER"
|
||||||
DATE_REPLACEMENT = "DATE_REPLACEMENT"
|
DATE_REPLACEMENT = "DATE_REPLACEMENT"
|
||||||
|
|
||||||
# config server
|
# config server
|
||||||
|
@@ -154,6 +154,7 @@ services:
|
|||||||
- MODEL_SERVER_PORT=${MODEL_SERVER_PORT:-}
|
- MODEL_SERVER_PORT=${MODEL_SERVER_PORT:-}
|
||||||
- INDEXING_MODEL_SERVER_HOST=${INDEXING_MODEL_SERVER_HOST:-indexing_model_server}
|
- INDEXING_MODEL_SERVER_HOST=${INDEXING_MODEL_SERVER_HOST:-indexing_model_server}
|
||||||
# Indexing Configs
|
# Indexing Configs
|
||||||
|
- VESPA_SEARCHER_THREADS=${VESPA_SEARCHER_THREADS:-}
|
||||||
- NUM_INDEXING_WORKERS=${NUM_INDEXING_WORKERS:-}
|
- NUM_INDEXING_WORKERS=${NUM_INDEXING_WORKERS:-}
|
||||||
- ENABLED_CONNECTOR_TYPES=${ENABLED_CONNECTOR_TYPES:-}
|
- ENABLED_CONNECTOR_TYPES=${ENABLED_CONNECTOR_TYPES:-}
|
||||||
- DISABLE_INDEX_UPDATE_ON_SWAP=${DISABLE_INDEX_UPDATE_ON_SWAP:-}
|
- DISABLE_INDEX_UPDATE_ON_SWAP=${DISABLE_INDEX_UPDATE_ON_SWAP:-}
|
||||||
|
@@ -147,6 +147,7 @@ services:
|
|||||||
- MODEL_SERVER_PORT=${MODEL_SERVER_PORT:-}
|
- MODEL_SERVER_PORT=${MODEL_SERVER_PORT:-}
|
||||||
- INDEXING_MODEL_SERVER_HOST=${INDEXING_MODEL_SERVER_HOST:-indexing_model_server}
|
- INDEXING_MODEL_SERVER_HOST=${INDEXING_MODEL_SERVER_HOST:-indexing_model_server}
|
||||||
# Indexing Configs
|
# Indexing Configs
|
||||||
|
- VESPA_SEARCHER_THREADS=${VESPA_SEARCHER_THREADS:-}
|
||||||
- NUM_INDEXING_WORKERS=${NUM_INDEXING_WORKERS:-}
|
- NUM_INDEXING_WORKERS=${NUM_INDEXING_WORKERS:-}
|
||||||
- ENABLED_CONNECTOR_TYPES=${ENABLED_CONNECTOR_TYPES:-}
|
- ENABLED_CONNECTOR_TYPES=${ENABLED_CONNECTOR_TYPES:-}
|
||||||
- DISABLE_INDEX_UPDATE_ON_SWAP=${DISABLE_INDEX_UPDATE_ON_SWAP:-}
|
- DISABLE_INDEX_UPDATE_ON_SWAP=${DISABLE_INDEX_UPDATE_ON_SWAP:-}
|
||||||
@@ -282,6 +283,7 @@ services:
|
|||||||
- INDEXING_ONLY=True
|
- INDEXING_ONLY=True
|
||||||
# Set to debug to get more fine-grained logs
|
# Set to debug to get more fine-grained logs
|
||||||
- LOG_LEVEL=${LOG_LEVEL:-info}
|
- LOG_LEVEL=${LOG_LEVEL:-info}
|
||||||
|
- VESPA_SEARCHER_THREADS=${VESPA_SEARCHER_THREADS:-1}
|
||||||
volumes:
|
volumes:
|
||||||
# Not necessary, this is just to reduce download time during startup
|
# Not necessary, this is just to reduce download time during startup
|
||||||
- indexing_huggingface_model_cache:/root/.cache/huggingface/
|
- indexing_huggingface_model_cache:/root/.cache/huggingface/
|
||||||
|
@@ -134,6 +134,7 @@ services:
|
|||||||
- INDEXING_ONLY=True
|
- INDEXING_ONLY=True
|
||||||
# Set to debug to get more fine-grained logs
|
# Set to debug to get more fine-grained logs
|
||||||
- LOG_LEVEL=${LOG_LEVEL:-info}
|
- LOG_LEVEL=${LOG_LEVEL:-info}
|
||||||
|
- VESPA_SEARCHER_THREADS=${VESPA_SEARCHER_THREADS:-1}
|
||||||
volumes:
|
volumes:
|
||||||
# Not necessary, this is just to reduce download time during startup
|
# Not necessary, this is just to reduce download time during startup
|
||||||
- indexing_huggingface_model_cache:/root/.cache/huggingface/
|
- indexing_huggingface_model_cache:/root/.cache/huggingface/
|
||||||
|
@@ -148,6 +148,7 @@ services:
|
|||||||
- INDEXING_ONLY=True
|
- INDEXING_ONLY=True
|
||||||
# Set to debug to get more fine-grained logs
|
# Set to debug to get more fine-grained logs
|
||||||
- LOG_LEVEL=${LOG_LEVEL:-info}
|
- LOG_LEVEL=${LOG_LEVEL:-info}
|
||||||
|
- VESPA_SEARCHER_THREADS=${VESPA_SEARCHER_THREADS:-1}
|
||||||
volumes:
|
volumes:
|
||||||
# Not necessary, this is just to reduce download time during startup
|
# Not necessary, this is just to reduce download time during startup
|
||||||
- indexing_huggingface_model_cache:/root/.cache/huggingface/
|
- indexing_huggingface_model_cache:/root/.cache/huggingface/
|
||||||
|
@@ -138,6 +138,7 @@ services:
|
|||||||
- INDEXING_ONLY=True
|
- INDEXING_ONLY=True
|
||||||
- LOG_LEVEL=${LOG_LEVEL:-debug}
|
- LOG_LEVEL=${LOG_LEVEL:-debug}
|
||||||
- index_model_cache_huggingface:/root/.cache/huggingface/
|
- index_model_cache_huggingface:/root/.cache/huggingface/
|
||||||
|
- VESPA_SEARCHER_THREADS=${VESPA_SEARCHER_THREADS:-1}
|
||||||
logging:
|
logging:
|
||||||
driver: json-file
|
driver: json-file
|
||||||
options:
|
options:
|
||||||
|
@@ -421,6 +421,7 @@ configMap:
|
|||||||
MODEL_SERVER_PORT: ""
|
MODEL_SERVER_PORT: ""
|
||||||
MIN_THREADS_ML_MODELS: ""
|
MIN_THREADS_ML_MODELS: ""
|
||||||
# Indexing Configs
|
# Indexing Configs
|
||||||
|
VESPA_SEARCHER_THREADS: ""
|
||||||
NUM_INDEXING_WORKERS: ""
|
NUM_INDEXING_WORKERS: ""
|
||||||
DISABLE_INDEX_UPDATE_ON_SWAP: ""
|
DISABLE_INDEX_UPDATE_ON_SWAP: ""
|
||||||
DASK_JOB_CLIENT_ENABLED: ""
|
DASK_JOB_CLIENT_ENABLED: ""
|
||||||
|
@@ -46,6 +46,7 @@ data:
|
|||||||
INDEXING_MODEL_SERVER_HOST: "indexing-model-server-service"
|
INDEXING_MODEL_SERVER_HOST: "indexing-model-server-service"
|
||||||
MIN_THREADS_ML_MODELS: ""
|
MIN_THREADS_ML_MODELS: ""
|
||||||
# Indexing Configs
|
# Indexing Configs
|
||||||
|
VESPA_SEARCHER_THREADS: ""
|
||||||
NUM_INDEXING_WORKERS: ""
|
NUM_INDEXING_WORKERS: ""
|
||||||
ENABLED_CONNECTOR_TYPES: ""
|
ENABLED_CONNECTOR_TYPES: ""
|
||||||
DISABLE_INDEX_UPDATE_ON_SWAP: ""
|
DISABLE_INDEX_UPDATE_ON_SWAP: ""
|
||||||
|
Reference in New Issue
Block a user