Skip to content

Commit

Permalink
DRIVERS-3063 Use self-contained python binary (#560)
Browse files Browse the repository at this point in the history
  • Loading branch information
blink1073 authored Dec 4, 2024
1 parent abbee34 commit 5048cca
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 4 deletions.
9 changes: 7 additions & 2 deletions .evergreen/auth_aws/teardown.sh
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,11 @@ SCRIPT_DIR=$(dirname ${BASH_SOURCE[0]})
. $SCRIPT_DIR/../handle-paths.sh

pushd $SCRIPT_DIR
. ./activate-authawsvenv.sh
python ./lib/aws_assign_instance_profile.py

# If we've gotten credentials, ensure the instance profile is set.
if [ -f secrets-export.sh ]; then
. ./activate-authawsvenv.sh
python ./lib/aws_assign_instance_profile.py
fi

popd
4 changes: 2 additions & 2 deletions .evergreen/find-python3.sh
Original file line number Diff line number Diff line change
Expand Up @@ -312,12 +312,12 @@ find_python3() (
# Diagnostic messages may be printed to stderr (pipe 2). Redirect to /dev/null
# with `2>/dev/null` to silence these messages.
#
# If PYTHON or PYTHON_BINARY are set, it will return that value. Otherwise
# If DRIVERS_TOOLS_PYTHON is set, it will return that value. Otherwise
# it will use find_python3 to return a suitable value.
#
ensure_python3() {
declare python_binary
python_binary="${PYTHON:-"${PYTHON_BINARY:-""}"}"
python_binary="${DRIVERS_TOOLS_PYTHON:-}"
{
if [ -z "${python_binary}" ]; then
echo "Finding Python3 binary..."
Expand Down
5 changes: 5 additions & 0 deletions .evergreen/setup.sh
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ set -o errexit

SCRIPT_DIR=$(dirname ${BASH_SOURCE[0]})
. $SCRIPT_DIR/handle-paths.sh
. $SCRIPT_DIR/find-python3.sh

# Ensure environment variables are set.
if [[ -z "$PROJECT_DIRECTORY" ]]; then
Expand All @@ -26,5 +27,9 @@ OS=${OS:-}
PATH=$PATH
EOF

# Set the python binary to use.
DRIVERS_TOOLS_PYTHON=$(find_python3 2>/dev/null)
echo "DRIVERS_TOOLS_PYTHON=$DRIVERS_TOOLS_PYTHON" >> $DRIVERS_TOOLS/.env

# Install the clis in this folder.
bash $SCRIPT_DIR/install-cli.sh $SCRIPT_DIR

0 comments on commit 5048cca

Please sign in to comment.