66 export BUCKET_NAME=pytorch-tutorial-build-pull-request
77fi
88
9+ # set locale for click dependency in spacy
10+ export LC_ALL=C.UTF-8
11+ export LANG=C.UTF-8
12+
913DIR=" $( cd " $( dirname " ${BASH_SOURCE[0]} " ) " > /dev/null && pwd ) "
1014
1115sudo apt-get update
@@ -15,8 +19,14 @@ export PATH=/opt/conda/bin:$PATH
1519rm -rf src
1620pip install -r $DIR /../requirements.txt
1721
18- export PATH=/opt/conda/bin:$PATH
19- pip install sphinx==1.8.2 pandas
22+ # export PATH=/opt/conda/bin:$PATH
23+ # pip install sphinx==1.8.2 pandas
24+
25+ # Install PyTorch Nightly for test.
26+ # Nightly - pip install --pre torch torchvision torchaudio -f https://download.pytorch.org/whl/nightly/cu102/torch_nightly.html
27+ # RC Link
28+ # pip uninstall -y torch torchvision torchaudio torchtext
29+ # pip install -f https://download.pytorch.org/whl/test/cu102/torch_test.html torch torchvision torchaudio torchtext
2030
2131# For Tensorboard. Until 1.14 moves to the release channel.
2232pip install tb-nightly
@@ -28,9 +38,7 @@ python -m spacy download de
2838# PyTorch Theme
2939rm -rf src
3040pip install -e git+git://github.com/pytorch/pytorch_sphinx_theme.git#egg=pytorch_sphinx_theme
31- # pillow >= 4.2 will throw error when trying to write mode RGBA as JPEG,
32- # this is a workaround to the issue.
33- pip install sphinx-gallery==0.3.1 tqdm matplotlib ipython pillow==4.1.1
41+ pip install sphinx-gallery==0.3.1 tqdm matplotlib ipython pillow==8.1.0
3442
3543aws configure set default.s3.multipart_threshold 5120MB
3644
@@ -39,6 +47,11 @@ export NUM_WORKERS=20
3947if [[ " ${JOB_BASE_NAME} " == * worker_* ]]; then
4048 # Step 1: Remove runnable code from tutorials that are not supposed to be run
4149 python $DIR /remove_runnable_code.py beginner_source/aws_distributed_training_tutorial.py beginner_source/aws_distributed_training_tutorial.py || true
50+ # python $DIR/remove_runnable_code.py advanced_source/ddp_pipeline_tutorial.py advanced_source/ddp_pipeline_tutorial.py || true
51+ # Temp remove for mnist download issue. (Re-enabled for 1.8.1)
52+ # python $DIR/remove_runnable_code.py beginner_source/fgsm_tutorial.py beginner_source/fgsm_tutorial.py || true
53+ # python $DIR/remove_runnable_code.py intermediate_source/spatial_transformer_tutorial.py intermediate_source/spatial_transformer_tutorial.py || true
54+
4255 # TODO: Fix bugs in these tutorials to make them runnable again
4356 # python $DIR/remove_runnable_code.py beginner_source/audio_classifier_tutorial.py beginner_source/audio_classifier_tutorial.py || true
4457
@@ -76,6 +89,26 @@ if [[ "${JOB_BASE_NAME}" == *worker_* ]]; then
7689 FILES_TO_RUN+=($( basename $filename .py) )
7790 fi
7891 count=$(( count+ 1 ))
92+ done
93+ for filename in $( find recipes_source/ -name ' *.py' -not -path ' */data/*' ) ; do
94+ if [ $(( $count % $NUM_WORKERS )) != $WORKER_ID ]; then
95+ echo " Removing runnable code from " $filename
96+ python $DIR /remove_runnable_code.py $filename $filename
97+ else
98+ echo " Keeping " $filename
99+ FILES_TO_RUN+=($( basename $filename .py) )
100+ fi
101+ count=$(( count+ 1 ))
102+ done
103+ for filename in $( find prototype_source/ -name ' *.py' -not -path ' */data/*' ) ; do
104+ if [ $(( $count % $NUM_WORKERS )) != $WORKER_ID ]; then
105+ echo " Removing runnable code from " $filename
106+ python $DIR /remove_runnable_code.py $filename $filename
107+ else
108+ echo " Keeping " $filename
109+ FILES_TO_RUN+=($( basename $filename .py) )
110+ fi
111+ count=$(( count+ 1 ))
79112 done
80113 echo " FILES_TO_RUN: " ${FILES_TO_RUN[@]}
81114
@@ -84,13 +117,13 @@ if [[ "${JOB_BASE_NAME}" == *worker_* ]]; then
84117
85118 # Step 4: If any of the generated files are not related the tutorial files we want to run,
86119 # then we remove them
87- for filename in $( find docs/beginner docs/intermediate docs/advanced -name ' *.html' ) ; do
120+ for filename in $( find docs/beginner docs/intermediate docs/advanced docs/recipes docs/prototype -name ' *.html' ) ; do
88121 file_basename=$( basename $filename .html)
89122 if [[ ! " ${FILES_TO_RUN[@]} " =~ " ${file_basename} " ]]; then
90123 rm $filename
91124 fi
92125 done
93- for filename in $( find docs/beginner docs/intermediate docs/advanced -name ' *.rst' ) ; do
126+ for filename in $( find docs/beginner docs/intermediate docs/advanced docs/recipes docs/prototype -name ' *.rst' ) ; do
94127 file_basename=$( basename $filename .rst)
95128 if [[ ! " ${FILES_TO_RUN[@]} " =~ " ${file_basename} " ]]; then
96129 rm $filename
@@ -108,13 +141,13 @@ if [[ "${JOB_BASE_NAME}" == *worker_* ]]; then
108141 rm $filename
109142 fi
110143 done
111- for filename in $( find docs/_sources/beginner docs/_sources/intermediate docs/_sources/advanced -name ' *.rst.txt' ) ; do
144+ for filename in $( find docs/_sources/beginner docs/_sources/intermediate docs/_sources/advanced docs/_sources/recipes -name ' *.rst.txt' ) ; do
112145 file_basename=$( basename $filename .rst.txt)
113146 if [[ ! " ${FILES_TO_RUN[@]} " =~ " ${file_basename} " ]]; then
114147 rm $filename
115148 fi
116149 done
117- for filename in $( find docs/.doctrees/beginner docs/.doctrees/intermediate docs/.doctrees/advanced -name ' *.doctree' ) ; do
150+ for filename in $( find docs/.doctrees/beginner docs/.doctrees/intermediate docs/.doctrees/advanced docs/.doctrees/recipes docs/.doctrees/prototype -name ' *.doctree' ) ; do
118151 file_basename=$( basename $filename .doctree)
119152 if [[ ! " ${FILES_TO_RUN[@]} " =~ " ${file_basename} " ]]; then
120153 rm $filename
0 commit comments