mirror of
https://github.com/pytorch/pytorch.git
synced 2025-10-20 21:14:14 +08:00
ARC uses dind-rootless which causes bind mounts to always be mounted as the "root" user inside the container rather than the "jenkins" user as expected. We run chown to ensure that the workspace gets mapped to the jenkins user as well as a trap to ensure this change gets reverted when the script ends for any reason. This is the same workaround as in #122922 but adapted for onnx tests. Issue: pytorch/ci-infra#112 Pull Request resolved: https://github.com/pytorch/pytorch/pull/123641 Approved by: https://github.com/jeanschmidt, https://github.com/seemethere
24 lines
631 B
Bash
24 lines
631 B
Bash
#!/bin/bash
|
|
|
|
set -ex
|
|
|
|
source "$(dirname "${BASH_SOURCE[0]}")/../pytorch/common_utils.sh"
|
|
|
|
LOCAL_DIR=$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)
|
|
ROOT_DIR=$(cd "$LOCAL_DIR"/../.. && pwd)
|
|
TEST_DIR="$ROOT_DIR/test"
|
|
pytest_reports_dir="${TEST_DIR}/test-reports/python"
|
|
|
|
# Figure out which Python to use
|
|
PYTHON="$(which python)"
|
|
if [[ "${BUILD_ENVIRONMENT}" =~ py((2|3)\.?[0-9]?\.?[0-9]?) ]]; then
|
|
PYTHON=$(which "python${BASH_REMATCH[1]}")
|
|
fi
|
|
|
|
if [[ "${BUILD_ENVIRONMENT}" == *rocm* ]]; then
|
|
# HIP_PLATFORM is auto-detected by hipcc; unset to avoid build errors
|
|
unset HIP_PLATFORM
|
|
fi
|
|
|
|
mkdir -p "$pytest_reports_dir" || true
|