"...ssh:/git@developer.sourcefind.cn:2222/OpenDAS/dynamo.git" did not exist on "c5d9d267033ddb6ce26be9dc6f6a5b9aa9684c9b"
Unverified Commit 44c5be7e authored by sanshang-nv's avatar sanshang-nv Committed by GitHub
Browse files

fix: replace tabs with whitespaces in container/run.sh (#1553)


Signed-off-by: default avatarSanshan Gao <sanshang@nvidia.com>
parent 64445c0a
...@@ -50,12 +50,12 @@ get_options() { ...@@ -50,12 +50,12 @@ get_options() {
show_help show_help
exit exit
;; ;;
--framework) --framework)
if [ "$2" ]; then if [ "$2" ]; then
FRAMEWORK=$2 FRAMEWORK=$2
shift shift
else else
missing_requirement "$1" missing_requirement "$1"
fi fi
;; ;;
--image) --image)
...@@ -63,7 +63,7 @@ get_options() { ...@@ -63,7 +63,7 @@ get_options() {
IMAGE=$2 IMAGE=$2
shift shift
else else
missing_requirement "$1" missing_requirement "$1"
fi fi
;; ;;
--target) --target)
...@@ -74,93 +74,93 @@ get_options() { ...@@ -74,93 +74,93 @@ get_options() {
missing_requirement "$1" missing_requirement "$1"
fi fi
;; ;;
--name) --name)
if [ "$2" ]; then if [ "$2" ]; then
NAME=$2 NAME=$2
shift shift
else else
missing_requirement "$1" missing_requirement "$1"
fi fi
;; ;;
--hf-cache) --hf-cache)
if [ "$2" ]; then if [ "$2" ]; then
HF_CACHE=$2 HF_CACHE=$2
shift shift
else else
missing_requirement "$1" missing_requirement "$1"
fi fi
;; ;;
--gpus) --gpus)
if [ "$2" ]; then if [ "$2" ]; then
GPUS=$2 GPUS=$2
shift shift
else else
missing_requirement "$1" missing_requirement "$1"
fi fi
;; ;;
--runtime) --runtime)
if [ "$2" ]; then if [ "$2" ]; then
RUNTIME=$2 RUNTIME=$2
shift shift
else else
missing_requirement "$1" missing_requirement "$1"
fi fi
;; ;;
--entrypoint) --entrypoint)
if [ "$2" ]; then if [ "$2" ]; then
ENTRYPOINT=$2 ENTRYPOINT=$2
shift shift
else else
missing_requirement "$1" missing_requirement "$1"
fi
;;
--workdir)
if [ "$2" ]; then
WORKDIR="$2"
shift
else
missing_requirement "$1"
fi fi
;; ;;
--workdir) --privileged)
if [ "$2" ]; then
WORKDIR="$2"
shift
else
missing_requirement "$1"
fi
;;
--privileged)
if [ "$2" ]; then if [ "$2" ]; then
PRIVILEGED=$2 PRIVILEGED=$2
shift shift
else else
missing_requirement "$1" missing_requirement "$1"
fi fi
;; ;;
--rm) --rm)
if [ "$2" ]; then if [ "$2" ]; then
RM=$2 RM=$2
shift shift
else else
missing_requirement "$1" missing_requirement "$1"
fi fi
;; ;;
-v) -v)
if [ "$2" ]; then if [ "$2" ]; then
VOLUME_MOUNTS+=" -v $2 " VOLUME_MOUNTS+=" -v $2 "
shift shift
else else
missing_requirement "$1" missing_requirement "$1"
fi fi
;; ;;
-e) -e)
if [ "$2" ]; then if [ "$2" ]; then
ENVIRONMENT_VARIABLES+=" -e $2 " ENVIRONMENT_VARIABLES+=" -e $2 "
shift shift
else else
missing_requirement "$1" missing_requirement "$1"
fi fi
;; ;;
-it) -it)
INTERACTIVE=" -it " INTERACTIVE=" -it "
;; ;;
--mount-workspace) --mount-workspace)
MOUNT_WORKSPACE=TRUE MOUNT_WORKSPACE=TRUE
;; ;;
--use-nixl-gds) --use-nixl-gds)
USE_NIXL_GDS=TRUE USE_NIXL_GDS=TRUE
;; ;;
...@@ -177,10 +177,10 @@ get_options() { ...@@ -177,10 +177,10 @@ get_options() {
break break
;; ;;
-?*) -?*)
error 'ERROR: Unknown option: ' "$1" error 'ERROR: Unknown option: ' "$1"
;; ;;
?*) ?*)
error 'ERROR: Unknown option: ' "$1" error 'ERROR: Unknown option: ' "$1"
;; ;;
*) *)
break break
...@@ -191,14 +191,14 @@ get_options() { ...@@ -191,14 +191,14 @@ get_options() {
done done
if [ -z "$FRAMEWORK" ]; then if [ -z "$FRAMEWORK" ]; then
FRAMEWORK=$DEFAULT_FRAMEWORK FRAMEWORK=$DEFAULT_FRAMEWORK
fi fi
if [ -n "$FRAMEWORK" ]; then if [ -n "$FRAMEWORK" ]; then
FRAMEWORK=${FRAMEWORK^^} FRAMEWORK=${FRAMEWORK^^}
if [[ -z "${FRAMEWORKS[$FRAMEWORK]}" ]]; then if [[ -z "${FRAMEWORKS[$FRAMEWORK]}" ]]; then
error 'ERROR: Unknown framework: ' "$FRAMEWORK" error 'ERROR: Unknown framework: ' "$FRAMEWORK"
fi fi
fi fi
if [ -z "$IMAGE" ]; then if [ -z "$IMAGE" ]; then
...@@ -209,68 +209,68 @@ get_options() { ...@@ -209,68 +209,68 @@ get_options() {
fi fi
if [[ ${GPUS^^} == "NONE" ]]; then if [[ ${GPUS^^} == "NONE" ]]; then
GPU_STRING="" GPU_STRING=""
else else
GPU_STRING="--gpus ${GPUS}" GPU_STRING="--gpus ${GPUS}"
fi fi
if [[ ${NAME^^} == "" ]]; then if [[ ${NAME^^} == "" ]]; then
NAME_STRING="" NAME_STRING=""
else else
NAME_STRING="--name ${NAME}" NAME_STRING="--name ${NAME}"
fi fi
if [[ ${ENTRYPOINT^^} == "" ]]; then if [[ ${ENTRYPOINT^^} == "" ]]; then
ENTRYPOINT_STRING="" ENTRYPOINT_STRING=""
else else
ENTRYPOINT_STRING="--entrypoint ${ENTRYPOINT}" ENTRYPOINT_STRING="--entrypoint ${ENTRYPOINT}"
fi fi
if [ -n "$MOUNT_WORKSPACE" ]; then if [ -n "$MOUNT_WORKSPACE" ]; then
VOLUME_MOUNTS+=" -v ${SOURCE_DIR}/..:/workspace " VOLUME_MOUNTS+=" -v ${SOURCE_DIR}/..:/workspace "
VOLUME_MOUNTS+=" -v /tmp:/tmp " VOLUME_MOUNTS+=" -v /tmp:/tmp "
VOLUME_MOUNTS+=" -v /mnt/:/mnt " VOLUME_MOUNTS+=" -v /mnt/:/mnt "
if [ -z "$HF_CACHE" ]; then if [ -z "$HF_CACHE" ]; then
HF_CACHE=$DEFAULT_HF_CACHE HF_CACHE=$DEFAULT_HF_CACHE
fi fi
if [ -z "${PRIVILEGED}" ]; then if [ -z "${PRIVILEGED}" ]; then
PRIVILEGED="TRUE" PRIVILEGED="TRUE"
fi fi
ENVIRONMENT_VARIABLES+=" -e HF_TOKEN" ENVIRONMENT_VARIABLES+=" -e HF_TOKEN"
INTERACTIVE=" -it " INTERACTIVE=" -it "
fi fi
if [[ ${HF_CACHE^^} == "NONE" ]]; then if [[ ${HF_CACHE^^} == "NONE" ]]; then
HF_CACHE= HF_CACHE=
fi fi
if [ -n "$HF_CACHE" ]; then if [ -n "$HF_CACHE" ]; then
mkdir -p "$HF_CACHE" mkdir -p "$HF_CACHE"
VOLUME_MOUNTS+=" -v $HF_CACHE:/root/.cache/huggingface" VOLUME_MOUNTS+=" -v $HF_CACHE:/root/.cache/huggingface"
fi fi
if [ -z "${PRIVILEGED}" ]; then if [ -z "${PRIVILEGED}" ]; then
PRIVILEGED="FALSE" PRIVILEGED="FALSE"
fi fi
if [ -z "${RM}" ]; then if [ -z "${RM}" ]; then
RM="TRUE" RM="TRUE"
fi fi
if [[ ${PRIVILEGED^^} == "FALSE" ]]; then if [[ ${PRIVILEGED^^} == "FALSE" ]]; then
PRIVILEGED_STRING="" PRIVILEGED_STRING=""
else else
PRIVILEGED_STRING="--privileged" PRIVILEGED_STRING="--privileged"
fi fi
if [[ ${RM^^} == "FALSE" ]]; then if [[ ${RM^^} == "FALSE" ]]; then
RM_STRING="" RM_STRING=""
else else
RM_STRING=" --rm " RM_STRING=" --rm "
fi fi
if [ -n "$USE_NIXL_GDS" ]; then if [ -n "$USE_NIXL_GDS" ]; then
...@@ -280,7 +280,7 @@ get_options() { ...@@ -280,7 +280,7 @@ get_options() {
NIXL_GDS_CAPS="" NIXL_GDS_CAPS=""
fi fi
if [[ "$GPUS" == "none" || "$GPUS" == "NONE" ]]; then if [[ "$GPUS" == "none" || "$GPUS" == "NONE" ]]; then
RUNTIME="" RUNTIME=""
fi fi
REMAINING_ARGS=("$@") REMAINING_ARGS=("$@")
} }
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment