File: docs.yaml

package info (click to toggle)
pytorch-audio 2.9.1-1
  • links: PTS, VCS
  • area: main
  • in suites: experimental
  • size: 108,884 kB
  • sloc: python: 44,403; cpp: 3,384; sh: 126; makefile: 32
file content (81 lines) | stat: -rw-r--r-- 2,874 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
name: Docs

on:
  pull_request:
  push:
    branches:
      - nightly
      - main
      - release/*
  workflow_dispatch:

jobs:
  build:
    strategy:
      matrix:
        python-version: ["3.11"]
        cuda-version: ["12.6"]
        ffmpeg-version: ["7"]
      fail-fast: false
    uses: pytorch/test-infra/.github/workflows/linux_job_v2.yml@main
    permissions:
      id-token: write
      contents: read
    with:
      runner: linux.4xlarge.nvidia.gpu
      repository: pytorch/audio
      gpu-arch-type: cuda
      gpu-arch-version: ${{ matrix.cuda-version }}
      timeout: 120
      job-name: docs

      script: |
        set -ex
        # Set up Environment Variables
        export PYTHON_VERSION="${{ matrix.python-version }}"
        export FFMPEG_VERSION="${{ matrix.ffmpeg-version }}"
        export CU_VERSION_WITHOUT_PERIODS="$(echo "${{ matrix.cuda-version }}" | sed 's/\.//g')"
        export PIP_PROGRESS_BAR=off
        export CONDA_QUIET=1

        # Set UPLOAD_CHANNEL
        if [[(${GITHUB_EVENT_NAME} = 'pull_request' && (${GITHUB_BASE_REF} = 'release'*)) || (${GITHUB_REF} = 'refs/heads/release'*) ]]; then
          export UPLOAD_CHANNEL=test
        else
          export UPLOAD_CHANNEL=nightly
        fi

        echo "::group::Create conda env"
        # Mark Build Directory Safe
        git config --global --add safe.directory /__w/audio/audio
        conda create -c conda-forge --strict-channel-priority -y --prefix ci_env python="${PYTHON_VERSION}" ffmpeg="${FFMPEG_VERSION}" cmake ninja
        conda activate ./ci_env
        conda info
        python -m pip install --upgrade pip
        echo "::endgroup::"

        echo "::group::Install PyTorch and TorchCodec"
        PYTORCH_WHEEL_INDEX="https://download.pytorch.org/whl/${UPLOAD_CHANNEL}/cu${CU_VERSION_WITHOUT_PERIODS}"
        python -m pip install numpy
        python -m pip install --pre torch --index-url="${PYTORCH_WHEEL_INDEX}"
        python -m pip install --pre torchcodec --index-url="https://download.pytorch.org/whl/nightly/cu${CU_VERSION_WITHOUT_PERIODS}"
        python -c 'import torch; print(f"{torch.__version__}"); print(f"{torch.__file__}"); print(f"{torch.cuda.is_available()=}")'
        echo "::endgroup::"

        echo "::group::Build and install TorchAudio"
        python -m pip install . -v --no-build-isolation
        echo "::endgroup::"

        echo "::group::Install TorchAudio documentation build requirements"
        python -m pip install -r docs/requirements.txt -r docs/requirements-tutorials.txt
        echo "::endgroup::"

        echo "::group::Build TorchAudio documentation"
        export BUILD_GALLERY=true
        (cd docs && make html)
        echo "::endgroup::"

        echo "::group::Copy artifacts"
        cp -rf docs/build/html/* "${RUNNER_DOCS_DIR}"
        mv docs/build/html /artifacts/
        echo "::endgroup::"