Skip to content

Commit

Permalink
Use lila-search ingestor cli to setup indexes
Browse files Browse the repository at this point in the history
  • Loading branch information
fitztrev committed Sep 13, 2024
1 parent a5ea335 commit 0fe197b
Showing 1 changed file with 9 additions and 8 deletions.
17 changes: 9 additions & 8 deletions lila-docker
Original file line number Diff line number Diff line change
Expand Up @@ -96,13 +96,6 @@ setup_database() {
sleep 1
done

if [[ $COMPOSE_PROFILES == *"search"* ]]; then
while ! docker compose exec elasticsearch curl -s -X GET "http://localhost:9200/_cluster/health?wait_for_status=yellow&timeout=10s" > /dev/null 2>&1; do
echo "Waiting for elasticsearch to be ready..."
sleep 2
done
fi

[[ $SETUP_API_TOKENS == "true" ]] && params+=(--tokens)

docker compose run --rm python python /lila-db-seed/spamdb/spamdb.py \
Expand All @@ -112,7 +105,6 @@ setup_database() {
--su-password=$SU_PASSWORD \
--streamers \
--coaches \
--es --es-host=elasticsearch:9200 \
"${params[@]}"

echo -n "Creating database indexes..."
Expand All @@ -123,6 +115,15 @@ setup_database() {
docker compose exec mongodb mongosh --quiet lichess /lila/bin/mongodb/create-trophy-kinds.js
echo " done"

if [[ $COMPOSE_PROFILES == *"search"* ]]; then
while ! docker compose exec elasticsearch curl -s -X GET "http://localhost:9200/_cluster/health?wait_for_status=yellow&timeout=10s" > /dev/null 2>&1; do
echo "Waiting for elasticsearch to be ready..."
sleep 2
done

docker compose exec lila_search_ingestor sbt 'ingestor/runMain lila.search.ingestor.cli rebuild --drop'
fi

docker compose run --rm python python /scripts/users.py
}

Expand Down

0 comments on commit 0fe197b

Please sign in to comment.