Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix update install scripts #600

Merged
merged 10 commits into from
Oct 16, 2023
Merged
Show file tree
Hide file tree
Changes from 8 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
2 changes: 2 additions & 0 deletions .github/workflows/build.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@ name: Docker Image CI
on:
push:
branches: [ "dev*" ]
pull_request:
branches: [ "dev" ]
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should we add the master branch here too?


jobs:
build_dockerImage:
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}
6 changes: 3 additions & 3 deletions docs/Installation/installation.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# Instructions
There are two ways of starting ATOS: using the docker image or building from source. The docker image is the easiest way to get started, but if you intend to make changes to ATOS, we recommend building from source.
There are two ways of starting ATOS: using the docker image or building from source. The docker image is the easiest way to get started, but if you intend to make changes to ATOS, we recommend building from source with the setup_atos.sh script.

## <a name="docker"></a> Using the docker image
To run ATOS using docker compose, first [install docker](https://docs.docker.com/engine/install/) on your computer. Download the [ATOS repo](https://github.com/RI-SE/ATOS). Then, run the following command from the root repo directory:
Expand All @@ -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