diff --git a/doc/manual/installation.md b/doc/manual/installation.md index 4453729d..d69eb042 100644 --- a/doc/manual/installation.md +++ b/doc/manual/installation.md @@ -76,6 +76,7 @@ docker start -i coverage-control-$USER # Replace with the name of the container - `--with-cuda` : With CUDA support - `--with-ros` : With ROS support - `--noble` : Ubuntu 24.04 Noble +- `--arm64` : ARM64 architecture The base image is `agarwalsaurav/pytorch_base` with different tags for different versions and configurations. @@ -89,6 +90,8 @@ The base image is `agarwalsaurav/pytorch_base` with different tags for different |`noble-torch2.5.1-cuda12.6.2` | `--with-cuda --noble`| |`noble-torch2.5.1-jazzy` | `--with-ros --noble`| |`noble-torch2.5.1` | `--noble`| +|`arm64-jammy-torch2.5.1-humble` | `--arm64`| +|`arm64-noble-torch2.5.1-jazzy` | `--arm64 --noble`| Install the library available on PyPI: diff --git a/doc/manual/lpac.md b/doc/manual/lpac.md index fbf58005..0ea496b0 100644 --- a/doc/manual/lpac.md +++ b/doc/manual/lpac.md @@ -34,7 +34,7 @@ They are similar, except that `data_generation.py` splits the dataset into train To generate a dataset, run the following command: ```bash python python/data_generation/data_generation.py \ - ${CoverageControl_ws}/lpac/params/data_params.toml + ${CoverageControl_ws}/lpac/params/data_params.toml --split True ``` A sample `data_params.toml` file is also provided in the `params` directory of the repository. diff --git a/utils/docker/base_images/.bashrc b/utils/docker/.bashrc similarity index 98% rename from utils/docker/base_images/.bashrc rename to utils/docker/.bashrc index e1c1eb55..23d8c5af 100755 --- a/utils/docker/base_images/.bashrc +++ b/utils/docker/.bashrc @@ -129,5 +129,4 @@ export EDITOR="$VISUAL" export LC_ALL=C.UTF-8 export LANG=C.UTF-8 -export PYTHONPATH=/opt/venv/lib/python3.11/site-packages:$PYTHONPATH source /opt/venv/bin/activate diff --git a/utils/docker/base_images/.ros.humble.bashrc b/utils/docker/.ros.bashrc similarity index 97% rename from utils/docker/base_images/.ros.humble.bashrc rename to utils/docker/.ros.bashrc index 01bc6d4a..22ee8df1 100755 --- a/utils/docker/base_images/.ros.humble.bashrc +++ b/utils/docker/.ros.bashrc @@ -133,10 +133,8 @@ export PYTHONPATH=/opt/venv/lib/python3.10/site-packages:$PYTHONPATH export ROS_DOMAIN_ID=7 export ROS_VERSION=2 -export ROS_DISTRO=humble export ROS_PYTHON_VERSION=3 -source /opt/venv/bin/activate -source /opt/ros/humble/setup.bash +source /opt/ros/${ROS_DISTRO}/setup.bash source /usr/share/colcon_cd/function/colcon_cd.sh -export _colcon_cd_root=/opt/ros/humble/ +export _colcon_cd_root=/opt/ros/${ROS_DISTRO}/ source /usr/share/colcon_argcomplete/hook/colcon-argcomplete.bash diff --git a/utils/docker/Dockerfile b/utils/docker/Dockerfile index 7928794c..b6ad5d7c 100644 --- a/utils/docker/Dockerfile +++ b/utils/docker/Dockerfile @@ -1,16 +1,148 @@ -ARG BASE_IMAGE=ghcr.io/kumarrobotics/pytorch_base -ARG BASE_TAG=latest -ARG SETUP_ARGS="--with-cuda" - -FROM ${BASE_IMAGE}:${BASE_TAG} -WORKDIR /app -ADD . . -RUN ["bash", "-c", "/app/setup.sh ${SETUP_ARGS}"] -RUN ${VENV_PATH}/bin/pip install coverage_control - -RUN echo "export CoverageControl_ws=/workspace" >> /root/.bashrc -COPY utils/docker/entrypoint.sh /entrypoint.sh -RUN chmod +x /entrypoint.sh -ENTRYPOINT ["/entrypoint.sh"] - -# RUN export SETUP_ARGS=${SETUP_ARGS} && source ${VENV_PATH}/bin/activate && bash -c "./setup.sh ${SETUP_ARGS}" +ARG IMAGE_TYPE="cpu" +ARG CUDA_VERSION="12.4.1" +ARG UBUNTU_VERSION="22.04" + +FROM nvidia/cuda:${CUDA_VERSION}-devel-ubuntu${UBUNTU_VERSION} AS cuda +ARG PYTORCH_VERSION="2.5.1" +ENV PYTORCH_VERSION=${PYTORCH_VERSION} +COPY requirements.txt /opt/requirements.txt +RUN mkdir download; \ + wget https://download.pytorch.org/libtorch/cu124/libtorch-win-shared-with-deps-${PYTORCH_VERSION}%2Bcu124.zip -O download/libtorch.zip; \ + unzip download/libtorch.zip -d /opt/; \ + rm -r download + +FROM ubuntu:${UBUNTU_VERSION} AS cpu +ARG PYTORCH_VERSION="2.5.1" +ENV PYTORCH_VERSION=${PYTORCH_VERSION} +COPY requirements_cpu.txt /opt/requirements.txt +RUN mkdir download; \ + wget https://download.pytorch.org/libtorch/cpu/libtorch-cxx11-abi-shared-with-deps-${PYTORCH_VERSION}%2Bcpu.zip -O download/libtorch.zip; \ + unzip download/libtorch.zip -d /opt/; \ + rm -r download + +FROM arm64v8/ubuntu:${UBUNTU_VERSION} AS arm64 +ARG PYTORCH_VERSION="2.5.1" +ENV PYTORCH_VERSION=${PYTORCH_VERSION} +COPY requirements_cpu.txt /opt/requirements.txt +RUN mkdir download; \ + wget https://github.com/AgarwalSaurav/libtorch_arm64/releases/download/v${PYTORCH_VERSION}/libtorch-cxx11-abi-shared-with-deps-${PYTORCH_VERSION}.zip -O download/libtorch.zip; \ + unzip download/libtorch.zip -d /opt/; \ + rm -r download + +FROM ${IMAGE_TYPE} AS base +ARG PYTHON_VERSION="3.10" +LABEL maintainer="Saurav Agarwal " +LABEL description="Dockerfile for PyTorch GPU and ROS2" + +SHELL ["/bin/bash", "-c"] + +ENV DEBIAN_FRONTEND=noninteractive +ENV PYTHON_VERSION=${PYTHON_VERSION} +ENV TERM=xterm-256color + +RUN apt-get update && apt-get install -y apt-utils + +RUN apt-get -y update \ + && apt-get -y upgrade \ + && apt-get -y install \ + build-essential \ + git \ + wget \ + gpg \ + curl \ + gdb \ + libbz2-dev \ + software-properties-common \ + ca-certificates \ + lsb-release \ + net-tools iputils-ping \ + locales \ + python${PYTHON_VERSION} \ + python${PYTHON_VERSION}-dev \ + python${PYTHON_VERSION}-venv \ + && apt-get -y autoremove \ + && apt-get -y clean autoclean + +# Add repo for installing latest version of cmake +RUN wget -O - https://apt.kitware.com/keys/kitware-archive-latest.asc 2>/dev/null | gpg --dearmor - | tee /usr/share/keyrings/kitware-archive-keyring.gpg >/dev/null; \ + echo 'deb [signed-by=/usr/share/keyrings/kitware-archive-keyring.gpg] https://apt.kitware.com/ubuntu/ jammy main' | tee /etc/apt/sources.list.d/kitware.list >/dev/null; \ + apt-get -y update; \ + rm /usr/share/keyrings/kitware-archive-keyring.gpg \ + && apt-get -y install kitware-archive-keyring + +RUN apt-get -y install \ + cmake \ + libgmp-dev \ + libmpfr-dev \ + libboost-all-dev \ + libeigen3-dev \ + libgeos-dev \ + libyaml-cpp-dev \ + vim \ + neovim \ + tmux \ + ffmpeg \ + unzip \ + gnuplot-nox \ + ninja-build \ + libpng-dev \ + libjpeg-dev \ + libopencv-dev \ + python3-opencv \ + && apt-get -y autoremove \ + && apt-get -y clean autoclean \ + && rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/* \ + && rm -f /var/cache/apt/archives/*.deb \ + && rm -f /var/cache/apt/archives/parital/*.deb \ + && rm -f /var/cache/apt/*.bin + +ENV LD_LIBRARY_PATH="/usr/local/lib:/opt/libtorch/lib" +ENV Torch_DIR=/opt/libtorch/share/cmake/ + +RUN python${PYTHON_VERSION} -m venv /opt/venv \ + && /opt/venv/bin/pip install --no-cache-dir wheel \ + && /opt/venv/bin/pip install --no-cache-dir -r /opt/requirements.txt +ENV VENV_PATH=/opt/venv + +COPY .bashrc /root/.bashrc + +FROM base AS ros2 +ARG ROS_DISTRO="humble" +ENV ROS_DISTRO=${ROS_DISTRO} +RUN apt-get -y update \ + && add-apt-repository universe \ + && locale-gen en_US en_US.UTF-8 \ + && update-locale LC_ALL=en_US.UTF-8 LANG=en_US.UTF-8 \ + && export LANG=en_US.UTF-8 \ + && curl -sSL https://raw.githubusercontent.com/ros/rosdistro/master/ros.key -o /usr/share/keyrings/ros-archive-keyring.gpg \ + && echo "deb [arch=$(dpkg --print-architecture) signed-by=/usr/share/keyrings/ros-archive-keyring.gpg] http://packages.ros.org/ros2/ubuntu $(. /etc/os-release && echo $UBUNTU_CODENAME) main" | tee /etc/apt/sources.list.d/ros2.list > /dev/null \ + && apt-get -y update \ + && apt-get install -y \ + python3-colcon-common-extensions \ + python3-vcstool \ + python3-pip \ + python3-argcomplete \ + python3-rosdep \ + python3-rosinstall-generator \ + ros-${ROS_DISTRO}-desktop \ + ros-dev-tools \ + ros-${ROS_DISTRO}-rmw-cyclonedds-cpp \ + ros-${ROS_DISTRO}-ros-gz \ + ros-${ROS_DISTRO}-ros2bag \ + ros-${ROS_DISTRO}-rosidl-generator-dds-idl \ + && apt-get -y autoremove \ + && apt-get -y clean autoclean \ + && rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/* \ + && rm -f /var/cache/apt/archives/*.deb \ + && rm -f /var/cache/apt/archives/parital/*.deb \ + && rm -f /var/cache/apt/*.bin + +RUN /opt/venv/bin/pip install --no-cache-dir catkin_pkg empy==3.3.4 lark tomli +RUN echo $'\n\ +export PYTHONPATH=/opt/venv/lib/python${PYTHON_VERSION}/site-packages:$PYTHONPATH\n\ +export ROS_PYTHON_VERSION=3\n\ +export ROS_VERSION=2\n\ +export ROS_DOMAIN_ID=10\n\ +source /opt/ros/${ROS_DISTRO}/setup.bash\n\ +source /usr/share/colcon_cd/function/colcon_cd.sh\n\ +export _colcon_cd_root=/opt/ros/${ROS_DISTRO}' >> /root/.bashrc diff --git a/utils/docker/base_images/.ros.jazzy.bashrc b/utils/docker/base_images/.ros.jazzy.bashrc deleted file mode 100755 index 8c78a5cc..00000000 --- a/utils/docker/base_images/.ros.jazzy.bashrc +++ /dev/null @@ -1,142 +0,0 @@ -#!/bin/bash -# ~/.bashrc: executed by bash(1) for non-login shells. -# see /usr/share/doc/bash/examples/startup-files (in the package bash-doc) -# for examples - -# If not running interactively, don't do anything -case $- in - *i*) ;; - *) return;; -esac - -# don't put duplicate lines or lines starting with space in the history. -# See bash(1) for more options -HISTCONTROL=ignoreboth - -# append to the history file, don't overwrite it -shopt -s histappend - -# for setting history length see HISTSIZE and HISTFILESIZE in bash(1) -HISTSIZE=1000 -HISTFILESIZE=2000 - -# check the window size after each command and, if necessary, -# update the values of LINES and COLUMNS. -shopt -s checkwinsize - -# If set, the pattern "**" used in a pathname expansion context will -# match all files and zero or more directories and subdirectories. -#shopt -s globstar - -# make less more friendly for non-text input files, see lesspipe(1) -[ -x /usr/bin/lesspipe ] && eval "$(SHELL=/bin/sh lesspipe)" - -# set variable identifying the chroot you work in (used in the prompt below) -if [ -z "${debian_chroot:-}" ] && [ -r /etc/debian_chroot ]; then - debian_chroot=$(cat /etc/debian_chroot) -fi - -# set a fancy prompt (non-color, unless we know we "want" color) -case "$TERM" in - xterm-color|*-256color) color_prompt=yes;; -esac - -# uncomment for a colored prompt, if the terminal has the capability; turned -# off by default to not distract the user: the focus in a terminal window -# should be on the output of commands, not on the prompt -#force_color_prompt=yes - -if [ -n "$force_color_prompt" ]; then - if [ -x /usr/bin/tput ] && tput setaf 1 >&/dev/null; then - # We have color support; assume it's compliant with Ecma-48 - # (ISO/IEC-6429). (Lack of such support is extremely rare, and such - # a case would tend to support setf rather than setaf.) - color_prompt=yes - else - color_prompt= - fi -fi - -if [ "$color_prompt" = yes ]; then - # PS1="\e]0;${debian_chroot:+($debian_chroot)}\u@\h: \w\a\]\[\033[01;31m\]\u@\h\[\033[00m\]:\[\033[01;34m\]\W\[\033[00m\]\$" - # Change username and hostname color to red - PS1="\[\033[01;31m\]\u@\h\[\033[00m\]:\[\033[01;34m\]\W\[\033[00m\]\$ " -else - PS1='${debian_chroot:+($debian_chroot)}\u@\h:\w\$ ' -fi -unset color_prompt force_color_prompt - -# If this is an xterm set the title to user@host:dir -case "$TERM" in -xterm*|rxvt*) - PS1="\[\e]0;${debian_chroot:+($debian_chroot)}\u@\h: \w\a\]$PS1" - ;; -*) - ;; -esac - -# enable color support of ls and also add handy aliases -if [ -x /usr/bin/dircolors ]; then - test -r ~/.dircolors && eval "$(dircolors -b ~/.dircolors)" || eval "$(dircolors -b)" - alias ls='ls --color=auto' - #alias dir='dir --color=auto' - #alias vdir='vdir --color=auto' - - alias grep='grep --color=auto' - alias fgrep='fgrep --color=auto' - alias egrep='egrep --color=auto' -fi - -# colored GCC warnings and errors -#export GCC_COLORS='error=01;31:warning=01;35:note=01;36:caret=01;32:locus=01:quote=01' - -# some more ls aliases -alias ll='ls -alF' -alias la='ls -A' -alias l='ls -CF' - -# Add an "alert" alias for long running commands. Use like so: -# sleep 10; alert -alias alert='notify-send --urgency=low -i "$([ $? = 0 ] && echo terminal || echo error)" "$(history|tail -n1|sed -e '\''s/^\s*[0-9]\+\s*//;s/[;&|]\s*alert$//'\'')"' - -# Alias definitions. -# You may want to put all your additions into a separate file like -# ~/.bash_aliases, instead of adding them here directly. -# See /usr/share/doc/bash-doc/examples in the bash-doc package. - -if [ -f ~/.bash_aliases ]; then - . ~/.bash_aliases -fi - -# enable programmable completion features (you don't need to enable -# this, if it's already enabled in /etc/bash.bashrc and /etc/profile -# sources /etc/bash.bashrc). -if ! shopt -oq posix; then - if [ -f /usr/share/bash-completion/bash_completion ]; then - . /usr/share/bash-completion/bash_completion - elif [ -f /etc/bash_completion ]; then - . /etc/bash_completion - fi -fi - -set -o vi -#export TERM="xterm-256color" -#[ -n "$PS1" ] && sh ~/.vim/bundle/snow/shell/snow_dark.sh -alias tmux='tmux -2' - -export VISUAL=vim -export EDITOR="$VISUAL" - -export LC_ALL=C.UTF-8 -export LANG=C.UTF-8 -export PYTHONPATH=/opt/venv/lib/python3.12/site-packages:$PYTHONPATH - -export ROS_DOMAIN_ID=7 -export ROS_VERSION=2 -export ROS_DISTRO=jazzy -export ROS_PYTHON_VERSION=3 -source /opt/venv/bin/activate -source /opt/ros/jazzy/setup.bash -source /usr/share/colcon_cd/function/colcon_cd.sh -export _colcon_cd_root=/opt/ros/jazzy/ -# source /opt/venv/share/colcon_argcomplete/hook/colcon-argcomplete.bash diff --git a/utils/docker/base_images/build_all_images.sh b/utils/docker/base_images/build_all_images.sh deleted file mode 100644 index 03ef0a8c..00000000 --- a/utils/docker/base_images/build_all_images.sh +++ /dev/null @@ -1,63 +0,0 @@ -print_usage() { - echo "Usage: ./build_all_images.sh " - echo "Example: ./build_all_images.sh johndoe/repo_name" - echo "Example: ./build_all_images.sh ghcr.io/johndoe/repo_name" - exit 1 -} - -if [ "$#" -ne 1 ]; then - print_usage -fi - -# Function build image takes 2 arguments: 1. username/repo_name 2. tag_name 3. Dockerfile -# Example: build_image johndoe/repo_name pytorch2.2.2 ubuntu22.04.Dockerfile -build_image() { - echo "Building image $2" - TAG_NAME=$2 - ALL_BUILD_ARGS="--no-cache --build-arg CUDA_VERSION=${CUDA_VERSION} --build-arg PYTHON_VERSION=${PYTHON_VERSION} --build-arg PYTORCH_VERSION=${PYTORCH_VERSION}" - echo "docker buildx build ${ALL_BUILD_ARGS} -t ${1}:${TAG_NAME} -f $3 ." - docker buildx build --push ${ALL_BUILD_ARGS} -t ${1}:${TAG_NAME} -f $3 . - if [ $? -ne 0 ]; then - echo "Failed to build image $2" - exit 1 - fi -} - -CUDA_VERSION="12.4.1" -PYTHON_VERSION="3.11" -PYTORCH_VERSION="2.5.1" -TAG_NAME=jammy-torch${PYTORCH_VERSION}-cuda${CUDA_VERSION} -build_image $1 $TAG_NAME ubuntu22.04/cuda.Dockerfile - -PYTHON_VERSION="3.10" -TAG_NAME=jammy-torch${PYTORCH_VERSION}-humble -build_image $1 $TAG_NAME ubuntu22.04/ros2.Dockerfile - -PYTHON_VERSION="3.10" -TAG_NAME=jammy-torch${PYTORCH_VERSION}-cuda${CUDA_VERSION}-humble -build_image $1 $TAG_NAME ubuntu22.04/cuda-ros2.Dockerfile - -PYTHON_VERSION="3.11" -TAG_NAME=jammy-torch${PYTORCH_VERSION} -build_image $1 $TAG_NAME ubuntu22.04/Dockerfile - -CUDA_VERSION="12.6.2" -PYTHON_VERSION="3.12" -PYTORCH_VERSION="2.5.1" -TAG_NAME=noble-torch${PYTORCH_VERSION}-cuda${CUDA_VERSION} -build_image $1 $TAG_NAME ubuntu24.04/cuda.Dockerfile - -TAG_NAME=noble-torch${PYTORCH_VERSION}-jazzy -build_image $1 $TAG_NAME ubuntu24.04/ros2.Dockerfile - -TAG_NAME=noble-torch${PYTORCH_VERSION}-cuda${CUDA_VERSION}-jazzy -build_image $1 $TAG_NAME ubuntu24.04/cuda-ros2.Dockerfile - -TAG_NAME=noble-torch${PYTORCH_VERSION} -build_image $1 $TAG_NAME ubuntu24.04/Dockerfile - -TAG_NAME=latest -build_image $1 $TAG_NAME ubuntu24.04/Dockerfile - -docker buildx build --platform linux/arm64 -t ${1}:arm64-jammy-torch2.5.1-humble -f ubuntu22.04/arm64-ros2.Dockerfile --push . -docker buildx build --platform linux/arm64 -t ${1}:arm64-noble-torch2.5.1-jazzy -f ubuntu24.04/arm64-ros2.Dockerfile --push . diff --git a/utils/docker/base_images/ubuntu22.04/Dockerfile b/utils/docker/base_images/ubuntu22.04/Dockerfile deleted file mode 100644 index 76010d45..00000000 --- a/utils/docker/base_images/ubuntu22.04/Dockerfile +++ /dev/null @@ -1,83 +0,0 @@ -FROM ubuntu:22.04 -LABEL maintainer="Saurav Agarwal " -LABEL description="Dockerfile for PyTorch CPU" - -SHELL ["/bin/bash", "-c"] - -ENV DEBIAN_FRONTEND=noninteractive - -ARG PYTHON_VERSION="3.10" -ARG PYTORCH_VERSION="2.5.1" - -ENV PYTHON_VERSION=${PYTHON_VERSION} -ENV PYTORCH_VERSION=${PYTORCH_VERSION} - -ENV TERM=xterm-256color - -RUN apt-get update && apt-get install -y apt-utils - -RUN apt-get -y update; \ - apt-get -y upgrade; \ - apt-get -y install \ - build-essential \ - git \ - wget \ - gpg \ - curl \ - gdb \ - software-properties-common \ - ca-certificates - -RUN add-apt-repository -y ppa:deadsnakes/ppa; \ - apt-get -y update; \ - apt-get -y install \ - python${PYTHON_VERSION} \ - python${PYTHON_VERSION}-dev \ - python${PYTHON_VERSION}-venv - -# Add repo for installing latest version of cmake -RUN wget -O - https://apt.kitware.com/keys/kitware-archive-latest.asc 2>/dev/null | gpg --dearmor - | tee /usr/share/keyrings/kitware-archive-keyring.gpg >/dev/null; \ - echo 'deb [signed-by=/usr/share/keyrings/kitware-archive-keyring.gpg] https://apt.kitware.com/ubuntu/ jammy main' | tee /etc/apt/sources.list.d/kitware.list >/dev/null; \ - apt-get update; \ - rm /usr/share/keyrings/kitware-archive-keyring.gpg - -RUN apt install -y kitware-archive-keyring - -RUN add-apt-repository -y ppa:deadsnakes/ppa; apt-get update; apt-get upgrade - -RUN apt-get -y install \ - cmake \ - libgmp-dev \ - libmpfr-dev \ - libboost-all-dev \ - libeigen3-dev \ - libgeos-dev \ - libyaml-cpp-dev \ - vim \ - tmux \ - ffmpeg \ - unzip \ - gnuplot-nox \ - ninja-build libpng-dev libjpeg-dev libopencv-dev python3-opencv - -# Remove cache to reduce image size -RUN rm -rf /var/lib/apt/lists/*; \ - rm -f /var/cache/apt/archives/*.deb; \ - rm -f /var/cache/apt/archives/parital/*.deb; \ - rm -f /var/cache/apt/*.bin - -RUN mkdir download; \ - wget https://download.pytorch.org/libtorch/cpu/libtorch-cxx11-abi-shared-with-deps-${PYTORCH_VERSION}%2Bcpu.zip -O download/libtorch.zip; \ - unzip download/libtorch.zip -d /opt/; \ - rm -r download - -ENV LD_LIBRARY_PATH="/usr/local/lib:/opt/libtorch/lib" -ENV Torch_DIR=/opt/libtorch/share/cmake/ - -COPY requirements_cpu.txt /opt/requirements.txt -RUN python${PYTHON_VERSION} -m venv /opt/venv -RUN /opt/venv/bin/pip install --no-cache-dir wheel -RUN /opt/venv/bin/pip install --no-cache-dir -r /opt/requirements.txt -ENV VENV_PATH=/opt/venv - -COPY .bashrc /root/.bashrc diff --git a/utils/docker/base_images/ubuntu22.04/arm64-ros2.Dockerfile b/utils/docker/base_images/ubuntu22.04/arm64-ros2.Dockerfile deleted file mode 100644 index 22babde9..00000000 --- a/utils/docker/base_images/ubuntu22.04/arm64-ros2.Dockerfile +++ /dev/null @@ -1,89 +0,0 @@ -FROM arm64v8/ubuntu:22.04 - -SHELL ["/bin/bash", "-c"] - -ENV DEBIAN_FRONTEND=noninteractive - -ARG PYTHON_VERSION="3.10" -ARG PYTORCH_VERSION="2.5.1" - -ENV PYTHON_VERSION=${PYTHON_VERSION} -ENV PYTORCH_VERSION=${PYTORCH_VERSION} - -ENV TERM=xterm-256color - -RUN apt-get update && apt-get install -y apt-utils - -RUN apt-get -y update; \ - apt-get -y upgrade; \ - apt-get -y install \ - build-essential \ - git \ - wget \ - gpg \ - curl \ - gdb \ - software-properties-common \ - ca-certificates \ - lsb-release \ - net-tools iputils-ping \ - locales \ - python${PYTHON_VERSION} \ - python${PYTHON_VERSION}-dev \ - python${PYTHON_VERSION}-venv \ - python-is-python3 - -# Add repo for installing latest version of cmake -RUN wget -O - https://apt.kitware.com/keys/kitware-archive-latest.asc 2>/dev/null | gpg --dearmor - | tee /usr/share/keyrings/kitware-archive-keyring.gpg >/dev/null; \ - echo 'deb [signed-by=/usr/share/keyrings/kitware-archive-keyring.gpg] https://apt.kitware.com/ubuntu/ jammy main' | tee /etc/apt/sources.list.d/kitware.list >/dev/null; \ - apt-get update; \ - rm /usr/share/keyrings/kitware-archive-keyring.gpg -RUN apt install -y kitware-archive-keyring - -RUN apt-get -y install \ - cmake \ - libgmp-dev \ - libmpfr-dev \ - libboost-all-dev \ - libeigen3-dev \ - libgeos-dev \ - libyaml-cpp-dev \ - vim \ - neovim \ - tmux \ - ffmpeg \ - unzip \ - gnuplot-nox \ - ninja-build libpng-dev libjpeg-dev libopencv-dev python3-opencv - -RUN add-apt-repository universe -RUN locale-gen en_US en_US.UTF-8; update-locale LC_ALL=en_US.UTF-8 LANG=en_US.UTF-8; export LANG=en_US.UTF-8 -RUN curl -sSL https://raw.githubusercontent.com/ros/rosdistro/master/ros.key -o /usr/share/keyrings/ros-archive-keyring.gpg -RUN echo "deb [arch=$(dpkg --print-architecture) signed-by=/usr/share/keyrings/ros-archive-keyring.gpg] http://packages.ros.org/ros2/ubuntu $(. /etc/os-release && echo $UBUNTU_CODENAME) main" | tee /etc/apt/sources.list.d/ros2.list > /dev/null - -RUN apt-get -y update && apt-get -y upgrade -RUN apt -y install ros-humble-desktop ros-dev-tools python3-colcon-common-extensions python3-vcstool python3-pip python3-argcomplete python3-rosdep python3-rosinstall-generator python3-rosinstall build-essential ros-humble-rmw-cyclonedds-cpp ros-humble-eigen3-cmake-module - -# Remove cache to reduce image size -RUN rm -rf /var/lib/apt/lists/*; \ - rm -f /var/cache/apt/archives/*.deb; \ - rm -f /var/cache/apt/archives/parital/*.deb; \ - rm -f /var/cache/apt/*.bin - -RUN mkdir -p /opt -RUN mkdir download; \ - wget https://github.com/AgarwalSaurav/libtorch_arm64/releases/download/v${PYTORCH_VERSION}/libtorch-cxx11-abi-shared-with-deps-${PYTORCH_VERSION}.zip -O download/libtorch.zip; \ - unzip download/libtorch.zip -d /opt/; \ - rm -r download - -ENV LD_LIBRARY_PATH="/usr/local/lib:/opt/libtorch/lib" -ENV Torch_DIR=/opt/libtorch/share/cmake/ - -COPY requirements_cpu.txt /opt/requirements.txt -RUN python${PYTHON_VERSION} -m venv /opt/venv -RUN /opt/venv/bin/pip install --no-cache-dir wheel -RUN /opt/venv/bin/pip install --no-cache-dir -r /opt/requirements.txt -RUN /opt/venv/bin/pip install --no-cache-dir catkin_pkg empy==3.3.4 lark -ENV VENV_PATH=/opt/venv - -COPY .ros.humble.bashrc /root/.bashrc diff --git a/utils/docker/base_images/ubuntu22.04/cuda-ros2.Dockerfile b/utils/docker/base_images/ubuntu22.04/cuda-ros2.Dockerfile deleted file mode 100644 index 86d57e88..00000000 --- a/utils/docker/base_images/ubuntu22.04/cuda-ros2.Dockerfile +++ /dev/null @@ -1,88 +0,0 @@ -ARG CUDA_VERSION="12.4.1" -FROM nvidia/cuda:${CUDA_VERSION}-devel-ubuntu22.04 AS base - -SHELL ["/bin/bash", "-c"] -ENV DEBIAN_FRONTEND=noninteractive - -ARG PYTHON_VERSION="3.10" -ARG PYTORCH_VERSION="2.5.1" - -ENV PYTHON_VERSION=${PYTHON_VERSION} -ENV PYTORCH_VERSION=${PYTORCH_VERSION} - -ENV TERM=xterm-256color - -RUN apt-get update && apt-get install -y apt-utils - -RUN apt-get -y update; \ - apt-get -y upgrade; \ - apt-get -y install \ - build-essential \ - git \ - wget \ - gpg \ - curl \ - gdb \ - software-properties-common \ - ca-certificates \ - lsb-release \ - net-tools iputils-ping \ - locales \ - python${PYTHON_VERSION} \ - python${PYTHON_VERSION}-dev \ - python${PYTHON_VERSION}-venv \ - python-is-python3 - -# Add repo for installing latest version of cmake -RUN wget -O - https://apt.kitware.com/keys/kitware-archive-latest.asc 2>/dev/null | gpg --dearmor - | tee /usr/share/keyrings/kitware-archive-keyring.gpg >/dev/null; \ - echo 'deb [signed-by=/usr/share/keyrings/kitware-archive-keyring.gpg] https://apt.kitware.com/ubuntu/ jammy main' | tee /etc/apt/sources.list.d/kitware.list >/dev/null; \ - apt-get update; \ - rm /usr/share/keyrings/kitware-archive-keyring.gpg - -RUN apt install -y kitware-archive-keyring - -RUN apt-get -y install \ - cmake \ - libgmp-dev \ - libmpfr-dev \ - libboost-all-dev \ - libeigen3-dev \ - libgeos-dev \ - libyaml-cpp-dev \ - vim \ - tmux \ - ffmpeg \ - unzip \ - gnuplot-nox \ - ninja-build libpng-dev libjpeg-dev libopencv-dev python3-opencv - -RUN add-apt-repository universe -RUN locale-gen en_US en_US.UTF-8; update-locale LC_ALL=en_US.UTF-8 LANG=en_US.UTF-8; export LANG=en_US.UTF-8 -RUN curl -sSL https://raw.githubusercontent.com/ros/rosdistro/master/ros.key -o /usr/share/keyrings/ros-archive-keyring.gpg -RUN echo "deb [arch=$(dpkg --print-architecture) signed-by=/usr/share/keyrings/ros-archive-keyring.gpg] http://packages.ros.org/ros2/ubuntu $(. /etc/os-release && echo $UBUNTU_CODENAME) main" | tee /etc/apt/sources.list.d/ros2.list > /dev/null - -RUN apt-get -y update && apt-get -y upgrade -RUN apt -y install ros-humble-desktop ros-dev-tools python3-colcon-common-extensions python3-vcstool python3-pip python3-argcomplete python3-rosdep python3-rosinstall-generator python3-rosinstall build-essential ros-humble-rmw-cyclonedds-cpp - -# Remove cache to reduce image size -RUN rm -rf /var/lib/apt/lists/*; \ - rm -f /var/cache/apt/archives/*.deb; \ - rm -f /var/cache/apt/archives/parital/*.deb; \ - rm -f /var/cache/apt/*.bin - -RUN mkdir download; \ - wget https://download.pytorch.org/libtorch/cpu/libtorch-cxx11-abi-shared-with-deps-${PYTORCH_VERSION}%2Bcpu.zip -O download/libtorch.zip; \ - unzip download/libtorch.zip -d /opt/; \ - rm -r download - -ENV LD_LIBRARY_PATH="/usr/local/lib:/opt/libtorch/lib" -ENV Torch_DIR=/opt/libtorch/share/cmake/ - -COPY requirements.txt /opt/requirements.txt -RUN python${PYTHON_VERSION} -m venv /opt/venv -RUN /opt/venv/bin/pip install --no-cache-dir wheel -RUN /opt/venv/bin/pip install --no-cache-dir -r /opt/requirements.txt -RUN /opt/venv/bin/pip install --no-cache-dir catkin_pkg empy==3.3.4 lark tomli -ENV VENV_PATH=/opt/venv - -COPY .ros.humble.bashrc /root/.bashrc diff --git a/utils/docker/base_images/ubuntu22.04/cuda.Dockerfile b/utils/docker/base_images/ubuntu22.04/cuda.Dockerfile deleted file mode 100644 index d0bddf87..00000000 --- a/utils/docker/base_images/ubuntu22.04/cuda.Dockerfile +++ /dev/null @@ -1,83 +0,0 @@ -ARG CUDA_VERSION="12.4.1" -FROM nvidia/cuda:${CUDA_VERSION}-devel-ubuntu22.04 AS base - -SHELL ["/bin/bash", "-c"] -ENV DEBIAN_FRONTEND=noninteractive - -ARG PYTHON_VERSION="3.11" -ARG PYTORCH_VERSION="2.5.1" - -ENV PYTHON_VERSION=${PYTHON_VERSION} -ENV PYTORCH_VERSION=${PYTORCH_VERSION} - -# Post actions after apt installs cause errors. This has been fixed in more recent versions of docker -# RUN sed -i -e 's/^APT/# APT/' -e 's/^DPkg/# DPkg/' \ -# /etc/apt/apt.conf.d/docker-clean - -ENV TERM=xterm-256color - -RUN apt-get update && apt-get install -y apt-utils - -RUN apt-get -y update; \ - apt-get -y upgrade; \ - apt-get -y install \ - build-essential \ - git \ - wget \ - gpg \ - curl \ - gdb \ - software-properties-common \ - ca-certificates - -RUN add-apt-repository -y ppa:deadsnakes/ppa; \ - apt-get -y update; \ - apt-get -y install \ - python${PYTHON_VERSION} \ - python${PYTHON_VERSION}-dev \ - python${PYTHON_VERSION}-venv - -# Add repo for installing latest version of cmake -RUN wget -O - https://apt.kitware.com/keys/kitware-archive-latest.asc 2>/dev/null | gpg --dearmor - | tee /usr/share/keyrings/kitware-archive-keyring.gpg >/dev/null; \ - echo 'deb [signed-by=/usr/share/keyrings/kitware-archive-keyring.gpg] https://apt.kitware.com/ubuntu/ jammy main' | tee /etc/apt/sources.list.d/kitware.list >/dev/null; \ - apt-get update; \ - rm /usr/share/keyrings/kitware-archive-keyring.gpg - -RUN apt install -y kitware-archive-keyring - -RUN apt-get -y install \ - cmake \ - libgmp-dev \ - libmpfr-dev \ - libboost-all-dev \ - libeigen3-dev \ - libgeos-dev \ - libyaml-cpp-dev \ - vim \ - tmux \ - ffmpeg \ - unzip \ - gnuplot-nox \ - ninja-build libpng-dev libjpeg-dev libopencv-dev python3-opencv - -# Remove cache to reduce image size -RUN rm -rf /var/lib/apt/lists/*; \ - rm -f /var/cache/apt/archives/*.deb; \ - rm -f /var/cache/apt/archives/parital/*.deb; \ - rm -f /var/cache/apt/*.bin - -RUN mkdir download; \ - wget https://download.pytorch.org/libtorch/cpu/libtorch-cxx11-abi-shared-with-deps-${PYTORCH_VERSION}%2Bcpu.zip -O download/libtorch.zip; \ - unzip download/libtorch.zip -d /opt/; \ - rm -r download - -ENV LD_LIBRARY_PATH="/usr/local/lib:/opt/libtorch/lib" -ENV Torch_DIR=/opt/libtorch/share/cmake/ - -COPY requirements.txt /opt/requirements.txt -RUN python${PYTHON_VERSION} -m venv /opt/venv -RUN /opt/venv/bin/pip install --no-cache-dir wheel -RUN /opt/venv/bin/pip install --no-cache-dir -r /opt/requirements.txt -ENV VENV_PATH=/opt/venv - -COPY .bashrc /root/.bashrc diff --git a/utils/docker/base_images/ubuntu22.04/ros2.Dockerfile b/utils/docker/base_images/ubuntu22.04/ros2.Dockerfile deleted file mode 100644 index ac5b3c9f..00000000 --- a/utils/docker/base_images/ubuntu22.04/ros2.Dockerfile +++ /dev/null @@ -1,89 +0,0 @@ -FROM ubuntu:22.04 - -SHELL ["/bin/bash", "-c"] - -ENV DEBIAN_FRONTEND=noninteractive - -ARG PYTHON_VERSION="3.10" -ARG PYTORCH_VERSION="2.5.1" - -ENV PYTHON_VERSION=${PYTHON_VERSION} -ENV PYTORCH_VERSION=${PYTORCH_VERSION} - -ENV TERM=xterm-256color - -RUN apt-get update && apt-get install -y apt-utils - -RUN apt-get -y update; \ - apt-get -y upgrade; \ - apt-get -y install \ - build-essential \ - git \ - wget \ - gpg \ - curl \ - gdb \ - software-properties-common \ - ca-certificates \ - lsb-release \ - net-tools iputils-ping \ - locales \ - python${PYTHON_VERSION} \ - python${PYTHON_VERSION}-dev \ - python${PYTHON_VERSION}-venv \ - python-is-python3 - -# Add repo for installing latest version of cmake -RUN wget -O - https://apt.kitware.com/keys/kitware-archive-latest.asc 2>/dev/null | gpg --dearmor - | tee /usr/share/keyrings/kitware-archive-keyring.gpg >/dev/null; \ - echo 'deb [signed-by=/usr/share/keyrings/kitware-archive-keyring.gpg] https://apt.kitware.com/ubuntu/ jammy main' | tee /etc/apt/sources.list.d/kitware.list >/dev/null; \ - apt-get update; \ - rm /usr/share/keyrings/kitware-archive-keyring.gpg -RUN apt install -y kitware-archive-keyring - -RUN apt-get -y install \ - cmake \ - libgmp-dev \ - libmpfr-dev \ - libboost-all-dev \ - libeigen3-dev \ - libgeos-dev \ - libyaml-cpp-dev \ - vim \ - neovim \ - tmux \ - ffmpeg \ - unzip \ - gnuplot-nox \ - ninja-build libpng-dev libjpeg-dev libopencv-dev python3-opencv - -RUN add-apt-repository universe -RUN locale-gen en_US en_US.UTF-8; update-locale LC_ALL=en_US.UTF-8 LANG=en_US.UTF-8; export LANG=en_US.UTF-8 -RUN curl -sSL https://raw.githubusercontent.com/ros/rosdistro/master/ros.key -o /usr/share/keyrings/ros-archive-keyring.gpg -RUN echo "deb [arch=$(dpkg --print-architecture) signed-by=/usr/share/keyrings/ros-archive-keyring.gpg] http://packages.ros.org/ros2/ubuntu $(. /etc/os-release && echo $UBUNTU_CODENAME) main" | tee /etc/apt/sources.list.d/ros2.list > /dev/null - -RUN apt-get -y update && apt-get -y upgrade -RUN apt -y install ros-humble-desktop ros-dev-tools python3-colcon-common-extensions python3-vcstool python3-pip python3-argcomplete python3-rosdep python3-rosinstall-generator python3-rosinstall build-essential ros-humble-rmw-cyclonedds-cpp - -# Remove cache to reduce image size -RUN rm -rf /var/lib/apt/lists/*; \ - rm -f /var/cache/apt/archives/*.deb; \ - rm -f /var/cache/apt/archives/parital/*.deb; \ - rm -f /var/cache/apt/*.bin - -RUN mkdir -p /opt -RUN mkdir download; \ - wget https://download.pytorch.org/libtorch/cpu/libtorch-cxx11-abi-shared-with-deps-${PYTORCH_VERSION}%2Bcpu.zip -O download/libtorch.zip; \ - unzip download/libtorch.zip -d /opt/; \ - rm -r download - -ENV LD_LIBRARY_PATH="/usr/local/lib:/opt/libtorch/lib" -ENV Torch_DIR=/opt/libtorch/share/cmake/ - -COPY requirements_cpu.txt /opt/requirements.txt -RUN python${PYTHON_VERSION} -m venv /opt/venv -RUN /opt/venv/bin/pip install --no-cache-dir wheel -RUN /opt/venv/bin/pip install --no-cache-dir -r /opt/requirements.txt -RUN /opt/venv/bin/pip install --no-cache-dir catkin_pkg empy==3.3.4 lark tomli -ENV VENV_PATH=/opt/venv - -COPY .ros.humble.bashrc /root/.bashrc diff --git a/utils/docker/base_images/ubuntu24.04/Dockerfile b/utils/docker/base_images/ubuntu24.04/Dockerfile deleted file mode 100644 index 1e0a1d9f..00000000 --- a/utils/docker/base_images/ubuntu24.04/Dockerfile +++ /dev/null @@ -1,74 +0,0 @@ -FROM ubuntu:24.04 - -SHELL ["/bin/bash", "-c"] - -ENV DEBIAN_FRONTEND=noninteractive - -ARG PYTHON_VERSION="3.12" -ARG PYTORCH_VERSION="2.5.1" - -ENV PYTHON_VERSION=${PYTHON_VERSION} -ENV PYTORCH_VERSION=${PYTORCH_VERSION} - -ENV TERM=xterm-256color - -RUN apt-get update && apt-get install -y apt-utils - -RUN apt-get -y update; \ - apt-get -y upgrade; \ - apt-get -y install \ - build-essential \ - git \ - wget \ - gpg \ - curl \ - gdb \ - libbz2-dev \ - software-properties-common \ - ca-certificates \ - lsb-release \ - net-tools iputils-ping \ - locales \ - python${PYTHON_VERSION} \ - python${PYTHON_VERSION}-dev \ - python${PYTHON_VERSION}-venv \ - python-is-python3 - -RUN apt-get -y install \ - cmake \ - libgmp-dev \ - libmpfr-dev \ - libboost-all-dev \ - libeigen3-dev \ - libgeos-dev \ - libyaml-cpp-dev \ - vim \ - neovim \ - tmux \ - ffmpeg \ - unzip \ - gnuplot-nox \ - ninja-build libpng-dev libjpeg-dev libopencv-dev python3-opencv - -# Remove cache to reduce image size -RUN rm -rf /var/lib/apt/lists/*; \ - rm -f /var/cache/apt/archives/*.deb; \ - rm -f /var/cache/apt/archives/parital/*.deb; \ - rm -f /var/cache/apt/*.bin - -RUN mkdir -p /opt -RUN mkdir download; \ - wget https://download.pytorch.org/libtorch/cpu/libtorch-cxx11-abi-shared-with-deps-${PYTORCH_VERSION}%2Bcpu.zip -O download/libtorch.zip; \ - unzip download/libtorch.zip -d /opt/; \ - rm -r download - -ENV LD_LIBRARY_PATH="/usr/local/lib:/opt/libtorch/lib" -ENV Torch_DIR=/opt/libtorch/share/cmake/ - -COPY requirements_cpu.txt /opt/requirements.txt -RUN python${PYTHON_VERSION} -m venv /opt/venv -RUN /opt/venv/bin/pip install --no-cache-dir wheel -RUN /opt/venv/bin/pip install --no-cache-dir -r /opt/requirements.txt -ENV VENV_PATH=/opt/venv - -COPY .bashrc /root/.bashrc diff --git a/utils/docker/base_images/ubuntu24.04/arm64-ros2.Dockerfile b/utils/docker/base_images/ubuntu24.04/arm64-ros2.Dockerfile deleted file mode 100644 index 73bc2953..00000000 --- a/utils/docker/base_images/ubuntu24.04/arm64-ros2.Dockerfile +++ /dev/null @@ -1,83 +0,0 @@ -FROM arm64v8/ubuntu:24.04 - -SHELL ["/bin/bash", "-c"] - -ENV DEBIAN_FRONTEND=noninteractive - -ARG PYTHON_VERSION="3.12" -ARG PYTORCH_VERSION="2.5.1" - -ENV PYTHON_VERSION=${PYTHON_VERSION} -ENV PYTORCH_VERSION=${PYTORCH_VERSION} - -ENV TERM=xterm-256color - -RUN apt-get update && apt-get install -y apt-utils - -RUN apt-get -y update; \ - apt-get -y upgrade; \ - apt-get -y install \ - build-essential \ - git \ - wget \ - gpg \ - curl \ - gdb \ - libbz2-dev \ - software-properties-common \ - ca-certificates \ - lsb-release \ - net-tools iputils-ping \ - locales \ - python${PYTHON_VERSION} \ - python${PYTHON_VERSION}-dev \ - python${PYTHON_VERSION}-venv \ - python-is-python3 - -RUN apt-get -y install \ - cmake \ - libgmp-dev \ - libmpfr-dev \ - libboost-all-dev \ - libeigen3-dev \ - libgeos-dev \ - libyaml-cpp-dev \ - vim \ - neovim \ - tmux \ - ffmpeg \ - unzip \ - gnuplot-nox \ - ninja-build libpng-dev libjpeg-dev libopencv-dev python3-opencv - -RUN add-apt-repository universe -RUN locale-gen en_US en_US.UTF-8; update-locale LC_ALL=en_US.UTF-8 LANG=en_US.UTF-8; export LANG=en_US.UTF-8 -RUN curl -sSL https://raw.githubusercontent.com/ros/rosdistro/master/ros.key -o /usr/share/keyrings/ros-archive-keyring.gpg -RUN echo "deb [arch=$(dpkg --print-architecture) signed-by=/usr/share/keyrings/ros-archive-keyring.gpg] http://packages.ros.org/ros2/ubuntu $(. /etc/os-release && echo $UBUNTU_CODENAME) main" | tee /etc/apt/sources.list.d/ros2.list > /dev/null - -RUN apt-get -y update && apt-get -y upgrade -RUN apt-get -y install ros-jazzy-desktop ros-dev-tools python3-colcon-common-extensions python3-vcstool python3-pip python3-argcomplete python3-rosdep python3-rosinstall-generator build-essential - -# Remove cache to reduce image size -RUN rm -rf /var/lib/apt/lists/*; \ - rm -f /var/cache/apt/archives/*.deb; \ - rm -f /var/cache/apt/archives/parital/*.deb; \ - rm -f /var/cache/apt/*.bin - -RUN mkdir -p /opt -RUN mkdir download; \ - wget https://github.com/AgarwalSaurav/libtorch_arm64/releases/download/v${PYTORCH_VERSION}/libtorch-cxx11-abi-shared-with-deps-${PYTORCH_VERSION}.zip -O download/libtorch.zip; \ - unzip download/libtorch.zip -d /opt/; \ - rm -r download - -ENV LD_LIBRARY_PATH="/usr/local/lib:/opt/libtorch/lib" -ENV Torch_DIR=/opt/libtorch/share/cmake/ - -COPY requirements_cpu.txt /opt/requirements.txt -RUN python${PYTHON_VERSION} -m venv /opt/venv -RUN /opt/venv/bin/pip install --no-cache-dir wheel setuptools==68.1.2 -RUN /opt/venv/bin/pip install --no-cache-dir -r /opt/requirements.txt -RUN /opt/venv/bin/pip install --no-cache-dir catkin_pkg lark empy==3.3.4 -ENV VENV_PATH=/opt/venv - -COPY .ros.jazzy.bashrc /root/.bashrc diff --git a/utils/docker/base_images/ubuntu24.04/cuda-ros2.Dockerfile b/utils/docker/base_images/ubuntu24.04/cuda-ros2.Dockerfile deleted file mode 100644 index d450071d..00000000 --- a/utils/docker/base_images/ubuntu24.04/cuda-ros2.Dockerfile +++ /dev/null @@ -1,83 +0,0 @@ -ARG CUDA_VERSION="12.6.2" -FROM nvidia/cuda:${CUDA_VERSION}-devel-ubuntu24.04 AS base - -SHELL ["/bin/bash", "-c"] -ENV DEBIAN_FRONTEND=noninteractive - -ARG PYTHON_VERSION="3.12" -ARG PYTORCH_VERSION="2.5.1" - -ENV PYTHON_VERSION=${PYTHON_VERSION} -ENV PYTORCH_VERSION=${PYTORCH_VERSION} - -ENV TERM=xterm-256color - -RUN apt-get update && apt-get install -y apt-utils - -RUN apt-get -y update; \ - apt-get -y upgrade; \ - apt-get -y install \ - build-essential \ - git \ - wget \ - gpg \ - curl \ - gdb \ - libbz2-dev \ - software-properties-common \ - ca-certificates \ - lsb-release \ - net-tools iputils-ping \ - locales \ - python${PYTHON_VERSION} \ - python${PYTHON_VERSION}-dev \ - python${PYTHON_VERSION}-venv \ - python-is-python3 - -RUN apt-get -y install \ - cmake \ - libgmp-dev \ - libmpfr-dev \ - libboost-all-dev \ - libeigen3-dev \ - libgeos-dev \ - libyaml-cpp-dev \ - vim \ - neovim \ - tmux \ - ffmpeg \ - unzip \ - gnuplot-nox \ - ninja-build libpng-dev libjpeg-dev libopencv-dev python3-opencv - -RUN add-apt-repository universe -RUN locale-gen en_US en_US.UTF-8; update-locale LC_ALL=en_US.UTF-8 LANG=en_US.UTF-8; export LANG=en_US.UTF-8 -RUN curl -sSL https://raw.githubusercontent.com/ros/rosdistro/master/ros.key -o /usr/share/keyrings/ros-archive-keyring.gpg -RUN echo "deb [arch=$(dpkg --print-architecture) signed-by=/usr/share/keyrings/ros-archive-keyring.gpg] http://packages.ros.org/ros2/ubuntu $(. /etc/os-release && echo $UBUNTU_CODENAME) main" | tee /etc/apt/sources.list.d/ros2.list > /dev/null - -RUN apt-get -y update && apt-get -y upgrade -RUN apt-get -y install ros-jazzy-desktop ros-dev-tools python3-colcon-common-extensions python3-vcstool python3-pip python3-argcomplete python3-rosdep python3-rosinstall-generator build-essential - -# Remove cache to reduce image size -RUN rm -rf /var/lib/apt/lists/*; \ - rm -f /var/cache/apt/archives/*.deb; \ - rm -f /var/cache/apt/archives/parital/*.deb; \ - rm -f /var/cache/apt/*.bin - -RUN mkdir -p /opt -RUN mkdir download; \ - wget https://download.pytorch.org/libtorch/cpu/libtorch-cxx11-abi-shared-with-deps-${PYTORCH_VERSION}%2Bcu124.zip -O download/libtorch.zip; \ - unzip download/libtorch.zip -d /opt/; \ - rm -r download - -ENV LD_LIBRARY_PATH="/usr/local/lib:/opt/libtorch/lib" -ENV Torch_DIR=/opt/libtorch/share/cmake/ - -COPY requirements.txt /opt/requirements.txt -RUN python${PYTHON_VERSION} -m venv /opt/venv -RUN /opt/venv/bin/pip install --no-cache-dir wheel setuptools==68.1.2 -RUN /opt/venv/bin/pip install --no-cache-dir -r /opt/requirements.txt -RUN /opt/venv/bin/pip install --no-cache-dir catkin_pkg lark empy==3.3.4 -ENV VENV_PATH=/opt/venv - -COPY .ros.jazzy.bashrc /root/.bashrc diff --git a/utils/docker/base_images/ubuntu24.04/cuda.Dockerfile b/utils/docker/base_images/ubuntu24.04/cuda.Dockerfile deleted file mode 100644 index 3e66ef9a..00000000 --- a/utils/docker/base_images/ubuntu24.04/cuda.Dockerfile +++ /dev/null @@ -1,73 +0,0 @@ -ARG CUDA_VERSION="12.6.2" -FROM nvidia/cuda:${CUDA_VERSION}-devel-ubuntu24.04 AS base - -SHELL ["/bin/bash", "-c"] -ENV DEBIAN_FRONTEND=noninteractive - -ARG PYTHON_VERSION="3.12" -ARG PYTORCH_VERSION="2.5.1" - -ENV PYTHON_VERSION=${PYTHON_VERSION} -ENV PYTORCH_VERSION=${PYTORCH_VERSION} - -ENV TERM=xterm-256color - -RUN apt-get update && apt-get install -y apt-utils - -RUN apt-get -y update; \ - apt-get -y upgrade; \ - apt-get -y install \ - build-essential \ - git \ - wget \ - gpg \ - curl \ - gdb \ - libbz2-dev \ - software-properties-common \ - ca-certificates \ - lsb-release \ - net-tools iputils-ping \ - locales \ - python${PYTHON_VERSION} \ - python${PYTHON_VERSION}-dev \ - python${PYTHON_VERSION}-venv \ - python-is-python3 - -RUN apt-get -y install \ - cmake \ - libgmp-dev \ - libmpfr-dev \ - libboost-all-dev \ - libeigen3-dev \ - libgeos-dev \ - libyaml-cpp-dev \ - vim \ - neovim \ - tmux \ - ffmpeg \ - unzip \ - gnuplot-nox \ - ninja-build libpng-dev libjpeg-dev libopencv-dev python3-opencv - -RUN rm -rf /var/lib/apt/lists/*; \ - rm -f /var/cache/apt/archives/*.deb; \ - rm -f /var/cache/apt/archives/parital/*.deb; \ - rm -f /var/cache/apt/*.bin - -RUN mkdir -p /opt -RUN mkdir download; \ - wget https://download.pytorch.org/libtorch/cpu/libtorch-cxx11-abi-shared-with-deps-${PYTORCH_VERSION}%2Bcu124.zip -O download/libtorch.zip; \ - unzip download/libtorch.zip -d /opt/; \ - rm -r download - -ENV LD_LIBRARY_PATH="/usr/local/lib:/opt/libtorch/lib" -ENV Torch_DIR=/opt/libtorch/share/cmake/ - -COPY requirements.txt /opt/requirements.txt -RUN python${PYTHON_VERSION} -m venv /opt/venv -RUN /opt/venv/bin/pip install --no-cache-dir wheel -RUN /opt/venv/bin/pip install --no-cache-dir -r /opt/requirements.txt -ENV VENV_PATH=/opt/venv - -COPY .bashrc /root/.bashrc diff --git a/utils/docker/base_images/ubuntu24.04/ros2.Dockerfile b/utils/docker/base_images/ubuntu24.04/ros2.Dockerfile deleted file mode 100644 index cd7d6e88..00000000 --- a/utils/docker/base_images/ubuntu24.04/ros2.Dockerfile +++ /dev/null @@ -1,83 +0,0 @@ -FROM ubuntu:24.04 - -SHELL ["/bin/bash", "-c"] - -ENV DEBIAN_FRONTEND=noninteractive - -ARG PYTHON_VERSION="3.12" -ARG PYTORCH_VERSION="2.5.1" - -ENV PYTHON_VERSION=${PYTHON_VERSION} -ENV PYTORCH_VERSION=${PYTORCH_VERSION} - -ENV TERM=xterm-256color - -RUN apt-get update && apt-get install -y apt-utils - -RUN apt-get -y update; \ - apt-get -y upgrade; \ - apt-get -y install \ - build-essential \ - git \ - wget \ - gpg \ - curl \ - gdb \ - libbz2-dev \ - software-properties-common \ - ca-certificates \ - lsb-release \ - net-tools iputils-ping \ - locales \ - python${PYTHON_VERSION} \ - python${PYTHON_VERSION}-dev \ - python${PYTHON_VERSION}-venv \ - python-is-python3 - -RUN apt-get -y install \ - cmake \ - libgmp-dev \ - libmpfr-dev \ - libboost-all-dev \ - libeigen3-dev \ - libgeos-dev \ - libyaml-cpp-dev \ - vim \ - neovim \ - tmux \ - ffmpeg \ - unzip \ - gnuplot-nox \ - ninja-build libpng-dev libjpeg-dev libopencv-dev python3-opencv - -RUN add-apt-repository universe -RUN locale-gen en_US en_US.UTF-8; update-locale LC_ALL=en_US.UTF-8 LANG=en_US.UTF-8; export LANG=en_US.UTF-8 -RUN curl -sSL https://raw.githubusercontent.com/ros/rosdistro/master/ros.key -o /usr/share/keyrings/ros-archive-keyring.gpg -RUN echo "deb [arch=$(dpkg --print-architecture) signed-by=/usr/share/keyrings/ros-archive-keyring.gpg] http://packages.ros.org/ros2/ubuntu $(. /etc/os-release && echo $UBUNTU_CODENAME) main" | tee /etc/apt/sources.list.d/ros2.list > /dev/null - -RUN apt-get -y update && apt-get -y upgrade -RUN apt-get -y install ros-jazzy-desktop ros-dev-tools python3-colcon-common-extensions python3-vcstool python3-pip python3-argcomplete python3-rosdep python3-rosinstall-generator build-essential - -# Remove cache to reduce image size -RUN rm -rf /var/lib/apt/lists/*; \ - rm -f /var/cache/apt/archives/*.deb; \ - rm -f /var/cache/apt/archives/parital/*.deb; \ - rm -f /var/cache/apt/*.bin - -RUN mkdir -p /opt -RUN mkdir download; \ - wget https://download.pytorch.org/libtorch/cpu/libtorch-cxx11-abi-shared-with-deps-${PYTORCH_VERSION}%2Bcpu.zip -O download/libtorch.zip; \ - unzip download/libtorch.zip -d /opt/; \ - rm -r download - -ENV LD_LIBRARY_PATH="/usr/local/lib:/opt/libtorch/lib" -ENV Torch_DIR=/opt/libtorch/share/cmake/ - -COPY requirements_cpu.txt /opt/requirements.txt -RUN python${PYTHON_VERSION} -m venv /opt/venv -RUN /opt/venv/bin/pip install --no-cache-dir wheel setuptools==68.1.2 -RUN /opt/venv/bin/pip install --no-cache-dir -r /opt/requirements.txt -RUN /opt/venv/bin/pip install --no-cache-dir catkin_pkg lark empy==3.3.4 -ENV VENV_PATH=/opt/venv - -COPY .ros.jazzy.bashrc /root/.bashrc diff --git a/utils/docker/build_all_images.sh b/utils/docker/build_all_images.sh new file mode 100644 index 00000000..6ade67dc --- /dev/null +++ b/utils/docker/build_all_images.sh @@ -0,0 +1,68 @@ +set -x +print_usage() { + echo "Usage: ./build_all_images.sh " + echo "Example: ./build_all_images.sh johndoe/repo_name" + echo "Example: ./build_all_images.sh ghcr.io/johndoe/repo_name" + exit 1 +} + +if [ "$#" -ne 1 ]; then + print_usage +fi + +build_image() { + echo "Building image $2" + TAG_NAME=$2 + ALL_BUILD_ARGS="--no-cache --build-arg CUDA_VERSION=${CUDA_VERSION} --build-arg PYTHON_VERSION=${PYTHON_VERSION} --build-arg PYTORCH_VERSION=${PYTORCH_VERSION} --build-arg IMAGE_TYPE=${IMAGE_TYPE} --build-arg UBUNTU_VERSION=${UBUNTU_VERSION} --build-arg ROS_DISTRO=${ROS_DISTRO}" + DOCKER_BUILDKIT=1 docker buildx build --push ${ALL_BUILD_ARGS} $3 -t ${1}:${TAG_NAME} . + if [ $? -ne 0 ]; then + echo "Failed to build image $2" + exit 1 + fi +} + +CUDA_VERSION="12.4.1" +PYTHON_VERSION="3.10" +PYTORCH_VERSION="2.5.1" +IMAGE_TYPE="cuda" +UBUNTU_VERSION="22.04" +ROS_DISTRO="humble" + +TAG_NAME=jammy-torch${PYTORCH_VERSION}-cuda${CUDA_VERSION} +build_image $1 $TAG_NAME "--target base" + +TAG_NAME=jammy-torch${PYTORCH_VERSION}-cuda${CUDA_VERSION}-humble +build_image $1 $TAG_NAME "--target ros2" + +IMAGE_TYPE="cpu" +TAG_NAME=jammy-torch${PYTORCH_VERSION}-humble +build_image $1 $TAG_NAME "--target ros2" + +TAG_NAME=jammy-torch${PYTORCH_VERSION} +build_image $1 $TAG_NAME "--target base" + +TAG_NAME=arm64-jammy-torch${PYTORCH_VERSION}-humble +build_image $1 $TAG_NAME "--platform linux/arm64 --target ros2" + +CUDA_VERSION="12.6.2" +PYTHON_VERSION="3.12" +PYTORCH_VERSION="2.5.1" +IMAGE_TYPE="cuda" +UBUNTU_VERSION="24.04" +ROS_DISTRO="jazzy" + +TAG_NAME=noble-torch${PYTORCH_VERSION}-cuda${CUDA_VERSION} +build_image $1 $TAG_NAME "--target base" + +TAG_NAME=noble-torch${PYTORCH_VERSION}-cuda${CUDA_VERSION}-jazzy +build_image $1 $TAG_NAME "--target ros2" + +IMAGE_TYPE="cpu" +TAG_NAME=noble-torch${PYTORCH_VERSION}-jazzy +build_image $1 $TAG_NAME "--target ros2" + +TAG_NAME=noble-torch${PYTORCH_VERSION} +build_image $1 $TAG_NAME "--target base -t ${1}:latest" + +TAG_NAME=arm64-noble-torch${PYTORCH_VERSION}-jazzy +build_image $1 $TAG_NAME "--platform linux/arm64 --target ros2" diff --git a/utils/docker/create_container.sh b/utils/docker/create_container.sh index 9445bd5f..abdd9440 100755 --- a/utils/docker/create_container.sh +++ b/utils/docker/create_container.sh @@ -1,5 +1,5 @@ ORIG_INPUT_PARAMS="$@" -params="$(getopt -o d:n: -l directory: -l name:,with-cuda,with-ros,noble --name "$(basename "$0")" -- "$@")" +params="$(getopt -o d:n: -l directory: -l name:,with-cuda,with-ros,noble,arm64 --name "$(basename "$0")" -- "$@")" if [ $? -ne 0 ] then @@ -8,7 +8,7 @@ then fi print_usage() { - printf "bash $0 [-d|--directory ] [--with-cuda] [--with-ros]\n" + printf "bash $0 [-d|--directory ] [--with-cuda] [--with-ros] [--noble] [--arm64] [-n|--name ]\n" } eval set -- "$params" @@ -25,6 +25,7 @@ while true; do --with-cuda) CUDA_IMAGE=true;shift;; --with-ros) ROS_IMAGE=true;shift;; --noble) NOBLE=true;shift;; + --arm64) ARM=true;shift;; --) shift;break;; *) print_usage exit 1 ;; @@ -64,6 +65,13 @@ if [[ ${ROS_IMAGE} == true ]]; then fi fi +if [[ ${ARM} == true ]]; then + if [[ ${NOBLE} == true ]]; then + IMAGE_TAG="arm64-noble-torch2.5.1-jazzy" + else + IMAGE_TAG="arm64-jammy-torch2.5.1-humble" +fi + IMAGE_NAME="${IMAGE_BASE_NAME}:${IMAGE_TAG}" docker pull ${IMAGE_NAME} diff --git a/utils/docker/base_images/requirements.txt b/utils/docker/requirements.txt similarity index 97% rename from utils/docker/base_images/requirements.txt rename to utils/docker/requirements.txt index 971b4365..e8365eb0 100644 --- a/utils/docker/base_images/requirements.txt +++ b/utils/docker/requirements.txt @@ -1,6 +1,7 @@ wheel numpy pyyaml +tomli opencv-python --find-links https://download.pytorch.org/whl/cu124 diff --git a/utils/docker/base_images/requirements_cpu.txt b/utils/docker/requirements_cpu.txt similarity index 97% rename from utils/docker/base_images/requirements_cpu.txt rename to utils/docker/requirements_cpu.txt index 8c197899..bea9156e 100644 --- a/utils/docker/base_images/requirements_cpu.txt +++ b/utils/docker/requirements_cpu.txt @@ -1,6 +1,7 @@ wheel numpy pyyaml +tomli opencv-python --find-links https://download.pytorch.org/whl/cpu