-
Notifications
You must be signed in to change notification settings - Fork 2
/
only-run.sh
executable file
·35 lines (30 loc) · 1.17 KB
/
only-run.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
IMAGE_NAME=epfl-lasa/franka-lightweight-interface
IMAGE_TAG=runtime
BUILD_FLAGS=()
HELP_MESSAGE="Usage: ./run-rt.sh
Build and run a runtime docker container with realtime permissions.
Options:
-r, --rebuild Rebuild the image using the docker
--no-cache option.
-v, --verbose Use the verbose option during the building
process.
-h, --help Show this help message."
BUILD_FLAGS=()
while [ "$#" -gt 0 ]; do
case "$1" in
-r|--rebuild) BUILD_FLAGS+=(--no-cache); shift 1;;
-v|--verbose) BUILD_FLAGS+=(--progress=plain); shift 1;;
-h|--help) echo "${HELP_MESSAGE}"; exit 0;;
*) echo "Unknown option: $1" >&2; echo "${HELP_MESSAGE}"; exit 1;;
esac
done
BUILD_FLAGS+=(--target "${IMAGE_TAG}")
BUILD_FLAGS+=(-t "${IMAGE_NAME}":"${IMAGE_TAG}")
# !!! Since rebuilding lead to errors, these lines are removed.
# docker pull ghcr.io/aica-technology/network-interfaces
# DOCKER_BUILDKIT=1 docker build "${BUILD_FLAGS[@]}" . || exit 1
docker run -it --rm --privileged --cap-add=SYS_NICE \
--net=host \
--ulimit rtprio=99:99 \
--ulimit memlock=102400:102400 \
"${IMAGE_NAME}:${IMAGE_TAG}"