Skip to content

Commit

Permalink
Added retry to tnsnames curl call
Browse files Browse the repository at this point in the history
  • Loading branch information
mathis-marcotte committed Dec 12, 2024
1 parent 5496a0b commit d5249a5
Show file tree
Hide file tree
Showing 8 changed files with 80 additions and 8 deletions.
11 changes: 10 additions & 1 deletion output/docker-stacks-datascience-notebook/start-custom.sh
Original file line number Diff line number Diff line change
Expand Up @@ -206,8 +206,17 @@ fi

# Retrieving Alias file for oracle client
# Runs on every startup because this output location is not persisted storage
# Implemented with a retry because it sometimes fails for some reason
echo "Retrieving Oracle tnsnames file"
curl --url "https://gitlab.k8s.cloud.statcan.ca/api/v4/snippets/499/raw" -o /opt/oracle/instantclient_23_5/network/admin/tnsnames.ora
RETRIES_NO=5
RETRY_DELAY=3
for i in $(seq 1 $RETRIES_NO); do
curl --url "https://gitlab.k8s.cloud.statcan.ca/api/v4/snippets/499/raw" -o /opt/oracle/instantclient_23_5/network/admin/tnsnames.ora && break
echo "Failed to get the tnsnames.ora file. Attempt $i of $RETRIES_NO"
#if it ran all the retries, exit
[[ $i -eq $RETRIES_NO ]] && echo "Failed to get the tnsnames.ora file after $RETRIES_NO retries"
sleep ${RETRY_DELAY}
done

# Add sasstudio default
if [[ -z "${SASSTUDIO_TEMP_HOME}" ]]; then
Expand Down
11 changes: 10 additions & 1 deletion output/jupyterlab-cpu/start-custom.sh
Original file line number Diff line number Diff line change
Expand Up @@ -206,8 +206,17 @@ fi

# Retrieving Alias file for oracle client
# Runs on every startup because this output location is not persisted storage
# Implemented with a retry because it sometimes fails for some reason
echo "Retrieving Oracle tnsnames file"
curl --url "https://gitlab.k8s.cloud.statcan.ca/api/v4/snippets/499/raw" -o /opt/oracle/instantclient_23_5/network/admin/tnsnames.ora
RETRIES_NO=5
RETRY_DELAY=3
for i in $(seq 1 $RETRIES_NO); do
curl --url "https://gitlab.k8s.cloud.statcan.ca/api/v4/snippets/499/raw" -o /opt/oracle/instantclient_23_5/network/admin/tnsnames.ora && break
echo "Failed to get the tnsnames.ora file. Attempt $i of $RETRIES_NO"
#if it ran all the retries, exit
[[ $i -eq $RETRIES_NO ]] && echo "Failed to get the tnsnames.ora file after $RETRIES_NO retries"
sleep ${RETRY_DELAY}
done

# Add sasstudio default
if [[ -z "${SASSTUDIO_TEMP_HOME}" ]]; then
Expand Down
11 changes: 10 additions & 1 deletion output/jupyterlab-pytorch/start-custom.sh
Original file line number Diff line number Diff line change
Expand Up @@ -206,8 +206,17 @@ fi

# Retrieving Alias file for oracle client
# Runs on every startup because this output location is not persisted storage
# Implemented with a retry because it sometimes fails for some reason
echo "Retrieving Oracle tnsnames file"
curl --url "https://gitlab.k8s.cloud.statcan.ca/api/v4/snippets/499/raw" -o /opt/oracle/instantclient_23_5/network/admin/tnsnames.ora
RETRIES_NO=5
RETRY_DELAY=3
for i in $(seq 1 $RETRIES_NO); do
curl --url "https://gitlab.k8s.cloud.statcan.ca/api/v4/snippets/499/raw" -o /opt/oracle/instantclient_23_5/network/admin/tnsnames.ora && break
echo "Failed to get the tnsnames.ora file. Attempt $i of $RETRIES_NO"
#if it ran all the retries, exit
[[ $i -eq $RETRIES_NO ]] && echo "Failed to get the tnsnames.ora file after $RETRIES_NO retries"
sleep ${RETRY_DELAY}
done

# Add sasstudio default
if [[ -z "${SASSTUDIO_TEMP_HOME}" ]]; then
Expand Down
11 changes: 10 additions & 1 deletion output/jupyterlab-tensorflow/start-custom.sh
Original file line number Diff line number Diff line change
Expand Up @@ -206,8 +206,17 @@ fi

# Retrieving Alias file for oracle client
# Runs on every startup because this output location is not persisted storage
# Implemented with a retry because it sometimes fails for some reason
echo "Retrieving Oracle tnsnames file"
curl --url "https://gitlab.k8s.cloud.statcan.ca/api/v4/snippets/499/raw" -o /opt/oracle/instantclient_23_5/network/admin/tnsnames.ora
RETRIES_NO=5
RETRY_DELAY=3
for i in $(seq 1 $RETRIES_NO); do
curl --url "https://gitlab.k8s.cloud.statcan.ca/api/v4/snippets/499/raw" -o /opt/oracle/instantclient_23_5/network/admin/tnsnames.ora && break
echo "Failed to get the tnsnames.ora file. Attempt $i of $RETRIES_NO"
#if it ran all the retries, exit
[[ $i -eq $RETRIES_NO ]] && echo "Failed to get the tnsnames.ora file after $RETRIES_NO retries"
sleep ${RETRY_DELAY}
done

