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