Skip to content
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

GODRIVER-1911 Pass PYTHON variable to set-temp-creds.sh #603

Merged
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
20 changes: 18 additions & 2 deletions .evergreen/config.yml
Expand Up @@ -75,8 +75,7 @@ functions:
if [ "Windows_NT" = "$OS" ]; then
mkdir -p c:/libmongocrypt/include
mkdir -p c:/libmongocrypt/bin
# TODO: After a stable libmongocrypt 1.1.0 is released in MONGOCRYPT-293, update this URL to: https://s3.amazonaws.com/mciuploads/libmongocrypt/windows/latest_release/libmongocrypt.tar.gz
curl https://s3.amazonaws.com/mciuploads/libmongocrypt/windows/latest_release/libmongocrypt_unstable.tar.gz --output libmongocrypt.tar.gz
curl https://s3.amazonaws.com/mciuploads/libmongocrypt/windows/latest_release/libmongocrypt.tar.gz --output libmongocrypt.tar.gz
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice, looks like there was a TODO all along.

tar -xvzf libmongocrypt.tar.gz
cp ./bin/mongocrypt.dll c:/libmongocrypt/bin
cp ./include/mongocrypt/*.h c:/libmongocrypt/include
Expand Down Expand Up @@ -304,6 +303,15 @@ functions:
export AWS_SECRET_ACCESS_KEY="${cse_aws_secret_access_key}"
export AWS_DEFAULT_REGION="us-east-1"
${PYTHON3_BINARY} -m venv ./venv

# Set the PYTHON environment variable to point to the active python3 binary. This is used by the
# set-temp-creds.sh script.
if [ "Windows_NT" = "$OS" ]; then
export PYTHON="$(pwd)/venv/Scripts/python"
else
export PYTHON="$(pwd)/venv/bin/python"
fi

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ideally, we'd combine the virtual environment creation, python3 binary setting, and boto3 installation into a single call to activate_venv.sh.. But, that unfortunately sets PYTHON_BINARY and not PYTHON, so it wouldn't work perfectly...

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Also, PYTHON3_BINARY points to the system installation of python3, but we actually want to point to the virtualenv python installation here.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ah yep, that too.

./venv/${VENV_BIN_DIR|bin}/pip3 install boto3
. ${DRIVERS_TOOLS}/.evergreen/csfle/set-temp-creds.sh
fi
Expand Down Expand Up @@ -476,6 +484,14 @@ functions:
export AWS_DEFAULT_REGION="us-east-1"
${PYTHON3_BINARY} -m venv ./venv
./venv/${VENV_BIN_DIR|bin}/pip3 install boto3

# Set the PYTHON environment variable to point to the active python3 binary. This is used by the
# set-temp-creds.sh script.
if [ "Windows_NT" = "$OS" ]; then
export PYTHON="$(pwd)/venv/Scripts/python"
else
export PYTHON="$(pwd)/venv/bin/python"
fi
. ${DRIVERS_TOOLS}/.evergreen/csfle/set-temp-creds.sh

export GOFLAGS=-mod=vendor
Expand Down