Skip to content

Commit a4d8353

Browse files
authored
Merge pull request pytorch#192 from pjh5/upload_logs_fix
Fixing credentials to upload_logs
2 parents 9d97cad + 1eaf09e commit a4d8353

File tree

4 files changed

+19
-9
lines changed

4 files changed

+19
-9
lines changed

cron/build_cron.sh

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -158,21 +158,21 @@ if [[ "$NIGHTLIES_DATE" == "$(date +%Y_%m_%d)" ]]; then
158158
echo "Uploading all of these succesful jobs\n: $succeeded_jobs"
159159
"${NIGHTLIES_BUILDER_ROOT}/cron/upload.sh" ${succeeded_jobs[@]} > "${log_root}/upload.log" 2>&1
160160
ret="$?"
161-
if [[ "$first_ret" == 0 ]]; then
161+
if [[ "$ret" != 0 && "$first_ret" == 0 ]]; then
162162
echo "FAILED upload.sh"
163163
first_ret="$ret"
164164
fi
165165
166166
# Upload the logs
167-
"${NIGHTLIES_BUILDER_ROOT}/cron/upload_logs.sh"
167+
"${NIGHTLIES_BUILDER_ROOT}/cron/upload_logs.sh" > "${log_root}/upload_logs.log" 2>&1
168168
ret="$?"
169-
if [[ "$first_ret" == 0 ]]; then
169+
if [[ "$ret" != 0 && "$first_ret" == 0 ]]; then
170170
echo "FAILED upload_logs.sh"
171171
first_ret="$ret"
172172
fi
173-
"${NIGHTLIES_BUILDER_ROOT}/cron/update_hud.sh"
173+
"${NIGHTLIES_BUILDER_ROOT}/cron/update_hud.sh" > "${log_root}/update_hud.log" 2>&1
174174
ret="$?"
175-
if [[ "$first_ret" == 0 ]]; then
175+
if [[ "$ret" != 0 && "$first_ret" == 0 ]]; then
176176
echo "FAILED update_hud.sh"
177177
first_ret="$ret"
178178
fi
@@ -182,7 +182,7 @@ fi
182182
# out of memory
183183
"${NIGHTLIES_BUILDER_ROOT}/cron/clean.sh" > "${log_root}/clean.sh" 2>&1
184184
ret="$?"
185-
if [[ "$first_ret" == 0 ]]; then
185+
if [[ "$ret" != 0 && "$first_ret" == 0 ]]; then
186186
echo "FAILED clean.sh"
187187
first_ret="$ret"
188188
fi

cron/nightly_defaults.sh

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,11 @@ if [[ -z "$PYTORCH_CREDENTIALS_FILE" ]]; then
2424
fi
2525
fi
2626

27+
# Location of the temporary miniconda that is downloaded to install conda-build
28+
# and aws to upload finished packages TODO this is messy to install this in
29+
# upload.sh and later use it in upload_logs.sh
30+
CONDA_UPLOADER_INSTALLATION="${today}/miniconda"
31+
2732
# NIGHTLIES_FOLDER
2833
# N.B. this is also defined in cron_start.sh
2934
# An arbitrary root folder to store all nightlies folders, each of which is a

cron/upload.sh

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -52,17 +52,16 @@ anaconda upload -h >/dev/null
5252
ret2="$?"
5353
set -e
5454
if [[ "$ret" -ne 0 || "$ret1" -ne 0 || "$ret2" -ne 0 ]]; then
55-
tmp_conda="${today}/miniconda"
5655
miniconda_sh="${today}/miniconda.sh"
5756
if [[ "$(uname)" == 'Darwin' ]]; then
5857
curl https://repo.continuum.io/miniconda/Miniconda3-latest-MacOSX-x86_64.sh -o "$miniconda_sh"
5958
else
6059
curl https://repo.continuum.io/miniconda/Miniconda3-latest-Linux-x86_64.sh -o "$miniconda_sh"
6160
fi
6261
chmod +x "$miniconda_sh" && \
63-
"$miniconda_sh" -b -p "$tmp_conda" && \
62+
"$miniconda_sh" -b -p "$CONDA_UPLOADER_INSTALLATION" && \
6463
rm "$miniconda_sh"
65-
export PATH="$tmp_conda/bin:$PATH"
64+
export PATH="$CONDA_UPLOADER_INSTALLATION/bin:$PATH"
6665

6766
# Install aws and anaconda client
6867
pip install awscli

cron/upload_logs.sh

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,12 @@ echo "upload_logs.sh at $(pwd) starting at $(date) on $(uname -a) with pid $$"
55
SOURCE_DIR=$(cd $(dirname $0) && pwd)
66
source "${SOURCE_DIR}/nightly_defaults.sh"
77

8+
# Source the credentials if given
9+
if [[ -x "$PYTORCH_CREDENTIALS_FILE" ]]; then
10+
source "$PYTORCH_CREDENTIALS_FILE"
11+
fi
12+
export PATH="$CONDA_UPLOADER_INSTALLATION/bin:$PATH"
13+
814
# Uploads all of the logs
915
# N.B. do NOT include the master logs, as there may be secrets in those
1016

0 commit comments

Comments
 (0)