From 610265185e22394734f9f3ca5957b3ad5497bdc7 Mon Sep 17 00:00:00 2001 From: Steven Silvester Date: Thu, 14 Nov 2024 06:50:09 -0600 Subject: [PATCH 1/3] INTPYTHON-323 Use Local Atlas on Chatgpt-retrieval-plugin Tests --- chatgpt-retrieval-plugin/run.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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" \ From 9b81bd10eb5746cca495c773313cedf6830279de Mon Sep 17 00:00:00 2001 From: Steven Silvester Date: Thu, 14 Nov 2024 07:20:26 -0600 Subject: [PATCH 2/3] add retries --- .evergreen/utils.sh | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/.evergreen/utils.sh b/.evergreen/utils.sh index 3adfe20..a774b69 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=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..." From 8813435b1db3e975d519564e7e36edc3ff082cc1 Mon Sep 17 00:00:00 2001 From: Steven Silvester Date: Mon, 18 Nov 2024 08:28:28 -0600 Subject: [PATCH 3/3] update image --- .evergreen/utils.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.evergreen/utils.sh b/.evergreen/utils.sh index a774b69..a14b063 100644 --- a/.evergreen/utils.sh +++ b/.evergreen/utils.sh @@ -65,7 +65,7 @@ retry() { setup_local_atlas() { echo "Starting the container" - IMAGE=mongodb/mongodb-atlas-local:latest + 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)