-
Notifications
You must be signed in to change notification settings - Fork 4
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
INTPYTHON-309 & INTPYTHON-417 Use new cluster and schedule on interval #50
Conversation
… into INTPYTHON-309
Before merging, we need to update the Evergreen project config to only run the local variants on pull requests. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks great! I have some clarifying questions, but everything else is solid. Great work! :)
.evergreen/config.yml
Outdated
tasks: | ||
- name: test-semantic-kernel-python | ||
- name: test-semantic-kernel-python-local | ||
commands: | ||
- func: "fetch repo" | ||
- func: "setup local atlas" | ||
- func: "execute tests" | ||
|
||
- name: test-semantic-kernel-python-remote | ||
commands: | ||
- func: "fetch repo" | ||
- func: "setup remote atlas" | ||
- func: "execute tests" | ||
|
||
- name: test-semantic-kernel-csharp-local | ||
commands: | ||
- func: "fetch repo" | ||
- func: "setup local atlas" | ||
- func: "execute tests" | ||
|
||
- name: test-semantic-kernel-csharp-remote | ||
commands: | ||
- func: "fetch repo" | ||
- func: "setup remote atlas" | ||
- func: "execute tests" | ||
|
||
- name: test-langchain-python-local |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Out of scope for this ticket.
We should make a python generator for this as well. That or change this to just two tasks.
local run
and remote run
There's no difference in the commands otherwise.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Lol, replied to the wrong comment: https://jira.mongodb.org/browse/INTPYTHON-441
- func: "execute tests" | ||
|
||
- name: test-semantic-kernel-csharp | ||
- name: test-langchain-python-remote |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do we need to add tags or can we do regex matching in evergreen to make sure these aren't run on pull requests
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done
.evergreen/setup-remote.sh
Outdated
# Ensure the remote database is populated. | ||
. .evergreen/utils.sh | ||
|
||
PYTHON_BINARY=$(find_python3) | ||
|
||
# Should be called from src | ||
EVERGREEN_PATH=$(pwd)/.evergreen | ||
TARGET_DIR=$(pwd)/$DIR | ||
SCAFFOLD_SCRIPT=$EVERGREEN_PATH/scaffold_atlas.py | ||
|
||
mkdir atlas | ||
|
||
pushd atlas | ||
|
||
$PYTHON_BINARY -m venv . | ||
source ./bin/activate | ||
popd | ||
|
||
# Test server is up | ||
$PYTHON_BINARY -m pip install pymongo | ||
CONN_STRING=$MONGODB_URI \ | ||
$PYTHON_BINARY -c "from pymongo import MongoClient; import os; MongoClient(os.environ['MONGODB_URI']).db.command('ping')" | ||
|
||
# Add database and index configurations | ||
DATABASE=$DATABASE \ | ||
CONN_STRING=$MONGODB_URI \ | ||
REPO_NAME=$REPO_NAME \ | ||
DIR=$DIR \ | ||
TARGET_DIR=$TARGET_DIR \ | ||
$PYTHON_BINARY $SCAFFOLD_SCRIPT |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This could call provision-atlas as a next step and remove duplication.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Refactored
"numDimensions": 1536, | ||
"path": "embedding", | ||
"similarity": "cosine", | ||
"type": "vector" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should this be changed?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Great work!
if collection_name in collections: | ||
logger.debug("Clearing existing collection", collection_name) | ||
db[collection_name].delete_many({}) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
NIT: We could also drop the collection entirely. This would remove all existing index definitions on it.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I tried that but it seemed to cause race conditions.
logger.debug( | ||
"creating search index: %s on %s.%s...", | ||
index_name, | ||
database_name, | ||
collection_name, | ||
) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
💯
semantic-kernel-python) | ||
MONGODB_URI=$SEMANTIC_KERNEL_MONGODB_URI | ||
;; | ||
semantic-kernel-csharp) | ||
MONGODB_URI=$SEMANTIC_KERNEL_MONGODB_URI |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Out of scope for this PR:
Could it be that sharing the URI could be leading to some failures in index definitions?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't think so, given they're using different DBs.
scaffold_atlas() { | ||
PYTHON_BINARY=$(find_python3) | ||
|
||
# Should be called from src | ||
EVERGREEN_PATH=$(pwd)/.evergreen | ||
TARGET_DIR=$(pwd)/$DIR | ||
SCAFFOLD_SCRIPT=$EVERGREEN_PATH/scaffold_atlas.py | ||
|
||
mkdir -p atlas | ||
pushd atlas | ||
|
||
$PYTHON_BINARY -m venv . | ||
source ./bin/activate | ||
popd | ||
|
||
# Test server is up | ||
$PYTHON_BINARY -m pip install pymongo | ||
CONN_STRING=$CONN_STRING \ | ||
$PYTHON_BINARY -c "from pymongo import MongoClient; import os; MongoClient(os.environ['CONN_STRING']).db.command('ping')" | ||
|
||
# Add database and index configurations | ||
DATABASE=$DATABASE \ | ||
CONN_STRING=$CONN_STRING \ | ||
REPO_NAME=$REPO_NAME \ | ||
DIR=$DIR \ | ||
DEBUG="${DEBUG:-1}" \ | ||
TARGET_DIR=$TARGET_DIR \ | ||
$PYTHON_BINARY $SCAFFOLD_SCRIPT | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🚀
Also resolves INTPYTHON-313 by adding support for docarray on local Atlas.