Skip to content

Commit 3bf5b30

Browse files
authored
chore(docker): autoware_data directory as an option (#5880)
Signed-off-by: Amadeusz Szymko <amadeusz.szymko.2@tier4.jp>
1 parent 501669a commit 3bf5b30

2 files changed

Lines changed: 14 additions & 6 deletions

File tree

docker/etc/ros_entrypoint.sh

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,12 @@ else
2727
source "/opt/ros/$ROS_DISTRO/setup.bash"
2828
source /opt/autoware/setup.bash
2929

30+
# Add symlink for autoware_data if directory exists
31+
if [ -d /autoware_data ]; then
32+
ln -s /autoware_data /home/"$USER_NAME"/autoware_data
33+
echo "Linked /autoware_data to /home/$USER_NAME/autoware_data"
34+
fi
35+
3036
# Execute the command as the user
3137
exec /usr/sbin/gosu "$USER_NAME" "$@"
3238
fi

docker/run.sh

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -37,9 +37,9 @@ print_help() {
3737
echo -e "Options:"
3838
echo -e " ${GREEN}--help/-h${NC} Display this help message"
3939
echo -e " ${GREEN}--map-path${NC} Specify to mount map files into /autoware_map (mandatory for runtime)"
40-
echo -e " ${GREEN}--data-path${NC} Specify to mount data files into /root/autoware_data (mandatory for runtime)"
4140
echo -e " ${GREEN}--devel${NC} Launch the latest Autoware development environment with shell access"
4241
echo -e " ${GREEN}--workspace${NC} (--devel only)Specify the directory to mount into /workspace, by default it uses current directory (pwd)"
42+
echo -e " ${GREEN}--data${NC} (--devel only)Specify the directory to mount into /autoware_data"
4343
echo -e " ${GREEN}--no-nvidia${NC} Disable NVIDIA GPU support"
4444
echo -e " ${GREEN}--headless${NC} Run Autoware in headless mode (default: false)"
4545
echo ""
@@ -70,7 +70,7 @@ parse_arguments() {
7070
MAP_PATH="$2"
7171
shift
7272
;;
73-
--data-path)
73+
--data)
7474
DATA_PATH="$2"
7575
shift
7676
;;
@@ -115,7 +115,7 @@ set_variables() {
115115

116116
# Set data path
117117
if [ "$DATA_PATH" != "" ]; then
118-
DATA="-v ${DATA_PATH}:/root/autoware_data:rw"
118+
DATA="-v ${DATA_PATH}:/autoware_data:rw"
119119
fi
120120

121121
# Set launch command
@@ -127,14 +127,13 @@ set_variables() {
127127
IMAGE="ghcr.io/autowarefoundation/autoware:universe"
128128

129129
# Set map path
130-
if [ "$MAP_PATH" = "" ] || [ "$DATA_PATH" = "" ]; then
130+
if [ "$MAP_PATH" = "" ]; then
131131
echo -e "\n------------------------------------------------------------"
132-
echo -e "${RED}Note:${NC} The --map-path and --data-path option is mandatory for the universe(runtime image). For development environment with shell access, use --devel option."
132+
echo -e "${RED}Note:${NC} The --map-path option is mandatory for the universe(runtime image). For development environment with shell access, use --devel option."
133133
echo -e "------------------------------------------------------------"
134134
exit 1
135135
else
136136
MAP="-v ${MAP_PATH}:/autoware_map:ro"
137-
DATA="-v ${DATA_PATH}:/root/autoware_data:rw"
138137
fi
139138

140139
# Set default launch command if not provided
@@ -185,6 +184,9 @@ main() {
185184
if [ "$MAP_PATH" != "" ]; then
186185
echo -e "${GREEN}MAP PATH(mounted):${NC} ${MAP_PATH}:/autoware_map"
187186
fi
187+
if [ "$DATA_PATH" != "" ]; then
188+
echo -e "${GREEN}DATA PATH(mounted):${NC} ${DATA_PATH}:/autoware_data"
189+
fi
188190
echo -e "${GREEN}LAUNCH CMD:${NC} ${LAUNCH_CMD}"
189191
echo -e "${GREEN}-----------------------------------------------------------------${NC}"
190192

0 commit comments

Comments
 (0)