Skip to content

Commit 69a31bb

Browse files
authored
[BugFix] Deploy doc (#920)
1 parent 3e7e4b3 commit 69a31bb

File tree

1 file changed

+65
-35
lines changed

1 file changed

+65
-35
lines changed

.github/workflows/docs.yml

Lines changed: 65 additions & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -10,53 +10,83 @@ on:
1010
workflow_dispatch:
1111
jobs:
1212
build_docs_job:
13-
strategy:
14-
matrix:
15-
python_version: ["3.8"] # "3.8", "3.9", "3.10", "3.11"
16-
cuda_arch_version: ["11.8"] # "11.6", "11.7"
17-
fail-fast: false
18-
uses: pytorch/test-infra/.github/workflows/linux_job.yml@main
19-
with:
20-
runner: linux.g5.4xlarge.nvidia.gpu
21-
repository: pytorch/rl
22-
gpu-arch-type: cuda
23-
gpu-arch-version: ${{ matrix.cuda_arch_version }}
24-
docker-image: nvidia/cudagl:11.4.0-base
25-
timeout: 45
26-
script: |
27-
# Set env vars from matrix
28-
export PYTHON_VERSION=${{ matrix.python_version }}
29-
# Commenting these out for now because the GPU test are not working inside docker
30-
export CUDA_ARCH_VERSION=${{ matrix.cuda_arch_version }}
31-
export CU_VERSION="cu${CUDA_ARCH_VERSION:0:2}${CUDA_ARCH_VERSION:3:1}"
32-
# Remove the following line when the GPU tests are working inside docker, and uncomment the above lines
33-
#export CU_VERSION="cpu"
34-
35-
echo "PYTHON_VERSION: $PYTHON_VERSION"
36-
echo "CU_VERSION: $CU_VERSION"
37-
38-
cd /work
39-
40-
## setup_env.sh
41-
./.circleci/docs/setup_env.sh
42-
43-
deploy:
44-
needs: build_docs_job
4513
runs-on: ubuntu-20.04
4614
strategy:
4715
matrix:
4816
include:
49-
- os: linux.12xlarge
17+
- os: linux.g5.4xlarge.nvidia.gpu
5018
python-version: 3.8
5119
defaults:
5220
run:
5321
shell: bash -l {0}
54-
container: nvidia/cuda:11.8.0-cudnn8-devel-ubuntu18.04
22+
container: nvidia/cudagl:11.4.0-base
5523
steps:
24+
- name: Install deps
25+
run: |
26+
apt-get update && apt-get install -y git wget gcc g++
5627
- name: Checkout
5728
uses: actions/checkout@v3
29+
# Update references
30+
- name: Setup conda
31+
run: |
32+
root_dir="$(pwd)"
33+
conda_dir="${root_dir}/conda"
34+
env_dir="${root_dir}/env"
35+
os=Linux
36+
# 1. Install conda at ./conda
37+
printf "* Installing conda\n"
38+
wget -O miniconda.sh "http://repo.continuum.io/miniconda/Miniconda3-latest-${os}-x86_64.sh"
39+
bash ./miniconda.sh -b -f -p "${conda_dir}"
40+
eval "$(${conda_dir}/bin/conda shell.bash hook)"
41+
printf "* Creating a test environment\n"
42+
conda create --prefix "${env_dir}" -y python="$PYTHON_VERSION"
43+
printf "* Activating\n"
44+
conda activate "${env_dir}"
45+
- name: Update pip
46+
run: |
47+
apt-get install python3.8 python3-pip -y
48+
pip3 install --upgrade pip
49+
- name: check python version
50+
run: |
51+
python3 --version
52+
- name: Check git version
53+
run: git version
54+
- name: Install PyTorch
55+
shell: bash
56+
run: |
57+
pip3 install --pre torch torchvision --index-url https://download.pytorch.org/whl/nightly/cu118 --quiet --root-user-action=ignore
58+
- name: Install tensordict
59+
run: |
60+
pip3 install git+https://github.com/pytorch-labs/tensordict.git --quiet --root-user-action=ignore
61+
- name: Install TorchRL
62+
run: |
63+
pip3 install -e . --quiet --root-user-action=ignore
64+
- name: Install requirements
65+
run: |
66+
pip3 install -r docs/requirements.txt --quiet --root-user-action=ignore
67+
- name: Test torchrl installation
68+
shell: bash
69+
run: |
70+
mkdir _tmp
71+
cd _tmp
72+
PYOPENGL_PLATFORM=egl MUJOCO_GL=egl python3 -c """from torchrl.envs.libs.dm_control import DMControlEnv
73+
print(DMControlEnv('cheetah', 'run').reset())"""
74+
cd ..
75+
- name: Build the docset
76+
id: build_doc
77+
run: |
78+
cd ./docs
79+
#timeout 7m bash -ic "MUJOCO_GL=egl sphinx-build ./source _local_build" || code=$?; if [[ $code -ne 124 && $code -ne 0 ]]; then exit $code; fi
80+
PYOPENGL_PLATFORM=egl MUJOCO_GL=egl sphinx-build ./source _local_build
81+
cd ..
82+
- name: Pull TensorDict docs
83+
run: |
84+
git clone --branch gh-pages https://github.com/pytorch-labs/tensordict.git docs/_local_build/tensordict
85+
rm -rf docs/_local_build/tensordict/.git
86+
- name: Get output time
87+
run: echo "The time was ${{ steps.build.outputs.time }}"
5888
- name: Deploy
59-
if: ${{ github.ref == 'refs/heads/main' || github.event_name == 'workflow_dispatch' }}
89+
if: ${{ github.ref == 'refs/heads/main' }}
6090
uses: JamesIves/github-pages-deploy-action@releases/v4
6191
with:
6292
token: ${{ secrets.GITHUB_TOKEN }}

0 commit comments

Comments
 (0)