From d11e101f835c0fae240cada8ee4a6472eb8f3959 Mon Sep 17 00:00:00 2001 From: Steven Silvester Date: Wed, 2 Jul 2025 13:41:18 -0500 Subject: [PATCH 01/12] INTPYTHON-667 Support Azure OpenAI in langchain tests --- .evergreen/execute-tests.sh | 3 +++ .evergreen/provision-atlas.sh | 9 +-------- .evergreen/setup-remote.sh | 5 +---- langchain-python/config.env | 2 ++ langchain-python/run.sh | 5 +++-- 5 files changed, 10 insertions(+), 14 deletions(-) diff --git a/.evergreen/execute-tests.sh b/.evergreen/execute-tests.sh index 130d680..682323b 100644 --- a/.evergreen/execute-tests.sh +++ b/.evergreen/execute-tests.sh @@ -5,6 +5,8 @@ set -eu SCRIPT_DIR=$(realpath "$(dirname ${BASH_SOURCE[0]})") ROOT_DIR=$(dirname $SCRIPT_DIR) +# Source the secrets. +source $ROOT_DIR/secrets-export.sh # Source the configuration. cd ${ROOT_DIR}/${DIR} @@ -13,4 +15,5 @@ source config.env set +a cd ${REPO_NAME} + bash ${ROOT_DIR}/${DIR}/run.sh diff --git a/.evergreen/provision-atlas.sh b/.evergreen/provision-atlas.sh index 5e4093e..7a88599 100644 --- a/.evergreen/provision-atlas.sh +++ b/.evergreen/provision-atlas.sh @@ -13,11 +13,4 @@ popd setup_local_atlas scaffold_atlas -# Get the secrets. -source secrets-export.sh - -# Create the env file -echo "export VOYAGEAI_S3_BUCKET=$VOYAGEAI_S3_BUCKET" >> env.sh -echo "export OPENAI_API_KEY=$OPENAI_API_KEY" >> env.sh -echo "export MONGODB_URI=$CONN_STRING" >> env.sh -echo "export VOYAGEAI_API_KEY=$VOYAGEAI_API_KEY" >> env.sh +echo "export MONGODB_URI=$CONN_STRING" > env.sh diff --git a/.evergreen/setup-remote.sh b/.evergreen/setup-remote.sh index 10691d3..bd48a5c 100644 --- a/.evergreen/setup-remote.sh +++ b/.evergreen/setup-remote.sh @@ -52,10 +52,7 @@ esac export MONGODB_URI # Create the env file -echo "export VOYAGEAI_S3_BUCKET=$VOYAGEAI_S3_BUCKET" >> env.sh -echo "export VOYAGEAI_API_KEY=$VOYAGEAI_API_KEY" >> env.sh -echo "export OPENAI_API_KEY=$OPENAI_API_KEY" >> env.sh -echo "export MONGODB_URI=$MONGODB_URI" >> env.sh +echo "export MONGODB_URI=$MONGODB_URI" > env.sh # Ensure the remote database is populated. . .evergreen/utils.sh diff --git a/langchain-python/config.env b/langchain-python/config.env index 18baa54..63fad76 100644 --- a/langchain-python/config.env +++ b/langchain-python/config.env @@ -1,3 +1,5 @@ REPO_NAME=langchain-mongodb REPO_ORG=langchain-ai DATABASE=langchain_test_db +REPO_ORG=blink1073 +REPO_BRANCH=INTPYTHON-667 diff --git a/langchain-python/run.sh b/langchain-python/run.sh index 74974f2..96634de 100644 --- a/langchain-python/run.sh +++ b/langchain-python/run.sh @@ -22,8 +22,9 @@ pip install uv rust-just just install -export MONGODB_URI=$MONGODB_URI -export OPENAI_API_KEY=$OPENAI_API_KEY +# Use the o4-mini model from Azure for tests. +export AZURE_OPENAI_ENDPOINT=$AZURE_OPENAI_O4_MINI_URI +export AZURE_OPENAI_API_KEY=$AZURE_OPENAI_O4_MINI_KEY just tests From 34308104902d50fa2083ea04bbe52cec0002e675 Mon Sep 17 00:00:00 2001 From: Steven Silvester Date: Wed, 2 Jul 2025 14:08:56 -0500 Subject: [PATCH 02/12] migrate semantic kernel python as well --- langgraph-python/run.sh | 5 +++-- semantic-kernel-python/run.sh | 12 ++++++------ 2 files changed, 9 insertions(+), 8 deletions(-) diff --git a/langgraph-python/run.sh b/langgraph-python/run.sh index 501a8ab..6e4432c 100644 --- a/langgraph-python/run.sh +++ b/langgraph-python/run.sh @@ -22,8 +22,9 @@ pip install uv rust-just just install -export MONGODB_URI=$MONGODB_URI -export OPENAI_API_KEY=$OPENAI_API_KEY +# Use the o4-mini model from Azure for tests. +export AZURE_OPENAI_ENDPOINT=$AZURE_OPENAI_O4_MINI_URI +export AZURE_OPENAI_API_KEY=$AZURE_OPENAI_O4_MINI_KEY just tests diff --git a/semantic-kernel-python/run.sh b/semantic-kernel-python/run.sh index 6923e67..0c1c501 100644 --- a/semantic-kernel-python/run.sh +++ b/semantic-kernel-python/run.sh @@ -27,21 +27,21 @@ make install-pre-commit cp $SCRIPT_DIR/test_mongodb_atlas_memory_store.py . # shellcheck disable=SC2154 -OPENAI_API_KEY="$OPENAI_API_KEY" \ +OPENAI_API_KEY="" \ OPENAI_ORG_ID="" \ AZURE_OPENAI_DEPLOYMENT_NAME="" \ - AZURE_OPENAI_ENDPOINT="" \ - AZURE_OPENAI_API_KEY="" \ + AZURE_OPENAI_ENDPOINT="$AZURE_OPENAI_O4_MINI_URI" \ + AZURE_OPENAI_API_KEY="$AZURE_OPENAI_O4_MINI_KEY" \ MONGODB_ATLAS_CONNECTION_STRING=$MONGODB_URI \ Python_Integration_Tests=1 \ uv run pytest test_mongodb_atlas_memory_store.py -k test_collection_knn # shellcheck disable=SC2154 -OPENAI_API_KEY="$OPENAI_API_KEY" \ +OPENAI_API_KEY="" \ OPENAI_ORG_ID="" \ AZURE_OPENAI_DEPLOYMENT_NAME="" \ - AZURE_OPENAI_ENDPOINT="" \ - AZURE_OPENAI_API_KEY="" \ + AZURE_OPENAI_ENDPOINT="$AZURE_OPENAI_O4_MINI_URI" \ + AZURE_OPENAI_API_KEY="$AZURE_OPENAI_O4_MINI_KEY" \ MONGODB_ATLAS_CONNECTION_STRING=$MONGODB_URI \ Python_Integration_Tests=1 \ uv run pytest test_mongodb_atlas_memory_store.py From 43fbde3530a39d8614ff279feca6a1c39cb185b2 Mon Sep 17 00:00:00 2001 From: Steven Silvester Date: Wed, 2 Jul 2025 14:55:53 -0500 Subject: [PATCH 03/12] add api version --- .evergreen/config.yml | 40 +++++++++++++++++++------------------ langchain-python/run.sh | 1 + langgraph-python/config.env | 2 ++ 3 files changed, 24 insertions(+), 19 deletions(-) diff --git a/.evergreen/config.yml b/.evergreen/config.yml index c13402a..da68798 100644 --- a/.evergreen/config.yml +++ b/.evergreen/config.yml @@ -306,16 +306,17 @@ buildvariants: - name: test-langgraph-python-remote batchtime: 10080 # 1 week - - name: test-chatgpt-retrieval-plugin-rhel - display_name: ChatGPT Retrieval Plugin - expansions: - DIR: chatgpt-retrieval-plugin - run_on: - - rhel87-small - tasks: - - name: test-chatgpt-retrieval-plugin-local - - name: test-chatgpt-retrieval-plugin-remote - batchtime: 10080 # 1 week + # Skip - INTPYTHON-667 + # - name: test-chatgpt-retrieval-plugin-rhel + # display_name: ChatGPT Retrieval Plugin + # expansions: + # DIR: chatgpt-retrieval-plugin + # run_on: + # - rhel87-small + # tasks: + # - name: test-chatgpt-retrieval-plugin-local + # - name: test-chatgpt-retrieval-plugin-remote + # batchtime: 10080 # 1 week - name: test-llama-index-vectorstore-rhel display_name: LlamaIndex RHEL Vector Store @@ -380,12 +381,13 @@ buildvariants: tasks: - name: test-langchaingo-local - - name: test-langchain-js-ubuntu - display_name: LangchainJS Ubuntu2204 - expansions: - DIR: langchain-js - run_on: - - ubuntu2204-small - tasks: - - name: test-langchain-js-local - - name: test-langchain-js-remote + # Skip - INTPYTHON-667 + # - name: test-langchain-js-ubuntu + # display_name: LangchainJS Ubuntu2204 + # expansions: + # DIR: langchain-js + # run_on: + # - ubuntu2204-small + # tasks: + # - name: test-langchain-js-local + # - name: test-langchain-js-remote diff --git a/langchain-python/run.sh b/langchain-python/run.sh index 96634de..03f222a 100644 --- a/langchain-python/run.sh +++ b/langchain-python/run.sh @@ -25,6 +25,7 @@ just install # Use the o4-mini model from Azure for tests. export AZURE_OPENAI_ENDPOINT=$AZURE_OPENAI_O4_MINI_URI export AZURE_OPENAI_API_KEY=$AZURE_OPENAI_O4_MINI_KEY +export OPENAI_API_VERSION="2024-12-01-preview" just tests diff --git a/langgraph-python/config.env b/langgraph-python/config.env index 568abf1..168a9f6 100644 --- a/langgraph-python/config.env +++ b/langgraph-python/config.env @@ -1,3 +1,5 @@ REPO_NAME=langchain-mongodb REPO_ORG=langchain-ai DATABASE=langgraph-test +REPO_ORG=blink1073 +REPO_BRANCH=INTPYTHON-667 From 4a1f63df1a4107edc5e30efe807d486bd9244f35 Mon Sep 17 00:00:00 2001 From: Steven Silvester Date: Wed, 2 Jul 2025 14:58:16 -0500 Subject: [PATCH 04/12] debug semantic kernel --- semantic-kernel-python/run.sh | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/semantic-kernel-python/run.sh b/semantic-kernel-python/run.sh index 0c1c501..2417474 100644 --- a/semantic-kernel-python/run.sh +++ b/semantic-kernel-python/run.sh @@ -30,18 +30,18 @@ cp $SCRIPT_DIR/test_mongodb_atlas_memory_store.py . OPENAI_API_KEY="" \ OPENAI_ORG_ID="" \ AZURE_OPENAI_DEPLOYMENT_NAME="" \ - AZURE_OPENAI_ENDPOINT="$AZURE_OPENAI_O4_MINI_URI" \ - AZURE_OPENAI_API_KEY="$AZURE_OPENAI_O4_MINI_KEY" \ + AZURE_OPENAI_ENDPOINT="" \ + AZURE_OPENAI_API_KEY="" \ MONGODB_ATLAS_CONNECTION_STRING=$MONGODB_URI \ Python_Integration_Tests=1 \ - uv run pytest test_mongodb_atlas_memory_store.py -k test_collection_knn + uv run pytest -v test_mongodb_atlas_memory_store.py -k test_collection_knn # shellcheck disable=SC2154 OPENAI_API_KEY="" \ OPENAI_ORG_ID="" \ AZURE_OPENAI_DEPLOYMENT_NAME="" \ - AZURE_OPENAI_ENDPOINT="$AZURE_OPENAI_O4_MINI_URI" \ - AZURE_OPENAI_API_KEY="$AZURE_OPENAI_O4_MINI_KEY" \ + AZURE_OPENAI_ENDPOINT="" \ + AZURE_OPENAI_API_KEY="" \ MONGODB_ATLAS_CONNECTION_STRING=$MONGODB_URI \ Python_Integration_Tests=1 \ - uv run pytest test_mongodb_atlas_memory_store.py + uv run pytest -v test_mongodb_atlas_memory_store.py From 25a0452dc0a4ad5615ddb7fce86840a1fde4c0fa Mon Sep 17 00:00:00 2001 From: Steven Silvester Date: Wed, 2 Jul 2025 15:12:53 -0500 Subject: [PATCH 05/12] debug semantic kernel --- langgraph-python/run.sh | 1 + semantic-kernel-python/run.sh | 4 ++-- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/langgraph-python/run.sh b/langgraph-python/run.sh index 6e4432c..de6379d 100644 --- a/langgraph-python/run.sh +++ b/langgraph-python/run.sh @@ -25,6 +25,7 @@ just install # Use the o4-mini model from Azure for tests. export AZURE_OPENAI_ENDPOINT=$AZURE_OPENAI_O4_MINI_URI export AZURE_OPENAI_API_KEY=$AZURE_OPENAI_O4_MINI_KEY +export OPENAI_API_VERSION="2024-12-01-preview" just tests diff --git a/semantic-kernel-python/run.sh b/semantic-kernel-python/run.sh index 2417474..2ec5a5d 100644 --- a/semantic-kernel-python/run.sh +++ b/semantic-kernel-python/run.sh @@ -34,7 +34,7 @@ OPENAI_API_KEY="" \ AZURE_OPENAI_API_KEY="" \ MONGODB_ATLAS_CONNECTION_STRING=$MONGODB_URI \ Python_Integration_Tests=1 \ - uv run pytest -v test_mongodb_atlas_memory_store.py -k test_collection_knn + uv run pytest -rav test_mongodb_atlas_memory_store.py -k test_collection_knn # shellcheck disable=SC2154 OPENAI_API_KEY="" \ @@ -44,4 +44,4 @@ OPENAI_API_KEY="" \ AZURE_OPENAI_API_KEY="" \ MONGODB_ATLAS_CONNECTION_STRING=$MONGODB_URI \ Python_Integration_Tests=1 \ - uv run pytest -v test_mongodb_atlas_memory_store.py + uv run pytest -rav test_mongodb_atlas_memory_store.py From d44daf2bb4003e5c6697bfff58242c7842546ed7 Mon Sep 17 00:00:00 2001 From: Steven Silvester Date: Wed, 2 Jul 2025 16:25:50 -0500 Subject: [PATCH 06/12] cleanup --- langchain-python/run.sh | 5 ----- langgraph-python/run.sh | 5 ----- 2 files changed, 10 deletions(-) diff --git a/langchain-python/run.sh b/langchain-python/run.sh index 03f222a..333ad98 100644 --- a/langchain-python/run.sh +++ b/langchain-python/run.sh @@ -22,11 +22,6 @@ pip install uv rust-just just install -# Use the o4-mini model from Azure for tests. -export AZURE_OPENAI_ENDPOINT=$AZURE_OPENAI_O4_MINI_URI -export AZURE_OPENAI_API_KEY=$AZURE_OPENAI_O4_MINI_KEY -export OPENAI_API_VERSION="2024-12-01-preview" - just tests just integration_tests diff --git a/langgraph-python/run.sh b/langgraph-python/run.sh index de6379d..c3a687f 100644 --- a/langgraph-python/run.sh +++ b/langgraph-python/run.sh @@ -22,11 +22,6 @@ pip install uv rust-just just install -# Use the o4-mini model from Azure for tests. -export AZURE_OPENAI_ENDPOINT=$AZURE_OPENAI_O4_MINI_URI -export AZURE_OPENAI_API_KEY=$AZURE_OPENAI_O4_MINI_KEY -export OPENAI_API_VERSION="2024-12-01-preview" - just tests just integration_tests From aa61cc8da79e07abd6791128a837103f51ef4b4e Mon Sep 17 00:00:00 2001 From: Steven Silvester Date: Wed, 2 Jul 2025 16:37:43 -0500 Subject: [PATCH 07/12] debug langgraph --- langgraph-python/run.sh | 3 +++ 1 file changed, 3 insertions(+) diff --git a/langgraph-python/run.sh b/langgraph-python/run.sh index c3a687f..867597f 100644 --- a/langgraph-python/run.sh +++ b/langgraph-python/run.sh @@ -18,6 +18,9 @@ cd libs/langgraph-checkpoint-mongodb $PYTHON_BINARY -m venv venv_pipeline source venv_pipeline/bin/activate +awk 'BEGIN{for(v in ENVIRON) print v}' +exit 1 + pip install uv rust-just just install From c483f793d41fa3eaa89ad7dcaeafcbb3871d6f26 Mon Sep 17 00:00:00 2001 From: Steven Silvester Date: Wed, 2 Jul 2025 16:41:28 -0500 Subject: [PATCH 08/12] remove debug --- langgraph-python/run.sh | 3 --- 1 file changed, 3 deletions(-) diff --git a/langgraph-python/run.sh b/langgraph-python/run.sh index 867597f..c3a687f 100644 --- a/langgraph-python/run.sh +++ b/langgraph-python/run.sh @@ -18,9 +18,6 @@ cd libs/langgraph-checkpoint-mongodb $PYTHON_BINARY -m venv venv_pipeline source venv_pipeline/bin/activate -awk 'BEGIN{for(v in ENVIRON) print v}' -exit 1 - pip install uv rust-just just install From 91ac206d487f03752fa0def82300d2575c657e66 Mon Sep 17 00:00:00 2001 From: Steven Silvester Date: Wed, 2 Jul 2025 18:27:10 -0500 Subject: [PATCH 09/12] cleanup --- .evergreen/config.yml | 4 ++-- .evergreen/execute-tests.sh | 3 --- .evergreen/provision-atlas.sh | 11 ++++++++++- .evergreen/setup-remote.sh | 10 +++++++++- 4 files changed, 21 insertions(+), 7 deletions(-) diff --git a/.evergreen/config.yml b/.evergreen/config.yml index da68798..49e7399 100644 --- a/.evergreen/config.yml +++ b/.evergreen/config.yml @@ -306,7 +306,7 @@ buildvariants: - name: test-langgraph-python-remote batchtime: 10080 # 1 week - # Skip - INTPYTHON-667 + # TODO: INTPYTHON-668 # - name: test-chatgpt-retrieval-plugin-rhel # display_name: ChatGPT Retrieval Plugin # expansions: @@ -381,7 +381,7 @@ buildvariants: tasks: - name: test-langchaingo-local - # Skip - INTPYTHON-667 + # TODO: INTPYTHON-667 # - name: test-langchain-js-ubuntu # display_name: LangchainJS Ubuntu2204 # expansions: diff --git a/.evergreen/execute-tests.sh b/.evergreen/execute-tests.sh index 682323b..950bad0 100644 --- a/.evergreen/execute-tests.sh +++ b/.evergreen/execute-tests.sh @@ -5,9 +5,6 @@ set -eu SCRIPT_DIR=$(realpath "$(dirname ${BASH_SOURCE[0]})") ROOT_DIR=$(dirname $SCRIPT_DIR) -# Source the secrets. -source $ROOT_DIR/secrets-export.sh - # Source the configuration. cd ${ROOT_DIR}/${DIR} set -a diff --git a/.evergreen/provision-atlas.sh b/.evergreen/provision-atlas.sh index 7a88599..7619a2b 100644 --- a/.evergreen/provision-atlas.sh +++ b/.evergreen/provision-atlas.sh @@ -13,4 +13,13 @@ popd setup_local_atlas scaffold_atlas -echo "export MONGODB_URI=$CONN_STRING" > env.sh +# Get the secrets. +source secrets-export.sh + +# Create the env file +echo "export VOYAGEAI_S3_BUCKET=$VOYAGEAI_S3_BUCKET" >> env.sh +echo "export AZURE_OPENAI_ENDPOINT=$AZURE_OPENAI_ENDPOINT" >> env.sh +echo "export AZURE_OPENAI_API_KEY=$AZURE_OPENAI_API_KEY" >> env.sh +echo "export OPENAI_API_VERSION=$OPENAI_API_VERSION" >> env.sh +echo "export MONGODB_URI=$CONN_STRING" >> env.sh +echo "export VOYAGEAI_API_KEY=$VOYAGEAI_API_KEY" >> env.sh diff --git a/.evergreen/setup-remote.sh b/.evergreen/setup-remote.sh index bd48a5c..8df2924 100644 --- a/.evergreen/setup-remote.sh +++ b/.evergreen/setup-remote.sh @@ -51,8 +51,16 @@ case $DIR in esac export MONGODB_URI +# Get the secrets. +source secrets-export.sh + # Create the env file -echo "export MONGODB_URI=$MONGODB_URI" > env.sh +echo "export VOYAGEAI_S3_BUCKET=$VOYAGEAI_S3_BUCKET" >> env.sh +echo "export AZURE_OPENAI_ENDPOINT=$AZURE_OPENAI_ENDPOINT" >> env.sh +echo "export AZURE_OPENAI_API_KEY=$AZURE_OPENAI_API_KEY" >> env.sh +echo "export OPENAI_API_VERSION=$OPENAI_API_VERSION" >> env.sh +echo "export MONGODB_URI=$CONN_STRING" >> env.sh +echo "export VOYAGEAI_API_KEY=$VOYAGEAI_API_KEY" >> env.sh # Ensure the remote database is populated. . .evergreen/utils.sh From 4f865d0815097cc9d9e515d304147d2852dad363 Mon Sep 17 00:00:00 2001 From: Steven Silvester Date: Wed, 2 Jul 2025 18:32:32 -0500 Subject: [PATCH 10/12] speed up tests --- langchain-python/run.sh | 2 +- langgraph-python/run.sh | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/langchain-python/run.sh b/langchain-python/run.sh index 333ad98..5cd6fb9 100644 --- a/langchain-python/run.sh +++ b/langchain-python/run.sh @@ -22,6 +22,6 @@ pip install uv rust-just just install -just tests +just unit_tests just integration_tests diff --git a/langgraph-python/run.sh b/langgraph-python/run.sh index c3a687f..2bba020 100644 --- a/langgraph-python/run.sh +++ b/langgraph-python/run.sh @@ -22,6 +22,6 @@ pip install uv rust-just just install -just tests +just unit_tests just integration_tests From 32199553e765a8b4042f0efeadafc989784b290e Mon Sep 17 00:00:00 2001 From: Steven Silvester Date: Wed, 2 Jul 2025 18:42:19 -0500 Subject: [PATCH 11/12] skip llama-index for now --- .evergreen/config.yml | 23 ++++++++++++----------- 1 file changed, 12 insertions(+), 11 deletions(-) diff --git a/.evergreen/config.yml b/.evergreen/config.yml index 49e7399..ee21f91 100644 --- a/.evergreen/config.yml +++ b/.evergreen/config.yml @@ -318,17 +318,18 @@ buildvariants: # - name: test-chatgpt-retrieval-plugin-remote # batchtime: 10080 # 1 week - - name: test-llama-index-vectorstore-rhel - display_name: LlamaIndex RHEL Vector Store - expansions: - DIR: llama-index-python-vectorstore - run_on: - - rhel87-small - tasks: - - name: test-llama-index-local - # TODO: INTPYTHON-440 - # - name: test-llama-index-remote - # batchtime: 10080 # 1 week + # TODO: INTPYTHON-669 + # - name: test-llama-index-vectorstore-rhel + # display_name: LlamaIndex RHEL Vector Store + # expansions: + # DIR: llama-index-python-vectorstore + # run_on: + # - rhel87-small + # tasks: + # - name: test-llama-index-local + # # TODO: INTPYTHON-440 + # # - name: test-llama-index-remote + # # batchtime: 10080 # 1 week - name: test-docarray-rhel display_name: DocArray RHEL From bdf9edaca3f2ba45d8c9eabf0b96624719c7357c Mon Sep 17 00:00:00 2001 From: Steven Silvester Date: Wed, 2 Jul 2025 18:43:15 -0500 Subject: [PATCH 12/12] cleanup --- .evergreen/setup-remote.sh | 3 --- 1 file changed, 3 deletions(-) diff --git a/.evergreen/setup-remote.sh b/.evergreen/setup-remote.sh index 8df2924..15d8d0d 100644 --- a/.evergreen/setup-remote.sh +++ b/.evergreen/setup-remote.sh @@ -51,9 +51,6 @@ case $DIR in esac export MONGODB_URI -# Get the secrets. -source secrets-export.sh - # Create the env file echo "export VOYAGEAI_S3_BUCKET=$VOYAGEAI_S3_BUCKET" >> env.sh echo "export AZURE_OPENAI_ENDPOINT=$AZURE_OPENAI_ENDPOINT" >> env.sh