-
Notifications
You must be signed in to change notification settings - Fork 48
/
Copy pathDockerfile.tester
68 lines (50 loc) · 2.3 KB
/
Dockerfile.tester
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
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
FROM ros:jazzy-perception AS base
SHELL [ "/bin/bash" , "-c" ]
WORKDIR /opt/ros/underlay
ENV ROS_HOME=/tmp
ENV RMW_IMPLEMENTATION=rmw_zenoh_cpp
# underlay stage: base + dependencies built
FROM base AS underlay
ADD ibpc_interfaces /opt/ros/underlay/src/ibpc_interfaces
RUN . /opt/ros/jazzy/setup.sh \
&& apt-get update \
&& rosdep update \
&& rosdep install --from-paths src --ignore-src --rosdistro jazzy -yir \
&& colcon build --cmake-args -DCMAKE_BUILD_TYPE=Release \
--event-handlers=console_direct+ \
--merge-install
FROM underlay AS overlay
RUN apt-get update \
&& apt install -y ros-jazzy-rmw-zenoh-cpp \
&& rm -rf /var/lib/apt/lists/*
ADD ibpc_tester /opt/ros/overlay/src/ibpc_tester
RUN . /opt/ros/jazzy/setup.sh \
&& . /opt/ros/underlay/install/setup.sh \
&& cd /opt/ros/overlay \
# clone bop_toolkit and pin version to include changes from https://github.com/thodan/bop_toolkit/pull/176.
&& cd src/ && git clone https://github.com/thodan/bop_toolkit.git && cd bop_toolkit && git checkout 0cb4be14cbde81d9d19d6dfc8a2ae253cc42d411 && cd ../../ \
# && rosdep install --from-paths src --ignore-src --rosdistro jazzy -yir \
&& colcon build --cmake-args -DCMAKE_BUILD_TYPE=Release \
--event-handlers=console_direct+ \
--merge-install
# result stage: base + copied install folders from the overlay + service setup.
FROM base
RUN apt-get update \
&& apt upgrade -y \
&& apt install -y ros-jazzy-rmw-zenoh-cpp python3-imageio python3-pandas python3-png python3-pip python3-scipy \
&& rm -rf /var/lib/apt/lists/*
# TODO remove deprecated pytz usage
RUN python3 -m pip install pytz --break-system-packages
COPY --from=overlay /opt/ros/underlay/install /opt/ros/underlay/install
COPY --from=overlay /opt/ros/overlay/install /opt/ros/overlay/install
RUN sed --in-place \
--expression '$isource "/opt/ros/overlay/install/setup.bash"' \
/ros_entrypoint.sh
ENV DATASET_NAME=ipd
ENV OUTPUT_DIR=/submission
ENV OUTPUT_FILENAME=submission.csv
ENV SERVICE_PACKAGE=ibpc_tester
ENV SERVICE_EXECUTABLE_NAME=ibpc_tester
ENV SPLIT_TYPE=val
CMD exec /opt/ros/overlay/install/lib/${SERVICE_PACKAGE}/${SERVICE_EXECUTABLE_NAME} \
--ros-args -p dataset_name:=${DATASET_NAME} -p split_type:=${SPLIT_TYPE} -p output_dir:=${OUTPUT_DIR} -p output_filename:=${OUTPUT_FILENAME}