mirror of
https://github.com/pytorch/pytorch.git
synced 2025-10-20 21:14:14 +08:00
Followup after https://github.com/pytorch/pytorch/pull/164969 Should fix binary build test failures Pull Request resolved: https://github.com/pytorch/pytorch/pull/165075 Approved by: https://github.com/seemethere, https://github.com/huydhn ghstack dependencies: #164968, #164969
49 lines
1.7 KiB
YAML
49 lines
1.7 KiB
YAML
name: Test pytorch binary
|
|
|
|
description: Pulls the docker image and tests the pytorch binary using it. All env variable referenced in the "Test PyTorch binary" step must be set in the GITHUB_ENV file
|
|
|
|
runs:
|
|
using: composite
|
|
steps:
|
|
- name: Test PyTorch binary
|
|
shell: bash
|
|
run: |
|
|
set -x
|
|
# shellcheck disable=SC2086,SC2090
|
|
container_name=$(docker run \
|
|
${GPU_FLAG:-} \
|
|
-e BINARY_ENV_FILE \
|
|
-e BUILD_ENVIRONMENT \
|
|
-e DESIRED_CUDA \
|
|
-e DESIRED_PYTHON \
|
|
-e GITHUB_ACTIONS \
|
|
-e GPU_ARCH_TYPE \
|
|
-e GPU_ARCH_VERSION \
|
|
-e LIBTORCH_VARIANT \
|
|
-e PACKAGE_TYPE \
|
|
-e PYTORCH_FINAL_PACKAGE_DIR \
|
|
-e PYTORCH_ROOT \
|
|
-e SKIP_ALL_TESTS \
|
|
--tty \
|
|
--detach \
|
|
-v "${GITHUB_WORKSPACE}/pytorch:/pytorch" \
|
|
-v "${RUNNER_TEMP}/artifacts:/final_pkgs" \
|
|
-w / \
|
|
"${DOCKER_IMAGE}"
|
|
)
|
|
|
|
echo "CONTAINER_NAME=${container_name}" >> "$GITHUB_ENV"
|
|
|
|
docker exec -t -w "${PYTORCH_ROOT}" "${container_name}" bash -c "bash .circleci/scripts/binary_populate_env.sh"
|
|
# Generate test script
|
|
docker exec -t -w "${PYTORCH_ROOT}" -e OUTPUT_SCRIPT="/run.sh" "${container_name}" bash -c "bash .circleci/scripts/binary_linux_test.sh"
|
|
docker exec -t "${container_name}" bash -c "source ${BINARY_ENV_FILE} && bash -x /run.sh"
|
|
|
|
- name: Cleanup docker
|
|
if: always() && (env.BUILD_ENVIRONMENT == 'linux-s390x-binary-manywheel' || env.GPU_ARCH_TYPE == 'xpu')
|
|
shell: bash
|
|
run: |
|
|
# on s390x or xpu stop the container for clean worker stop
|
|
# shellcheck disable=SC2046
|
|
docker stop "${{ env.CONTAINER_NAME }}" || true
|