release repository

This commit is contained in:
Balakumar Sundaralingam
2023-10-26 04:17:19 -07:00
commit 07e6ccfc91
287 changed files with 70659 additions and 0 deletions

3
docker/.dockerignore Normal file
View File

@@ -0,0 +1,3 @@
*.git
*_build
*build

36
docker/README.md Normal file
View File

@@ -0,0 +1,36 @@
<!--
Copyright (c) 2023 NVIDIA CORPORATION & AFFILIATES. All rights reserved.
NVIDIA CORPORATION, its affiliates and licensors retain all intellectual
property and proprietary rights in and to this material, related
documentation and any modifications thereto. Any use, reproduction,
disclosure or distribution of this material and related documentation
without an express license agreement from NVIDIA CORPORATION or
its affiliates is strictly prohibited.
-->
# Docker Instructions
## Running docker from NGC (Recommended)
1. `sh build_user_docker.sh $UID`
2. `sh start_docker_x86.sh` will start the docker
## Building your own docker image with CuRobo
1. Add default nvidia runtime to enable cuda compilation during docker build:
```
Edit/create the /etc/docker/daemon.json with content:
{
"runtimes": {
"nvidia": {
"path": "/usr/bin/nvidia-container-runtime",
"runtimeArgs": []
}
},
"default-runtime": "nvidia" # ADD this line (the above lines will already exist in your json file)
}
```
2. `sh pull_repos.sh`
3. `bash build_dev_docker.sh`
4. Change the docker image name in `user.dockerfile`
5. `sh build_user_docker.sh`
6. `sh start_docker_x86.sh` will start the docker

181
docker/arm64.dockerfile Normal file
View File

