From b6a796db36006c946cf0899265b3f2fd482c66dc Mon Sep 17 00:00:00 2001 From: Omkar Salpekar Date: Wed, 19 Oct 2022 17:45:52 -0400 Subject: [PATCH 01/13] [Nova] Migrate Linux CPU job to Generic Job --- .github/workflows/test-linux-cpu.yml | 118 +++++++++++++++++---------- 1 file changed, 74 insertions(+), 44 deletions(-) diff --git a/.github/workflows/test-linux-cpu.yml b/.github/workflows/test-linux-cpu.yml index b6891bbfb4c..8d40ca8618e 100644 --- a/.github/workflows/test-linux-cpu.yml +++ b/.github/workflows/test-linux-cpu.yml @@ -14,57 +14,87 @@ env: jobs: tests: - name: "Unit-tests on Linux CPU" - runs-on: [self-hosted, linux.12xlarge] - container: - image: pytorch/conda-builder:cpu strategy: matrix: py_vers: ["3.7", "3.8", "3.9", "3.10"] fail-fast: false - steps: - name: Checkout repository uses: actions/checkout@v2 - - name: Set Release CHANNEL (for release) + - name: Set Channel if: ${{ (github.event_name == 'pull_request' && startsWith(github.base_ref, 'release')) || startsWith(github.ref, 'refs/heads/release') }} run: | echo "CHANNEL=test" >> "$GITHUB_ENV" - - name: Setup Conda - shell: bash -l {0} - env: - ENV_NAME: conda-env-${{ github.run_id }} - PY_VERS: ${{ matrix.py_vers }} - run: | - git config --global --add safe.directory /__w/vision/vision - . ~/miniconda3/etc/profile.d/conda.sh - conda create -yp ${ENV_NAME} python=${PY_VERS} numpy libpng jpeg scipy - echo "CONDA_RUN=conda run -p ${ENV_NAME}" >> "$GITHUB_ENV" - - name: Install TorchVision - shell: bash -l {0} - env: - VERSION: cpu - CUDATOOLKIT: cpuonly - run: | - # Needed for JPEG library detection as setup.py detects conda presence - # by running `shutil.which('conda')` - export PATH=~/miniconda3/bin:$PATH - set -ex - ${CONDA_RUN} conda install \ - --yes \ - -c "pytorch-${CHANNEL}" \ - -c nvidia "pytorch-${CHANNEL}"::pytorch[build="*${VERSION}*"] \ - "${CUDATOOLKIT}" - ${CONDA_RUN} python3 setup.py develop - ${CONDA_RUN} python3 -m pip install pytest pytest-mock 'av<10' - - name: Run tests - shell: bash -l {0} - env: - ENV_NAME: conda-env-${{ github.run_id }} - PY_VERS: ${{ matrix.py_vers }} - run: | - . ~/miniconda3/etc/profile.d/conda.sh - set -ex - ${CONDA_RUN} python3 -m torch.utils.collect_env - ${CONDA_RUN} python3 -m pytest --junitxml=test-results/junit.xml -v --durations 20 - conda env remove -p ${ENV_NAME} + - id: Run Tests + uses: pytorch/test-infra/.github/workflows/linux_job.yml + with: + runner: linux.12xlarge + script: | + ENV_NAME = conda-env-${{ github.run_id }} + PYTHON_VERSION = ${{ matrix.py_vers }} + + git config --global --add safe.directory /__w/vision/vision + . ~/miniconda3/etc/profile.d/conda.sh + conda create -yp ${ENV_NAME} python=${PY_VERS} numpy libpng jpeg scipy + echo "CONDA_RUN=conda run -p ${ENV_NAME}" >> "$GITHUB_ENV" + + export PATH=~/miniconda3/bin:$PATH + set -ex + ${CONDA_RUN} conda install \ + --yes \ + -c "pytorch-${CHANNEL}" \ + -c nvidia "pytorch-${CHANNEL}"::pytorch[build="*${VERSION}*"] \ + "${CUDATOOLKIT}" + ${CONDA_RUN} python3 setup.py develop + ${CONDA_RUN} python3 -m pip install pytest pytest-mock 'av<10' + + . ~/miniconda3/etc/profile.d/conda.sh + set -ex + ${CONDA_RUN} python3 -m torch.utils.collect_env + ${CONDA_RUN} python3 -m pytest --junitxml=test-results/junit.xml -v --durations 20 + + # steps: + # - name: Checkout repository + # uses: actions/checkout@v2 + # - name: Set Release CHANNEL (for release) + # if: ${{ (github.event_name == 'pull_request' && startsWith(github.base_ref, 'release')) || startsWith(github.ref, 'refs/heads/release') }} + # run: | + # echo "CHANNEL=test" >> "$GITHUB_ENV" + # - name: Setup Conda + # shell: bash -l {0} + # env: + # ENV_NAME: conda-env-${{ github.run_id }} + # PY_VERS: ${{ matrix.py_vers }} + # run: | + # git config --global --add safe.directory /__w/vision/vision + # . ~/miniconda3/etc/profile.d/conda.sh + # conda create -yp ${ENV_NAME} python=${PY_VERS} numpy libpng jpeg scipy + # echo "CONDA_RUN=conda run -p ${ENV_NAME}" >> "$GITHUB_ENV" + # - name: Install TorchVision + # shell: bash -l {0} + # env: + # VERSION: cpu + # CUDATOOLKIT: cpuonly + # run: | + # # Needed for JPEG library detection as setup.py detects conda presence + # # by running `shutil.which('conda')` + # export PATH=~/miniconda3/bin:$PATH + # set -ex + # ${CONDA_RUN} conda install \ + # --yes \ + # -c "pytorch-${CHANNEL}" \ + # -c nvidia "pytorch-${CHANNEL}"::pytorch[build="*${VERSION}*"] \ + # "${CUDATOOLKIT}" + # ${CONDA_RUN} python3 setup.py develop + # ${CONDA_RUN} python3 -m pip install pytest pytest-mock 'av<10' + # - name: Run tests + # shell: bash -l {0} + # env: + # ENV_NAME: conda-env-${{ github.run_id }} + # PY_VERS: ${{ matrix.py_vers }} + # run: | + # . ~/miniconda3/etc/profile.d/conda.sh + # set -ex + # ${CONDA_RUN} python3 -m torch.utils.collect_env + # ${CONDA_RUN} python3 -m pytest --junitxml=test-results/junit.xml -v --durations 20 + # conda env remove -p ${ENV_NAME} From e60218e920fa9261446657bdb0c8c2d080f88950 Mon Sep 17 00:00:00 2001 From: Omkar Salpekar Date: Wed, 19 Oct 2022 17:50:57 -0400 Subject: [PATCH 02/13] branch ref for composite action job --- .github/workflows/test-linux-cpu.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/test-linux-cpu.yml b/.github/workflows/test-linux-cpu.yml index 8d40ca8618e..304a21f4fba 100644 --- a/.github/workflows/test-linux-cpu.yml +++ b/.github/workflows/test-linux-cpu.yml @@ -26,7 +26,7 @@ jobs: run: | echo "CHANNEL=test" >> "$GITHUB_ENV" - id: Run Tests - uses: pytorch/test-infra/.github/workflows/linux_job.yml + uses: pytorch/test-infra/.github/workflows/linux_job.yml@main with: runner: linux.12xlarge script: | From afcd2f3a5b6c6ca122c733a49ff9c00ebd9b648c Mon Sep 17 00:00:00 2001 From: Omkar Salpekar Date: Wed, 19 Oct 2022 18:07:18 -0400 Subject: [PATCH 03/13] move checkout step to separate job --- .github/workflows/test-linux-cpu.yml | 60 ++++++++++++++-------------- 1 file changed, 30 insertions(+), 30 deletions(-) diff --git a/.github/workflows/test-linux-cpu.yml b/.github/workflows/test-linux-cpu.yml index 304a21f4fba..e1d2378422a 100644 --- a/.github/workflows/test-linux-cpu.yml +++ b/.github/workflows/test-linux-cpu.yml @@ -13,11 +13,7 @@ env: CHANNEL: "nightly" jobs: - tests: - strategy: - matrix: - py_vers: ["3.7", "3.8", "3.9", "3.10"] - fail-fast: false + setup: steps: - name: Checkout repository uses: actions/checkout@v2 @@ -25,33 +21,37 @@ jobs: if: ${{ (github.event_name == 'pull_request' && startsWith(github.base_ref, 'release')) || startsWith(github.ref, 'refs/heads/release') }} run: | echo "CHANNEL=test" >> "$GITHUB_ENV" - - id: Run Tests - uses: pytorch/test-infra/.github/workflows/linux_job.yml@main - with: - runner: linux.12xlarge - script: | - ENV_NAME = conda-env-${{ github.run_id }} - PYTHON_VERSION = ${{ matrix.py_vers }} + tests: + strategy: + matrix: + py_vers: ["3.7", "3.8", "3.9", "3.10"] + fail-fast: false + uses: pytorch/test-infra/.github/workflows/linux_job.yml@main + with: + runner: linux.12xlarge + script: | + ENV_NAME = conda-env-${{ github.run_id }} + PYTHON_VERSION = ${{ matrix.py_vers }} - git config --global --add safe.directory /__w/vision/vision - . ~/miniconda3/etc/profile.d/conda.sh - conda create -yp ${ENV_NAME} python=${PY_VERS} numpy libpng jpeg scipy - echo "CONDA_RUN=conda run -p ${ENV_NAME}" >> "$GITHUB_ENV" - - export PATH=~/miniconda3/bin:$PATH - set -ex - ${CONDA_RUN} conda install \ - --yes \ - -c "pytorch-${CHANNEL}" \ - -c nvidia "pytorch-${CHANNEL}"::pytorch[build="*${VERSION}*"] \ - "${CUDATOOLKIT}" - ${CONDA_RUN} python3 setup.py develop - ${CONDA_RUN} python3 -m pip install pytest pytest-mock 'av<10' + git config --global --add safe.directory /__w/vision/vision + . ~/miniconda3/etc/profile.d/conda.sh + conda create -yp ${ENV_NAME} python=${PY_VERS} numpy libpng jpeg scipy + echo "CONDA_RUN=conda run -p ${ENV_NAME}" >> "$GITHUB_ENV" + + export PATH=~/miniconda3/bin:$PATH + set -ex + ${CONDA_RUN} conda install \ + --yes \ + -c "pytorch-${CHANNEL}" \ + -c nvidia "pytorch-${CHANNEL}"::pytorch[build="*${VERSION}*"] \ + "${CUDATOOLKIT}" + ${CONDA_RUN} python3 setup.py develop + ${CONDA_RUN} python3 -m pip install pytest pytest-mock 'av<10' - . ~/miniconda3/etc/profile.d/conda.sh - set -ex - ${CONDA_RUN} python3 -m torch.utils.collect_env - ${CONDA_RUN} python3 -m pytest --junitxml=test-results/junit.xml -v --durations 20 + . ~/miniconda3/etc/profile.d/conda.sh + set -ex + ${CONDA_RUN} python3 -m torch.utils.collect_env + ${CONDA_RUN} python3 -m pytest --junitxml=test-results/junit.xml -v --durations 20 # steps: # - name: Checkout repository From b685f605056a7d361cae05c8821c13fc5610e6ae Mon Sep 17 00:00:00 2001 From: Omkar Salpekar Date: Wed, 19 Oct 2022 18:08:28 -0400 Subject: [PATCH 04/13] added runs-on --- .github/workflows/test-linux-cpu.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/test-linux-cpu.yml b/.github/workflows/test-linux-cpu.yml index e1d2378422a..bb035e3da8b 100644 --- a/.github/workflows/test-linux-cpu.yml +++ b/.github/workflows/test-linux-cpu.yml @@ -14,6 +14,7 @@ env: jobs: setup: + runs-on: linux.12xlarge steps: - name: Checkout repository uses: actions/checkout@v2 From 99d3d85d6c537b959a17cb0840654117df9dde45 Mon Sep 17 00:00:00 2001 From: Omkar Salpekar Date: Wed, 19 Oct 2022 18:16:52 -0400 Subject: [PATCH 05/13] nit fixes --- .github/workflows/test-linux-cpu.yml | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/.github/workflows/test-linux-cpu.yml b/.github/workflows/test-linux-cpu.yml index bb035e3da8b..2dc0cb438e9 100644 --- a/.github/workflows/test-linux-cpu.yml +++ b/.github/workflows/test-linux-cpu.yml @@ -31,13 +31,14 @@ jobs: with: runner: linux.12xlarge script: | - ENV_NAME = conda-env-${{ github.run_id }} - PYTHON_VERSION = ${{ matrix.py_vers }} + export ENV_NAME=conda-env-"${{ github.run_id }}" + export PYTHON_VERSION="${{ matrix.py_vers }}" git config --global --add safe.directory /__w/vision/vision . ~/miniconda3/etc/profile.d/conda.sh - conda create -yp ${ENV_NAME} python=${PY_VERS} numpy libpng jpeg scipy - echo "CONDA_RUN=conda run -p ${ENV_NAME}" >> "$GITHUB_ENV" + conda create -yp "${ENV_NAME}" python="${PYTHON_VERSION}" numpy libpng jpeg scipy + # echo "CONDA_RUN=conda run -p ${ENV_NAME}" >> "$GITHUB_ENV" + export CONDA_RUN="conda run -p ${ENV_NAME}" export PATH=~/miniconda3/bin:$PATH set -ex @@ -49,8 +50,6 @@ jobs: ${CONDA_RUN} python3 setup.py develop ${CONDA_RUN} python3 -m pip install pytest pytest-mock 'av<10' - . ~/miniconda3/etc/profile.d/conda.sh - set -ex ${CONDA_RUN} python3 -m torch.utils.collect_env ${CONDA_RUN} python3 -m pytest --junitxml=test-results/junit.xml -v --durations 20 From ab7298aa56c0e84e2f46c2b568d70835e611881c Mon Sep 17 00:00:00 2001 From: Omkar Salpekar Date: Wed, 19 Oct 2022 18:24:53 -0400 Subject: [PATCH 06/13] no need to run conda sheel script thing --- .github/workflows/test-linux-cpu.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/test-linux-cpu.yml b/.github/workflows/test-linux-cpu.yml index 2dc0cb438e9..3b5c13aa7d1 100644 --- a/.github/workflows/test-linux-cpu.yml +++ b/.github/workflows/test-linux-cpu.yml @@ -35,12 +35,12 @@ jobs: export PYTHON_VERSION="${{ matrix.py_vers }}" git config --global --add safe.directory /__w/vision/vision - . ~/miniconda3/etc/profile.d/conda.sh + # . ~/miniconda3/etc/profile.d/conda.sh conda create -yp "${ENV_NAME}" python="${PYTHON_VERSION}" numpy libpng jpeg scipy # echo "CONDA_RUN=conda run -p ${ENV_NAME}" >> "$GITHUB_ENV" export CONDA_RUN="conda run -p ${ENV_NAME}" - export PATH=~/miniconda3/bin:$PATH + # export PATH=~/miniconda3/bin:$PATH set -ex ${CONDA_RUN} conda install \ --yes \ From d7fd77b36b797d699a6cd67f2deaf0d54db8f1c8 Mon Sep 17 00:00:00 2001 From: Omkar Salpekar Date: Wed, 19 Oct 2022 18:38:00 -0400 Subject: [PATCH 07/13] Channel is set inside the script --- .github/workflows/test-linux-cpu.yml | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/.github/workflows/test-linux-cpu.yml b/.github/workflows/test-linux-cpu.yml index 3b5c13aa7d1..40db3806350 100644 --- a/.github/workflows/test-linux-cpu.yml +++ b/.github/workflows/test-linux-cpu.yml @@ -33,6 +33,11 @@ jobs: script: | export ENV_NAME=conda-env-"${{ github.run_id }}" export PYTHON_VERSION="${{ matrix.py_vers }}" + if [[${{ (github.event_name == 'pull_request' && startsWith(github.base_ref, 'release')) || startsWith(github.ref, 'refs/heads/release') }} ]]; then + export CHANNEL=test + else + export CHANNEL=nightly + fi git config --global --add safe.directory /__w/vision/vision # . ~/miniconda3/etc/profile.d/conda.sh From bb02f47ecdf99dd7963d12aac5c68fb1d53ed9ce Mon Sep 17 00:00:00 2001 From: Omkar Salpekar Date: Wed, 19 Oct 2022 18:43:35 -0400 Subject: [PATCH 08/13] add remaining env vars --- .github/workflows/test-linux-cpu.yml | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/.github/workflows/test-linux-cpu.yml b/.github/workflows/test-linux-cpu.yml index 40db3806350..bae54315af6 100644 --- a/.github/workflows/test-linux-cpu.yml +++ b/.github/workflows/test-linux-cpu.yml @@ -33,6 +33,8 @@ jobs: script: | export ENV_NAME=conda-env-"${{ github.run_id }}" export PYTHON_VERSION="${{ matrix.py_vers }}" + export VERSION="cpu" + export CUDATOOLKIT="cpuonly" if [[${{ (github.event_name == 'pull_request' && startsWith(github.base_ref, 'release')) || startsWith(github.ref, 'refs/heads/release') }} ]]; then export CHANNEL=test else @@ -50,7 +52,7 @@ jobs: ${CONDA_RUN} conda install \ --yes \ -c "pytorch-${CHANNEL}" \ - -c nvidia "pytorch-${CHANNEL}"::pytorch[build="*${VERSION}*"] \ + -c nvidia "pytorch-${CHANNEL}"::pytorch[build="*{VERSION}*"] \ "${CUDATOOLKIT}" ${CONDA_RUN} python3 setup.py develop ${CONDA_RUN} python3 -m pip install pytest pytest-mock 'av<10' From 189cf4b3e1ffe32adb578476d8ae3f6e490bccfa Mon Sep 17 00:00:00 2001 From: Omkar Salpekar Date: Wed, 19 Oct 2022 19:03:55 -0400 Subject: [PATCH 09/13] nit env var fix --- .github/workflows/test-linux-cpu.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/test-linux-cpu.yml b/.github/workflows/test-linux-cpu.yml index bae54315af6..910f60add2a 100644 --- a/.github/workflows/test-linux-cpu.yml +++ b/.github/workflows/test-linux-cpu.yml @@ -52,7 +52,7 @@ jobs: ${CONDA_RUN} conda install \ --yes \ -c "pytorch-${CHANNEL}" \ - -c nvidia "pytorch-${CHANNEL}"::pytorch[build="*{VERSION}*"] \ + -c nvidia "pytorch-${CHANNEL}"::pytorch[build="*${VERSION}*"] \ "${CUDATOOLKIT}" ${CONDA_RUN} python3 setup.py develop ${CONDA_RUN} python3 -m pip install pytest pytest-mock 'av<10' From 17cf75fff2066270be80473d3ab9df0faec2de40 Mon Sep 17 00:00:00 2001 From: Omkar Salpekar Date: Thu, 20 Oct 2022 10:42:45 -0400 Subject: [PATCH 10/13] cleanup --- .github/workflows/test-linux-cpu.yml | 63 ++++------------------------ 1 file changed, 9 insertions(+), 54 deletions(-) diff --git a/.github/workflows/test-linux-cpu.yml b/.github/workflows/test-linux-cpu.yml index 910f60add2a..e16b2443c84 100644 --- a/.github/workflows/test-linux-cpu.yml +++ b/.github/workflows/test-linux-cpu.yml @@ -18,10 +18,6 @@ jobs: steps: - name: Checkout repository uses: actions/checkout@v2 - - name: Set Channel - if: ${{ (github.event_name == 'pull_request' && startsWith(github.base_ref, 'release')) || startsWith(github.ref, 'refs/heads/release') }} - run: | - echo "CHANNEL=test" >> "$GITHUB_ENV" tests: strategy: matrix: @@ -31,23 +27,27 @@ jobs: with: runner: linux.12xlarge script: | + # Mark Build Directory Safe + git config --global --add safe.directory /__w/vision/vision + + # Set up Environment Variables export ENV_NAME=conda-env-"${{ github.run_id }}" export PYTHON_VERSION="${{ matrix.py_vers }}" export VERSION="cpu" export CUDATOOLKIT="cpuonly" + + # Set CHANNEL if [[${{ (github.event_name == 'pull_request' && startsWith(github.base_ref, 'release')) || startsWith(github.ref, 'refs/heads/release') }} ]]; then export CHANNEL=test else export CHANNEL=nightly fi - git config --global --add safe.directory /__w/vision/vision - # . ~/miniconda3/etc/profile.d/conda.sh + # Create Conda Env conda create -yp "${ENV_NAME}" python="${PYTHON_VERSION}" numpy libpng jpeg scipy - # echo "CONDA_RUN=conda run -p ${ENV_NAME}" >> "$GITHUB_ENV" export CONDA_RUN="conda run -p ${ENV_NAME}" - # export PATH=~/miniconda3/bin:$PATH + # Install PyTorch, Torchvision, and testing libraries set -ex ${CONDA_RUN} conda install \ --yes \ @@ -57,51 +57,6 @@ jobs: ${CONDA_RUN} python3 setup.py develop ${CONDA_RUN} python3 -m pip install pytest pytest-mock 'av<10' + # Run Tests ${CONDA_RUN} python3 -m torch.utils.collect_env ${CONDA_RUN} python3 -m pytest --junitxml=test-results/junit.xml -v --durations 20 - - # steps: - # - name: Checkout repository - # uses: actions/checkout@v2 - # - name: Set Release CHANNEL (for release) - # if: ${{ (github.event_name == 'pull_request' && startsWith(github.base_ref, 'release')) || startsWith(github.ref, 'refs/heads/release') }} - # run: | - # echo "CHANNEL=test" >> "$GITHUB_ENV" - # - name: Setup Conda - # shell: bash -l {0} - # env: - # ENV_NAME: conda-env-${{ github.run_id }} - # PY_VERS: ${{ matrix.py_vers }} - # run: | - # git config --global --add safe.directory /__w/vision/vision - # . ~/miniconda3/etc/profile.d/conda.sh - # conda create -yp ${ENV_NAME} python=${PY_VERS} numpy libpng jpeg scipy - # echo "CONDA_RUN=conda run -p ${ENV_NAME}" >> "$GITHUB_ENV" - # - name: Install TorchVision - # shell: bash -l {0} - # env: - # VERSION: cpu - # CUDATOOLKIT: cpuonly - # run: | - # # Needed for JPEG library detection as setup.py detects conda presence - # # by running `shutil.which('conda')` - # export PATH=~/miniconda3/bin:$PATH - # set -ex - # ${CONDA_RUN} conda install \ - # --yes \ - # -c "pytorch-${CHANNEL}" \ - # -c nvidia "pytorch-${CHANNEL}"::pytorch[build="*${VERSION}*"] \ - # "${CUDATOOLKIT}" - # ${CONDA_RUN} python3 setup.py develop - # ${CONDA_RUN} python3 -m pip install pytest pytest-mock 'av<10' - # - name: Run tests - # shell: bash -l {0} - # env: - # ENV_NAME: conda-env-${{ github.run_id }} - # PY_VERS: ${{ matrix.py_vers }} - # run: | - # . ~/miniconda3/etc/profile.d/conda.sh - # set -ex - # ${CONDA_RUN} python3 -m torch.utils.collect_env - # ${CONDA_RUN} python3 -m pytest --junitxml=test-results/junit.xml -v --durations 20 - # conda env remove -p ${ENV_NAME} From d23c434faa0e33d8b3be41d8daf7e6f3c535097a Mon Sep 17 00:00:00 2001 From: Omkar Salpekar Date: Thu, 20 Oct 2022 11:50:04 -0400 Subject: [PATCH 11/13] simplify unneeded jobs --- .github/workflows/test-linux-cpu.yml | 24 ++++++++++-------------- 1 file changed, 10 insertions(+), 14 deletions(-) diff --git a/.github/workflows/test-linux-cpu.yml b/.github/workflows/test-linux-cpu.yml index e16b2443c84..05fd1f26af0 100644 --- a/.github/workflows/test-linux-cpu.yml +++ b/.github/workflows/test-linux-cpu.yml @@ -13,11 +13,6 @@ env: CHANNEL: "nightly" jobs: - setup: - runs-on: linux.12xlarge - steps: - - name: Checkout repository - uses: actions/checkout@v2 tests: strategy: matrix: @@ -26,37 +21,38 @@ jobs: uses: pytorch/test-infra/.github/workflows/linux_job.yml@main with: runner: linux.12xlarge + repository: pytorch/vision + ref: main script: | # Mark Build Directory Safe git config --global --add safe.directory /__w/vision/vision # Set up Environment Variables - export ENV_NAME=conda-env-"${{ github.run_id }}" export PYTHON_VERSION="${{ matrix.py_vers }}" export VERSION="cpu" export CUDATOOLKIT="cpuonly" # Set CHANNEL - if [[${{ (github.event_name == 'pull_request' && startsWith(github.base_ref, 'release')) || startsWith(github.ref, 'refs/heads/release') }} ]]; then + if [[ (${GITHUB_EVENT_NAME} = 'pull_request' && (${GITHUB_BASE_REF} = 'release'*)) || (${GITHUB_REF} = 'refs/heads/release'*) ]]; then export CHANNEL=test else export CHANNEL=nightly fi # Create Conda Env - conda create -yp "${ENV_NAME}" python="${PYTHON_VERSION}" numpy libpng jpeg scipy - export CONDA_RUN="conda run -p ${ENV_NAME}" + conda create -yp ci_env python="${PYTHON_VERSION}" numpy libpng jpeg scipy + conda activate ci_env # Install PyTorch, Torchvision, and testing libraries set -ex - ${CONDA_RUN} conda install \ + conda install \ --yes \ -c "pytorch-${CHANNEL}" \ -c nvidia "pytorch-${CHANNEL}"::pytorch[build="*${VERSION}*"] \ "${CUDATOOLKIT}" - ${CONDA_RUN} python3 setup.py develop - ${CONDA_RUN} python3 -m pip install pytest pytest-mock 'av<10' + python3 setup.py develop + python3 -m pip install pytest pytest-mock 'av<10' # Run Tests - ${CONDA_RUN} python3 -m torch.utils.collect_env - ${CONDA_RUN} python3 -m pytest --junitxml=test-results/junit.xml -v --durations 20 + python3 -m torch.utils.collect_env + python3 -m pytest --junitxml=test-results/junit.xml -v --durations 20 From 486646481c8a5dc4889a391b827b4f81b673706d Mon Sep 17 00:00:00 2001 From: Omkar Salpekar Date: Thu, 20 Oct 2022 11:57:13 -0400 Subject: [PATCH 12/13] name of the conda env should be the path --- .github/workflows/test-linux-cpu.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/test-linux-cpu.yml b/.github/workflows/test-linux-cpu.yml index 05fd1f26af0..824fbb2747f 100644 --- a/.github/workflows/test-linux-cpu.yml +++ b/.github/workflows/test-linux-cpu.yml @@ -41,7 +41,7 @@ jobs: # Create Conda Env conda create -yp ci_env python="${PYTHON_VERSION}" numpy libpng jpeg scipy - conda activate ci_env + conda activate /work/ci_env # Install PyTorch, Torchvision, and testing libraries set -ex From 24abee0aa6ae5e2898b2e528a0ad6159d3f4af64 Mon Sep 17 00:00:00 2001 From: Omkar Salpekar Date: Thu, 20 Oct 2022 12:51:37 -0400 Subject: [PATCH 13/13] remove main ref to use PR --- .github/workflows/test-linux-cpu.yml | 1 - 1 file changed, 1 deletion(-) diff --git a/.github/workflows/test-linux-cpu.yml b/.github/workflows/test-linux-cpu.yml index 824fbb2747f..f78dd323da7 100644 --- a/.github/workflows/test-linux-cpu.yml +++ b/.github/workflows/test-linux-cpu.yml @@ -22,7 +22,6 @@ jobs: with: runner: linux.12xlarge repository: pytorch/vision - ref: main script: | # Mark Build Directory Safe git config --global --add safe.directory /__w/vision/vision