From f407509cb1ff80c523a23020c0045ea16d982b50 Mon Sep 17 00:00:00 2001 From: macmacal Date: Fri, 1 Aug 2025 01:24:15 +0200 Subject: [PATCH 1/4] added learning and genesis-sim stages --- Dockerfile | 52 +++++++++++++++++++++++++++++++++++++++------------- README.md | 8 ++++++++ build.sh | 7 +++++++ 3 files changed, 54 insertions(+), 13 deletions(-) create mode 100755 build.sh diff --git a/Dockerfile b/Dockerfile index d5f97b0..4711689 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,23 +1,49 @@ 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 +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==2.7.1+cu128 \ + torchaudio==0.22.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} diff --git a/README.md b/README.md index 4c420d0..5d54158 100644 --- a/README.md +++ b/README.md @@ -17,8 +17,16 @@ Currently there is no docker compose for running it - please stick to the toolbo Toolbox ([toolbx](https://containertoolbx.org/)) is a development tool to mitigate the headaches about the users' privileges. **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 diff --git a/build.sh b/build.sh new file mode 100755 index 0000000..93ab5ba --- /dev/null +++ b/build.sh @@ -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 + From 9793702135213b2d00c71f0d6880e1ced3dd1b45 Mon Sep 17 00:00:00 2001 From: macmacal Date: Fri, 1 Aug 2025 01:34:02 +0200 Subject: [PATCH 2/4] added note about MIT-MAGIC-COOKIE --- README.md | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/README.md b/README.md index 5d54158..77ae910 100644 --- a/README.md +++ b/README.md @@ -36,3 +36,14 @@ toolbox list ```bash toolbox enter aegis_dev-latest ``` + +#### Forwarding the X-session +Podman does almost everthing, there could be a problem with the magic cookie: +```bash +# 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 +# 3. You can now access the toolbx's X-session on a remote machine +ssh -X remote-host +``` From 4e19c47d863e9dc91c7cd262f9906100c1a1da40 Mon Sep 17 00:00:00 2001 From: macmacal Date: Fri, 1 Aug 2025 13:22:02 +0200 Subject: [PATCH 3/4] depedency fixes --- Dockerfile | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/Dockerfile b/Dockerfile index 4711689..8fc5c4b 100644 --- a/Dockerfile +++ b/Dockerfile @@ -37,13 +37,16 @@ RUN apt update \ RUN pip3 install \ torch==2.7.1+cu128 \ - torchvision==2.7.1+cu128 \ - torchaudio==0.22.1+cu128 \ - --index-url https://download.pytorch.org/whl/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} +RUN pip3 install \ + genesis-world==${GENESIS_VER} \ + # Downgrade libigl from a breaking change + "libigl==2.5.1" From 65d189091f33066285b8a4ca846266af68e9249f Mon Sep 17 00:00:00 2001 From: macmacal Date: Fri, 1 Aug 2025 13:22:17 +0200 Subject: [PATCH 4/4] added more docs realted to the DISPLAY --- README.md | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 77ae910..825e20d 100644 --- a/README.md +++ b/README.md @@ -38,8 +38,18 @@ toolbox enter aegis_dev-latest ``` #### Forwarding the X-session -Podman does almost everthing, there could be a problem with the magic cookie: +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= +``` +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