Skip to content

Commit fc4a879

Browse files
authored
PHPLIB-1038: Use activate-kmstlsvenv.sh and find-python3.sh in Evergreen config (#1017)
* PHPLIB-1038: Use activate-kmstlsvenv.sh in Evergreen config * Use find-python3.sh in "create serverless instance" function PYTHON3_BINARY was never declared. The original code only worked thanks to the shebang in mongodl.py. * find-python3.sh and activate-kmstlsvenv.sh require bash * Remove Windows-specific logic from "create serverless instance" function Serverless is only tested on Debian hosts
1 parent 39ebf5e commit fc4a879

File tree

1 file changed

+16
-16
lines changed

1 file changed

+16
-16
lines changed

.evergreen/config.yml

Lines changed: 16 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -214,47 +214,45 @@ functions:
214214
file: src/serverless-expansion.yml
215215
- command: shell.exec
216216
params:
217-
shell: "bash"
217+
shell: bash
218218
script: |
219219
${PREPARE_SHELL}
220-
220+
221221
if [ -z "${SERVERLESS_MONGODB_VERSION}" ]; then
222222
echo "expected SERVERLESS_MONGODB_VERSION to be set"
223223
exit 1
224224
fi
225-
225+
226+
. ${DRIVERS_TOOLS}/.evergreen/find-python3.sh
227+
PYTHON_BINARY="$(find_python3)" || exit 1
228+
226229
# Download the enterprise server download for current platform to $MONGODB_BINARIES.
227230
# This is required for tests that need mongocryptd.
228231
# $MONGODB_BINARIES is added to the $PATH in fetch-source.
229-
${PYTHON3_BINARY} $DRIVERS_TOOLS/.evergreen/mongodl.py \
232+
${PYTHON_BINARY} ${DRIVERS_TOOLS}/.evergreen/mongodl.py \
230233
--component archive \
231234
--version ${SERVERLESS_MONGODB_VERSION} \
232235
--edition enterprise \
233236
--out $MONGODB_BINARIES \
234237
--strip-path-components 2
235-
238+
236239
# Download the crypt_shared dynamic library for the current platform.
237-
${PYTHON3_BINARY} $DRIVERS_TOOLS/.evergreen/mongodl.py \
240+
${PYTHON_BINARY} ${DRIVERS_TOOLS}/.evergreen/mongodl.py \
238241
--component crypt_shared \
239242
--version ${SERVERLESS_MONGODB_VERSION} \
240243
--edition enterprise \
241244
--out . \
242245
--only "**/mongo_crypt_v1.*" \
243246
--strip-path-components 1
244-
247+
245248
# Find the crypt_shared library file in the current directory and set the CRYPT_SHARED_LIB_PATH to
246249
# the path of that file. Only look for .so, .dll, or .dylib files to prevent matching any other
247250
# downloaded files.
248251
CRYPT_SHARED_LIB_PATH="$(find $(pwd) -maxdepth 1 -type f \
249252
-name 'mongo_crypt_v1.so' -o \
250253
-name 'mongo_crypt_v1.dll' -o \
251254
-name 'mongo_crypt_v1.dylib')"
252-
253-
# If we're on Windows, convert the "cygdrive" path to Windows-style paths.
254-
if [ "Windows_NT" = "$OS" ]; then
255-
CRYPT_SHARED_LIB_PATH=$(cygpath -m $CRYPT_SHARED_LIB_PATH)
256-
fi
257-
255+
258256
echo "CRYPT_SHARED_LIB_PATH: $CRYPT_SHARED_LIB_PATH" >> crypt-expansion.yml
259257
260258
# Load the expansion file to make an evergreen variable with the current unique version
@@ -429,18 +427,20 @@ functions:
429427
- command: shell.exec
430428
# Init venv without background:true to install dependencies
431429
params:
430+
shell: bash
432431
script: |-
433432
set -o errexit
434433
cd ${DRIVERS_TOOLS}/.evergreen/csfle
435-
. ./activate_venv.sh
434+
. ./activate-kmstlsvenv.sh
436435
- command: shell.exec
437436
params:
438437
background: true
438+
shell: bash
439439
# Use different ports for KMS HTTP servers to avoid conflicts with load balancers
440440
script: |-
441441
set -o errexit
442442
cd ${DRIVERS_TOOLS}/.evergreen/csfle
443-
. ./activate_venv.sh
443+
. ./activate-kmstlsvenv.sh
444444
python -u kms_http_server.py --ca_file ../x509gen/ca.pem --cert_file ../x509gen/expired.pem --port 8100 &
445445
python -u kms_http_server.py --ca_file ../x509gen/ca.pem --cert_file ../x509gen/wrong-host.pem --port 8101 &
446446
python -u kms_http_server.py --ca_file ../x509gen/ca.pem --cert_file ../x509gen/server.pem --port 8102 --require_client_cert &
@@ -473,7 +473,7 @@ functions:
473473
export AWS_DEFAULT_REGION="us-east-1"
474474
475475
pushd ${DRIVERS_TOOLS}/.evergreen/csfle
476-
. ./activate_venv.sh
476+
. ./activate-kmstlsvenv.sh
477477
. ./set-temp-creds.sh
478478
popd
479479

0 commit comments

Comments
 (0)