Skip to content

Commit

Permalink
Divide install scripts into smaller files
Browse files Browse the repository at this point in the history
  • Loading branch information
Robert108 committed Oct 9, 2023
1 parent 524e79f commit be914bb
Show file tree
Hide file tree
Showing 9 changed files with 360 additions and 401 deletions.
1 change: 0 additions & 1 deletion .dockerignore
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
build
docs
install
scripts
plugins
gui/controlpanel/node_modules
gui/controlpanel/package-lock.json
Expand Down
102 changes: 11 additions & 91 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -8,96 +8,16 @@ FROM ${FROM_IMAGE} AS cacher
ENV DEBIAN_FRONTEND=noninteractive
RUN echo 'debconf debconf/frontend select Noninteractive' | debconf-set-selections

# Install system libs
RUN \
--mount=type=cache,target=/var/cache/apt \
apt update && apt install -y \
curl \
libsystemd-dev \
libprotobuf-dev \
protobuf-compiler \
libeigen3-dev \
nlohmann-json3-dev \
libpaho-mqtt-dev \
gnupg2 \
lsb-release \
python3-pip \
libpaho-mqtt-dev

RUN pip install pyOpenSSL

ENV ROS_DISTRO=${ROS_DISTRO}
ENV REPO_DIR=/root/atos_git
# NODE_VERSION is also specified in the install_atos.sh script
ENV NODE_VERSION=16.20.0
RUN apt install -y curl
RUN curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.39.0/install.sh | bash
ENV NVM_DIR=/root/.nvm
RUN . "$NVM_DIR/nvm.sh" && nvm install ${NODE_VERSION}
RUN . "$NVM_DIR/nvm.sh" && nvm use v${NODE_VERSION}
RUN . "$NVM_DIR/nvm.sh" && nvm alias default v${NODE_VERSION}
ENV PATH="/root/.nvm/versions/node/v${NODE_VERSION}/bin/:${PATH}"
RUN node --version
RUN npm --version

# Install ROS2 libs
RUN \
--mount=type=cache,target=/var/cache/apt \
apt update && apt install -y \
python3-colcon-common-extensions \
ros-${ROS_DISTRO}-geographic-msgs \
ros-${ROS_DISTRO}-geometry-msgs \
ros-${ROS_DISTRO}-std-msgs \
ros-${ROS_DISTRO}-std-srvs \
ros-${ROS_DISTRO}-desktop \
ros-${ROS_DISTRO}-nav-msgs \
ros-${ROS_DISTRO}-geographic-msgs \
ros-${ROS_DISTRO}-foxglove-msgs \
ros-${ROS_DISTRO}-pcl-conversions \
ros-${ROS_DISTRO}-rosbridge-suite


ENV TEMP_SRC_PATH=/root/sourceinstall
RUN mkdir -p $TEMP_SRC_PATH
WORKDIR /root/sourceinstall
# Install OpenSimulationInterface
RUN cd $TEMP_SRC_PATH && \
git clone https://github.com/OpenSimulationInterface/open-simulation-interface.git -b v3.4.0 && \
cd open-simulation-interface && \
mkdir -p build && cd build && \
cmake .. && make -j4 && \
sudo make install && \
sudo sh -c "echo '/usr/local/lib/osi3' > /etc/ld.so.conf.d/osi3.conf" && \
sudo ldconfig && \
sudo rm -rf $TEMP_SRC_PATH/open-simulation-interface

# Install esmini
RUN cd $TEMP_SRC_PATH && \
git clone https://github.com/esmini/esmini && \
cd esmini && \
mkdir -p build && cd build && \
cmake .. && make -j4 && \
sudo make install && \
sudo cp ../bin/libesminiLib.so /usr/local/lib && \
sudo cp ../bin/libesminiRMLib.so /usr/local/lib && \
sudo mkdir -p /usr/local/include/esmini/ && \
sudo cp ../EnvironmentSimulator/Libraries/esminiLib/esminiLib.hpp /usr/local/include/esmini/ && \
sudo cp ../EnvironmentSimulator/Libraries/esminiRMLib/esminiRMLib.hpp /usr/local/include/esmini/ && \
sudo ldconfig && \
sudo rm -rf $TEMP_SRC_PATH/esmini



WORKDIR /root/atos_ws
# Setup workspace (.dockerignore is used to avoid copying unnecessary files)
RUN mkdir -p ./src/atos
COPY . ./src/atos
RUN mv ./src/atos/atos_interfaces ./src

# Build
RUN . /opt/ros/${ROS_DISTRO}/setup.sh && \
MAKEFLAGS=-j4 colcon build && \
chmod +x /root/atos_ws/install/setup.sh && \
rm -rf /root/atos_ws/build /root/atos_ws/src

RUN mkdir -p /root/.astazero/ATOS
COPY ./conf /root/.astazero/ATOS/

RUN echo "source /root/atos_ws/install/setup.sh" >> /root/.bashrc
SHELL ["/bin/bash", "-c"]

WORKDIR /root/atos_git
COPY ./scripts/ ./scripts
RUN --mount=type=cache,target=/var/cache/apt \
./scripts/install_deps.sh ${REPO_DIR}
COPY . .
RUN ./scripts/install_atos.sh ${REPO_DIR}
4 changes: 2 additions & 2 deletions docs/Installation/installation.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,9 +23,9 @@ sudo chown -R $USER:$USER ~/.astazero/ATOS/
```

## <a name="Installation script"></a> Using the installation script
ATOS comes with an installation script that automates the installation process. It is intended for use on Ubuntu 20.04 or 22.04, and has been tested on a fresh install of Ubuntu 20.04. The script will install ROS 2, ATOS dependencies, and ATOS itself. It will also create a workspace and build ATOS. The script can be executed using the following command:
ATOS comes with an installation script that automates the installation process. It is intended for use on Ubuntu 20.04 or 22.04, and has been tested on a fresh install of Ubuntu 22.04. The script will install ROS 2, ATOS dependencies, and ATOS itself. It will also create a workspace and build ATOS. The script can be executed using the following command:
```bash
./install_atos.sh
./setup_atos.sh
```

## <a name="Native build"></a> Building from source manually
Expand Down
Loading

0 comments on commit be914bb

Please sign in to comment.