@@ -0,0 +1,181 @@
##
## Copyright (c) 2023 NVIDIA CORPORATION & AFFILIATES. All rights reserved.
##
## NVIDIA CORPORATION, its affiliates and licensors retain all intellectual
## property and proprietary rights in and to this material, related
## documentation and any modifications thereto. Any use, reproduction,
## disclosure or distribution of this material and related documentation
## without an express license agreement from NVIDIA CORPORATION or
## its affiliates is strictly prohibited.
##
FROM nvcr.io/nvidia/l4t-pytorch:r35.1.0-pth1.13-py3 AS l4t_pytorch
# Install ros components:
RUN apt-get update &&\
apt-get install -y sudo git bash unattended-upgrades glmark2 &&\
rm -rf /var/lib/apt/lists/*
# Deal with getting tons of debconf messages
# See: https://github.com/phusion/baseimage-docker/issues/58
RUN echo 'debconf debconf/frontend select Noninteractive' | debconf-set-selections
# TODO: Don't hardcode timezone setting to Los_Angeles, pull from host computer
# Set timezone info
RUN apt-get update && apt-get install -y \
tzdata \
&& rm -rf /var/lib/apt/lists/* \
&& ln -fs /usr/share/zoneinfo/America/Los_Angeles /etc/localtime \
&& echo "America/Los_Angeles" > /etc/timezone \
&& dpkg-reconfigure -f noninteractive tzdata
# Install apt-get packages necessary for building, downloading, etc
# NOTE: Dockerfile best practices recommends having apt-get update
# and install commands in one line to avoid apt-get caching issues.
# https://docs.docker.com/develop/develop-images/dockerfile_best-practices/#run
RUN apt-get update && apt-get install -y \
curl \
lsb-core \
software-properties-common \
wget \
&& rm -rf /var/lib/apt/lists/*
RUN add-apt-repository -y ppa:git-core/ppa
RUN apt-get update && apt-get install -y \
build-essential \
cmake \
git \
git-lfs \
iputils-ping \
make \
openssh-server \
openssh-client \
libeigen3-dev \
libssl-dev \
python3-pip \
python3-ipdb \
python3-tk \
python3-wstool \
sudo git bash unattended-upgrades \
apt-utils \
terminator \
&& rm -rf /var/lib/apt/lists/*
ARG ROS_PKG=ros_base # desktop does not work
ENV ROS_DISTRO=noetic
ENV ROS_ROOT=/opt/ros/${ROS_DISTRO}
ENV ROS_PYTHON_VERSION=3
ENV DEBIAN_FRONTEND=noninteractive
WORKDIR /workspace
#
# add the ROS deb repo to the apt sources list
#
RUN apt-get update && \
apt-get install -y --no-install-recommends \
git \
cmake \
build-essential \
curl \
wget \
gnupg2 \
lsb-release \
ca-certificates \
&& rm -rf /var/lib/apt/lists/*
RUN sh -c 'echo "deb http://packages.ros.org/ros/ubuntu $(lsb_release -sc) main" > /etc/apt/sources.list.d/ros-latest.list'
RUN curl -s https://raw.githubusercontent.com/ros/rosdistro/master/ros.asc | apt-key add -
#
# install bootstrap dependencies
#
RUN apt-get update && \
apt-get install -y --no-install-recommends \
libpython3-dev \
python3-rosdep \
python3-rosinstall-generator \
python3-vcstool \
build-essential && \
rosdep init && \
rosdep update && \
rm -rf /var/lib/apt/lists/*
#
# download/build the ROS source
#
RUN mkdir ros_catkin_ws && \
cd ros_catkin_ws && \
rosinstall_generator ${ROS_PKG} vision_msgs --rosdistro ${ROS_DISTRO} --deps --tar > ${ROS_DISTRO}-${ROS_PKG}.rosinstall && \
mkdir src && \
vcs import --input ${ROS_DISTRO}-${ROS_PKG}.rosinstall ./src && \
apt-get update && \
rosdep install --from-paths ./src --ignore-packages-from-source --rosdistro ${ROS_DISTRO} --skip-keys python3-pykdl -y && \
python3 ./src/catkin/bin/catkin_make_isolated --install --install-space ${ROS_ROOT} -DCMAKE_BUILD_TYPE=Release && \
rm -rf /var/lib/apt/lists/*
RUN pip3 install trimesh \
numpy-quaternion \
networkx \
pyyaml \
rospkg \
rosdep \
empy
# copy pkgs directory:
COPY pkgs /pkgs
# install warp:
RUN cd /pkgs/warp && python3 build_lib.py && pip3 install .
# install curobolib-extras/warp_torch:
RUN cd /pkgs/warp_torch && pip3 install .
# install nvblox:
RUN apt-get update && \
apt-get install -y libgoogle-glog-dev libgtest-dev curl libsqlite3-dev && \
cd /usr/src/googletest && cmake . && cmake --build . --target install && \
rm -rf /var/lib/apt/lists/*
RUN cd /pkgs/nvblox/nvblox && mkdir build && cd build && cmake .. && \
make -j8 && make install
# install curobolib-extras/nvblox_torch:
RUN cd /pkgs/nvblox_torch && sh install.sh
# install curobolib and curobo:
RUN cd /pkgs/curobolib && pip3 install .
RUN cd /pkgs/curobo && pip3 install .
# sudo apt-get install lcov libbullet-extras-dev python3-catkin-tools swig ros-noetic-ifopt libyaml-cpp-dev libjsoncpp-dev
# pip3 install tqdm
# sudo apt-get install liborocos-kdl-dev ros-noetic-fcl libpcl-dev libompl-dev libnlopt-cxx-dev liburdf-dev libkdlparser-dev
# clone taskflow and compile
# libfranka:
RUN apt-get update && apt-get install -y build-essential cmake git libpoco-dev libeigen3-dev && cd /pkgs && git clone --recursive https://github.com/frankaemika/libfranka && cd libfranka && git checkout 0.7.1 && git submodule update && mkdir build && cd build && cmake -DCMAKE_BUILD_TYPE=Release -DBUILD_TESTS=OFF .. && \
cmake --build . && cpack -G DEB && dpkg -i libfranka*.deb && rm -rf /var/lib/apt/lists/*
# franka_ros and franka_motion_control:
RUN mkdir -p /curobo_ws/src && mv /pkgs/curobo_ros /curobo_ws/src/ && mv /pkgs/franka_motion_control /curobo_ws/src/
RUN cd /curobo_ws/src && git clone --branch 0.7.1 https://github.com/frankaemika/franka_ros.git && \
git clone https://github.com/justagist/franka_panda_description.git
RUN apt-get update && apt-get install -y ros-noetic-robot-state-publisher ros-noetic-rviz \
ros-noetic-moveit-visualization ros-noetic-moveit-msgs \
ros-noetic-controller-interface ros-noetic-combined-robot-hw ros-noetic-joint-limits-interface \
ros-noetic-control-msgs ros-noetic-controller-manager ros-noetic-realtime-tools ros-noetic-eigen-conversions ros-noetic-tf-conversions ros-noetic-moveit-ros-visualization && rm -rf /var/lib/apt/lists/*
RUN cd /curobo_ws && \
/bin/bash -c "source /opt/ros/noetic/setup.bash && catkin_make -DCMAKE_BUILD_TYPE=Release"
#RUN apt-get update && apt-get install -y ros-noetic-robot-state-publisher ros-noetic-rviz ros-noetic-moveit-msgs\
# ros-noetic-moveit-ros ros-noetic-controller-interface ros-noetic-combined-robot-hw ros-noetic-joint-limits-interface ros-noetic-control-msgs && rm -rf /var/lib/apt/lists/*

30
docker/base.dockerfile Normal file
View File

@@ -0,0 +1,30 @@
##
## Copyright (c) 2023 NVIDIA CORPORATION & AFFILIATES. All rights reserved.
##
## NVIDIA CORPORATION, its affiliates and licensors retain all intellectual
## property and proprietary rights in and to this material, related
## documentation and any modifications thereto. Any use, reproduction,
## disclosure or distribution of this material and related documentation
## without an express license agreement from NVIDIA CORPORATION or
## its affiliates is strictly prohibited.
##
#@FROM nvcr.io/nvidia/pytorch:22.12-py3
FROM nvcr.io/nvidia/pytorch:23.08-py3 AS torch_cuda_base
RUN echo 'debconf debconf/frontend select Noninteractive' | debconf-set-selections
RUN apt-get update && apt-get install -y \
tzdata \
&& rm -rf /var/lib/apt/lists/* \
&& ln -fs /usr/share/zoneinfo/America/Los_Angeles /etc/localtime \
&& echo "America/Los_Angeles" > /etc/timezone \
&& dpkg-reconfigure -f noninteractive tzdata
RUN apt-get update &&\
apt-get install -y sudo git bash software-properties-common graphviz &&\
rm -rf /var/lib/apt/lists/*
RUN python -m pip install --upgrade pip && python3 -m pip install graphviz

View File

@@ -0,0 +1,46 @@
#!/bin/bash
##
## Copyright (c) 2023 NVIDIA CORPORATION & AFFILIATES. All rights reserved.
##
## NVIDIA CORPORATION, its affiliates and licensors retain all intellectual
## property and proprietary rights in and to this material, related
## documentation and any modifications thereto. Any use, reproduction,
## disclosure or distribution of this material and related documentation
## without an express license agreement from NVIDIA CORPORATION or
## its affiliates is strictly prohibited.
##
# This script will create a dev docker. Run this script by calling `bash build_dev_docker.sh`
# Make sure you have pulled all required repos into pkgs folder (see pull_repos.sh script)
# Check architecture to build:
arch=`uname -m`
if [ ${arch} == "x86_64" ]; then
echo "Building for X86 Architecture"
dockerfile="x86.dockerfile"
elif [ ${arch} = "aarch64" ]; then
echo "Building for ARM Architecture"
dockerfile="arm64.dockerfile"
else
echo "Unknown Architecture, defaulting to " + ${arch}
dockerfile="x86.dockerfile"
fi
# build docker file:
# Make sure you enable nvidia runtime by:
# Edit/create the /etc/docker/daemon.json with content:
# {
# "runtimes": {
# "nvidia": {
# "path": "/usr/bin/nvidia-container-runtime",
# "runtimeArgs": []
# }
# },
# "default-runtime": "nvidia" # ADD this line (the above lines will already exist in your json file)
# }
#
echo "${dockerfile}"
docker build -t curobo_docker:latest -f ${dockerfile} .

View File

@@ -0,0 +1,11 @@
##
## Copyright (c) 2023 NVIDIA CORPORATION & AFFILIATES. All rights reserved.
##
## NVIDIA CORPORATION, its affiliates and licensors retain all intellectual
## property and proprietary rights in and to this material, related
## documentation and any modifications thereto. Any use, reproduction,
## disclosure or distribution of this material and related documentation
## without an express license agreement from NVIDIA CORPORATION or
## its affiliates is strictly prohibited.
##
docker build --build-arg USERNAME=$USER --no-cache --build-arg USER_ID=$1 --tag curobo_user_docker:latest -f user.dockerfile .

View File

@@ -0,0 +1,69 @@
##
## Copyright (c) 2023 NVIDIA CORPORATION & AFFILIATES. All rights reserved.
##
## NVIDIA CORPORATION, its affiliates and licensors retain all intellectual
## property and proprietary rights in and to this material, related
## documentation and any modifications thereto. Any use, reproduction,
## disclosure or distribution of this material and related documentation
## without an express license agreement from NVIDIA CORPORATION or
## its affiliates is strictly prohibited.
##
FROM nvcr.io/nvidia/pytorch:23.02-py3
RUN echo 'debconf debconf/frontend select Noninteractive' | debconf-set-selections
RUN apt-get update && apt-get install -y \
tzdata \
&& rm -rf /var/lib/apt/lists/* \
&& ln -fs /usr/share/zoneinfo/America/Los_Angeles /etc/localtime \
&& echo "America/Los_Angeles" > /etc/timezone \
&& dpkg-reconfigure -f noninteractive tzdata
RUN apt-get update &&\
apt-get install -y sudo git bash software-properties-common graphviz &&\
rm -rf /var/lib/apt/lists/*
RUN python -m pip install --upgrade pip && python3 -m pip install graphviz
# Install ROS noetic
RUN sh -c 'echo "deb http://packages.ros.org/ros/ubuntu focal main" > /etc/apt/sources.list.d/ros-latest.list' \
&& apt-key adv --keyserver 'hkp://keyserver.ubuntu.com:80' --recv-key C1CF6E31E6BADE8868B172B4F42ED6FBAB17C654 \
&& apt-get update && apt-get install -y \
ros-noetic-desktop-full git build-essential python3-rosdep \
&& rm -rf /var/lib/apt/lists/*
# install realsense and azure kinect
# Install the RealSense library (https://github.com/IntelRealSense/librealsense/blob/master/doc/distribution_linux.md#installing-the-packages)
#RUN sudo apt-key adv --keyserver keys.gnupg.net --recv-key F6E65AC044F831AC80A06380C8B3A55A6F3EFCDE || sudo apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv-key F6E65AC044F831AC80A06380C8B3A55A6F3EFCDE
#RUN sudo add-apt-repository "deb https://librealsense.intel.com/Debian/apt-repo $(lsb_release -cs) main" -u
#RUN apt-get update && apt-get install -y \
# librealsense2-dkms \
# software-properties-common \
# librealsense2-utils \
# && rm -rf /var/lib/apt/lists/*
# install moveit from source for all algos:
ARG ROS_DISTRO=noetic
RUN apt-get update && apt-get install -y \
ros-$ROS_DISTRO-apriltag-ros \
ros-$ROS_DISTRO-realsense2-camera \
ros-$ROS_DISTRO-ros-numpy \
ros-$ROS_DISTRO-vision-msgs \
ros-$ROS_DISTRO-franka-ros \
ros-$ROS_DISTRO-moveit-resources \
ros-$ROS_DISTRO-rosparam-shortcuts \
libglfw3-dev \
ros-$ROS_DISTRO-collada-urdf \
ros-$ROS_DISTRO-ur-msgs \
swig \
&& rm -rf /var/lib/apt/lists/*
RUN apt-get update && rosdep init && rosdep update && apt-get install -y ros-noetic-moveit-ros-visualization && rm -rf /var/lib/apt/lists/*
RUN pip3 install netifaces

View File

@@ -0,0 +1,22 @@
##
## Copyright (c) 2023 NVIDIA CORPORATION & AFFILIATES. All rights reserved.
##
## NVIDIA CORPORATION, its affiliates and licensors retain all intellectual
## property and proprietary rights in and to this material, related
## documentation and any modifications thereto. Any use, reproduction,
## disclosure or distribution of this material and related documentation
## without an express license agreement from NVIDIA CORPORATION or
## its affiliates is strictly prohibited.
##
docker run --rm -it \
--runtime nvidia \
--mount type=bind,src=/home/$USER/code,target=/home/$USER/code \
--hostname ros1-docker \
--add-host ros1-docker:127.0.0.1 \
--network host \
--gpus all \
--env ROS_HOSTNAME=localhost \
--env DISPLAY=$DISPLAY \
--volume /tmp/.X11-unix:/tmp/.X11-unix \
--volume /dev/input:/dev/input \
curobo_user_docker:latest

View File

@@ -0,0 +1,22 @@
##
## Copyright (c) 2023 NVIDIA CORPORATION & AFFILIATES. All rights reserved.
##
## NVIDIA CORPORATION, its affiliates and licensors retain all intellectual
## property and proprietary rights in and to this material, related
## documentation and any modifications thereto. Any use, reproduction,
## disclosure or distribution of this material and related documentation
## without an express license agreement from NVIDIA CORPORATION or
## its affiliates is strictly prohibited.
##
docker run --rm -it \
--privileged --mount type=bind,src=/home/$USER/code,target=/home/$USER/code \
-e NVIDIA_DISABLE_REQUIRE=1 \
-e NVIDIA_DRIVER_CAPABILITIES=all --device /dev/dri \
--hostname ros1-docker \
--add-host ros1-docker:127.0.0.1 \
--gpus all \
--network host \
--env DISPLAY=unix$DISPLAY \
--volume /tmp/.X11-unix:/tmp/.X11-unix \
--volume /dev:/dev \
curobo_user_docker:latest

View File

@@ -0,0 +1,24 @@
##
## Copyright (c) 2023 NVIDIA CORPORATION & AFFILIATES. All rights reserved.
##
## NVIDIA CORPORATION, its affiliates and licensors retain all intellectual
## property and proprietary rights in and to this material, related
## documentation and any modifications thereto. Any use, reproduction,
## disclosure or distribution of this material and related documentation
## without an express license agreement from NVIDIA CORPORATION or
## its affiliates is strictly prohibited.
##
docker run --rm -it \
--privileged --mount type=bind,src=/home/$USER/code,target=/home/$USER/code \
-e NVIDIA_DISABLE_REQUIRE=1 \
-e NVIDIA_DRIVER_CAPABILITIES=all --device /dev/dri \
--hostname ros1-docker \
--add-host ros1-docker:127.0.0.1 \
--gpus all \
--network host \
--env ROS_MASTER_URI=http://127.0.0.1:11311 \
--env ROS_IP=127.0.0.1 \
--env DISPLAY=unix$DISPLAY \
--volume /tmp/.X11-unix:/tmp/.X11-unix \
--volume /dev/input:/dev/input \
curobo_user_docker:latest

34
docker/user.dockerfile Normal file
View File

@@ -0,0 +1,34 @@
##
## Copyright (c) 2023 NVIDIA CORPORATION & AFFILIATES. All rights reserved.
##
## NVIDIA CORPORATION, its affiliates and licensors retain all intellectual
## property and proprietary rights in and to this material, related
## documentation and any modifications thereto. Any use, reproduction,
## disclosure or distribution of this material and related documentation
## without an express license agreement from NVIDIA CORPORATION or
## its affiliates is strictly prohibited.
##
# Check architecture and load:
FROM curobo_docker:latest
# Set variables
ARG USERNAME
ARG USER_ID
# Set environment variables
# Set up sudo user
#RUN /sbin/adduser --disabled-password --gecos '' --uid $USER_ID $USERNAME
RUN useradd -l -u $USER_ID -g users $USERNAME
RUN /sbin/adduser $USERNAME sudo
RUN echo '%sudo ALL=(ALL) NOPASSWD:ALL' >> /etc/sudoers
# Set user
USER $USERNAME
WORKDIR /home/$USERNAME
ENV USER=$USERNAME
ENV PATH="${PATH}:/home/${USER}/.local/bin"
RUN echo 'completed'

93
docker/x86.dockerfile Normal file
View File

@@ -0,0 +1,93 @@
##
## Copyright (c) 2023 NVIDIA CORPORATION & AFFILIATES. All rights reserved.
##
## NVIDIA CORPORATION, its affiliates and licensors retain all intellectual
## property and proprietary rights in and to this material, related
## documentation and any modifications thereto. Any use, reproduction,
## disclosure or distribution of this material and related documentation
## without an express license agreement from NVIDIA CORPORATION or
## its affiliates is strictly prohibited.
##
FROM nvcr.io/nvidia/pytorch:23.08-py3 AS torch_cuda_base
LABEL maintainer "User Name"
# add GL:
RUN apt-get update && apt-get install -y --no-install-recommends \
pkg-config \
libglvnd-dev \
libgl1-mesa-dev \
libegl1-mesa-dev \
libgles2-mesa-dev && \
rm -rf /var/lib/apt/lists/*
ENV NVIDIA_VISIBLE_DEVICES all
ENV NVIDIA_DRIVER_CAPABILITIES graphics,utility,compute
RUN apt-get update &&\
apt-get install -y sudo git bash unattended-upgrades glmark2 &&\
rm -rf /var/lib/apt/lists/*
# Deal with getting tons of debconf messages
# See: https://github.com/phusion/baseimage-docker/issues/58
RUN echo 'debconf debconf/frontend select Noninteractive' | debconf-set-selections
# Set timezone info
RUN apt-get update && apt-get install -y \
tzdata \
software-properties-common \
&& rm -rf /var/lib/apt/lists/* \
&& ln -fs /usr/share/zoneinfo/America/Los_Angeles /etc/localtime \
&& echo "America/Los_Angeles" > /etc/timezone \
&& dpkg-reconfigure -f noninteractive tzdata \
&& add-apt-repository -y ppa:git-core/ppa
RUN apt-get update && apt-get install -y \
curl \
lsb-core \
wget \
build-essential \
cmake \
git \
git-lfs \
iputils-ping \
make \
openssh-server \
openssh-client \
libeigen3-dev \
libssl-dev \
python3-pip \
python3-ipdb \
python3-tk \
python3-wstool \
sudo git bash unattended-upgrades \
apt-utils \
terminator \
&& rm -rf /var/lib/apt/lists/*
# push defaults to bashrc:
RUN apt-get update && apt-get install --reinstall -y \
libmpich-dev \
hwloc-nox libmpich12 mpich \
&& rm -rf /var/lib/apt/lists/*
# This is required to enable mpi lib access:
ENV PATH="${PATH}:/opt/hpcx/ompi/bin"
ENV LD_LIBRARY_PATH="${LD_LIBRARY_PATH}:/opt/hpcx/ompi/lib"
ENV TORCH_CUDA_ARCH_LIST "7.0+PTX"
ENV LD_LIBRARY_PATH="/usr/local/lib:${LD_LIBRARY_PATH}"
# copy pkgs directory: clone curobo into docker/pkgs folder.
COPY pkgs /pkgs
RUN pip install "robometrics[evaluator] @ git+https://github.com/fishbotics/robometrics.git"
RUN cd /pkgs/curobo && pip3 install .[dev,usd] --no-build-isolation