Skip to content

Commit

Permalink
[Feat] Update dockerfile
Browse files Browse the repository at this point in the history
  • Loading branch information
hridaybavle committed Apr 19, 2024
1 parent 15899e0 commit c7ab80f
Show file tree
Hide file tree
Showing 9 changed files with 58 additions and 133 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/setup.sh
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#!/bin/bash

sudo apt update
sudo apt install -y libceres-dev
DEBIAN_FRONTEND=noninteractive sudo apt install -y libceres-dev

#rosdep init
rosdep update --include-eol-distros
Expand All @@ -13,7 +13,7 @@ git submodule update --init --recursive
pip3 install -r requirements.txt

#rosdep install
rosdep install --from-paths . -y --ignore-src -r
DEBIAN_FRONTEND=noninteractive rosdep install --from-paths . -y --ignore-src -r

# - Importing all dependencies
colcon build --symlink-install
6 changes: 1 addition & 5 deletions .rosinstall_ros1
Original file line number Diff line number Diff line change
Expand Up @@ -62,8 +62,4 @@ repositories:
s_graphs_utils/voxblox:
type: git
url: https://github.com/ethz-asl/voxblox.git
version: master
s_graphs_utils/ros1_graph_manager_interface:
type: git
url: [email protected]:snt-arg/ros1_graph_manager_interface.git
version: main
version: master
8 changes: 4 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -192,13 +192,13 @@ git clone [email protected]:snt-arg/lidar_s_graphs.git -b feature/ros2 s_graphs &&

3. Build image

> [!NOTE]
> In case you have a different ssh key name for your GitHub account, change `id_ed25519` oto yours.
```sh
docker build -t sntarg/s_graphs --ssh default=$HOME/.ssh/id_ed25519 .
docker build -t sntarg/s_graphs .
```

> [!NOTE]
There are two docker files, one for foxy and another for humble. The above commands build the foxy image, you use the same commands to build the humble image if needed.

## 🚀 Example on Datasets <a id="examples"></a>

> [!WARNING]
Expand Down
2 changes: 0 additions & 2 deletions docker/build.sh

This file was deleted.

38 changes: 13 additions & 25 deletions docker/foxy_noetic/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -24,23 +24,17 @@ RUN apt install --no-install-recommends -y \
ros-foxy-velodyne \
ros-foxy-teleop-twist-keyboard

# Authorize SSH Host (GitHub)
RUN mkdir -p -m 0700 /root/.ssh && \
ssh-keyscan -H github.com >> /root/.ssh/known_hosts
# Creating working spaces directory and clone s_graphs inside it
RUN mkdir -p /root/workspaces
WORKDIR /root/workspaces
RUN git clone https://github.com/snt-arg/lidar_s_graphs.git -b feature/ros2 s_graphs

# Creating working spaces directory and clone s_graphs_ros2_ws inside it
RUN mkdir -p /root/workspaces/s_graphs_ros2_ws/src
WORKDIR /root/workspaces/s_graphs_ros2_ws/src
RUN --mount=type=ssh \
git clone [email protected]:snt-arg/lidar_s_graphs.git -b feature/ros2 s_graphs

