Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: expose search engine ping max time as a new environment variable #4997

Open
wants to merge 6 commits into
base: develop
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions argilla-server/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,10 @@ These are the section headers that we use:

## [Unreleased]()

### Added

- Added `ARGILLA_SEARCH_ENGINE_PING_TIMEOUT` new environment variable to specify a number of seconds that Argilla will wait for the search engine to be ready.

### Removed

- Removed all API v0 endpoints. ([#4852](https://github.com/argilla-io/argilla/pull/4852))
Expand Down
2 changes: 1 addition & 1 deletion argilla-server/src/argilla_server/_app.py
Original file line number Diff line number Diff line change
Expand Up @@ -166,7 +166,7 @@ async def configure_opensearch():
logging.getLogger("opensearch_transport").setLevel(logging.ERROR)

@app.on_event("startup")
@backoff.on_exception(backoff.expo, ConnectionError, max_time=60)
@backoff.on_exception(backoff.expo, ConnectionError, max_time=settings.search_engine_ping_timeout)
async def ping_search_engine():
async for search_engine in get_search_engine():
if not await search_engine.ping():
Expand Down
2 changes: 2 additions & 0 deletions argilla-server/src/argilla_server/constants.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,8 @@
SEARCH_ENGINE_ELASTICSEARCH = "elasticsearch"
SEARCH_ENGINE_OPENSEARCH = "opensearch"

DEFAULT_SEARCH_ENGINE_PING_TIMEOUT = 60

DEFAULT_USERNAME = "argilla"
DEFAULT_PASSWORD = "1234"
DEFAULT_API_KEY = "argilla.apikey"
Expand Down
5 changes: 5 additions & 0 deletions argilla-server/src/argilla_server/settings.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@
from argilla_server.constants import (
DEFAULT_LABEL_SELECTION_OPTIONS_MAX_ITEMS,
DEFAULT_MAX_KEYWORD_LENGTH,
DEFAULT_SEARCH_ENGINE_PING_TIMEOUT,
DEFAULT_SPAN_OPTIONS_MAX_ITEMS,
DEFAULT_TELEMETRY_KEY,
SEARCH_ENGINE_ELASTICSEARCH,
Expand Down Expand Up @@ -100,6 +101,10 @@ class Settings(BaseSettings):
es_mapping_total_fields_limit: int = 2000

search_engine: str = SEARCH_ENGINE_ELASTICSEARCH
search_engine_ping_timeout: int = Field(
default=DEFAULT_SEARCH_ENGINE_PING_TIMEOUT,
description="Maximum time in seconds that Argilla will wait for the search engine to respond when starting",
)

vectors_fields_limit: int = Field(
default=5,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,8 @@ You can set the following environment variables to further configure your server

- `ARGILLA_SEARCH_ENGINE`: (Only for Feedback datasets) Search engine to use. Valid values are "elasticsearch" and "opensearch" (Default: "elasticsearch").

- `ARGILLA_SEARCH_ENGINE_PING_TIMEOUT`: The maximum time in seconds that Argilla will wait for the search engine to be up and running (Default: `60`).

- `ARGILLA_ELASTICSEARCH_SSL_VERIFY`: If "False", disables SSL certificate verification when connecting to the Elasticsearch backend.

- `ARGILLA_ELASTICSEARCH_CA_PATH`: Path to CA cert for ES host. For example: `/full/path/to/root-ca.pem` (Optional)
Expand Down
Loading