File tree Expand file tree Collapse file tree 4 files changed +16
-4
lines changed Expand file tree Collapse file tree 4 files changed +16
-4
lines changed Original file line number Diff line number Diff line change 77 description : " Use nightly builds inside build.sh"
88 required : false
99 type : number
10- default : false
10+ default : 0
11+ UPLOAD :
12+ description : " Upload built docs to PR preview and main site"
13+ required : false
14+ type : number
15+ default : 0
1116
1217concurrency :
1318 group : ${{ github.workflow }}-${{ github.event.pull_request.number || github.sha }}-${{ github.event_name == 'workflow_dispatch' }}-${{ github.event_name == 'schedule' }}
7782 JOB_TYPE : worker
7883 COMMIT_SOURCE : ${{ github.ref }}
7984 USE_NIGHTLY : ${{ inputs.USE_NIGHTLY }}
85+ UPLOAD : ${{ inputs.UPLOAD }}
8086 run : |
8187 set -ex
8288
9096 -e JOB_TYPE \
9197 -e COMMIT_SOURCE \
9298 -e USE_NIGHTLY \
99+ -e UPLOAD \
93100 --env-file="/tmp/github_env_${GITHUB_RUN_ID}" \
94101 --tty \
95102 --detach \
@@ -110,6 +117,7 @@ jobs:
110117 name : pytorch_tutorial_build_manager
111118 needs : worker
112119 runs-on : [self-hosted, linux.2xlarge]
120+ if : ${{ inputs.UPLOAD == 1 }}
113121 environment : ${{ github.ref == 'refs/heads/main' && 'pytorchbot-env' || '' }}
114122 steps :
115123 - name : Setup SSH (Click me for login details)
Original file line number Diff line number Diff line change 1616 secrets : inherit
1717 with :
1818 USE_NIGHTLY : 1
19+ UPLOAD : 0
Original file line number Diff line number Diff line change 1616 secrets : inherit
1717 with :
1818 USE_NIGHTLY : 0
19+ UPLOAD : 1
Original file line number Diff line number Diff line change @@ -20,7 +20,7 @@ sudo apt-get install -y pandoc
2020# export PATH=/opt/conda/bin:$PATH
2121
2222# Install PyTorch Nightly for test.
23- if [ " $USE_NIGHTLY " -eq 1 ]; then
23+ if [ " ${ USE_NIGHTLY:- 0} " -eq 1 ]; then
2424 sudo pip uninstall -y torch
2525 pip install --pre torch --index-url https://download.pytorch.org/whl/nightly/cu130
2626 pip show torch
@@ -120,8 +120,10 @@ if [[ "${JOB_TYPE}" == "worker" ]]; then
120120 python .jenkins/validate_tutorials_built.py
121121
122122 # Step 6: Copy generated files to S3, tag with commit ID
123- 7z a worker_${WORKER_ID} .7z docs
124- awsv2 s3 cp worker_${WORKER_ID} .7z s3://${BUCKET_NAME} /${COMMIT_ID} /worker_${WORKER_ID} .7z
123+ if [ " ${UPLOAD:- 0} " -eq 1 ]; then
124+ 7z a worker_${WORKER_ID} .7z docs
125+ awsv2 s3 cp worker_${WORKER_ID} .7z s3://${BUCKET_NAME} /${COMMIT_ID} /worker_${WORKER_ID} .7z
126+ fi
125127elif [[ " ${JOB_TYPE} " == " manager" ]]; then
126128 # Step 1: Generate no-plot HTML pages for all tutorials
127129 pip3 install -e git+https://github.com/pytorch/pytorch_sphinx_theme.git#egg=pytorch_sphinx_theme
You can’t perform that action at this time.
0 commit comments