forked from pytorch/TensorRT
-
Notifications
You must be signed in to change notification settings - Fork 1
94 lines (89 loc) · 4.09 KB
/
docgen.yml
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
82
83
84
85
86
87
88
89
90
91
92
93
94
# This is a basic workflow to help you get started with Actions
name: Generate Docs
# Controls when the action will run. Triggers the workflow on push or pull request
# events but only for the master branch
on:
push:
branches: [ main ]
jobs:
build-docs:
runs-on: ubuntu-20.04
container:
image: ghcr.io/pytorch/tensorrt/docgen:latest
credentials:
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
steps:
- name: Reclaim space
run: |
rm -rf /usr/share/dotnet
rm -rf /opt/ghc
rm -rf "/usr/local/share/boost"
rm -rf /usr/local/cuda/cuda-*
- name: Install base deps
run: |
apt update
DEBIAN_FRONTEND=noninteractive apt install -y software-properties-common gcc git curl wget make zlib1g-dev bzip2 libbz2-dev lzma lzma-dev libreadline-dev libsqlite3-dev libssl-dev libffi-dev doxygen pandoc
git config --global --add safe.directory '*'
- name: Set up Python 3.10.12
uses: actions/setup-python@v4
with:
python-version: 3.10.12
- uses: actions/checkout@v3
with:
ref: ${{github.head_ref}}
- name: Get HEAD SHA
id: vars
run: echo "sha=$(git rev-parse --short HEAD)" >> $GITHUB_OUTPUT
- name: Get Bazel version
id: bazel_info
run: echo "version=$(cat .bazelversion)" >> $GITHUB_OUTPUT
- name: Install Bazel
run: |
wget -q https://github.com/bazelbuild/bazel/releases/download/${{ steps.bazel_info.outputs.version }}/bazel-${{ steps.bazel_info.outputs.version }}-linux-x86_64 -O /usr/bin/bazel
chmod a+x /usr/bin/bazel
- name: Install cudnn + tensorrt
run: |
apt-get update
wget https://developer.download.nvidia.com/compute/cuda/repos/ubuntu2004/x86_64/cuda-ubuntu2004.pin
mv cuda-ubuntu2004.pin /etc/apt/preferences.d/cuda-repository-pin-600
apt-key adv --fetch-keys https://developer.download.nvidia.com/compute/cuda/repos/ubuntu2004/x86_64/7fa2af80.pub
apt-key adv --keyserver keyserver.ubuntu.com --recv-keys 536F8F1DE80F6A35
apt-key adv --keyserver keyserver.ubuntu.com --recv-keys A4B469963BF863CC
add-apt-repository "deb https://developer.download.nvidia.com/compute/cuda/repos/ubuntu2004/x86_64/ /"
apt-get update
apt-get install -y libcudnn8 libcudnn8-dev
apt-key adv --fetch-keys https://developer.download.nvidia.com/compute/cuda/repos/ubuntu2004/x86_64/3bf863cc.pub
add-apt-repository "deb https://developer.download.nvidia.com/compute/cuda/repos/ubuntu2004/x86_64/ /"
apt-get update
apt-get install -y libnvinfer8 libnvinfer-plugin8 libnvinfer-dev libnvinfer-plugin-dev
- name: Install Torch
run: |
python3 -m pip install -r py/requirements.txt --user
- name: Build Python Package
run: |
cp toolchains/ci_workspaces/WORKSPACE.x86_64 WORKSPACE
cd py
python3 -m pip install pip==21.3.1
echo $(which python3)
echo $(python3 -c 'import site; print(site.getsitepackages()[0])')
mkdir -p /opt/circleci/.pyenv/versions/3.9.4/lib/python3.9/
ln -s $(python3 -c 'import site; print(site.getsitepackages()[0])') /opt/circleci/.pyenv/versions/3.9.4/lib/python3.9/site-packages
python3 setup.py install
cd ..
- name: Generate New Docs
run: |
cd docsrc
python3 -m pip install -r requirements.txt
python3 -c "import torch_tensorrt; print(torch_tensorrt.__version__)"
make html
cd ..
- uses: stefanzweifel/git-auto-commit-action@v4
with:
# Required
commit_message: "docs: [Automated] Regenerating documenation for ${{ steps.vars.outputs.sha }}"
commit_options: "--no-verify --signoff"
file_pattern: docs/
commit_user_name: Torch-TensorRT Github Bot
commit_user_email: [email protected]
commit_author: Torch-TensorRT Github Bot <[email protected]>