diff --git a/.evergreen/utils.sh b/.evergreen/utils.sh index 3adfe20..a14b063 100644 --- a/.evergreen/utils.sh +++ b/.evergreen/utils.sh @@ -52,10 +52,22 @@ is_python_310() { } +retry() { + for i in 1 2 4 8 16; do + { "$@" && return 0; } || sleep $i + done + return 1 +} + + # start mongodb-atlas-local container, because of a bug in podman we have to define the healtcheck ourselves (is the same as in the image) # stores the connection string in .local_atlas_uri file setup_local_atlas() { echo "Starting the container" + + IMAGE=artifactory.corp.mongodb.com/dockerhub/mongodb/mongodb-atlas-local:latest + retry podman pull $IMAGE + CONTAINER_ID=$(podman run --rm -d -e DO_NOT_TRACK=1 -P --health-cmd "/usr/local/bin/runner healthcheck" mongodb/mongodb-atlas-local:latest) echo "waiting for container to become healthy..." diff --git a/chatgpt-retrieval-plugin/run.sh b/chatgpt-retrieval-plugin/run.sh index 4445ed0..feea4b2 100644 --- a/chatgpt-retrieval-plugin/run.sh +++ b/chatgpt-retrieval-plugin/run.sh @@ -26,7 +26,7 @@ $PYTHON_BINARY -m poetry install --with dev OPENAI_API_KEY=$openai_api_key \ DATASTORE="mongodb" \ BEARER_TOKEN="staylowandkeepmoving" \ -MONGODB_URI=$chatgpt_retrieval_plugin_mongodb_uri \ +MONGODB_URI=$(fetch_local_atlas_uri) \ MONGODB_DATABASE="chatgpt_retrieval_plugin_test_db" \ MONGODB_COLLECTION="chatgpt_retrieval_plugin_test_vectorstore" \ MONGODB_INDEX="vector_index" \