Skip to content

Commit 896ea01

Browse files
committed
linting error fixed
Signed-off-by: sharvil10 <sharvil.shah@intel.com>
1 parent 03cb5af commit 896ea01

File tree

5 files changed

+25
-20
lines changed

5 files changed

+25
-20
lines changed

enterprise/redhat/openshift-ai/gaudi/docker/builder/run

+10-10
Original file line numberDiff line numberDiff line change
@@ -4,36 +4,36 @@ set -eo pipefail
44

55
set -x
66

7-
APP_ROOT=${APP_ROOT:-/workspace}
7+
APP_ROOT=${APP_ROOT:-/opt/app-root}
88

99
# Pre-clone repositories defined in JUPYTER_PRELOAD_REPOS
1010
if [ -n "${JUPYTER_PRELOAD_REPOS}" ]; then
11-
for repo in `echo ${JUPYTER_PRELOAD_REPOS} | tr ',' ' '`; do
11+
for repo in $(echo "${JUPYTER_PRELOAD_REPOS}" | tr ',' ' '); do
1212
# Check for the presence of "@branch" in the repo string
13-
REPO_BRANCH=$(echo ${repo} | cut -s -d'@' -f2)
13+
REPO_BRANCH=$(echo "${repo}" | cut -s -d'@' -f2)
1414
if [[ -n ${REPO_BRANCH} ]]; then
1515
# Remove the branch from the repo string and convert REPO_BRANCH to git clone arg
16-
repo=$(echo ${repo} | cut -d'@' -f1)
16+
repo=$(echo "${repo}" | cut -d'@' -f1)
1717
REPO_BRANCH="-b ${REPO_BRANCH}"
1818
fi
1919
echo "Checking if repository $repo exists locally"
20-
REPO_DIR=$(basename ${repo})
20+
REPO_DIR=$(basename "${repo}")
2121
if [ -d "${REPO_DIR}" ]; then
22-
pushd ${REPO_DIR}
22+
pushd "${REPO_DIR}"
2323
# Do nothing if the repo already exists
2424
echo "The ${repo} has already been cloned"
2525
:
2626
popd
2727
else
28-
GIT_SSL_NO_VERIFY=true git clone ${repo} ${REPO_DIR} ${REPO_BRANCH}
28+
GIT_SSL_NO_VERIFY=true git clone "${repo}" "${REPO_DIR}" "${REPO_BRANCH}"
2929
fi
3030
done
3131
fi
3232

3333
if [ -n "${NOTEBOOK_SAMPLES_LINK}" ]; then
34-
for link in `echo ${NOTEBOOK_SAMPLES_LINK} | tr ',' ' '`; do
35-
wget ${link}
34+
for link in $(echo "${NOTEBOOK_SAMPLES_LINK}" | tr ',' ' '); do
35+
wget "${link}"
3636
done
3737
fi
3838

39-
${APP_ROOT}/bin/start-notebook.sh "$@"
39+
"${APP_ROOT}"/bin/start-notebook.sh "$@"

enterprise/redhat/openshift-ai/gaudi/docker/install_efa.sh

+6-5
Original file line numberDiff line numberDiff line change
@@ -18,10 +18,11 @@ DEFAULT_EFA_INSTALLER_VER=1.29.0
1818
efa_installer_version=${1:-$DEFAULT_EFA_INSTALLER_VER}
1919

2020
tmp_dir=$(mktemp -d)
21-
wget -nv https://efa-installer.amazonaws.com/aws-efa-installer-$efa_installer_version.tar.gz -P $tmp_dir
22-
tar -xf $tmp_dir/aws-efa-installer-$efa_installer_version.tar.gz -C $tmp_dir
23-
pushd $tmp_dir/aws-efa-installer
24-
case $(. /etc/os-release ; echo -n $ID) in
21+
wget -nv https://efa-installer.amazonaws.com/aws-efa-installer-"$efa_installer_version".tar.gz -P "$tmp_dir"
22+
tar -xf "$tmp_dir"/aws-efa-installer-"$efa_installer_version".tar.gz -C "$tmp_dir"
23+
pushd "$tmp_dir"/aws-efa-installer
24+
# shellcheck disable=SC1091
25+
case $(. /etc/os-release ; echo -n "$ID") in
2526
rhel)
2627
# we cannot install dkms packages on RHEL images due to OCP rules
2728
rm -f RPMS/RHEL8/x86_64/dkms*.rpm
@@ -33,4 +34,4 @@ case $(. /etc/os-release ; echo -n $ID) in
3334
esac
3435
./efa_installer.sh -y --skip-kmod --skip-limit-conf --no-verify
3536
popd
36-
rm -rf $tmp_dir
37+
rm -rf "$tmp_dir"

enterprise/redhat/openshift-ai/gaudi/docker/install_packages.sh

+1-1
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ tmp_path=$(mktemp --directory)
4040
wget --no-verbose "${pt_artifact_path}/${pt_package_name}"
4141
tar -xf "${pt_package_name}" -C "${tmp_path}"/.
4242
pushd "${tmp_path}"
43-
./install.sh $VERSION $REVISION
43+
./install.sh "$VERSION" "$REVISION"
4444
popd
4545
# cleanup
4646
rm -rf "${tmp_path}" "${pt_package_name}"

enterprise/redhat/openshift-ai/gaudi/docker/start-notebook.sh

+6-3
Original file line numberDiff line numberDiff line change
@@ -16,10 +16,12 @@
1616

1717
# Load bash libraries
1818
SCRIPT_DIR=${APP_ROOT}/bin
19-
source ${SCRIPT_DIR}/utils/process.sh
19+
# shellcheck disable=SC1091
20+
source "${SCRIPT_DIR}"/utils/process.sh
2021

2122
if [ -f "${SCRIPT_DIR}/utils/setup-elyra.sh" ]; then
22-
source ${SCRIPT_DIR}/utils/setup-elyra.sh
23+
# shellcheck disable=SC1091
24+
source "${SCRIPT_DIR}"/utils/setup-elyra.sh
2325
fi
2426

2527
# Initialize notebooks arguments variable
@@ -47,9 +49,10 @@ if [ -n "${NOTEBOOK_ARGS}" ]; then
4749
NOTEBOOK_PROGRAM_ARGS+=${NOTEBOOK_ARGS}
4850
fi
4951

50-
echo ${NOTEBOOK_PROGRAM_ARGS}
52+
echo "${NOTEBOOK_PROGRAM_ARGS}"
5153

5254
# Start the JupyterLab notebook
55+
# shellcheck disable=SC2086
5356
start_process jupyter lab ${NOTEBOOK_PROGRAM_ARGS} \
5457
--ServerApp.ip=0.0.0.0 \
5558
--ServerApp.allow_origin="*" \

enterprise/redhat/openshift-ai/gaudi/docker/utils/process.sh

+2-1
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@ function start_process() {
1818
trap stop_process TERM INT
1919

2020
echo "Running command:" "$@"
21+
echo -e "$@"
2122
"$@" &
2223

2324
PID=$!
@@ -29,5 +30,5 @@ function start_process() {
2930
}
3031

3132
function stop_process() {
32-
kill -TERM $PID
33+
kill -TERM "$PID"
3334
}

0 commit comments

Comments
 (0)