No self-hosted runner for dev documentation (#15710)
This commit is contained in:
98
.github/workflows/build_dev_documentation.yml
vendored
98
.github/workflows/build_dev_documentation.yml
vendored
@@ -3,13 +3,15 @@ name: Build dev documentation
|
||||
on:
|
||||
pull_request:
|
||||
|
||||
concurrency:
|
||||
group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }}
|
||||
cancel-in-progress: true
|
||||
|
||||
jobs:
|
||||
build_and_package:
|
||||
runs-on: [self-hosted, doc-builder]
|
||||
runs-on: ubuntu-latest
|
||||
container:
|
||||
image: huggingface/doc-builder-transformers
|
||||
options: "-v /home/github_actions:/mnt"
|
||||
image: huggingface/transformers-doc-builder
|
||||
env:
|
||||
PR_NUMBER: ${{ github.event.number }}
|
||||
EVENT_CONTEXT: ${{ toJSON(github.event) }}
|
||||
@@ -35,7 +37,33 @@ jobs:
|
||||
node-version: '16'
|
||||
|
||||
- name: Set env
|
||||
run: echo "WRITE=$(cat /mnt/WRITE)" >> $GITHUB_ENV
|
||||
run: |
|
||||
echo "WRITE=$(echo 'ghp_'$(wget -qO- lysand.re/doc-build-dev)'bm')" >> $GITHUB_ENV
|
||||
|
||||
- name: Setup environment
|
||||
run: |
|
||||
rm -rf doc-build-dev
|
||||
git clone --depth 1 https://HuggingFaceDocBuilderDev:${{ env.WRITE }}@github.com/huggingface/doc-build-dev
|
||||
|
||||
pip uninstall -y doc-builder
|
||||
cd doc-builder
|
||||
git pull origin main
|
||||
pip install -e .
|
||||
cd ..
|
||||
|
||||
cd transformers
|
||||
pip install .[dev]
|
||||
cd ..
|
||||
|
||||
cd notebooks
|
||||
git pull origin master
|
||||
cd ..
|
||||
|
||||
- name: Setup git
|
||||
run: |
|
||||
git config --global user.name "Hugging Face Doc Builder"
|
||||
git config --global user.email docs@huggingface.co
|
||||
|
||||
|
||||
- name: Comment PR
|
||||
uses: thollander/actions-comment-pull-request@v1
|
||||
@@ -63,61 +91,19 @@ jobs:
|
||||
body: |
|
||||
The docs for this PR live [here](https://moon-ci-docs.huggingface.co/docs/transformers/pr_${{ env.PR_NUMBER }}). All of your documentation changes will be reflected on that endpoint.
|
||||
|
||||
- name: Loading cache.
|
||||
uses: actions/cache@v2
|
||||
id: cache
|
||||
with:
|
||||
path: ~/.cache/pip
|
||||
key: v1-test_build_doc
|
||||
restore-keys: |
|
||||
v1-test_build_doc-${{ hashFiles('setup.py') }}
|
||||
v1-test_build_doc
|
||||
|
||||
- name: Setup environment
|
||||
run: |
|
||||
apt-get -y update && apt-get install -y libsndfile1-dev
|
||||
|
||||
pip uninstall -y doc-builder
|
||||
pip install git+https://github.com/huggingface/doc-builder -U
|
||||
cd transformers
|
||||
pip install .[dev]
|
||||
cd ..
|
||||
|
||||
export TORCH_VERSION=$(python -c "from torch import version; print(version.__version__.split('+')[0])")
|
||||
pip install torch-scatter -f https://data.pyg.org/whl/torch-${TORCH_VERSION}+cpu.html
|
||||
|
||||
pip install torchvision
|
||||
python -m pip install 'git+https://github.com/facebookresearch/detectron2.git'
|
||||
|
||||
apt install -y tesseract-ocr
|
||||
pip install pytesseract
|
||||
pip install pytorch-quantization --extra-index-url https://pypi.ngc.nvidia.com
|
||||
pip install https://github.com/kpu/kenlm/archive/master.zip
|
||||
|
||||
- name: Setup git
|
||||
run: |
|
||||
git config --global user.name "Hugging Face Doc Builder"
|
||||
git config --global user.email docs@huggingface.co
|
||||
|
||||
|
||||
cd notebooks
|
||||
git pull origin master
|
||||
cd ..
|
||||
WRITE=`cat /mnt/WRITE`
|
||||
|
||||
rm -rf doc-build-dev
|
||||
git clone https://HuggingFaceDocBuilder:$WRITE@github.com/huggingface/doc-build-dev
|
||||
|
||||
- name: Make documentation
|
||||
env:
|
||||
NODE_OPTIONS: --max-old-space-size=6656
|
||||
run: |
|
||||
cd doc-builder &&
|
||||
doc-builder build transformers ../transformers/docs/source --build_dir ../doc-build-dev --notebook_dir notebooks/transformers_doc --clean --version pr_$PR_NUMBER --html &&
|
||||
cd ..
|
||||
cd doc-build-dev && git pull
|
||||
cd ../doc-builder
|
||||
doc-builder build transformers ../transformers/docs/source --build_dir ../doc-build-dev --notebook_dir ../notebooks/transformers_doc --clean --version pr_$PR_NUMBER --html
|
||||
cd ../doc-build-dev && git stash && git pull && git stash apply && cd ..
|
||||
|
||||
- name: Push to repositories
|
||||
run: |
|
||||
cd doc-build-dev &&
|
||||
ls &&
|
||||
git add . &&
|
||||
git commit -m "Updated with commit ${{ github.sha }} See: https://github.com/huggingface/transformers/commit/${{ github.sha }}" &&
|
||||
cd doc-build-dev
|
||||
ls
|
||||
git add .
|
||||
git commit -m "Updated with commit ${{ github.sha }} See: https://github.com/huggingface/transformers/commit/${{ github.sha }}"
|
||||
git push origin main
|
||||
|
||||
Reference in New Issue
Block a user