Skip to content

Commit

Permalink
fix: tnsnames.ora clone script fix (#738)
Browse files Browse the repository at this point in the history
* fix: fixed cloning of tnsnames.ora file

* updated tnsnames clone command
  • Loading branch information
mathis-marcotte authored Jan 28, 2025
1 parent f251863 commit 041bafb
Show file tree
Hide file tree
Showing 8 changed files with 72 additions and 32 deletions.
13 changes: 9 additions & 4 deletions output/docker-stacks-datascience-notebook/start-custom.sh
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ if [[ ! -d ~/aaw-contrib-jupyter-notebooks ]]; then
RETRY_DELAY=3
for i in $(seq 1 $RETRIES_NO); do
test -z "$GIT_EXAMPLE_NOTEBOOKS" || git clone "$GIT_EXAMPLE_NOTEBOOKS" && break
echo "Failed to cloned the example notebooks. Attempt $i of $RETRIES_NO"
echo "Failed to clone the example notebooks. Attempt $i of $RETRIES_NO"
#if it ran all the retries, exit
[[ $i -eq $RETRIES_NO ]] && echo "Failed to clone example notebooks after $RETRIES_NO retries"
sleep ${RETRY_DELAY}
Expand Down Expand Up @@ -208,13 +208,18 @@ fi
# 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"
GIT_ORACLE_SNIPPET="https://gitlab.k8s.cloud.statcan.ca/business-transformation/aaw/aaw-contrib-containers/snippets/515.git"
ORACLE_ADMIN_PATH="/opt/oracle/instantclient_23_5/network/admin"
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/515/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"
test -z "$GIT_ORACLE_SNIPPET" || git clone "$GIT_ORACLE_SNIPPET" "${ORACLE_ADMIN_PATH}/515" \
&& mv "${ORACLE_ADMIN_PATH}/515/tnsnames.ora" "${ORACLE_ADMIN_PATH}" \
&& rm -rf "${ORACLE_ADMIN_PATH}/515" \
&& break
echo "Failed to clone 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"
[[ $i -eq $RETRIES_NO ]] && echo "Failed to clone the tnsnames.ora after $RETRIES_NO retries"
sleep ${RETRY_DELAY}
done

Expand Down
13 changes: 9 additions & 4 deletions output/jupyterlab-cpu/start-custom.sh
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ if [[ ! -d ~/aaw-contrib-jupyter-notebooks ]]; then
RETRY_DELAY=3
for i in $(seq 1 $RETRIES_NO); do
test -z "$GIT_EXAMPLE_NOTEBOOKS" || git clone "$GIT_EXAMPLE_NOTEBOOKS" && break
echo "Failed to cloned the example notebooks. Attempt $i of $RETRIES_NO"
echo "Failed to clone the example notebooks. Attempt $i of $RETRIES_NO"
#if it ran all the retries, exit
[[ $i -eq $RETRIES_NO ]] && echo "Failed to clone example notebooks after $RETRIES_NO retries"
sleep ${RETRY_DELAY}
Expand Down Expand Up @@ -208,13 +208,18 @@ fi
# 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"
GIT_ORACLE_SNIPPET="https://gitlab.k8s.cloud.statcan.ca/business-transformation/aaw/aaw-contrib-containers/snippets/515.git"
ORACLE_ADMIN_PATH="/opt/oracle/instantclient_23_5/network/admin"
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/515/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"
test -z "$GIT_ORACLE_SNIPPET" || git clone "$GIT_ORACLE_SNIPPET" "${ORACLE_ADMIN_PATH}/515" \
&& mv "${ORACLE_ADMIN_PATH}/515/tnsnames.ora" "${ORACLE_ADMIN_PATH}" \
&& rm -rf "${ORACLE_ADMIN_PATH}/515" \
&& break
echo "Failed to clone 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"
[[ $i -eq $RETRIES_NO ]] && echo "Failed to clone the tnsnames.ora after $RETRIES_NO retries"
sleep ${RETRY_DELAY}
done

Expand Down
13 changes: 9 additions & 4 deletions output/jupyterlab-pytorch/start-custom.sh
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ if [[ ! -d ~/aaw-contrib-jupyter-notebooks ]]; then
RETRY_DELAY=3
for i in $(seq 1 $RETRIES_NO); do
test -z "$GIT_EXAMPLE_NOTEBOOKS" || git clone "$GIT_EXAMPLE_NOTEBOOKS" && break
echo "Failed to cloned the example notebooks. Attempt $i of $RETRIES_NO"
echo "Failed to clone the example notebooks. Attempt $i of $RETRIES_NO"
#if it ran all the retries, exit
[[ $i -eq $RETRIES_NO ]] && echo "Failed to clone example notebooks after $RETRIES_NO retries"
sleep ${RETRY_DELAY}
Expand Down Expand Up @@ -208,13 +208,18 @@ fi
# 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"
GIT_ORACLE_SNIPPET="https://gitlab.k8s.cloud.statcan.ca/business-transformation/aaw/aaw-contrib-containers/snippets/515.git"
ORACLE_ADMIN_PATH="/opt/oracle/instantclient_23_5/network/admin"
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/515/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"
test -z "$GIT_ORACLE_SNIPPET" || git clone "$GIT_ORACLE_SNIPPET" "${ORACLE_ADMIN_PATH}/515" \
&& mv "${ORACLE_ADMIN_PATH}/515/tnsnames.ora" "${ORACLE_ADMIN_PATH}" \
&& rm -rf "${ORACLE_ADMIN_PATH}/515" \
&& break
echo "Failed to clone 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"
[[ $i -eq $RETRIES_NO ]] && echo "Failed to clone the tnsnames.ora after $RETRIES_NO retries"
sleep ${RETRY_DELAY}
done

Expand Down
13 changes: 9 additions & 4 deletions output/jupyterlab-tensorflow/start-custom.sh
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ if [[ ! -d ~/aaw-contrib-jupyter-notebooks ]]; then
RETRY_DELAY=3
for i in $(seq 1 $RETRIES_NO); do
test -z "$GIT_EXAMPLE_NOTEBOOKS" || git clone "$GIT_EXAMPLE_NOTEBOOKS" && break
echo "Failed to cloned the example notebooks. Attempt $i of $RETRIES_NO"
echo "Failed to clone the example notebooks. Attempt $i of $RETRIES_NO"
#if it ran all the retries, exit
[[ $i -eq $RETRIES_NO ]] && echo "Failed to clone example notebooks after $RETRIES_NO retries"
sleep ${RETRY_DELAY}
Expand Down Expand Up @@ -208,13 +208,18 @@ fi
# 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"
GIT_ORACLE_SNIPPET="https://gitlab.k8s.cloud.statcan.ca/business-transformation/aaw/aaw-contrib-containers/snippets/515.git"
ORACLE_ADMIN_PATH="/opt/oracle/instantclient_23_5/network/admin"
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/515/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"
test -z "$GIT_ORACLE_SNIPPET" || git clone "$GIT_ORACLE_SNIPPET" "${ORACLE_ADMIN_PATH}/515" \
&& mv "${ORACLE_ADMIN_PATH}/515/tnsnames.ora" "${ORACLE_ADMIN_PATH}" \
&& rm -rf "${ORACLE_ADMIN_PATH}/515" \
&& break
echo "Failed to clone 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"
[[ $i -eq $RETRIES_NO ]] && echo "Failed to clone the tnsnames.ora after $RETRIES_NO retries"
sleep ${RETRY_DELAY}
done

Expand Down
13 changes: 9 additions & 4 deletions output/remote-desktop/start-custom.sh
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ if [[ ! -d ~/aaw-contrib-jupyter-notebooks ]]; then
RETRY_DELAY=3
for i in $(seq 1 $RETRIES_NO); do
test -z "$GIT_EXAMPLE_NOTEBOOKS" || git clone "$GIT_EXAMPLE_NOTEBOOKS" && break
echo "Failed to cloned the example notebooks. Attempt $i of $RETRIES_NO"
echo "Failed to clone the example notebooks. Attempt $i of $RETRIES_NO"
#if it ran all the retries, exit
[[ $i -eq $RETRIES_NO ]] && echo "Failed to clone example notebooks after $RETRIES_NO retries"
sleep ${RETRY_DELAY}
Expand Down Expand Up @@ -208,13 +208,18 @@ fi
# 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"
GIT_ORACLE_SNIPPET="https://gitlab.k8s.cloud.statcan.ca/business-transformation/aaw/aaw-contrib-containers/snippets/515.git"
ORACLE_ADMIN_PATH="/opt/oracle/instantclient_23_5/network/admin"
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/515/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"
test -z "$GIT_ORACLE_SNIPPET" || git clone "$GIT_ORACLE_SNIPPET" "${ORACLE_ADMIN_PATH}/515" \
&& mv "${ORACLE_ADMIN_PATH}/515/tnsnames.ora" "${ORACLE_ADMIN_PATH}" \
&& rm -rf "${ORACLE_ADMIN_PATH}/515" \
&& break
echo "Failed to clone 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"
[[ $i -eq $RETRIES_NO ]] && echo "Failed to clone the tnsnames.ora after $RETRIES_NO retries"
sleep ${RETRY_DELAY}
done

Expand Down
13 changes: 9 additions & 4 deletions output/rstudio/start-custom.sh
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ if [[ ! -d ~/aaw-contrib-jupyter-notebooks ]]; then
RETRY_DELAY=3
for i in $(seq 1 $RETRIES_NO); do
test -z "$GIT_EXAMPLE_NOTEBOOKS" || git clone "$GIT_EXAMPLE_NOTEBOOKS" && break
echo "Failed to cloned the example notebooks. Attempt $i of $RETRIES_NO"
echo "Failed to clone the example notebooks. Attempt $i of $RETRIES_NO"
#if it ran all the retries, exit
[[ $i -eq $RETRIES_NO ]] && echo "Failed to clone example notebooks after $RETRIES_NO retries"
sleep ${RETRY_DELAY}
Expand Down Expand Up @@ -208,13 +208,18 @@ fi
# 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"
GIT_ORACLE_SNIPPET="https://gitlab.k8s.cloud.statcan.ca/business-transformation/aaw/aaw-contrib-containers/snippets/515.git"
ORACLE_ADMIN_PATH="/opt/oracle/instantclient_23_5/network/admin"
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/515/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"
test -z "$GIT_ORACLE_SNIPPET" || git clone "$GIT_ORACLE_SNIPPET" "${ORACLE_ADMIN_PATH}/515" \
&& mv "${ORACLE_ADMIN_PATH}/515/tnsnames.ora" "${ORACLE_ADMIN_PATH}" \
&& rm -rf "${ORACLE_ADMIN_PATH}/515" \
&& break
echo "Failed to clone 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"
[[ $i -eq $RETRIES_NO ]] && echo "Failed to clone the tnsnames.ora after $RETRIES_NO retries"
sleep ${RETRY_DELAY}
done

Expand Down
13 changes: 9 additions & 4 deletions output/sas/start-custom.sh
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ if [[ ! -d ~/aaw-contrib-jupyter-notebooks ]]; then
RETRY_DELAY=3
for i in $(seq 1 $RETRIES_NO); do
test -z "$GIT_EXAMPLE_NOTEBOOKS" || git clone "$GIT_EXAMPLE_NOTEBOOKS" && break
echo "Failed to cloned the example notebooks. Attempt $i of $RETRIES_NO"
echo "Failed to clone the example notebooks. Attempt $i of $RETRIES_NO"
#if it ran all the retries, exit
[[ $i -eq $RETRIES_NO ]] && echo "Failed to clone example notebooks after $RETRIES_NO retries"
sleep ${RETRY_DELAY}
Expand Down Expand Up @@ -208,13 +208,18 @@ fi
# 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"
GIT_ORACLE_SNIPPET="https://gitlab.k8s.cloud.statcan.ca/business-transformation/aaw/aaw-contrib-containers/snippets/515.git"
ORACLE_ADMIN_PATH="/opt/oracle/instantclient_23_5/network/admin"
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/515/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"
test -z "$GIT_ORACLE_SNIPPET" || git clone "$GIT_ORACLE_SNIPPET" "${ORACLE_ADMIN_PATH}/515" \
&& mv "${ORACLE_ADMIN_PATH}/515/tnsnames.ora" "${ORACLE_ADMIN_PATH}" \
&& rm -rf "${ORACLE_ADMIN_PATH}/515" \
&& break
echo "Failed to clone 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"
[[ $i -eq $RETRIES_NO ]] && echo "Failed to clone the tnsnames.ora after $RETRIES_NO retries"
sleep ${RETRY_DELAY}
done

Expand Down
13 changes: 9 additions & 4 deletions resources/common/start-custom.sh
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ if [[ ! -d ~/aaw-contrib-jupyter-notebooks ]]; then
RETRY_DELAY=3
for i in $(seq 1 $RETRIES_NO); do
test -z "$GIT_EXAMPLE_NOTEBOOKS" || git clone "$GIT_EXAMPLE_NOTEBOOKS" && break
echo "Failed to cloned the example notebooks. Attempt $i of $RETRIES_NO"
echo "Failed to clone the example notebooks. Attempt $i of $RETRIES_NO"
#if it ran all the retries, exit
[[ $i -eq $RETRIES_NO ]] && echo "Failed to clone example notebooks after $RETRIES_NO retries"
sleep ${RETRY_DELAY}
Expand Down Expand Up @@ -208,13 +208,18 @@ fi
# 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"
GIT_ORACLE_SNIPPET="https://gitlab.k8s.cloud.statcan.ca/business-transformation/aaw/aaw-contrib-containers/snippets/515.git"
ORACLE_ADMIN_PATH="/opt/oracle/instantclient_23_5/network/admin"
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/515/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"
test -z "$GIT_ORACLE_SNIPPET" || git clone "$GIT_ORACLE_SNIPPET" "${ORACLE_ADMIN_PATH}/515" \
&& mv "${ORACLE_ADMIN_PATH}/515/tnsnames.ora" "${ORACLE_ADMIN_PATH}" \
&& rm -rf "${ORACLE_ADMIN_PATH}/515" \
&& break
echo "Failed to clone 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"
[[ $i -eq $RETRIES_NO ]] && echo "Failed to clone the tnsnames.ora after $RETRIES_NO retries"
sleep ${RETRY_DELAY}
done

Expand Down

0 comments on commit 041bafb

Please sign in to comment.