Skip to content

Commit c4cd7b1

Browse files
committed
adjust paths on windows
1 parent f06c67e commit c4cd7b1

File tree

1 file changed

+12
-7
lines changed

1 file changed

+12
-7
lines changed

ci/utilities/run_docker_container.sh

Lines changed: 12 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -51,17 +51,22 @@ if ! docker container inspect jax >/dev/null 2>&1 ; then
5151
export IP_ADDR=$(powershell -command "(Get-NetIPAddress -AddressFamily IPv4 -InterfaceAlias 'vEthernet (nat)').IPAddress")
5252
netsh interface portproxy add v4tov4 listenaddress=$IP_ADDR listenport=80 connectaddress=169.254.169.254 connectport=80
5353
JAXCI_DOCKER_ARGS="$JAXCI_DOCKER_ARGS -e GCE_METADATA_HOST=$IP_ADDR"
54-
else
55-
# The volume mapping flag below shares the user's gcloud credentials, if any,
56-
# with the container, in case the user has credentials stored there.
57-
# This would allow Bazel to authenticate for RBE.
58-
# Note: JAX's CI does not have any credentials stored there.
59-
JAXCI_DOCKER_ARGS="$JAXCI_DOCKER_ARGS -v $HOME/.config/gcloud:/root/.config/gcloud"
54+
fi
55+
56+
# Create a temporary file to store all JAXCI variables
57+
JAXCI_TEMP_ENVFILE_DIR=$(mktemp)
58+
env | grep "JAXCI_" > "$JAXCI_TEMP_ENVFILE_DIR"
59+
60+
# On Windows, convert MSYS Linux-like paths to Windows paths.
61+
if [[ "$(uname -s)" =~ "MSYS_NT" ]]; then
62+
echo 'Converting MSYS Linux-like paths to Windows paths (for Bazel, Python, etc.)'
63+
# Convert all "JAXCI.*DIR" variables
64+
source <(python3 ./ci/utilities/convert_msys_paths_to_win_paths.py --convert $(env | grep "JAXCI.*DIR" | awk -F= '{print $1}'))
6065
fi
6166

6267
# Start the container.
6368
docker run $JAXCI_DOCKER_ARGS --name jax \
64-
--env-file <(env | grep JAXCI_) \
69+
--env-file $JAXCI_TEMP_ENVFILE_DIR \
6570
-w "$JAXCI_DOCKER_WORK_DIR" -itd --rm \
6671
-v "$JAXCI_JAX_GIT_DIR:$JAXCI_DOCKER_WORK_DIR" \
6772
"$JAXCI_DOCKER_IMAGE" \

0 commit comments

Comments
 (0)