Skip to content

Commit

Permalink
removing obsolete nvidia arguments / variables
Browse files Browse the repository at this point in the history
  • Loading branch information
M1chaelM committed Jun 22, 2023
1 parent 841e1d7 commit 7e211b2
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 65 deletions.
14 changes: 3 additions & 11 deletions replay_trial.bash
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ NOCOLOR='\033[0m'
# Define usage function.
usage()
{
echo "Usage: $0 [-n --nvidia] [--keep-docker] [--manual-play] [--keep-gz] <team_name> <task_name> <trial_num>"
echo "Usage: $0 [--keep-docker] [--manual-play] [--keep-gz] <team_name> <task_name> <trial_num>"
echo "--keep-docker: Keep Gazebo window open and Docker container running after playback ends."
echo " By default, everything is terminated automatically."
echo "--manual-play: Do not automatically start playback. Wait for user to click in GUI."
Expand All @@ -31,8 +31,6 @@ usage()
}

# Parse arguments
nvidia_arg=""
image_nvidia=""
keep_docker=1

# Args to pass to script internal to Docker container
Expand All @@ -45,12 +43,6 @@ do
key="$1"

case $key in
-n|--nvidia)
nvidia_arg="-n"
image_nvidia="-nvidia"
shift
;;

--keep-docker)
keep_docker=1
shift
Expand Down Expand Up @@ -166,8 +158,8 @@ y=$y" > ${HOST_GZ_GUI_CONFIG_DIR}/gui.ini

# Run Gazebo simulation server container
SERVER_CMD="/play_vrx_log.sh ${LOG_FILE} ${OUTPUT} ${manual_play} ${keep_gz}"
SERVER_IMG="vrx-server-${ROS_DISTRO}${image_nvidia}:latest"
${DIR}/vrx_server/run_container.bash $nvidia_arg ${SERVER_CONTAINER_NAME} $SERVER_IMG \
SERVER_IMG="vrx-server-${ROS_DISTRO}:latest"
${DIR}/vrx_server/run_container.bash ${SERVER_CONTAINER_NAME} $SERVER_IMG \
"--net ${NETWORK} \
--ip ${SERVER_ROS_IP} \
-v ${HOST_LOG_DIR}:${LOG_DIR} \
Expand Down
34 changes: 3 additions & 31 deletions run_trial.bash
Original file line number Diff line number Diff line change
Expand Up @@ -19,37 +19,10 @@ NOCOLOR='\033[0m'
# Define usage function.
usage()
{
echo "Usage: $0 [-n --nvidia] <team_name> <task_name> <trial_num>"
echo "Usage: $0 <team_name> <task_name> <trial_num>"
exit 1
}

# Parse arguments
# TODO: nvidia runtime by default; runtime may be obsolete
RUNTIME="nvidia"
nvidia_arg=""
image_nvidia=""

POSITIONAL=()
while [[ $# -gt 0 ]]
do
key="$1"

case $key in
-n|--nvidia)
RUNTIME="nvidia"
nvidia_arg="-n"
image_nvidia="-nvidia"
shift
;;
*) # unknown option
POSITIONAL+=("$1")
shift
;;
esac
done

set -- "${POSITIONAL[@]}"

# Call usage() function if arguments not supplied.
[[ $# -ne 3 ]] && usage

Expand All @@ -68,7 +41,7 @@ fi
SERVER_CONTAINER_NAME=vrx-server-system
SERVER_USER=developer
ROS_DISTRO=humble
SERVER_IMG="vrx-server-${ROS_DISTRO}${image_nvidia}:latest"
SERVER_IMG="vrx-server-${ROS_DISTRO}:latest"
LOG_DIR=/vrx/logs
NETWORK=vrx-network
NETWORK_SUBNET="172.16.0.10/16" # subnet mask allows communication between IP addresses with 172.16.xx.xx (xx = any)
Expand Down Expand Up @@ -148,7 +121,7 @@ echo "---------------------------------"
# container waiting for ROS master and has error before server is created.
# Run Gazebo simulation server container
SERVER_CMD="/run_vrx_trial.sh /team_generated/${TEAM_NAME}.urdf /task_generated/worlds/${TASK_NAME}${TRIAL_NUM} ${LOG_DIR}"
${DIR}/vrx_server/run_container.bash $nvidia_arg ${SERVER_CONTAINER_NAME} $SERVER_IMG \
${DIR}/vrx_server/run_container.bash ${SERVER_CONTAINER_NAME} $SERVER_IMG \
"--net ${NETWORK} \
--ip ${SERVER_ROS_IP} \
--gpus all \
Expand Down Expand Up @@ -179,7 +152,6 @@ docker run \
--ip ${COMPETITOR_ROS_IP} \
--gpus all \
--privileged \
--runtime=$RUNTIME \
${DOCKERHUB_IMAGE} &

# Run competition until server is ended
Expand Down
24 changes: 1 addition & 23 deletions vrx_server/run_container.bash
Original file line number Diff line number Diff line change
Expand Up @@ -22,32 +22,10 @@
set -x

# Parse arguments
RUNTIME="runc"

POSITIONAL=()
while [[ $# -gt 0 ]]
do
key="$1"

case $key in
-n|--nvidia)
RUNTIME="nvidia"
shift
;;
*) # unknown option
POSITIONAL+=("$1")
[ruby $(which gz) sim-1] qt.qpa.plugin: Could not load the Qt platform plugin "xcb" in "" even though it was found.
shift
;;
esac
done

set -- "${POSITIONAL[@]}"

if [[ $# -lt 2 ]]
then
[ruby $(which gz) sim-1] qt.qpa.plugin: Could not load the Qt platform plugin "xcb" in "" even though it was found.
echo "Usage: $0 [-n --nvidia] <container_name> <image_name> [<docker_extra_args> <command>]"
echo "Usage: $0 <container_name> <image_name> [<docker_extra_args> <command>]"
exit 1
fi

Expand Down

0 comments on commit 7e211b2

Please sign in to comment.