44
55export BUCKET_NAME=pytorch-tutorial-build-pull-request
66
7+ # Set build prefix based on whether this is a nightly build or not
8+ # This prevents conflicts when both builds run simultaneously
9+ if [ " ${USE_NIGHTLY:- 0} " -eq 1 ]; then
10+ export BUILD_PREFIX=" nightly"
11+ else
12+ export BUILD_PREFIX=" stable"
13+ fi
14+
715# set locale for click dependency in spacy
816export LC_ALL=C.UTF-8
917export LANG=C.UTF-8
@@ -122,7 +130,7 @@ if [[ "${JOB_TYPE}" == "worker" ]]; then
122130 # Step 6: Copy generated files to S3, tag with commit ID
123131 if [ " ${UPLOAD:- 0} " -eq 1 ]; then
124132 7z a worker_${WORKER_ID} .7z docs
125- awsv2 s3 cp worker_${WORKER_ID} .7z s3://${BUCKET_NAME} /${COMMIT_ID} /worker_${WORKER_ID} .7z
133+ awsv2 s3 cp worker_${WORKER_ID} .7z s3://${BUCKET_NAME} /${BUILD_PREFIX} / ${ COMMIT_ID} /worker_${WORKER_ID} .7z
126134 fi
127135elif [[ " ${JOB_TYPE} " == " manager" ]]; then
128136 # Step 1: Generate no-plot HTML pages for all tutorials
@@ -136,7 +144,7 @@ elif [[ "${JOB_TYPE}" == "manager" ]]; then
136144 # Step 3: Download generated with-plot HTML files and static files from S3, merge into one folder
137145 mkdir -p docs_with_plot/docs
138146 for (( worker_id= 1 ;worker_id< NUM_WORKERS+ 1 ;worker_id++ )) ; do
139- awsv2 s3 cp s3://${BUCKET_NAME} /${COMMIT_ID} /worker_$worker_id .7z worker_$worker_id .7z
147+ awsv2 s3 cp s3://${BUCKET_NAME} /${BUILD_PREFIX} / ${ COMMIT_ID} /worker_$worker_id .7z worker_$worker_id .7z
140148 7z x worker_$worker_id .7z -oworker_$worker_id
141149 yes | cp -R worker_$worker_id /docs/* docs_with_plot/docs
142150 done
@@ -153,7 +161,7 @@ elif [[ "${JOB_TYPE}" == "manager" ]]; then
153161
154162 # Step 6: Copy generated HTML files and static files to S3
155163 7z a manager.7z docs
156- awsv2 s3 cp manager.7z s3://${BUCKET_NAME} /${COMMIT_ID} /manager.7z
164+ awsv2 s3 cp manager.7z s3://${BUCKET_NAME} /${BUILD_PREFIX} / ${ COMMIT_ID} /manager.7z
157165
158166 # Step 7: push new HTML files and static files to gh-pages
159167 if [[ " $COMMIT_SOURCE " == " refs/heads/master" || " $COMMIT_SOURCE " == " refs/heads/main" ]]; then
0 commit comments