Skip to content

Commit 72f26f8

Browse files
authored
INTPYTHON-591 Add pymongo-voyageai to pipeline (#64)
1 parent 2400b57 commit 72f26f8

File tree

7 files changed

+70
-3
lines changed

7 files changed

+70
-3
lines changed

.evergreen/config.yml

Lines changed: 32 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,11 +45,16 @@ functions:
4545
binary: bash
4646
args: [.evergreen/fetch-repo.sh]
4747

48+
"assume role":
49+
- command: ec2.assume_role
50+
params:
51+
role_arn: ${assume_role_arn}
52+
4853
"execute tests":
4954
- command: subprocess.exec
5055
type: test
5156
params:
52-
include_expansions_in_env: [DIR]
57+
include_expansions_in_env: [DIR, AWS_ACCESS_KEY_ID, AWS_SECRET_ACCESS_KEY, AWS_SESSION_TOKEN]
5358
working_dir: "src"
5459
binary: bash
5560
args: [.evergreen/execute-tests.sh]
@@ -185,6 +190,22 @@ tasks:
185190
- func: "setup remote atlas"
186191
- func: "execute tests"
187192

193+
- name: test-pymongo-voyageai-local
194+
tags: [local]
195+
commands:
196+
- func: "fetch repo"
197+
- func: "assume role"
198+
- func: "setup local atlas"
199+
- func: "execute tests"
200+
201+
- name: test-pymongo-voyageai-remote
202+
tags: [remote]
203+
commands:
204+
- func: "fetch repo"
205+
- func: "assume role"
206+
- func: "setup remote atlas"
207+
- func: "execute tests"
208+
188209
- name: test-haystack-embeddings-local
189210
tags: [local]
190211
commands:
@@ -298,6 +319,16 @@ buildvariants:
298319
- name: test-docarray-local
299320
- name: test-docarray-remote
300321

322+
- name: test-pymongo-voyageai-rhel
323+
display_name: PyMongo-VoyageAI RHEL
324+
expansions:
325+
DIR: pymongo-voyageai
326+
run_on:
327+
- rhel87-small
328+
tasks:
329+
- name: test-pymongo-voyageai-local
330+
- name: test-pymongo-voyageai-remote
331+
301332
- name: test-haystack-embeddings-rhel
302333
display_name: Haystack Embeddings RHEL
303334
expansions:

.evergreen/fetch-repo.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
set -eu
44

55
if [ ! -d "${DIR}" ]; then
6-
echo '${REPO_NAME} could not be found' 1>&2
6+
echo "${REPO_NAME} could not be found" 1>&2
77
exit 1
88
fi
99

.evergreen/provision-atlas.sh

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,5 +17,7 @@ scaffold_atlas
1717
source secrets-export.sh
1818

1919
# Create the env file
20+
echo "export VOYAGEAI_S3_BUCKET=$VOYAGEAI_S3_BUCKET" >> env.sh
2021
echo "export OPENAI_API_KEY=$OPENAI_API_KEY" >> env.sh
2122
echo "export MONGODB_URI=$CONN_STRING" >> env.sh
23+
echo "export VOYAGEAI_API_KEY=$VOYAGEAI_API_KEY" >> env.sh

.evergreen/setup-remote.sh

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,14 +38,19 @@ case $DIR in
3838
haystack-embeddings | haystack-fulltext)
3939
MONGODB_URI=$HAYSTACK_MONGODB_URI
4040
;;
41+
pymongo-voyageai)
42+
MONGODB_URI=$VOYAGEAI_MONGODB_URI
43+
;;
4144
*)
42-
echo "Missing config in fetch-secrets.sh for DIR: $DIR"
45+
echo "Missing config in setup-remote.sh for DIR: $DIR"
4346
exit 1
4447
;;
4548
esac
4649
export MONGODB_URI
4750

4851
# Create the env file
52+
echo "export VOYAGEAI_S3_BUCKET=$VOYAGEAI_S3_BUCKET" >> env.sh
53+
echo "export VOYAGEAI_API_KEY=$VOYAGEAI_API_KEY" >> env.sh
4954
echo "export OPENAI_API_KEY=$OPENAI_API_KEY" >> env.sh
5055
echo "export MONGODB_URI=$MONGODB_URI" >> env.sh
5156

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -60,3 +60,4 @@ env.sh
6060
# Repo checkouts
6161
haystack-fulltext/haystack-core-integrations
6262
haystack-embeddings/haystack-core-integrations
63+
pymongo-voyageai/pymongo-voyageai

pymongo-voyageai/config.env

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
REPO_NAME=pymongo-voyageai
2+
CLONE_URL="https://github.com/mongodb-labs/pymongo-voyageai.git"
3+
DATABASE="pymongo_voyageai_test_db"

pymongo-voyageai/run.sh

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
#!/bin/bash
2+
3+
set -eu
4+
5+
# Get the MONGODB_URI and VOYAGEAI_API_KEY.
6+
SCRIPT_DIR=$(realpath "$(dirname ${BASH_SOURCE[0]})")
7+
ROOT_DIR=$(dirname $SCRIPT_DIR)
8+
. $ROOT_DIR/env.sh
9+
10+
. $ROOT_DIR/.evergreen/utils.sh
11+
12+
PYTHON_BINARY=$(find_python3)
13+
14+
$PYTHON_BINARY -m venv venv_pipeline
15+
source venv_pipeline/bin/activate
16+
17+
pip install uv rust-just
18+
19+
just install
20+
21+
export S3_BUCKET_NAME=$VOYAGEAI_S3_BUCKET
22+
export MONGODB_URI=$MONGODB_URI
23+
export VOYAGEAI_API_KEY=$VOYAGEAI_API_KEY
24+
25+
just test

0 commit comments

Comments
 (0)