Skip to content
Draft
Show file tree
Hide file tree
Changes from all 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
55 changes: 42 additions & 13 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,23 +1,52 @@
ARG ROS_DISTRO=humble
ARG GENESIS_VER="0.2.1"

FROM docker.io/osrf/ros:${ROS_DISTRO}-desktop

# --------------------------------------------------------------------------- #
FROM docker.io/osrf/ros:${ROS_DISTRO}-desktop as base
WORKDIR /ws

RUN apt-get update && \
apt-get install -y \
RUN apt update \
&& apt install -y \
zsh \
ros-dev-tools && \
ros-dev-tools \
# Setup workspace
git clone -b humble-devel https://github.com/AGH-CEAI/aegis_ros.git src/aegis_ros && \
vcs import src < src/aegis_ros/aegis/aegis.repos && \
&& git clone -b humble-devel https://github.com/AGH-CEAI/aegis_ros.git src/aegis_ros \
&& vcs import src < src/aegis_ros/aegis/aegis.repos \
# Install dependencies
rosdep update --rosdistro $ROS_DISTRO && \
rosdep install --from-paths src -y -i && \
&& rosdep update --rosdistro ${ROS_DISTRO} \
&& rosdep install --from-paths src -y -i \
# Size optimalization
export SUDO_FORCE_REMOVE=yes && \
apt-get autoremove -y && \
apt-get clean && \
rm -rf /var/lib/apt/lists/*
&& export SUDO_FORCE_REMOVE=yes \
&& apt autoremove -y \
&& apt clean \
&& rm -rf /var/lib/apt/lists/*

CMD ["/bin/bash"]

# --------------------------------------------------------------------------- #
FROM base as learning
Copy link
Contributor Author

Choose a reason for hiding this comment

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

TODO: create a new base image in form of
ubuntu -> osrf/ros-humble-desktop -> pytorch
or
ubuntu -> pytorch -> osrf/ros-humble-desktop

and reuse it.
Probably it's to much for now, and it should be moved to a new issue

WORKDIR /ws

RUN apt update \
&& apt install -y \
python3-pip \
&& export SUDO_FORCE_REMOVE=yes \
&& apt autoremove -y \
&& apt clean \
&& rm -rf /var/lib/apt/lists/*

RUN pip3 install \
torch==2.7.1+cu128 \
torchvision==0.22.1+cu128\
torchaudio==2.7.1+cu128 \
--index-url https://download.pytorch.org/whl/cu128

# --------------------------------------------------------------------------- #
FROM learning AS genesis-sim
ARG GENESIS_VER
WORKDIR /ws

RUN pip3 install \
genesis-world==${GENESIS_VER} \
# Downgrade libigl from a breaking change
"libigl==2.5.1"
29 changes: 29 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,16 @@ Toolbox ([toolbx](https://containertoolbx.org/)) is a development tool to mitiga
To enable GPU support in toolbx containers on Ubuntu 22/24 host [some manual updates](./docs/ubuntu_gpu_toolbx.md) are necessary.

**Building**:
Build and tag all 3 stages or build whole stack at once:
```bash
podman build . -t ceai/aegis_dev:latest
# OR
./build.sh

```
then proceed to toolbox creation:

```bash
toolbox create --image localhost/ceai/aegis_dev:latest
# Check available images
toolbox list
Expand All @@ -30,3 +38,24 @@ toolbox list
```bash
toolbox enter aegis_dev-latest
```

#### Forwarding the X-session
Podman does almost everything, there could be a problem with the magic cookie:
```bash
# 0. Setup proper display session inside the container
# in host
echo $DISPLAY
# in toolbx
export DISPLAY=<PASTE HERE>
```
If it doesn't work
```bash
# 0. Check /etc/hosts if there is a link for toolbx
sudo echo "127.0.0.1 toolbx" >> /etc/hosts
# 1. Check the MIT cookie for unix:10
xauth list
# 2. Duplicate the cookie for the toolbox
xauth add toolbx/unix:10 MIT-MAGIC-COOKIE-1 <PASTE_HERE>
# 3. You can now access the toolbx's X-session on a remote machine
ssh -X remote-host
```
7 changes: 7 additions & 0 deletions build.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
#!/bin/bash

podman build . --target base -t ceai/aegis_dev:base
podman build . --target learning -t ceai/aegis_dev:learning
podman build . --target genesis-sim -t ceai/aegis_dev:genesis-sim
podman build . -t ceai/aegis_dev:latest

Loading