From 6bed802e127023cecf5f20c98310bb8f280a0644 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jos=C3=A9=20Francisco=20Calvo?= Date: Fri, 19 Jul 2024 11:21:32 +0200 Subject: [PATCH] improvement: add `REINDEX_DATASETS` environment variable to Argilla server Docker image (#5268) # Description **Type of change** - Improvement (change adding some improvement to an existing functionality) **How Has This Been Tested** - [x] The image should be correctly generated and we will check it on dev environment (if reindex is correctly done). **Checklist** - I added relevant documentation - I followed the style guidelines of this project - I did a self-review of my code - I made corresponding changes to the documentation - I confirm My changes generate no new warnings - I have added tests that prove my fix is effective or that my feature works - I have added relevant notes to the CHANGELOG.md file (See https://keepachangelog.com/) --- argilla-server/CHANGELOG.md | 1 + .../docker/server/scripts/start_argilla_server.sh | 8 +++++++- .../installation/configurations/database_migrations.md | 4 +--- 3 files changed, 9 insertions(+), 4 deletions(-) diff --git a/argilla-server/CHANGELOG.md b/argilla-server/CHANGELOG.md index e74f93daae..3a12ad1e9f 100644 --- a/argilla-server/CHANGELOG.md +++ b/argilla-server/CHANGELOG.md @@ -28,6 +28,7 @@ These are the section headers that we use: - Added new `ARGILLA_DATABASE_POSTGRESQL_POOL_SIZE` environment variable allowing to set the number of connections to keep open inside the database connection pool. ([#5220](https://github.com/argilla-io/argilla/pull/5220)) - Added new `ARGILLA_DATABASE_POSTGRESQL_MAX_OVERFLOW` environment variable allowing to set the number of connections that can be opened above and beyond the `ARGILLA_DATABASE_POSTGRESQL_POOL_SIZE` setting. ([#5220](https://github.com/argilla-io/argilla/pull/5220)) - Added new `Server-Timing` header to all responses with the total time in milliseconds the server took to generate the response. ([#5239](https://github.com/argilla-io/argilla/pull/5239)) +- Added `REINDEX_DATASETS` environment variable to Argilla server Docker image. ([#5268](https://github.com/argilla-io/argilla/pull/5268)) ### Changed diff --git a/argilla-server/docker/server/scripts/start_argilla_server.sh b/argilla-server/docker/server/scripts/start_argilla_server.sh index 0a3e5c4d40..df23d6b2e1 100755 --- a/argilla-server/docker/server/scripts/start_argilla_server.sh +++ b/argilla-server/docker/server/scripts/start_argilla_server.sh @@ -5,10 +5,16 @@ set -e python -m argilla_server database migrate # Create default user -if [ "$DEFAULT_USER_ENABLED" = "true" ]; then +if [ "$DEFAULT_USER_ENABLED" = "true" ] || [ "$DEFAULT_USER_ENABLED" = "1" ]; then python -m argilla_server database users create_default --password $DEFAULT_USER_PASSWORD --api-key $DEFAULT_USER_API_KEY fi +# Reindexing data into search engine +if [ "$REINDEX_DATASETS" == "true" ] || [ "$REINDEX_DATASETS" == "1" ]; then + echo "Reindexing existing datasets" + python -m argilla_server search-engine reindex +fi + # Run argilla-server (See https://www.uvicorn.org/settings/#settings) # # From uvicorn docs: diff --git a/docs/_source/getting_started/installation/configurations/database_migrations.md b/docs/_source/getting_started/installation/configurations/database_migrations.md index 2d836d9e22..6f8198e3a2 100644 --- a/docs/_source/getting_started/installation/configurations/database_migrations.md +++ b/docs/_source/getting_started/installation/configurations/database_migrations.md @@ -236,10 +236,8 @@ argilla server search-engine reindex --feedback-dataset-id 08476931-ac30-4eec-9a :::: -If you are using the quickstart docker image, you can set the `REINDEX_DATASETS` environment variable to `true` to reindex the datasets. -You can visit the [Docker Quickstart](/getting_started/installation/deployments/docker-quickstart) deployment page for more information. +You can set the `REINDEX_DATASETS` environment variable to `true` to reindex the datasets. ::: :::: -