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

Address build failures due to Python 3 binary lookup #357

Merged
merged 3 commits into from
Oct 2, 2023
Merged
Show file tree
Hide file tree
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
18 changes: 6 additions & 12 deletions .evergreen/run-orchestration.sh
Original file line number Diff line number Diff line change
Expand Up @@ -30,17 +30,11 @@ DIR=$(dirname $0)
# Functions to fetch MongoDB binaries.
. $DIR/download-mongodb.sh

# Find python3 if we are running in bash, otherwise prefer a
# python3 binary over python, since some modern build hosts
# only have the python3 binary.
export PYTHON
PYTHON=$(command -v python3 || command -v python)
if [ -n "$BASH" ]; then
. $DIR/find-python3.sh
echo "Finding Python3 binary..."
PYTHON="$(find_python3 2>/dev/null)"
echo "Finding Python3 binary... done."
fi
# To continue supporting `sh run-orchestration.sh` for backwards-compatibility,
# explicitly invoke Bash as a subshell here when running `find_python3`.
echo "Finding Python3 binary..."
PYTHON="$(bash -c ". $DIR/find-python3.sh && find_python3 2>/dev/null")"
echo "Finding Python3 binary... done."

get_distro
if [ -z "$MONGODB_DOWNLOAD_URL" ]; then
Expand Down Expand Up @@ -107,7 +101,7 @@ fi
export ORCHESTRATION_URL="http://localhost:8889/v1/${TOPOLOGY}s"

# Start mongo-orchestration
bash $DIR/start-orchestration.sh "$MONGO_ORCHESTRATION_HOME"
PYTHON="${PYTHON:?}" bash $DIR/start-orchestration.sh "$MONGO_ORCHESTRATION_HOME"

if ! curl --silent --show-error --data @"$ORCHESTRATION_FILE" "$ORCHESTRATION_URL" --max-time 600 --fail -o tmp.json; then
echo Failed to start cluster, see $MONGO_ORCHESTRATION_HOME/out.log:
Expand Down
3 changes: 2 additions & 1 deletion .evergreen/start-orchestration.sh
Original file line number Diff line number Diff line change
Expand Up @@ -25,11 +25,12 @@ det_evergreen_dir="$(dirname "${BASH_SOURCE[0]}")"

cd "$MONGO_ORCHESTRATION_HOME"

if [ -z "$PYTHON" ];then
if [[ -z "${PYTHON:-}" ]]; then
echo "Finding Python3 binary..."
PYTHON="$(find_python3 2>/dev/null)"
echo "Finding Python3 binary... done."
else
# May have already been found by run-orchestration.sh. Avoid redundant lookup.
echo "Using Python3 binary: $PYTHON"
fi

Expand Down
2 changes: 1 addition & 1 deletion action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ runs:
STORAGE_ENGINE: ${{ inputs.storage-engine }}
REQUIRE_API_VERSION: ${{ inputs.require-api-version }}
SKIP_LEGACY_SHELL: ${{ inputs.skip-legacy-shell }}
shell: sh
shell: bash
- id: "get-cluster-uri"
name: "Expose Cluster URI"
run: echo "cluster-uri=$(cat ${{ github.action_path }}/uri.txt)" >> $GITHUB_OUTPUT
Expand Down
Loading