2020-09-10 04:14:49 -06:00
|
|
|
#!/bin/bash
|
|
|
|
|
2021-03-16 23:23:38 -06:00
|
|
|
DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" >/dev/null && pwd)"
|
|
|
|
cd $DIR
|
|
|
|
|
2020-09-10 04:14:49 -06:00
|
|
|
# expose X to the container
|
|
|
|
xhost +local:root
|
|
|
|
|
2021-03-14 13:59:05 -06:00
|
|
|
docker pull ghcr.io/commaai/openpilot-sim:latest
|
2021-03-08 07:42:24 -07:00
|
|
|
|
2021-03-16 23:23:38 -06:00
|
|
|
OPENPILOT_DIR="/openpilot"
|
|
|
|
if ! [[ -z "$MOUNT_OPENPILOT" ]]
|
|
|
|
then
|
2021-05-14 21:00:13 -06:00
|
|
|
OPENPILOT_DIR="$(dirname $(dirname $DIR))"
|
|
|
|
EXTRA_ARGS="-v $OPENPILOT_DIR:$OPENPILOT_DIR -e PYTHONPATH=$OPENPILOT_DIR:$PYTHONPATH"
|
2021-03-16 23:23:38 -06:00
|
|
|
fi
|
|
|
|
|
2020-09-10 04:14:49 -06:00
|
|
|
docker run --net=host\
|
2020-09-28 15:44:03 -06:00
|
|
|
--name openpilot_client \
|
2020-09-10 04:14:49 -06:00
|
|
|
--rm \
|
|
|
|
-it \
|
|
|
|
--gpus all \
|
2021-04-06 01:55:18 -06:00
|
|
|
--device=/dev/dri:/dev/dri \
|
|
|
|
--device=/dev/input:/dev/input \
|
2020-09-10 04:14:49 -06:00
|
|
|
-v /tmp/.X11-unix:/tmp/.X11-unix \
|
|
|
|
--shm-size 1G \
|
|
|
|
-e DISPLAY=$DISPLAY \
|
2021-03-08 00:02:57 -07:00
|
|
|
-e QT_X11_NO_MITSHM=1 \
|
2021-03-16 23:23:38 -06:00
|
|
|
-w "$OPENPILOT_DIR/tools/sim" \
|
|
|
|
$EXTRA_ARGS \
|
2021-03-23 06:20:11 -06:00
|
|
|
ghcr.io/commaai/openpilot-sim:latest \
|
2021-03-16 23:23:38 -06:00
|
|
|
/bin/bash -c "./tmux_script.sh $*"
|