# Fetching all packages specified in the .rosinstall file and running build everything with colcon build.
WORKDIR /root/workspaces/s_graphs_ros2_ws/src/s_graphs
RUN --mount=type=ssh \
vcs import --recursive ../ < .rosinstall_ros2
WORKDIR /root/workspaces/s_graphs_ros2_ws/
# Fetching all packages specified in the gitsubmodules and running build everything with colcon build.
WORKDIR /root/workspaces/s_graphs
RUN git submodule update --init --recursive
WORKDIR /root/workspaces/s_graphs
RUN sudo apt install python3-rosdep
RUN rosdep install --from-paths src -y --ignore-src -r
RUN rosdep install --from-paths . -y --ignore-src -r
SHELL ["/bin/bash", "-c"]
RUN source /opt/ros/foxy/setup.bash && \
colcon build --symlink-install
Expand All @@ -62,11 +56,9 @@ RUN rosdep update --include-eol-distros
# Setup ROS1 workspace for ROS1 related dependencies of s_graphs
RUN mkdir -p /root/workspaces/s_graphs_ros1_ws/src
WORKDIR /root/workspaces/s_graphs_ros1_ws/src
RUN --mount=type=ssh \
git clone [email protected]:snt-arg/lidar_s_graphs.git -b feature/ros2 s_graphs
RUN git clone https://github.com/snt-arg/lidar_s_graphs.git -b feature/ros2 s_graphs
WORKDIR /root/workspaces/s_graphs_ros1_ws/src/s_graphs
RUN --mount=type=ssh \
vcs import --recursive ../ < .rosinstall_ros1
RUN vcs import --recursive ../ < .rosinstall_ros1
WORKDIR /root/workspaces/s_graphs_ros1_ws
RUN rosdep install --from-paths src --ignore-src -y -r
RUN apt install --no-install-recommends -y \
Expand All @@ -77,7 +69,6 @@ RUN source /opt/ros/noetic/setup.bash && \
catkin config --cmake-args -DCMAKE_BUILD_TYPE=Release && \
catkin build


# Install mprocs
WORKDIR /root
RUN wget https://github.com/pvolok/mprocs/releases/download/v0.6.4/mprocs-0.6.4-linux64.tar.gz
Expand All @@ -86,8 +77,5 @@ RUN tar -xf mprocs* && \
mv mprocs /usr/local/bin

# alias for mprocs
RUN echo "alias mprocs_real='mprocs -c /root/workspaces/s_graphs_ros2_ws/src/s_graphs/.real_mprocs.yaml'" >> /root/.bashrc
RUN echo "alias mprocs_virtual='mprocs -c /root/workspaces/s_graphs_ros2_ws/src/s_graphs/.virtual_mprocs.yaml'" >> /root/.bashrc

# Removing SSH Host authorization (GitHub)
RUN rm -rf /root/.ssh/
RUN echo "alias mprocs_real='mprocs -c /root/workspaces/s_graphs/.real_mprocs.yaml'" >> /root/.bashrc
RUN echo "alias mprocs_virtual='mprocs -c /root/workspaces/s_graphs/.virtual_mprocs.yaml'" >> /root/.bashrc
40 changes: 0 additions & 40 deletions docker/howtouse.md

This file was deleted.

38 changes: 38 additions & 0 deletions docker/humble/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
FROM ros:humble

# Install necessary and useful packages
RUN apt update && \
apt install --no-install-recommends -y \
ssh \
vim \
python3-pip \
python3-vcstool \
python3-catkin-tools \
wget \
git

# Creating working spaces directory and clone s_graphs inside it
RUN mkdir -p /root/workspaces
WORKDIR /root/workspaces
RUN git clone https://github.com/snt-arg/lidar_s_graphs.git -b feature/ros2 s_graphs

# Fetching all packages specified in the .rosinstall file and running build everything with colcon build.
WORKDIR /root/workspaces/s_graphs
RUN git submodule update --init --recursive
WORKDIR /root/workspaces/s_graphs
RUN sudo apt install python3-rosdep
RUN rosdep install --from-paths . -y --ignore-src -r
SHELL ["/bin/bash", "-c"]
RUN source /opt/ros/humble/setup.bash && \
colcon build --symlink-install

# Install mprocs
WORKDIR /root
RUN wget https://github.com/pvolok/mprocs/releases/download/v0.6.4/mprocs-0.6.4-linux64.tar.gz
RUN tar -xf mprocs* && \
rm mprocs*.tar.gz && \
mv mprocs /usr/local/bin

# alias for mprocs
RUN echo "alias mprocs_real='mprocs -c /root/workspaces/s_graphs/.real_mprocs.yaml'" >> /root/.bashrc
RUN echo "alias mprocs_virtual='mprocs -c /root/workspaces/s_graphs/.virtual_mprocs.yaml'" >> /root/.bashrc
49 changes: 0 additions & 49 deletions docker/noetic/Dockerfile

This file was deleted.

6 changes: 0 additions & 6 deletions docker/run.sh

This file was deleted.

0 comments on commit c7ab80f

Please sign in to comment.