From 0806c0ab85906fb53b26358451592390f63e473f Mon Sep 17 00:00:00 2001 From: Rishi Soni Date: Sun, 29 Sep 2024 16:14:45 -0400 Subject: [PATCH 1/5] Updated legacy dockerfile with new setup --- Dockerfile | 2 +- Dockerfile.dev | 98 ++++++++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 99 insertions(+), 1 deletion(-) create mode 100644 Dockerfile.dev diff --git a/Dockerfile b/Dockerfile index f1bdef3446b..2f197b3fa34 100644 --- a/Dockerfile +++ b/Dockerfile @@ -18,4 +18,4 @@ ENV LANG en_US.UTF-8 COPY . ~/robocup-software WORKDIR ~/robocup-software -RUN sudo ./util/ubuntu-setup --yes --no-submodules +RUN sudo ./util/ubuntu-setup --yes --no-submodules \ No newline at end of file diff --git a/Dockerfile.dev b/Dockerfile.dev new file mode 100644 index 00000000000..b48842ec4a7 --- /dev/null +++ b/Dockerfile.dev @@ -0,0 +1,98 @@ +# The image has been pushed to rishiso/robocup-software:latest on DockerHub +# Please read https://hub.docker.com/repository/docker/rishiso/robocup-software/general for usage + +# Use the official Ubuntu 22.04 image +FROM ubuntu:22.04 + +# Set environment variables for non-interactive installation +ENV DEBIAN_FRONTEND=noninteractive +ENV USER=root +ENV DISPLAY=:1 + +# Define the architecture-specific variable +ARG TARGETARCH +ENV TARGETARCH=${TARGETARCH} + +# Update the package list and install necessary packages, including the missing ones +RUN apt-get update && \ + apt-get install -y \ + xfce4 xfce4-goodies \ + tightvncserver \ + xterm \ + sudo \ + dbus-x11 \ + git \ + net-tools \ + vim \ + python3 \ + python3-pip \ + curl \ + wget \ + cmake \ + build-essential \ + lsb-release \ + software-properties-common \ + gnupg \ + locales \ + && apt-get clean + +# Install websockify and its dependencies (latest stable version) +RUN pip3 install --upgrade websockify + +# Download and install the latest stable version of noVNC from GitHub +RUN git clone https://github.com/novnc/noVNC.git /opt/noVNC && \ + cd /opt/noVNC && \ + git checkout v1.3.0 && \ + ln -s /opt/noVNC/vnc.html /opt/noVNC/index.html + +# Setup the VNC server configuration +RUN mkdir -p /root/.vnc && \ + echo "#!/bin/bash\nxrdb $HOME/.Xresources\nstartxfce4 &" > /root/.vnc/xstartup && \ + chmod +x /root/.vnc/xstartup + +# Clone RoboJackets RoboCup software and install dependencies +RUN git clone https://github.com/RoboJackets/robocup-software.git /root/robocup-software + +# Set timezone to avoid interactive prompt +ENV TZ=America/New_York +RUN ln -snf /usr/share/zoneinfo/$TZ /etc/localtime && echo $TZ > /etc/timezone + +# Install dependencies +RUN cd /root/robocup-software && \ + ./util/ubuntu-setup -y || { echo 'ubuntu-setup script failed' ; exit 1; } + +RUN cd /root/robocup-software && \ + ./util/git-setup || { echo 'git-setup script failed' ; exit 1; } + +# Clone and build ER-Force’s simulator +RUN git clone https://github.com/robotics-erlangen/framework.git /root/framework && \ + cd /root/framework && \ + mkdir build && cd build && \ + cmake .. && \ + make simulator-cli + +# Use bash to source the ROS2 setup file and run make perf +RUN bash -c "source /opt/ros/humble/setup.bash && \ + cd /root/robocup-software && make perf && \ + source install/setup.bash" + +# Install external ref (conditionally download the correct binary based on architecture) +RUN cd /root && \ + if [ "$TARGETARCH" = "amd64" ]; then \ + curl https://github.com/RoboCup-SSL/ssl-game-controller/releases/download/v3.12.3/ssl-game-controller_v3.12.3_linux_amd64 -L -O; \ + elif [ "$TARGETARCH" = "arm64" ]; then \ + curl https://github.com/RoboCup-SSL/ssl-game-controller/releases/download/v3.12.3/ssl-game-controller_v3.12.3_linux_arm64 -L -O; \ + fi && \ + chmod +x ssl-game-controller_v3.12.3_linux_* + +# Expose the VNC, noVNC, and external ref ports +EXPOSE 5901 6080 8081 + +# Start the VNC server and noVNC services +CMD ["/bin/bash", "-c", "\ + rm -rf /tmp/.X1-lock /tmp/.X11-unix/X1 && \ + mkdir -p /root/.vnc && \ + echo 'password' | vncpasswd -f > /root/.vnc/passwd && \ + chmod 600 /root/.vnc/passwd && \ + vncserver :1 -geometry 1920x1080 -depth 24 && \ + /opt/noVNC/utils/novnc_proxy --vnc localhost:5901 --listen 6080"] \ No newline at end of file From 43a17f747cb9a74bdf91cd3c59ca7ef03cfe7ca8 Mon Sep 17 00:00:00 2001 From: Rishi Soni Date: Sun, 29 Sep 2024 16:24:26 -0700 Subject: [PATCH 2/5] Updating documentation for Docker --- docs/source/installation.rst | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/docs/source/installation.rst b/docs/source/installation.rst index 4f6b5b8f671..7a61813d566 100644 --- a/docs/source/installation.rst +++ b/docs/source/installation.rst @@ -5,6 +5,8 @@ Installation If you are completely unfamiliar with the command line or basic git usage, see the Tutorial page before proceeding. +Virtual Machine Setup +--------------------- We only provide official support for Ubuntu 22.04 due to ROS2. Make sure you are on an Ubuntu 22.04 machine before continuing. For Windows users, using WSL2 with Ubuntu 22.04 will work. The steps to set this up can be found `here @@ -125,6 +127,13 @@ If everything is working properly, you should see the following window show up. ./_static/soccer.png +Docker Setup +------------ +Instead of using a virtual machine, you can also install robocup software using Docker. +The Docker image has our software stack and all the dependencies pre-installed with +a desktop GUI. The steps for installation can be found on +`DockerHub +`_. Shortcuts --------- From ea8738562fedaf54569001aca2010732b3755fb1 Mon Sep 17 00:00:00 2001 From: Rishi Soni Date: Sun, 29 Sep 2024 16:31:58 -0700 Subject: [PATCH 3/5] Slight modification to docs --- docs/source/installation.rst | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/docs/source/installation.rst b/docs/source/installation.rst index 7a61813d566..f4c9045b500 100644 --- a/docs/source/installation.rst +++ b/docs/source/installation.rst @@ -129,10 +129,15 @@ If everything is working properly, you should see the following window show up. Docker Setup ------------ -Instead of using a virtual machine, you can also install robocup software using Docker. -The Docker image has our software stack and all the dependencies pre-installed with -a desktop GUI. The steps for installation can be found on -`DockerHub +Instead of using a virtual machine, you can also install our software using Docker. +The Docker image has our tech stack and all the dependencies pre-installed with +a desktop GUI. The Docker setup should work on any platform (Windows, Mac, ARM, AMD, etc.). + +Before you start, make sure you have Docker installed on your computer. The steps for doing +so can be found at https://docs.docker.com/engine/install/. + +Once you have Docker installed, please follow the steps for installing and using our RoboCup +image at `DockerHub `_. Shortcuts From 78d40ba3be6a98857c01ad5c50f0723d831f342d Mon Sep 17 00:00:00 2001 From: Rishi Soni Date: Wed, 22 Jan 2025 21:54:16 -0500 Subject: [PATCH 4/5] Cleanup --- Dockerfile | 2 +- Dockerfile.dev | 8 +++----- docs/source/installation.rst | 26 +++++++++++++++++--------- 3 files changed, 21 insertions(+), 15 deletions(-) diff --git a/Dockerfile b/Dockerfile index 6c6df68ec5c..d4d075085b3 100644 --- a/Dockerfile +++ b/Dockerfile @@ -18,4 +18,4 @@ ENV LANG en_US.UTF-8 COPY . ~/robocup-software WORKDIR ~/robocup-software -RUN sudo ./util/ubuntu-setup --yes --no-submodules \ No newline at end of file +RUN sudo ./util/ubuntu-setup --yes --no-submodules diff --git a/Dockerfile.dev b/Dockerfile.dev index b48842ec4a7..cc264dc872e 100644 --- a/Dockerfile.dev +++ b/Dockerfile.dev @@ -1,6 +1,3 @@ -# The image has been pushed to rishiso/robocup-software:latest on DockerHub -# Please read https://hub.docker.com/repository/docker/rishiso/robocup-software/general for usage - # Use the official Ubuntu 22.04 image FROM ubuntu:22.04 @@ -73,7 +70,8 @@ RUN git clone https://github.com/robotics-erlangen/framework.git /root/framework # Use bash to source the ROS2 setup file and run make perf RUN bash -c "source /opt/ros/humble/setup.bash && \ - cd /root/robocup-software && make perf && \ + cd /root/robocup-software && \ + make perf && \ source install/setup.bash" # Install external ref (conditionally download the correct binary based on architecture) @@ -95,4 +93,4 @@ CMD ["/bin/bash", "-c", "\ echo 'password' | vncpasswd -f > /root/.vnc/passwd && \ chmod 600 /root/.vnc/passwd && \ vncserver :1 -geometry 1920x1080 -depth 24 && \ - /opt/noVNC/utils/novnc_proxy --vnc localhost:5901 --listen 6080"] \ No newline at end of file + /opt/noVNC/utils/novnc_proxy --vnc localhost:5901 --listen 6080"] diff --git a/docs/source/installation.rst b/docs/source/installation.rst index f4c9045b500..050344ce4ba 100644 --- a/docs/source/installation.rst +++ b/docs/source/installation.rst @@ -5,8 +5,14 @@ Installation If you are completely unfamiliar with the command line or basic git usage, see the Tutorial page before proceeding. -Virtual Machine Setup ---------------------- +There are two main ways to install our software. The first is use a native +or virtual machine running Ubuntu 22.04, and the second is to use Docker. +The Docker method is recommended for Mac users. + + +Native/Virtual Machine Setup +---------------------------- + We only provide official support for Ubuntu 22.04 due to ROS2. Make sure you are on an Ubuntu 22.04 machine before continuing. For Windows users, using WSL2 with Ubuntu 22.04 will work. The steps to set this up can be found `here @@ -123,22 +129,24 @@ simulator, plus a UI to show what's happening, run the following: If everything is working properly, you should see the following window show up. -.. image:: +.. image:: ./_static/soccer.png - ./_static/soccer.png Docker Setup ------------- -Instead of using a virtual machine, you can also install our software using Docker. -The Docker image has our tech stack and all the dependencies pre-installed with -a desktop GUI. The Docker setup should work on any platform (Windows, Mac, ARM, AMD, etc.). +---------------------------- + +Instead of using an Ubuntu 22.04 machine, you can also install our software using our Docker +image that runs Ubuntu 22.04. The Docker image also has our tech stack and all the dependencies +pre-installed with a desktop GUI. The Docker setup should work on any platform +(Windows, Mac, ARM, x86, etc.). Before you start, make sure you have Docker installed on your computer. The steps for doing so can be found at https://docs.docker.com/engine/install/. Once you have Docker installed, please follow the steps for installing and using our RoboCup image at `DockerHub -`_. +`_. + Shortcuts --------- From aa098de99774162154a56363d1ec46ee14353d72 Mon Sep 17 00:00:00 2001 From: Rishi Soni Date: Thu, 23 Jan 2025 09:38:43 -0500 Subject: [PATCH 5/5] Fixing bad link --- docs/source/installation.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/source/installation.rst b/docs/source/installation.rst index 050344ce4ba..1bae0c78ac5 100644 --- a/docs/source/installation.rst +++ b/docs/source/installation.rst @@ -141,7 +141,7 @@ pre-installed with a desktop GUI. The Docker setup should work on any platform (Windows, Mac, ARM, x86, etc.). Before you start, make sure you have Docker installed on your computer. The steps for doing -so can be found at https://docs.docker.com/engine/install/. +so can be found `here `_. Once you have Docker installed, please follow the steps for installing and using our RoboCup image at `DockerHub