Unverified Commit a6731450 authored by Pavithra Vijayakrishnan's avatar Pavithra Vijayakrishnan Committed by GitHub
Browse files

ci: Add args to run.sh (#1418)


Signed-off-by: default avatarPavithra Vijayakrishnan <160681768+pvijayakrish@users.noreply.github.com>
parent 74b858fa
...@@ -40,6 +40,8 @@ ENVIRONMENT_VARIABLES= ...@@ -40,6 +40,8 @@ ENVIRONMENT_VARIABLES=
REMAINING_ARGS= REMAINING_ARGS=
INTERACTIVE= INTERACTIVE=
USE_NIXL_GDS= USE_NIXL_GDS=
RUNTIME=nvidia
WORKDIR=/workspace
get_options() { get_options() {
while :; do while :; do
...@@ -97,6 +99,14 @@ get_options() { ...@@ -97,6 +99,14 @@ get_options() {
missing_requirement "$1" missing_requirement "$1"
fi fi
;; ;;
--runtime)
if [ "$2" ]; then
RUNTIME=$2
shift
else
missing_requirement "$1"
fi
;;
--entrypoint) --entrypoint)
if [ "$2" ]; then if [ "$2" ]; then
ENTRYPOINT=$2 ENTRYPOINT=$2
...@@ -105,6 +115,14 @@ get_options() { ...@@ -105,6 +115,14 @@ get_options() {
missing_requirement "$1" missing_requirement "$1"
fi fi
;; ;;
--workdir)
if [ "$2" ]; then
WORKDIR="$2"
shift
else
missing_requirement "$1"
fi
;;
--privileged) --privileged)
if [ "$2" ]; then if [ "$2" ]; then
PRIVILEGED=$2 PRIVILEGED=$2
...@@ -261,7 +279,9 @@ get_options() { ...@@ -261,7 +279,9 @@ get_options() {
else else
NIXL_GDS_CAPS="" NIXL_GDS_CAPS=""
fi fi
if [[ "$GPUS" == "none" || "$GPUS" == "NONE" ]]; then
RUNTIME=""
fi
REMAINING_ARGS=("$@") REMAINING_ARGS=("$@")
} }
...@@ -279,6 +299,8 @@ show_help() { ...@@ -279,6 +299,8 @@ show_help() {
echo " [-e add environment variable]" echo " [-e add environment variable]"
echo " [--mount-workspace set up for local development]" echo " [--mount-workspace set up for local development]"
echo " [-- stop processing and pass remaining args as command to docker run]" echo " [-- stop processing and pass remaining args as command to docker run]"
echo " [--workdir set the working directory inside the container]"
echo " [--runtime add runtime variables]"
exit 0 exit 0
} }
...@@ -304,13 +326,14 @@ ${RUN_PREFIX} docker run \ ...@@ -304,13 +326,14 @@ ${RUN_PREFIX} docker run \
${INTERACTIVE} \ ${INTERACTIVE} \
${RM_STRING} \ ${RM_STRING} \
--network host \ --network host \
${RUNTIME:+--runtime "$RUNTIME"} \
--shm-size=10G \ --shm-size=10G \
--ulimit memlock=-1 \ --ulimit memlock=-1 \
--ulimit stack=67108864 \ --ulimit stack=67108864 \
--ulimit nofile=65536:65536 \ --ulimit nofile=65536:65536 \
${ENVIRONMENT_VARIABLES} \ ${ENVIRONMENT_VARIABLES} \
${VOLUME_MOUNTS} \ ${VOLUME_MOUNTS} \
-w /workspace \ -w "$WORKDIR" \
--cap-add CAP_SYS_PTRACE \ --cap-add CAP_SYS_PTRACE \
${NIXL_GDS_CAPS} \ ${NIXL_GDS_CAPS} \
--ipc host \ --ipc host \
......
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