# Add sasstudio default
if [[ -z "${SASSTUDIO_TEMP_HOME}" ]]; then
Expand Down
11 changes: 10 additions & 1 deletion output/remote-desktop/start-custom.sh
Original file line number Diff line number Diff line change
Expand Up @@ -206,8 +206,17 @@ fi

# Retrieving Alias file for oracle client
# Runs on every startup because this output location is not persisted storage
# Implemented with a retry because it sometimes fails for some reason
echo "Retrieving Oracle tnsnames file"
curl --url "https://gitlab.k8s.cloud.statcan.ca/api/v4/snippets/499/raw" -o /opt/oracle/instantclient_23_5/network/admin/tnsnames.ora
RETRIES_NO=5
RETRY_DELAY=3
for i in $(seq 1 $RETRIES_NO); do
curl --url "https://gitlab.k8s.cloud.statcan.ca/api/v4/snippets/499/raw" -o /opt/oracle/instantclient_23_5/network/admin/tnsnames.ora && break
echo "Failed to get the tnsnames.ora file. Attempt $i of $RETRIES_NO"
#if it ran all the retries, exit
[[ $i -eq $RETRIES_NO ]] && echo "Failed to get the tnsnames.ora file after $RETRIES_NO retries"
sleep ${RETRY_DELAY}
done

# Add sasstudio default
if [[ -z "${SASSTUDIO_TEMP_HOME}" ]]; then
Expand Down
11 changes: 10 additions & 1 deletion output/rstudio/start-custom.sh
Original file line number Diff line number Diff line change
Expand Up @@ -206,8 +206,17 @@ fi

# Retrieving Alias file for oracle client
# Runs on every startup because this output location is not persisted storage
# Implemented with a retry because it sometimes fails for some reason
echo "Retrieving Oracle tnsnames file"
curl --url "https://gitlab.k8s.cloud.statcan.ca/api/v4/snippets/499/raw" -o /opt/oracle/instantclient_23_5/network/admin/tnsnames.ora
RETRIES_NO=5
RETRY_DELAY=3
for i in $(seq 1 $RETRIES_NO); do
curl --url "https://gitlab.k8s.cloud.statcan.ca/api/v4/snippets/499/raw" -o /opt/oracle/instantclient_23_5/network/admin/tnsnames.ora && break
echo "Failed to get the tnsnames.ora file. Attempt $i of $RETRIES_NO"
#if it ran all the retries, exit
[[ $i -eq $RETRIES_NO ]] && echo "Failed to get the tnsnames.ora file after $RETRIES_NO retries"
sleep ${RETRY_DELAY}
done

# Add sasstudio default
if [[ -z "${SASSTUDIO_TEMP_HOME}" ]]; then
Expand Down
11 changes: 10 additions & 1 deletion output/sas/start-custom.sh
Original file line number Diff line number Diff line change
Expand Up @@ -206,8 +206,17 @@ fi

# Retrieving Alias file for oracle client
# Runs on every startup because this output location is not persisted storage
# Implemented with a retry because it sometimes fails for some reason
echo "Retrieving Oracle tnsnames file"
curl --url "https://gitlab.k8s.cloud.statcan.ca/api/v4/snippets/499/raw" -o /opt/oracle/instantclient_23_5/network/admin/tnsnames.ora
RETRIES_NO=5
RETRY_DELAY=3
for i in $(seq 1 $RETRIES_NO); do
curl --url "https://gitlab.k8s.cloud.statcan.ca/api/v4/snippets/499/raw" -o /opt/oracle/instantclient_23_5/network/admin/tnsnames.ora && break
echo "Failed to get the tnsnames.ora file. Attempt $i of $RETRIES_NO"
#if it ran all the retries, exit
[[ $i -eq $RETRIES_NO ]] && echo "Failed to get the tnsnames.ora file after $RETRIES_NO retries"
sleep ${RETRY_DELAY}
done

# Add sasstudio default
if [[ -z "${SASSTUDIO_TEMP_HOME}" ]]; then
Expand Down
11 changes: 10 additions & 1 deletion resources/common/start-custom.sh
Original file line number Diff line number Diff line change
Expand Up @@ -206,8 +206,17 @@ fi

# Retrieving Alias file for oracle client
# Runs on every startup because this output location is not persisted storage
# Implemented with a retry because it sometimes fails for some reason
echo "Retrieving Oracle tnsnames file"
curl --url "https://gitlab.k8s.cloud.statcan.ca/api/v4/snippets/499/raw" -o /opt/oracle/instantclient_23_5/network/admin/tnsnames.ora
RETRIES_NO=5
RETRY_DELAY=3
for i in $(seq 1 $RETRIES_NO); do
curl --url "https://gitlab.k8s.cloud.statcan.ca/api/v4/snippets/499/raw" -o /opt/oracle/instantclient_23_5/network/admin/tnsnames.ora && break
echo "Failed to get the tnsnames.ora file. Attempt $i of $RETRIES_NO"
#if it ran all the retries, exit
[[ $i -eq $RETRIES_NO ]] && echo "Failed to get the tnsnames.ora file after $RETRIES_NO retries"
sleep ${RETRY_DELAY}
done

# Add sasstudio default
if [[ -z "${SASSTUDIO_TEMP_HOME}" ]]; then
Expand Down

0 comments on commit d5249a5

Please sign in to comment.