Skip to content

Commit bd6bc89

Browse files
[PYTHON-4160] Add LlamaIndex (#9)
* PYTHON-4160 Skeleton * [PYTHON-4160] Add required env vars in run.sh * CHanged display name of LlamaIndex build variant * Typo in MONGO_URI * Removed .idea directory mistakenly added.
1 parent 36e34d9 commit bd6bc89

File tree

3 files changed

+62
-0
lines changed

3 files changed

+62
-0
lines changed

.evergreen/config.yml

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -94,6 +94,11 @@ tasks:
9494
- func: "fetch repo"
9595
- func: "execute tests"
9696

97+
- name: test-llama-index
98+
commands:
99+
- func: "fetch repo"
100+
- func: "execute tests"
101+
97102
buildvariants:
98103
- name: test-semantic-kernel-python-rhel
99104
display_name: Semantic-Kernel RHEL Python
@@ -142,3 +147,16 @@ buildvariants:
142147
- rhel87-small
143148
tasks:
144149
- name: test-chatgpt-retrieval-plugin
150+
151+
- name: test-llama-index-rhel
152+
display_name: LlamaIndex RHEL
153+
expansions:
154+
DIR: llama_index
155+
REPO_NAME: llama_index
156+
# TODO - Update CLONE_URL once pull-request is merged
157+
CLONE_URL: -b feature/mongodb-datastore --single-branch https://github.com/caseyclements/llama_index.git
158+
DATABASE: llama_index_test_db
159+
run_on:
160+
- rhel87-small
161+
tasks:
162+
- name: test-llama-index

llama_index/indexConfig.json

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
{
2+
"fields": [
3+
{
4+
"numDimensions": 1536,
5+
"path": "embedding",
6+
"similarity": "cosine",
7+
"type": "vector"
8+
}
9+
],
10+
"name": "vector_index",
11+
"type": "vectorSearch",
12+
"database": "llama_index_test_db",
13+
"collectionName": "llama_index_test_vectorstore"
14+
}

llama_index/run.sh

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
#!/bin/sh
2+
3+
set -x
4+
5+
. $workdir/src/.evergreen/utils.sh
6+
7+
PYTHON_BINARY=$(find_python3)
8+
$PYTHON_BINARY -c "import sys; print(f'Python version found: {sys.version_info}')"
9+
10+
# cd to the MongoDB integration. It has its own project
11+
cd llama-index-integrations/vector_stores/llama-index-vector-stores-mongodb
12+
13+
# Install Poetry into base python
14+
$PYTHON_BINARY -m pip install -U pip poetry
15+
# Create a package specific poetry environment
16+
$PYTHON_BINARY -m poetry env use $PYTHON_BINARY
17+
# Activate the poetry env, which itself does not include poetry
18+
source $($PYTHON_BINARY -m poetry env info --path)/bin/activate
19+
# Recreate the poetry lock file
20+
$PYTHON_BINARY -m poetry lock --no-update
21+
# Install from pyproject.toml into package specific environment
22+
$PYTHON_BINARY -m poetry install --with dev
23+
24+
# Run tests. Sensitive variables in Evergreen come from Evergreen project: ai-ml-pipeline-testing/
25+
OPENAI_API_KEY=$openai_api_key \
26+
MONGO_URI=$llama_index_mongodb_uri \
27+
MONGODB_DATABASE="llama_index_test_db" \
28+
MONGODB_COLLECTION="llama_index_test_vectorstore" \
29+
MONGODB_INDEX="vector_index" \
30+
$PYTHON_BINARY -m poetry run pytest -v tests

0 commit comments

Comments
 (0)