Skip to content

Commit 634df21

Browse files
authored
Merge pull request pytorch#232 from pjh5/circle
Fixing libtorch s3 dir in smoke tests
2 parents b03aeb5 + 31654b0 commit 634df21

File tree

1 file changed

+23
-7
lines changed

1 file changed

+23
-7
lines changed

smoke_test.sh

Lines changed: 23 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,15 @@ if [[ "$DATE" == 'today' ]]; then
99
DATE="$(date +%Y%m%d)"
1010
fi
1111

12+
# Helper variables for logging
13+
date_under="${DATE:1:4}_${DATE:4:2}_${DATE:6:2}"
14+
if [[ "$(uname)" == 'Darwin' ]]; then
15+
macos_or_linux='macos'
16+
else
17+
macos_or_linux='linux'
18+
fi
19+
log_url="https://download.pytorch.org/nightly_logs/$macos_or_linux/$date_under/${PACKAGE_TYPE}_${DESIRED_PYTHON}_${DESIRED_CUDA}.log"
20+
1221
# DESIRED_PYTHON is in format 2.7m?u?
1322
# DESIRED_CUDA is in format cu80 (or 'cpu')
1423

@@ -76,7 +85,12 @@ which python
7685
if [[ "$PACKAGE_TYPE" == 'conda' ]]; then
7786
conda search -c pytorch "$package_name"
7887
else
79-
curl "https://download.pytorch.org/whl/nightly/$DESIRED_CUDA/torch_nightly.html" -v
88+
if [[ "$PACKAGE_TYPE" == 'libtorch' ]]; then
89+
s3_dir='libtorch'
90+
else
91+
s3_dir='whl'
92+
fi
93+
curl "https://download.pytorch.org/$s3_dir/nightly/$DESIRED_CUDA/torch_nightly.html" -v
8094
fi
8195

8296
# Install the package for the requested date
@@ -88,7 +102,7 @@ if [[ "$PACKAGE_TYPE" == 'conda' ]]; then
88102
fi
89103
else
90104
pip install "$package_name_and_version" \
91-
-f "https://download.pytorch.org/whl/nightly/$DESIRED_CUDA/torch_nightly.html" \
105+
-f "https://download.pytorch.org/$s3_dir/nightly/$DESIRED_CUDA/torch_nightly.html" \
92106
--no-cache-dir \
93107
--no-index \
94108
-v
@@ -117,6 +131,12 @@ if [[ "$PACKAGE_TYPE" == 'conda' ]]; then
117131
fi
118132
fi
119133

134+
if [[ "$PACKAGE_TYPE" == 'libtorch' ]]; then
135+
echo "For libtorch we only test that the download works"
136+
echo "The logfile for this run can be found at $log_url"
137+
exit 0
138+
fi
139+
120140
# Quick smoke test that it works
121141
echo "Smoke testing imports"
122142
python -c 'import torch'
@@ -191,8 +211,4 @@ else
191211
fi
192212

193213
# Echo the location of the logs
194-
if [[ "$(uname)" == 'Darwin' ]]; then
195-
echo "The logfile for this run can be found at https://download.pytorch.org/nightly_logs/macos/${DATE:1:4}_${DATE:4:2}_${DATE:6:2}"/${PACKAGE_TYPE}_${DESIRED_PYTHON}_cpu.log"
196-
else
197-
echo "The logfile for this run can be found at https://download.pytorch.org/nightly_logs/linux/${DATE:1:4}_${DATE:4:2}_${DATE:6:2}"/${PACKAGE_TYPE}_${DESIRED_PYTHON}_${DESIRED_CUDA}.log"
198-
fi
214+
echo "The logfile for this run can be found at $log_url"

0 commit comments

Comments
 (0)