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

Delete base indices before recreation of sample data #4213

Merged
merged 2 commits into from
Apr 29, 2024
Merged
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
10 changes: 8 additions & 2 deletions docker/es/justfile
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@ set dotenv-load := false
COLOR := "\\033[0;32m"
NO_COLOR := "\\033[0m"

ES_LOCALHOST := "localhost:50292"

# Show all available recipes
@_default:
printf "\n{{ COLOR }}# ES (path: \`docker/es/\`)\n"
Expand All @@ -19,7 +21,7 @@ NO_COLOR := "\\033[0m"
-curl -s -o /dev/null -w '%{http_code}' 'http://{{ host }}/_cluster/health'

# Wait for the service to be healthy
@wait host="localhost:50292":
@wait host=ES_LOCALHOST:
# The just command on the second line is executed in the context of the
# root directory and so must be prefixed with `docker/es/`.
just ../../_loop \
Expand All @@ -35,7 +37,7 @@ _curl path:
-curl \
-s \
-H 'Accept: application/json' \
'http://localhost:50292/{{ path }}'
'http://{{ ES_LOCALHOST }}/{{ path }}'

# Count the number of times the given string appears in the response
_curl-wc path search:
Expand Down Expand Up @@ -68,3 +70,7 @@ _curl-wc path search:
'"$(just docker/es/check-count {{ index }} {{ count }})" != "1"' \
"Waiting for index '{{ index }}' to have {{ count }} docs..." \
"10s"

# Delete an index if it exists, ignoring if it doesn't
@delete-index index="image":
curl -X DELETE "http://{{ ES_LOCALHOST }}/{{ index }}?ignore_unavailable=true"
6 changes: 6 additions & 0 deletions load_sample_data.sh
Original file line number Diff line number Diff line change
Expand Up @@ -115,6 +115,12 @@ VALUES
# Ingestion #
#############

# Remove base indices if they exist
just docker/es/delete-index audio-init
just docker/es/delete-index audio-init-filtered
just docker/es/delete-index image-init
just docker/es/delete-index image-init-filtered

# Ingest and index the data
just ingestion_server/ingest-upstream "audio" "init"
just docker/es/wait-for-index "audio-init"
Expand Down
Loading