From 26cf7d8f69718a2c47e6c47402ccd35267660fd1 Mon Sep 17 00:00:00 2001 From: Philip Meier Date: Fri, 10 Mar 2023 10:06:11 +0100 Subject: [PATCH 01/12] [PoC] migrate docs workflow to GHA --- .circleci/config.yml | 112 ------------------------------------- .circleci/config.yml.in | 67 ---------------------- .circleci/regenerate.py | 39 +------------ .github/workflows/docs.yml | 41 ++++++++++++++ 4 files changed, 42 insertions(+), 217 deletions(-) create mode 100644 .github/workflows/docs.yml diff --git a/.circleci/config.yml b/.circleci/config.yml index e1552f8e4df..6d43ceeeb96 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -869,73 +869,6 @@ jobs: conda activate python39 packaging/build_cmake.sh - build_docs: - <<: *binary_common - docker: - - image: cimg/python:3.8 - resource_class: 2xlarge+ - steps: - - attach_workspace: - at: ~/workspace - - checkout - - download_model_weights - - run: - name: Setup - command: .circleci/unittest/linux/scripts/setup_env.sh - - designate_upload_channel - - run: - name: Install torchvision - command: .circleci/unittest/linux/scripts/install.sh - - run: - name: Build docs - command: | - set -ex - # turn v1.12.0rc3 into 1.12.0 - tag=$(echo $CIRCLE_TAG | sed -e 's/v*\([0-9.]*\).*/\1/') - VERSION=${tag:-main} - eval "$(./conda/bin/conda shell.bash hook)" - conda activate ./env - pushd docs - pip install --progress-bar=off -r requirements.txt - make html - popd - - persist_to_workspace: - root: ./ - paths: - - "*" - - store_artifacts: - path: ./docs/build/html - destination: docs - - upload_docs: - <<: *binary_common - docker: - - image: "pytorch/manylinux-cuda100" - resource_class: 2xlarge+ - steps: - - attach_workspace: - at: ~/workspace - - run: - name: Generate netrc - command: | - # set credentials for https pushing - # requires the org-member context - cat > ~/.netrc \< ~/.netrc \< Date: Fri, 10 Mar 2023 10:13:05 +0100 Subject: [PATCH 02/12] remove wrong id --- .github/workflows/docs.yml | 1 - 1 file changed, 1 deletion(-) diff --git a/.github/workflows/docs.yml b/.github/workflows/docs.yml index 215347b1185..a958ff3256f 100644 --- a/.github/workflows/docs.yml +++ b/.github/workflows/docs.yml @@ -12,7 +12,6 @@ on: jobs: build: uses: pytorch/test-infra/.github/workflows/linux_job.yml@main - id: build with: repository: pytorch/vision upload-artifact: docs From 267e9436931019dc13c89ead1254b7105cdc8371 Mon Sep 17 00:00:00 2001 From: Philip Meier Date: Fri, 10 Mar 2023 10:21:10 +0100 Subject: [PATCH 03/12] add ebug --- .github/workflows/docs.yml | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/.github/workflows/docs.yml b/.github/workflows/docs.yml index a958ff3256f..e85364d9ef6 100644 --- a/.github/workflows/docs.yml +++ b/.github/workflows/docs.yml @@ -1,4 +1,4 @@ -name: docs +name: Docs on: pull_request: @@ -15,6 +15,7 @@ jobs: with: repository: pytorch/vision upload-artifact: docs + timeout: 120 script: | set -euo pipefail @@ -33,6 +34,8 @@ jobs: pip install --progress-bar=off -r requirements.txt echo '::endgroup::' + sleep 7200 + echo '::group::Build HTML docs' make html echo '::endgroup::' From 548a7caa3adc598d6b9cfbcf9fafa0fe89cf4f5f Mon Sep 17 00:00:00 2001 From: Philip Meier Date: Fri, 10 Mar 2023 10:45:36 +0100 Subject: [PATCH 04/12] fix linker path --- .github/workflows/docs.yml | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/.github/workflows/docs.yml b/.github/workflows/docs.yml index e85364d9ef6..a540ed8bcc7 100644 --- a/.github/workflows/docs.yml +++ b/.github/workflows/docs.yml @@ -27,6 +27,12 @@ jobs: CONDA_PATH=$(which conda) eval "$(${CONDA_PATH} shell.bash hook)" conda activate ci + # FIXME: not sure why we need this. `ldd torchvision/video_reader.so` shows that it + # already links against the one pulled from conda. However, at runtime it pulls from + # /lib64 + # 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 From 98d4f56f0fe8dfd5be49a489db8840609830e54e Mon Sep 17 00:00:00 2001 From: Philip Meier Date: Fri, 10 Mar 2023 10:53:18 +0100 Subject: [PATCH 05/12] try larger runner --- .github/workflows/docs.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/docs.yml b/.github/workflows/docs.yml index a540ed8bcc7..b331ceefb22 100644 --- a/.github/workflows/docs.yml +++ b/.github/workflows/docs.yml @@ -14,6 +14,7 @@ jobs: uses: pytorch/test-infra/.github/workflows/linux_job.yml@main with: repository: pytorch/vision + runner: linux.24xlarge upload-artifact: docs timeout: 120 script: | From 8010a129a490174f453515b06bc5e8574caa5968 Mon Sep 17 00:00:00 2001 From: Philip Meier Date: Fri, 10 Mar 2023 11:25:01 +0100 Subject: [PATCH 06/12] limit number of parallel processes --- .github/workflows/docs.yml | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/.github/workflows/docs.yml b/.github/workflows/docs.yml index b331ceefb22..28795bd7970 100644 --- a/.github/workflows/docs.yml +++ b/.github/workflows/docs.yml @@ -14,9 +14,7 @@ jobs: uses: pytorch/test-infra/.github/workflows/linux_job.yml@main with: repository: pytorch/vision - runner: linux.24xlarge upload-artifact: docs - timeout: 120 script: | set -euo pipefail @@ -41,9 +39,10 @@ jobs: pip install --progress-bar=off -r requirements.txt echo '::endgroup::' - sleep 7200 - echo '::group::Build HTML docs' + # The runner does not have sufficient memory to run with as many processes as their are + # cores (`-j auto`). Thus, we limit to 4 (`-j 4`) here. + sed -i -e 's/-j auto/-j 4/' Makefile make html echo '::endgroup::' From b3ff0f97a1a2568471750a2efd09824ac0ed40ad Mon Sep 17 00:00:00 2001 From: Philip Meier Date: Fri, 10 Mar 2023 11:30:49 +0100 Subject: [PATCH 07/12] single process --- .github/workflows/docs.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/docs.yml b/.github/workflows/docs.yml index 28795bd7970..dad2266a0f3 100644 --- a/.github/workflows/docs.yml +++ b/.github/workflows/docs.yml @@ -41,8 +41,8 @@ jobs: echo '::group::Build HTML docs' # The runner does not have sufficient memory to run with as many processes as their are - # cores (`-j auto`). Thus, we limit to 4 (`-j 4`) here. - sed -i -e 's/-j auto/-j 4/' Makefile + # cores (`-j auto`). Thus, we limit to a single process (`-j 1`) here. + sed -i -e 's/-j auto/-j 1/' Makefile make html echo '::endgroup::' From eb77d0f60ce1cc266888d6a83d21663d9dabf518 Mon Sep 17 00:00:00 2001 From: Philip Meier Date: Mon, 13 Mar 2023 21:23:32 +0100 Subject: [PATCH 08/12] try docs upload --- .github/workflows/docs.yml | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) diff --git a/.github/workflows/docs.yml b/.github/workflows/docs.yml index dad2266a0f3..576b892ce39 100644 --- a/.github/workflows/docs.yml +++ b/.github/workflows/docs.yml @@ -47,3 +47,27 @@ jobs: echo '::endgroup::' mv build/html "${RUNNER_ARTIFACT_DIR}" + + upload-preview: + if: github.event_name == 'pull_request' + needs: [build] + runs-on: ubuntu-latest + steps: + - uses: actions/download-artifact@v3 + with: + name: docs + + - name: Debug + run: | + sudo apt -y update && sudo apt -y install tree + ls -la + tree docs + + - name: Upload docs preview + uses: seemethere/upload-artifact-s3@v5 + with: + retention-days: 14 + s3-bucket: doc-previews + if-no-files-found: error + path: docs/build/html + s3-prefix: pytorch/vision/${{ github.event.pull_request.number }} From 0620cf6b5956e0feafe06c197270cd9ca86b859f Mon Sep 17 00:00:00 2001 From: Philip Meier Date: Mon, 13 Mar 2023 21:27:35 +0100 Subject: [PATCH 09/12] fix env var --- .github/workflows/docs.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/docs.yml b/.github/workflows/docs.yml index 576b892ce39..d27e82df98a 100644 --- a/.github/workflows/docs.yml +++ b/.github/workflows/docs.yml @@ -20,6 +20,7 @@ jobs: export PYTHON_VERSION=3.8 export GPU_ARCH_TYPE=cpu + export GPU_ARCH_VERSION='' ./.github/scripts/setup-env.sh # Prepare conda From 4506642b87037625fc399e71bd9f3865b41105ea Mon Sep 17 00:00:00 2001 From: Philip Meier Date: Mon, 13 Mar 2023 21:36:37 +0100 Subject: [PATCH 10/12] fix path --- .github/workflows/docs.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/docs.yml b/.github/workflows/docs.yml index d27e82df98a..e65f4c9ce7c 100644 --- a/.github/workflows/docs.yml +++ b/.github/workflows/docs.yml @@ -62,7 +62,7 @@ jobs: run: | sudo apt -y update && sudo apt -y install tree ls -la - tree docs + tree html - name: Upload docs preview uses: seemethere/upload-artifact-s3@v5 @@ -70,5 +70,5 @@ jobs: retention-days: 14 s3-bucket: doc-previews if-no-files-found: error - path: docs/build/html + path: html s3-prefix: pytorch/vision/${{ github.event.pull_request.number }} From 7b0ebd2d184c387077f51c6c09bb4a9cbbf0a5e9 Mon Sep 17 00:00:00 2001 From: Nikita Shulga Date: Wed, 15 Mar 2023 11:52:43 -0700 Subject: [PATCH 11/12] Update .github/workflows/docs.yml --- .github/workflows/docs.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/docs.yml b/.github/workflows/docs.yml index e65f4c9ce7c..b46cd9a69e2 100644 --- a/.github/workflows/docs.yml +++ b/.github/workflows/docs.yml @@ -52,7 +52,7 @@ jobs: upload-preview: if: github.event_name == 'pull_request' needs: [build] - runs-on: ubuntu-latest + runs-on: [self-hosted, linux.2xlarge] steps: - uses: actions/download-artifact@v3 with: From 64f77ff71f725b06d9076b7b75f30fccc381aba7 Mon Sep 17 00:00:00 2001 From: Nikita Shulga Date: Wed, 15 Mar 2023 12:02:38 -0700 Subject: [PATCH 12/12] Update .github/workflows/docs.yml --- .github/workflows/docs.yml | 6 ------ 1 file changed, 6 deletions(-) diff --git a/.github/workflows/docs.yml b/.github/workflows/docs.yml index b46cd9a69e2..22ff4ab84b3 100644 --- a/.github/workflows/docs.yml +++ b/.github/workflows/docs.yml @@ -58,12 +58,6 @@ jobs: with: name: docs - - name: Debug - run: | - sudo apt -y update && sudo apt -y install tree - ls -la - tree html - - name: Upload docs preview uses: seemethere/upload-artifact-s3@v5 with: