diff --git a/.evergreen/config.yml b/.evergreen/config.yml index a9bb287..c0a84b4 100644 --- a/.evergreen/config.yml +++ b/.evergreen/config.yml @@ -119,18 +119,10 @@ tasks: - func: "setup remote atlas" - func: "execute tests" - - name: test-semantic-kernel-csharp-local + - name: test-semantic-kernel-csharp tags: [local] commands: - func: "fetch repo" - - func: "setup local atlas" - - func: "execute tests" - - - name: test-semantic-kernel-csharp-remote - tags: [remote] - commands: - - func: "fetch repo" - - func: "setup remote atlas" - func: "execute tests" - name: test-langchain-python-local @@ -270,8 +262,7 @@ buildvariants: run_on: - rhel87-small tasks: - - name: test-semantic-kernel-csharp-local - - name: test-semantic-kernel-csharp-remote + - name: test-semantic-kernel-csharp batchtime: 10080 # 1 week - name: test-langchain-python-rhel diff --git a/semantic-kernel-csharp/config.env b/semantic-kernel-csharp/config.env index 2b036d5..5277798 100644 --- a/semantic-kernel-csharp/config.env +++ b/semantic-kernel-csharp/config.env @@ -1,3 +1,2 @@ REPO_NAME=semantic-kernel REPO_ORG=microsoft -DATABASE=dotnetMSKNearestTest diff --git a/semantic-kernel-csharp/database/nearestSearch.json b/semantic-kernel-csharp/database/nearestSearch.json deleted file mode 100644 index bb379a9..0000000 --- a/semantic-kernel-csharp/database/nearestSearch.json +++ /dev/null @@ -1,138 +0,0 @@ -[ - { - "_id": "test_0", - "metadata": { - "isReference": false, - "externalSourceName": "", - "_id": "test_0", - "description": "description_0", - "text": "text_0", - "additionalMetadata": "" - }, - "embedding": [ - 1.0, - 1.0, - 0.0 - ], - "timestamp": "2024-01-22 23:46:31.408000" - }, - { - "_id": "test_1", - "metadata": { - "isReference": false, - "externalSourceName": "", - "_id": "test_1", - "description": "description_1", - "text": "text_1", - "additionalMetadata": "" - }, - "embedding": [ - 1.0, - 0.9238795042037964, - 0.3826834261417389 - ], - "timestamp": "2024-01-22 23:46:31.408000" - }, - { - "_id": "test_2", - "metadata": { - "isReference": false, - "externalSourceName": "", - "_id": "test_2", - "description": "description_2", - "text": "text_2", - "additionalMetadata": "" - }, - "embedding": [ - 1.0, - 0.7071067690849304, - 0.7071067690849304 - ], - "timestamp": "2024-01-22 23:46:31.408000" - }, - { - "_id": "test_3", - "metadata": { - "isReference": false, - "externalSourceName": "", - "_id": "test_3", - "description": "description_3", - "text": "text_3", - "additionalMetadata": "" - }, - "embedding": [ - 1.0, - 0.3826834261417389, - 0.9238795042037964 - ], - "timestamp": "2024-01-22 23:46:31.408000" - }, - { - "_id": "test_4", - "metadata": { - "isReference": false, - "externalSourceName": "", - "_id": "test_4", - "description": "description_4", - "text": "text_4", - "additionalMetadata": "" - }, - "embedding": [ - 1.0, - 6.123234262925839e-17, - 1.0 - ], - "timestamp": "2024-01-22 23:46:31.408000" - }, - { - "_id": "test_5", - "metadata": { - "isReference": false, - "externalSourceName": "", - "_id": "test_5", - "description": "description_5", - "text": "text_5", - "additionalMetadata": "" - }, - "embedding": [ - 1.0, - -0.3826834261417389, - 0.9238795042037964 - ], - "timestamp": "2024-01-22 23:46:31.408000" - }, - { - "_id": "test_6", - "metadata": { - "isReference": false, - "externalSourceName": "", - "_id": "test_6", - "description": "description_6", - "text": "text_6", - "additionalMetadata": "" - }, - "embedding": [ - 1.0, - -0.7071067690849304, - 0.7071067690849304 - ], - "timestamp": "2024-01-22 23:46:31.408000" - }, - { - "_id": "test_7", - "metadata": { - "isReference": false, - "externalSourceName": "", - "_id": "test_7", - "description": "description_7", - "text": "text_7", - "additionalMetadata": "" - }, - "embedding": [ - 1.0, - -0.9238795042037964, - 0.3826834261417389 - ], - "timestamp": "2024-01-22 23:46:31.408000" - } -] \ No newline at end of file diff --git a/semantic-kernel-csharp/indexes/nearestSearch_default.json b/semantic-kernel-csharp/indexes/nearestSearch_default.json deleted file mode 100644 index aa932ff..0000000 --- a/semantic-kernel-csharp/indexes/nearestSearch_default.json +++ /dev/null @@ -1,12 +0,0 @@ -{ - "collectionName": "nearestSearch", - "database": "dotnetMSKNearestTest", - "type": "vectorSearch", - "fields": [{ - "path": "embedding", - "numDimensions": 3, - "similarity": "cosine", - "type": "vector" - }], - "name": "default" -} \ No newline at end of file diff --git a/semantic-kernel-csharp/run.sh b/semantic-kernel-csharp/run.sh index 2f15b68..e73a4af 100644 --- a/semantic-kernel-csharp/run.sh +++ b/semantic-kernel-csharp/run.sh @@ -2,13 +2,6 @@ set -eu -# Get the MONGODB_URI. -SCRIPT_DIR=$(realpath "$(dirname ${BASH_SOURCE[0]})") -ROOT_DIR=$(dirname $SCRIPT_DIR) -. $ROOT_DIR/env.sh - -. $ROOT_DIR/.evergreen/utils.sh - # WORKING_DIR = $ROOT_DIR/semantic-kernel-csharp/semantic-kernel # Install .NET @@ -20,10 +13,21 @@ curl -Lfo "$DOTNET_SDK_PATH"/dotnet-install.sh https://dot.net/v1/dotnet-install echo "Installing .NET LTS SDK..." bash "$DOTNET_SDK_PATH"/dotnet-install.sh --channel 8.0 --install-dir "$DOTNET_SDK_PATH" --no-path +# The tests use the TestContainers.Net library which requires docker. +# RHEL 8 and 9 don't support docker so we have the setup below to emulate docker with podman +sudo dnf install -y docker + +# Enable and start Podman's socket service to listen for Docker API calls +sudo systemctl enable --now podman.socket + +# Point docker commands to use the podman socket +export DOCKER_HOST="unix:///run/podman/podman.sock" + # Set SkipReason to null to enable tests -sed -i -e 's/"MongoDB Atlas cluster is required"/null/g' dotnet/src/IntegrationTests/Connectors/Memory/MongoDB/MongoDBMemoryStoreTests.cs +sed -i -e 's/"The MongoDB container is intermittently timing out at startup time blocking prs, so these test should be run manually."/null/g' dotnet/src/IntegrationTests/Connectors/Memory/MongoDB/MongoDBVectorStoreRecordCollectionTests.cs + +# Remove the attribute blocking tests so we can run them +sed -i -e 's/\[DisableVectorStoreTests(Skip = "The MongoDB container is intermittently timing out at startup time blocking prs, so these test should be run manually.")\]//g' dotnet/src/IntegrationTests/Connectors/Memory/MongoDB/MongoDBVectorStoreTests.cs -# Run tests -echo "Running MongoDBMemoryStoreTests" -MongoDB__ConnectionString=$MONGODB_URI \ -$DOTNET_SDK_PATH/dotnet test dotnet/src/IntegrationTests/IntegrationTests.csproj --filter SemanticKernel.IntegrationTests.Connectors.MongoDB.MongoDBMemoryStoreTests +echo "Running MongoDBVectorStoreTests and MongoDBVectorStoreRecordCollectionTests" +sudo $DOTNET_SDK_PATH/dotnet test dotnet/src/IntegrationTests/IntegrationTests.csproj --filter "SemanticKernel.IntegrationTests.Connectors.MongoDB.MongoDBVectorStoreTests | SemanticKernel.IntegrationTests.Connectors.MongoDB.MongoDBVectorStoreRecordCollectionTests"