Skip to content

Commit 83af185

Browse files
committed
address review
1 parent 5809946 commit 83af185

File tree

4 files changed

+45
-58
lines changed

4 files changed

+45
-58
lines changed

.evergreen/config.yml

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -92,54 +92,63 @@ pre:
9292

9393
tasks:
9494
- name: test-semantic-kernel-python-local
95+
tags: [local]
9596
commands:
9697
- func: "fetch repo"
9798
- func: "setup local atlas"
9899
- func: "execute tests"
99100

100101
- name: test-semantic-kernel-python-remote
102+
tags: [remote]
101103
commands:
102104
- func: "fetch repo"
103105
- func: "setup remote atlas"
104106
- func: "execute tests"
105107

106108
- name: test-semantic-kernel-csharp-local
109+
tags: [local]
107110
commands:
108111
- func: "fetch repo"
109112
- func: "setup local atlas"
110113
- func: "execute tests"
111114

112115
- name: test-semantic-kernel-csharp-remote
116+
tags: [remote]
113117
commands:
114118
- func: "fetch repo"
115119
- func: "setup remote atlas"
116120
- func: "execute tests"
117121

118122
- name: test-langchain-python-local
123+
tags: [local]
119124
commands:
120125
- func: "fetch repo"
121126
- func: "setup local atlas"
122127
- func: "execute tests"
123128

124129
- name: test-langchain-python-remote
130+
tags: [remote]
125131
commands:
126132
- func: "fetch repo"
127133
- func: "setup remote atlas"
128134
- func: "execute tests"
129135

130136
- name: test-chatgpt-retrieval-plugin-local
137+
tags: [local]
131138
commands:
132139
- func: "fetch repo"
133140
- func: "setup local atlas"
134141
- func: "execute tests"
135142

136143
- name: test-chatgpt-retrieval-plugin-remote
144+
tags: [remote]
137145
commands:
138146
- func: "fetch repo"
139147
- func: "setup remote atlas"
140148
- func: "execute tests"
141149

142150
- name: test-llama-index-local
151+
tags: [local]
143152
commands:
144153
- func: "fetch repo"
145154
- func: "setup local atlas"
@@ -152,12 +161,14 @@ tasks:
152161
- func: "execute tests"
153162

154163
- name: test-docarray-local
164+
tags: [local]
155165
commands:
156166
- func: "fetch repo"
157167
- func: "setup local atlas"
158168
- func: "execute tests"
159169

160170
- name: test-docarray-remote
171+
tags: [remote]
161172
commands:
162173
- func: "fetch repo"
163174
- func: "setup remote atlas"

.evergreen/provision-atlas.sh

Lines changed: 2 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -3,36 +3,8 @@ set -eu
33

44
. .evergreen/utils.sh
55

6-
PYTHON_BINARY=$(find_python3)
7-
8-
# Should be called from src
9-
EVERGREEN_PATH=$(pwd)/.evergreen
10-
TARGET_DIR=$(pwd)/$DIR
11-
SCAFFOLD_SCRIPT=$EVERGREEN_PATH/scaffold_atlas.py
12-
13-
mkdir atlas
14-
15-
setup_local_atlas
16-
17-
pushd atlas
18-
19-
$PYTHON_BINARY -m venv .
20-
source ./bin/activate
21-
popd
22-
23-
# Test server is up
24-
$PYTHON_BINARY -m pip install pymongo
25-
CONN_STRING=$CONN_STRING \
26-
$PYTHON_BINARY -c "from pymongo import MongoClient; import os; MongoClient(os.environ['CONN_STRING']).db.command('ping')"
27-
28-
# Add database and index configurations
29-
DATABASE=$DATABASE \
30-
CONN_STRING=$CONN_STRING \
31-
REPO_NAME=$REPO_NAME \
32-
DIR=$DIR \
33-
DEBUG="${DEBUG:-1}" \
34-
TARGET_DIR=$TARGET_DIR \
35-
$PYTHON_BINARY $SCAFFOLD_SCRIPT
6+
CONN_STRING=$(setup_local_atlas)
7+
CONN_STRING=$CONN_STRING provision_atlas
368

379
# Get the secrets.
3810
source secrets-export.sh

.evergreen/setup-remote.sh

Lines changed: 1 addition & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -42,34 +42,7 @@ export MONGODB_URI
4242
echo "export OPENAI_API_KEY=$OPENAI_API_KEY" >> env.sh
4343
echo "export MONGODB_URI=$MONGODB_URI" >> env.sh
4444

45-
4645
# Ensure the remote database is populated.
4746
. .evergreen/utils.sh
4847

49-
PYTHON_BINARY=$(find_python3)
50-
51-
# Should be called from src
52-
EVERGREEN_PATH=$(pwd)/.evergreen
53-
TARGET_DIR=$(pwd)/$DIR
54-
SCAFFOLD_SCRIPT=$EVERGREEN_PATH/scaffold_atlas.py
55-
56-
mkdir atlas
57-
58-
pushd atlas
59-
60-
$PYTHON_BINARY -m venv .
61-
source ./bin/activate
62-
popd
63-
64-
# Test server is up
65-
$PYTHON_BINARY -m pip install pymongo
66-
CONN_STRING=$MONGODB_URI \
67-
$PYTHON_BINARY -c "from pymongo import MongoClient; import os; MongoClient(os.environ['MONGODB_URI']).db.command('ping')"
68-
69-
# Add database and index configurations
70-
DATABASE=$DATABASE \
71-
CONN_STRING=$MONGODB_URI \
72-
REPO_NAME=$REPO_NAME \
73-
DIR=$DIR \
74-
TARGET_DIR=$TARGET_DIR \
75-
$PYTHON_BINARY $SCAFFOLD_SCRIPT
48+
CONN_STRING=MONGODB_URI provision_atlas

.evergreen/utils.sh

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -115,3 +115,34 @@ fetch_local_atlas_uri() {
115115
export CONN_STRING=$CONN_STRING
116116
echo "$CONN_STRING"
117117
}
118+
119+
120+
scaffold_atlas() {
121+
PYTHON_BINARY=$(find_python3)
122+
123+
# Should be called from src
124+
EVERGREEN_PATH=$(pwd)/.evergreen
125+
TARGET_DIR=$(pwd)/$DIR
126+
SCAFFOLD_SCRIPT=$EVERGREEN_PATH/scaffold_atlas.py
127+
128+
mkdir -p atlas
129+
pushd atlas
130+
131+
$PYTHON_BINARY -m venv .
132+
source ./bin/activate
133+
popd
134+
135+
# Test server is up
136+
$PYTHON_BINARY -m pip install pymongo
137+
CONN_STRING=$CONN_STRING \
138+
$PYTHON_BINARY -c "from pymongo import MongoClient; import os; MongoClient(os.environ['CONN_STRING']).db.command('ping')"
139+
140+
# Add database and index configurations
141+
DATABASE=$DATABASE \
142+
CONN_STRING=$CONN_STRING \
143+
REPO_NAME=$REPO_NAME \
144+
DIR=$DIR \
145+
DEBUG="${DEBUG:-1}" \
146+
TARGET_DIR=$TARGET_DIR \
147+
$PYTHON_BINARY $SCAFFOLD_SCRIPT
148+
}

0 commit comments

Comments
 (0)