diff --git a/.github/workflows/build-cmake.yml b/.github/workflows/build-cmake.yml index 3871dca340f..8da613cf194 100644 --- a/.github/workflows/build-cmake.yml +++ b/.github/workflows/build-cmake.yml @@ -26,6 +26,7 @@ jobs: runner: ${{ matrix.runner }} gpu-arch-type: ${{ matrix.gpu-arch-type }} gpu-arch-version: ${{ matrix.gpu-arch-version }} + test-infra-ref: main script: | set -euo pipefail @@ -46,6 +47,7 @@ jobs: with: repository: pytorch/vision runner: ${{ matrix.runner }} + test-infra-ref: main script: | set -euo pipefail @@ -71,6 +73,7 @@ jobs: runner: ${{ matrix.runner }} gpu-arch-type: ${{ matrix.gpu-arch-type }} gpu-arch-version: ${{ matrix.gpu-arch-version }} + test-infra-ref: main script: | set -euo pipefail diff --git a/.github/workflows/docs.yml b/.github/workflows/docs.yml index 779da13e3a2..51cc77b3cea 100644 --- a/.github/workflows/docs.yml +++ b/.github/workflows/docs.yml @@ -18,6 +18,7 @@ jobs: with: repository: pytorch/vision upload-artifact: docs + test-infra-ref: main script: | set -euo pipefail @@ -25,7 +26,7 @@ jobs: export GPU_ARCH_TYPE=cpu export GPU_ARCH_VERSION='' ./.github/scripts/setup-env.sh - + # Prepare conda CONDA_PATH=$(which conda) eval "$(${CONDA_PATH} shell.bash hook)" @@ -36,13 +37,13 @@ jobs: # Should we maybe always do this in `./.github/scripts/setup-env.sh` so that we don't # have to pay attention in all other workflows? export LD_LIBRARY_PATH="${CONDA_PREFIX}/lib:${LD_LIBRARY_PATH}" - + cd docs - + echo '::group::Install doc requirements' pip install --progress-bar=off -r requirements.txt echo '::endgroup::' - + if [[ ${{ github.event_name }} == push && (${{ github.ref_type }} == tag || (${{ github.ref_type }} == branch && ${{ github.ref_name }} == release/*)) ]]; then echo '::group::Enable version string sanitization' # This environment variable just has to exist and must not be empty. The actual value is arbitrary. @@ -66,9 +67,9 @@ jobs: cp $file build/html/_generated_ipynb_notebooks/ fi done - + cp -r build/html "${RUNNER_ARTIFACT_DIR}" - + # On PRs we also want to upload the docs into our S3 bucket for preview. if [[ ${{ github.event_name == 'pull_request' }} ]]; then cp -r build/html/* "${RUNNER_DOCS_DIR}" @@ -85,9 +86,10 @@ jobs: repository: pytorch/vision download-artifact: docs ref: gh-pages + test-infra-ref: main script: | set -euo pipefail - + REF_TYPE=${{ github.ref_type }} REF_NAME=${{ github.ref_name }} @@ -112,14 +114,14 @@ jobs: rm -rf "${TARGET_FOLDER}"/* mv "${RUNNER_ARTIFACT_DIR}"/html/* "${TARGET_FOLDER}" git add "${TARGET_FOLDER}" || true - + if [[ "${TARGET_FOLDER}" == main ]]; then mkdir -p _static rm -rf _static/* cp -r "${TARGET_FOLDER}"/_static/* _static git add _static || true fi - + git config user.name 'pytorchbot' git config user.email 'soumith+bot@pytorch.org' git config http.postBuffer 524288000 diff --git a/.github/workflows/lint.yml b/.github/workflows/lint.yml index 8203bb61e4f..b8dc5566cc7 100644 --- a/.github/workflows/lint.yml +++ b/.github/workflows/lint.yml @@ -14,6 +14,7 @@ jobs: uses: pytorch/test-infra/.github/workflows/linux_job.yml@main with: repository: pytorch/vision + test-infra-ref: main script: | set -euo pipefail @@ -23,14 +24,14 @@ jobs: conda create --name ci --quiet --yes python=3.8 pip conda activate ci echo '::endgroup::' - + echo '::group::Install lint tools' pip install --progress-bar=off pre-commit echo '::endgroup::' - + set +e pre-commit run --all-files - + if [ $? -ne 0 ]; then git --no-pager diff exit 1 @@ -40,9 +41,10 @@ jobs: uses: pytorch/test-infra/.github/workflows/linux_job.yml@main with: repository: pytorch/vision + test-infra-ref: main script: | set -euo pipefail - + echo '::group::Setup environment' CONDA_PATH=$(which conda) eval "$(${CONDA_PATH} shell.bash hook)" @@ -53,7 +55,7 @@ jobs: conda activate ci export LD_LIBRARY_PATH="${CONDA_PREFIX}/lib:${LD_LIBRARY_PATH}" echo '::endgroup::' - + echo '::group::Install lint tools' curl https://oss-clang-format.s3.us-east-2.amazonaws.com/linux64/clang-format-linux64 -o ./clang-format chmod +x ./clang-format @@ -62,7 +64,7 @@ jobs: echo '::group::Lint C source' set +e ./.github/scripts/run-clang-format.py -r torchvision/csrc --clang-format-executable ./clang-format - + if [ $? -ne 0 ]; then git --no-pager diff exit 1 @@ -74,23 +76,24 @@ jobs: uses: pytorch/test-infra/.github/workflows/linux_job.yml@main with: repository: pytorch/vision + test-infra-ref: main script: | set -euo pipefail - + export PYTHON_VERSION=3.8 export GPU_ARCH_TYPE=cpu export GPU_ARCH_VERSION='' ./.github/scripts/setup-env.sh - + CONDA_PATH=$(which conda) eval "$(${CONDA_PATH} shell.bash hook)" conda activate ci - + echo '::group::Install lint tools' pip install --progress-bar=off mypy echo '::endgroup::' - + echo '::group::Lint Python types' mypy --install-types --non-interactive --config-file mypy.ini echo '::endgroup::' diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index 22e1a4ac18d..eb6290fdfe9 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -33,6 +33,7 @@ jobs: gpu-arch-type: ${{ matrix.gpu-arch-type }} gpu-arch-version: ${{ matrix.gpu-arch-version }} timeout: 120 + test-infra-ref: main script: | set -euo pipefail @@ -41,7 +42,7 @@ jobs: export GPU_ARCH_VERSION=${{ matrix.gpu-arch-version }} ./.github/scripts/unittest.sh - + unittests-macos: strategy: matrix: @@ -62,6 +63,7 @@ jobs: # and needs roughly 2 hours to just run the test suite timeout: 240 runner: ${{ matrix.runner }} + test-infra-ref: main script: | set -euo pipefail @@ -94,6 +96,7 @@ jobs: gpu-arch-type: ${{ matrix.gpu-arch-type }} gpu-arch-version: ${{ matrix.gpu-arch-version }} timeout: 120 + test-infra-ref: main script: | set -euxo pipefail @@ -102,13 +105,14 @@ jobs: export VSDEVCMD_ARGS="" export GPU_ARCH_TYPE=${{ matrix.gpu-arch-type }} export GPU_ARCH_VERSION=${{ matrix.gpu-arch-version }} - + ./.github/scripts/unittest.sh onnx: uses: pytorch/test-infra/.github/workflows/linux_job.yml@main with: repository: pytorch/vision + test-infra-ref: main script: | set -euo pipefail @@ -117,20 +121,20 @@ jobs: export GPU_ARCH_VERSION='' ./.github/scripts/setup-env.sh - + # Prepare conda CONDA_PATH=$(which conda) eval "$(${CONDA_PATH} shell.bash hook)" conda activate ci - + echo '::group::Install ONNX' pip install --progress-bar=off onnx onnxruntime echo '::endgroup::' - + echo '::group::Install testing utilities' pip install --progress-bar=off pytest echo '::endgroup::' - + echo '::group::Run ONNX tests' pytest --junit-xml="${RUNNER_TEST_RESULTS_DIR}/test-results.xml" -v --durations=25 test/test_onnx.py echo '::endgroup::' @@ -139,6 +143,7 @@ jobs: uses: pytorch/test-infra/.github/workflows/linux_job.yml@main with: repository: pytorch/vision + test-infra-ref: main script: | set -euo pipefail @@ -147,21 +152,21 @@ jobs: export GPU_ARCH_VERSION='' ./.github/scripts/setup-env.sh - + # Prepare conda CONDA_PATH=$(which conda) eval "$(${CONDA_PATH} shell.bash hook)" conda activate ci - + echo '::group::Pre-download model weights' pip install --progress-bar=off aiohttp aiofiles tqdm python scripts/download_model_urls.py echo '::endgroup::' - + echo '::group::Install testing utilities' pip install --progress-bar=off pytest echo '::endgroup::' - + echo '::group::Run extended unittests' export PYTORCH_TEST_WITH_EXTENDED=1 pytest --junit-xml="${RUNNER_TEST_RESULTS_DIR}/test-results.xml" -v --durations=25 test/test_extended_*.py diff --git a/.github/workflows/update-viablestrict.yml b/.github/workflows/update-viablestrict.yml index 665d833b60a..8e4889b9ba7 100644 --- a/.github/workflows/update-viablestrict.yml +++ b/.github/workflows/update-viablestrict.yml @@ -18,6 +18,7 @@ jobs: with: repository: pytorch/vision required_checks: "Build Linux,Build M1,Build Macos,Build Windows,Tests,CMake,Lint,Docs" + test-infra-ref: main secrets: ROCKSET_API_KEY: ${{ secrets.ROCKSET_API_KEY }} GITHUB_DEPLOY_KEY : ${{ secrets.VISION_GITHUB_DEPLOY_KEY }}