Skip to content

: bootstrap: integrate ProcHandle in BootstrapProcManager #2364

: bootstrap: integrate ProcHandle in BootstrapProcManager

: bootstrap: integrate ProcHandle in BootstrapProcManager #2364

Workflow file for this run

name: Docs
on:
push:
branches:
- main
pull_request:
workflow_dispatch:
concurrency:
group: docs-${{ github.workflow }}-${{ github.ref == 'refs/heads/main' && github.run_number || github.ref }}
cancel-in-progress: true
jobs:
build-and-deploy:
name: Build and Deploy Documentation
uses: pytorch/test-infra/.github/workflows/linux_job_v2.yml@main
with:
timeout: 120
runner: linux.g5.4xlarge.nvidia.gpu
gpu-arch-type: cuda
gpu-arch-version: "12.6"
submodules: recursive
upload-artifact: docs
script: |
# Source common setup functions
source scripts/common-setup.sh
# Setup build environment (conda + system deps + rust + build deps)
# docs build will use 3.13
setup_build_environment 3.13
# Setup Tensor Engine
setup_tensor_engine
# Setup Python dependencies
python -m pip install --upgrade pip
pip install -r build-requirements.txt
pip install -r docs/requirements.txt
# Install PyTorch with CUDA support (matching build-cuda.yml)
pip install --pre torch --index-url https://download.pytorch.org/whl/nightly/cu126
# Set environment variables for CUDA build
export USE_CUDA=1
export USE_TENSOR_ENGINE=1
export RUSTFLAGS="-Zthreads=16"
export _GLIBCXX_USE_CXX11_ABI=1
export CUDA_LIB_DIR=/usr/lib64
# Build Monarch completely for documentation - use dedicated script
./scripts/build_monarch_for_docs.sh
# Generate documentation for all workspace crates
cargo doc --workspace --no-deps
# Prepare documentation structure for Sphinx and final output
mkdir -p docs/source/target
cp -r target/doc docs/source/target/
# Build Sphinx documentation with error detection
echo "Building Sphinx documentation..."
cd docs
make clean
make html SPHINXOPTS="-v --keep-going"
cd ..
# Copy Rust API docs to final location
mkdir -p docs/build/html/rust-api
cp -r target/doc/* docs/build/html/rust-api/
# Copy documentation to artifact directory
mkdir -p ${RUNNER_ARTIFACT_DIR}
cp -r docs/build/html ${RUNNER_ARTIFACT_DIR}/docs-html
deploy:
needs: build-and-deploy
if: github.ref == 'refs/heads/main'
permissions:
pages: write
id-token: write
environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}
runs-on: ubuntu-latest
steps:
- name: Download build artifact
uses: actions/download-artifact@v4
with:
name: docs
path: .
- name: Upload Pages artifact
uses: actions/upload-pages-artifact@v3
with:
path: docs-html
- name: Deploy to GitHub Pages
id: deployment
uses: actions/deploy-pages@v4