Skip to content

PHPLIB-1038: Use activate-kmstlsvenv.sh and find-python3.sh in Evergreen config #1017

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

Merged
merged 4 commits into from
Dec 22, 2022
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
32 changes: 16 additions & 16 deletions .evergreen/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -214,47 +214,45 @@ functions:
file: src/serverless-expansion.yml
- command: shell.exec
params:
shell: "bash"
shell: bash
script: |
${PREPARE_SHELL}

if [ -z "${SERVERLESS_MONGODB_VERSION}" ]; then
echo "expected SERVERLESS_MONGODB_VERSION to be set"
exit 1
fi


. ${DRIVERS_TOOLS}/.evergreen/find-python3.sh
PYTHON_BINARY="$(find_python3)" || exit 1

# Download the enterprise server download for current platform to $MONGODB_BINARIES.
# This is required for tests that need mongocryptd.
# $MONGODB_BINARIES is added to the $PATH in fetch-source.
${PYTHON3_BINARY} $DRIVERS_TOOLS/.evergreen/mongodl.py \
${PYTHON_BINARY} ${DRIVERS_TOOLS}/.evergreen/mongodl.py \
--component archive \
--version ${SERVERLESS_MONGODB_VERSION} \
--edition enterprise \
--out $MONGODB_BINARIES \
--strip-path-components 2

# Download the crypt_shared dynamic library for the current platform.
${PYTHON3_BINARY} $DRIVERS_TOOLS/.evergreen/mongodl.py \
${PYTHON_BINARY} ${DRIVERS_TOOLS}/.evergreen/mongodl.py \
--component crypt_shared \
--version ${SERVERLESS_MONGODB_VERSION} \
--edition enterprise \
--out . \
--only "**/mongo_crypt_v1.*" \
--strip-path-components 1

# Find the crypt_shared library file in the current directory and set the CRYPT_SHARED_LIB_PATH to
# the path of that file. Only look for .so, .dll, or .dylib files to prevent matching any other
# downloaded files.
CRYPT_SHARED_LIB_PATH="$(find $(pwd) -maxdepth 1 -type f \
-name 'mongo_crypt_v1.so' -o \
-name 'mongo_crypt_v1.dll' -o \
-name 'mongo_crypt_v1.dylib')"

# If we're on Windows, convert the "cygdrive" path to Windows-style paths.
if [ "Windows_NT" = "$OS" ]; then
CRYPT_SHARED_LIB_PATH=$(cygpath -m $CRYPT_SHARED_LIB_PATH)
fi


echo "CRYPT_SHARED_LIB_PATH: $CRYPT_SHARED_LIB_PATH" >> crypt-expansion.yml

# Load the expansion file to make an evergreen variable with the current unique version
Expand Down Expand Up @@ -429,18 +427,20 @@ functions:
- command: shell.exec
# Init venv without background:true to install dependencies
params:
shell: bash
script: |-
set -o errexit
cd ${DRIVERS_TOOLS}/.evergreen/csfle
. ./activate_venv.sh
. ./activate-kmstlsvenv.sh
- command: shell.exec
params:
background: true
shell: bash
# Use different ports for KMS HTTP servers to avoid conflicts with load balancers
script: |-
set -o errexit
cd ${DRIVERS_TOOLS}/.evergreen/csfle
. ./activate_venv.sh
. ./activate-kmstlsvenv.sh
python -u kms_http_server.py --ca_file ../x509gen/ca.pem --cert_file ../x509gen/expired.pem --port 8100 &
python -u kms_http_server.py --ca_file ../x509gen/ca.pem --cert_file ../x509gen/wrong-host.pem --port 8101 &
python -u kms_http_server.py --ca_file ../x509gen/ca.pem --cert_file ../x509gen/server.pem --port 8102 --require_client_cert &
Expand Down Expand Up @@ -473,7 +473,7 @@ functions:
export AWS_DEFAULT_REGION="us-east-1"

pushd ${DRIVERS_TOOLS}/.evergreen/csfle
. ./activate_venv.sh
. ./activate-kmstlsvenv.sh
. ./set-temp-creds.sh
popd

Expand Down