From 9a3eef154c8c9e751b0de2df6faf6080eb351974 Mon Sep 17 00:00:00 2001 From: Pau Carre Cardona Date: Thu, 15 Dec 2022 21:45:21 +0100 Subject: [PATCH 1/2] Docker machine support --- README.md | 4 + docker/README.md | 31 +++ docker/bin/build.sh | 3 + docker/bin/install-docker.sh | 25 +++ docker/bin/install.sh | 12 ++ docker/bin/launch.py | 42 ++++ docker/bin/stop.sh | 5 + docker/dockerfiles/base/Dockerfile | 108 ++++++++++ docker/dockerfiles/desktop/Dockerfile | 207 ++++++++++++++++++++ docker/dockerfiles/desktop/arduino-cli.yaml | 3 + docker/dockerfiles/desktop/lxterminal.conf | 53 +++++ 11 files changed, 493 insertions(+) create mode 100644 docker/README.md create mode 100755 docker/bin/build.sh create mode 100755 docker/bin/install-docker.sh create mode 100755 docker/bin/install.sh create mode 100755 docker/bin/launch.py create mode 100755 docker/bin/stop.sh create mode 100644 docker/dockerfiles/base/Dockerfile create mode 100644 docker/dockerfiles/desktop/Dockerfile create mode 100644 docker/dockerfiles/desktop/arduino-cli.yaml create mode 100644 docker/dockerfiles/desktop/lxterminal.conf diff --git a/README.md b/README.md index e868cb8..38e8d48 100644 --- a/README.md +++ b/README.md @@ -54,6 +54,10 @@ cd acronym && pip install -e . ``` +## Docker Setup + +Refer to [docker documenation](./docker/README.md) for details. + ## Folder structure ```bash NGDF diff --git a/docker/README.md b/docker/README.md new file mode 100644 index 0000000..71aac94 --- /dev/null +++ b/docker/README.md @@ -0,0 +1,31 @@ +# Introduction + +This folder contains a mechanism to launch `NGDF` using docker as well as a development +environment for it, which includes VSCode, ROS, Open3D and nVidia support among others. + +## Installation + +For the docker machine to work it is necesary to install `docker` and `nVidia docker`. + +If you are using `Ubuntu`, you can install the requirements running: +```bash +./bin/install-docker.sh +``` + +Then, build the docker images running: +```bash +./bin/build.sh +``` + +Finally, copy the `HOME` folder of the docker machine into a local +folder so that you can develop using the docker machine in a way that changes are persisted. +```bash +./bin/install.sh +``` + +## Launch + +After the installation is sucessful, run: +```bash +./bin/launch.py +``` \ No newline at end of file diff --git a/docker/bin/build.sh b/docker/bin/build.sh new file mode 100755 index 0000000..df4851d --- /dev/null +++ b/docker/bin/build.sh @@ -0,0 +1,3 @@ +#!/bin/bash +docker build -t ros-base:v1.0 --build-arg BUILD_USER_ID=$(id -u) --build-arg BUILD_GROUP_ID=$(id -g) dockerfiles/base +docker build --build-arg SSH_PRIVATE_KEY="$(cat $HOME/.ssh/id_rsa)" --build-arg SSH_PUBLIC_KEY="$(cat $HOME/.ssh/id_rsa.pub)" -t ros-desktop:v1.0 dockerfiles/desktop \ No newline at end of file diff --git a/docker/bin/install-docker.sh b/docker/bin/install-docker.sh new file mode 100755 index 0000000..ba8b102 --- /dev/null +++ b/docker/bin/install-docker.sh @@ -0,0 +1,25 @@ +#!/bin/bash +sudo apt-get uninstall -y docker docker-engine docker.io containerd runc nvidia-docker2 +sudo apt-get install -y \ + apt-transport-https \ + ca-certificates \ + curl \ + gnupg \ + lsb-release + +sudo groupadd docker +sudo usermod -aG docker $USER +newgrp docker +pip3 install click + +distribution=$(. /etc/os-release;echo $ID$VERSION_ID) \ + && curl -fsSL https://nvidia.github.io/libnvidia-container/gpgkey | sudo gpg --dearmor -o /usr/share/keyrings/nvidia-container-toolkit-keyring.gpg \ + && curl -s -L https://nvidia.github.io/libnvidia-container/$distribution/libnvidia-container.list | \ + sed 's#deb https://#deb [signed-by=/usr/share/keyrings/nvidia-container-toolkit-keyring.gpg] https://#g' | \ + sudo tee /etc/apt/sources.list.d/nvidia-container-toolkit.list + +sudo apt-get update +sudo apt-get install -y nvidia-docker2 +sudo systemctl restart docker +# THIS IS NECESSARY AS OTHERWISE NVIDIA REPOS TAKE OVER UBUNTU-ONES AND THE VERSIONING GETS BROKEN +sudo rm -rf /etc/apt/sources.list.d/nvidia-* \ No newline at end of file diff --git a/docker/bin/install.sh b/docker/bin/install.sh new file mode 100755 index 0000000..e696135 --- /dev/null +++ b/docker/bin/install.sh @@ -0,0 +1,12 @@ +#!/bin/bash +./bin/run-desktop.sh dt +sleep 5 +container_id=$(docker ps -aqf "name=ros-desktop" | tr -d '\n') +echo "Docker container $container_id" +destination_folder="$HOME/docker-dir" +mkdir -p $destination_folder/home/ros +mkdir -p $destination_folder/home/ros/.ssh +docker cp $container_id:/home/ros $destination_folder/home +cp $HOME/.ssh/* $destination_folder/home/ros/.ssh/ +docker stop -t 1 $container_id +pip3 install click \ No newline at end of file diff --git a/docker/bin/launch.py b/docker/bin/launch.py new file mode 100755 index 0000000..f313c98 --- /dev/null +++ b/docker/bin/launch.py @@ -0,0 +1,42 @@ +#!/usr/bin/env python3 +import sys +import os +import click +import subprocess + +@click.command() +@click.option("--data-dir", default=lambda: f"{os.environ.get('HOME', '')}/docker-dir", help="Data directory") +@click.option("--desktop", default=False, help="Desktop mode", type=bool) +@click.option("--gpu", default=True, help="GPU Support", type=bool) +def main(data_dir, desktop, gpu): + entrypoint = "" if desktop else "--entrypoint /bin/bash" + gpu_support = "-e NVIDIA_DRIVER_CAPABILITIES=all --gpus all \\" if gpu else "\\" + commands = [ + "xhost +", + "export LIBGL_ALWAYS_INDIRECT=1", + f""" + docker container run --rm -it \ + --cap-add=SYS_PTRACE \ + --security-opt=seccomp:unconfined \ + --security-opt=apparmor:unconfined \ + --privileged {gpu_support} + --device-cgroup-rule "c 81:* rmw" \ + --device-cgroup-rule "c 189:* rmw" \ + --volume=/dev:/dev \ + --device=/dev:/dev \ + --user $(id -u) {entrypoint} \ + --workdir /home/ros \ + --mount type=bind,source="{data_dir}/home/ros",target=/home/ros \ + --name ros-desktop-nvidia \ + --security-opt apparmor:unconfined \ + --net=host \ + --env="DISPLAY" \ + --volume="$HOME/.Xauthority:/home/ros/.Xauthority:rw" \ + ros-desktop:v1.0 + """ + ] + for command in commands: + results = subprocess.run(command, shell=True, text=True) + +if __name__ == "__main__": + main() diff --git a/docker/bin/stop.sh b/docker/bin/stop.sh new file mode 100755 index 0000000..c305074 --- /dev/null +++ b/docker/bin/stop.sh @@ -0,0 +1,5 @@ +#!/bin/bash +container_id=$(docker ps -aqf "name=ros-desktop" | tr -d '\n') +echo "$container_id" +docker stop $container_id + diff --git a/docker/dockerfiles/base/Dockerfile b/docker/dockerfiles/base/Dockerfile new file mode 100644 index 0000000..db5458f --- /dev/null +++ b/docker/dockerfiles/base/Dockerfile @@ -0,0 +1,108 @@ +## +## How do I select the base image? +## Check the host nvidia version by running: nvcc --version +## That will give you your host's cuda version. +## Then try to find one that matches from the release notes +## of nVidia's images: https://docs.nvidia.com/deeplearning/frameworks/tensorflow-release-notes/rel_21-12.html#rel_21-12 +## Finally, the tag in: https://catalog.ngc.nvidia.com/orgs/nvidia/containers/l4t-tensorflow/tags +## You will have to also change the installation of pytorch so that the cuda version also fits +## +## For the current version, the host, the docker image and pytorch are CUDA 11.5 +## +## First you can try the base by using: docker run --runtime=nvidia --rm nvcr.io/nvidia/tensorflow:21.12-tf2-py3 /bin/bash +## +FROM nvcr.io/nvidia/tensorflow:21.12-tf2-py3 + +ENV DEBIAN_FRONTEND=noninteractive + +RUN echo 'Etc/UTC' > /etc/timezone && \ + apt-get update && \ + apt-get install -q -y --no-install-recommends tzdata && \ + apt-get autoclean + +RUN apt-get update && apt-get install -q -y --no-install-recommends \ + dirmngr \ + gnupg2 && \ + apt-get autoclean + +## +## What's at the end of this line "cu115" should be consistent with both: +## (1) The cuda version in the host that shall be checked with "nvcc --version" +## (2) The cuda version in the base image which you can check in +## https://docs.nvidia.com/deeplearning/frameworks/tensorflow-release-notes/rel_21-12.html#rel_21-12 +RUN pip install torch==1.13.0 torchvision torchaudio --extra-index-url https://download.pytorch.org/whl/cu113 + +RUN apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv-keys C1CF6E31E6BADE8868B172B4F42ED6FBAB17C654 + +ENV LANG C.UTF-8 +ENV LC_ALL C.UTF-8 + +ARG BUILD_GROUP_ID +ARG BUILD_USER_ID + +# Create 'ros' user with sudo powers +ARG USERNAME=ros +RUN groupadd --gid $BUILD_GROUP_ID $USERNAME && \ + useradd -s /bin/bash --uid $BUILD_USER_ID --gid $BUILD_GROUP_ID -m $USERNAME && \ + mkdir -p /etc/sudoers.d && \ + echo $USERNAME ALL=\(root\) NOPASSWD:ALL > /etc/sudoers.d/$USERNAME && \ + chmod 0440 /etc/sudoers.d/$USERNAME && \ + echo "source /usr/share/bash-completion/completions/git" >> /home/$USERNAME/.bashrc + +RUN apt-get update && apt-get install -y --no-install-recommends \ + build-essential \ + git vim tree net-tools \ + python3-pip \ + apt-file \ + graphicsmagick-libmagick-dev-compat \ + libceres-dev \ + libzmq3-dev \ + libboost-dev \ + jq \ + wget \ + python3-tk \ + curl \ + libssl-dev \ + libusb-1.0-0-dev \ + usb-1.0-0 \ + libudev-dev \ + udev \ + pkg-config \ + libgtk-3-dev \ + freeglut3 \ + freeglut3-dev \ + libglfw3-dev \ + libgl1-mesa-dev \ + libglu1-mesa-dev \ + fswebcam \ + xdg-utils && \ + apt-get autoclean + +RUN apt-get update && \ + apt install -y lsb-release && \ + sh -c 'echo "deb http://packages.ros.org/ros/ubuntu $(lsb_release -sc) main" > /etc/apt/sources.list.d/ros-latest.list' && \ + curl -s https://raw.githubusercontent.com/ros/rosdistro/master/ros.asc | apt-key add - && \ + apt-get autoclean + +RUN apt-get update && \ + apt install -y ros-noetic-desktop-full python3-rosdep python3-rosinstall python3-rosinstall-generator python3-wstool build-essential && \ + apt-get autoclean + +RUN curl https://bootstrap.pypa.io/get-pip.py -o get-pip.py && \ + python3 get-pip.py --force-reinstall + +USER $USERNAME +WORKDIR /home/$USERNAME + +RUN sudo mkdir /etc/ros && \ + sudo chown -R ros:ros /etc/ros && \ + sudo chown -R ros:ros /usr/local/lib/python3.8/dist-packages + +RUN wget -qO- https://packages.microsoft.com/keys/microsoft.asc | gpg --dearmor > packages.microsoft.gpg && \ + sudo install -o root -g root -m 644 packages.microsoft.gpg /etc/apt/trusted.gpg.d/ && \ + sudo sh -c 'echo "deb [arch=amd64,arm64,armhf signed-by=/etc/apt/trusted.gpg.d/packages.microsoft.gpg] https://packages.microsoft.com/repos/code stable main" > /etc/apt/sources.list.d/vscode.list' && \ + rm -f packages.microsoft.gpg + +RUN sudo apt update && \ + sudo apt install --no-install-recommends -y apt-transport-https code ninja-build && \ + sudo apt-get autoclean diff --git a/docker/dockerfiles/desktop/Dockerfile b/docker/dockerfiles/desktop/Dockerfile new file mode 100644 index 0000000..d1f8a29 --- /dev/null +++ b/docker/dockerfiles/desktop/Dockerfile @@ -0,0 +1,207 @@ +FROM ros-base:v1.0 + +ENV DEBIAN_FRONTEND noninteractive + +ARG USERNAME=ros +USER $USERNAME +RUN mkdir -p /home/ros/phase4ai/ws/arm/src + +USER root + +ARG USERNAME=ros +USER $USERNAME +WORKDIR /home/$USERNAME + +RUN sudo apt update && \ + sudo apt install -y --no-install-recommends --allow-unauthenticated \ + software-properties-common curl apache2-utils \ + supervisor nginx sudo net-tools zenity xz-utils \ + dbus-x11 x11-utils alsa-utils curl ca-certificates gnupg patch \ + mesa-utils libgl1-mesa-dri ffmpeg tmux libusb* \ + lxde gtk2-engines-murrine gnome-themes-standard gtk2-engines-pixbuf gtk2-engines-murrine arc-theme \ + xvfb x11vnc libcanberra-gtk-module libcanberra-gtk3-module meshlab psmisc python-dev python3-dev \ + vim-tiny sudo firefox-geckodriver ttf-ubuntu-font-family ttf-wqy-zenhei tmuxinator python-dev \ + usbutils joystick cheese libglvnd-dev python3-pip && \ + pip install hidapi && \ + pip install --upgrade setuptools && \ + sudo add-apt-repository -r ppa:fcwu-tw/apps && \ + sudo mkdir /usr/local/ffmpeg && \ + sudo apt-get autoclean + +RUN cd /home/ros/ &&\ + git clone --branch v2.50.0 https://github.com/IntelRealSense/librealsense.git && \ + cd librealsense && \ + ./scripts/setup_udev_rules.sh && \ + mkdir build && cd build && \ + cmake .. -DBUILD_EXAMPLES=true -DCMAKE_BUILD_TYPE=release -DFORCE_RSUSB_BACKEND=false -DBUILD_WITH_CUDA=false && make -j$(($(nproc)-1)) + +USER root + +RUN cd /home/ros/librealsense/build && make install +RUN usermod -a -G video ros + +USER $USERNAME + +RUN sudo ln -s /usr/bin/ffmpeg /usr/local/ffmpeg/ffmpeg && \ + sudo chmod -R o+rw /usr/local && \ + pip install empty catkin_pkg lark PyYAML + +RUN wget -O arduino-ide.zip https://downloads.arduino.cc/arduino-ide/arduino-ide_2.0.0-rc3_Linux_64bit.zip?_gl=1*1lij0u2*_ga*MTg0MTE3MTE1NS4xNjQwNDI0NjE3*_ga_NEXN8H46L5*MTY0MDQyNDYxNi4xLjEuMTY0MDQyNDY2MC4w && \ + unzip arduino-ide.zip && \ + rm arduino-ide.zip && \ + wget -O arduino-cli.tar.gz https://github.com/arduino/arduino-cli/releases/download/0.20.2/arduino-cli_0.20.2_Linux_64bit.tar.gz && \ + tar -xvf arduino-cli.tar.gz && \ + rm arduino-cli.tar.gz && \ + mkdir -p .local/bin && \ + mv arduino-cli .local/bin +COPY arduino-cli.yaml $HOME/ +RUN .local/bin/arduino-cli core update-index --config-file arduino-cli.yaml && \ + .local/bin/arduino-cli core update-index && \ + .local/bin/arduino-cli board listall && \ + .local/bin/arduino-cli core install esp32:esp32 + + +ENV HOME=/home/ros \ + SHELL=/bin/bash \ + CUDA_HOME=/usr/local/cuda + +RUN mkdir -p /home/ros/.config/lxterminal/ +COPY lxterminal.conf /home/ros/.config/lxterminal/lxterminal.conf + +RUN python3 -m pip install --upgrade pip && \ + sudo apt update && \ + sudo apt install -y python3-send2trash && \ + sudo apt install -y --no-install-recommends iputils-ping ros-noetic-rviz-visual-tools ros-noetic-ddynamic-reconfigure* && \ + sudo apt install -y ros-noetic-geometric-shapes ros-noetic-moveit-msgs \ + ros-noetic-srdfdom ros-noetic-pybind11-catkin ros-noetic-moveit-resources-* \ + ros-noetic-ompl ros-noetic-warehouse-ros-* ros-noetic-eigenpy \ + ros-noetic-moveit-visual-tools ros-noetic-rosparam-shortcuts \ + ros-noetic-collada-urdf ros-noetic-rospy-message-converter && \ + sudo python3 -m pip install --ignore-installed setuptools testresources && \ + sudo chown -R ros:ros /usr/local && \ + sudo apt-get autoclean + +RUN cd /home/ros/librealsense && \ + sudo cp config/99-realsense-libusb.rules /etc/udev/rules.d/ && \ + sudo /lib/systemd/systemd-udevd --daemon && \ + sudo udevadm control --reload-rules && udevadm trigger + +RUN cd /home/ros && \ + git clone https://github.com/crigroup/openrave-installation && \ + cd openrave-installation && \ + ./install-dependencies.sh && \ + ./install-osg.sh && \ + ./install-fcl.sh && \ + ./install-openrave.sh && \ + sudo apt-get autoclean + +RUN pip install catkin_pkg && \ + pip install lxml && \ + sudo chmod -R o+rw /usr/local && \ + pip3 uninstall -y sklearn scipy && \ + pip3 install -U sklearn scipy pyrealsense2 configargparse gdown && \ + pip3 install argh natsort diskcache easydict trimesh + +RUN sudo apt-get update && \ + sudo apt-get install -y ros-noetic-trac-ik-kinematics-plugin && \ + sudo apt-get install --no-install-recommends -y \ + libblosc-dev \ + libboost-iostreams-dev \ + libboost-system-dev \ + libboost-system-dev \ + libeigen3-dev && \ + sudo apt install -y ros-noetic-tf2* ros-noetic-pcl-* \ + xorg-dev libglu1-mesa-dev python3-dev libsdl2-dev \ + libc++-7-dev libc++abi-7-dev ninja-build libxi-dev gfortran libtbb-dev \ + libosmesa6-dev libudev-dev autoconf libtool flex libkdtree++-dev && \ + sudo apt-get autoclean + +RUN sudo DEBIAN_FRONTEND=noninteractive apt install -y intel-mkl && \ + echo 'deb [trusted=yes] https://developer.download.nvidia.com/hpc-sdk/ubuntu/amd64 /' | sudo tee /etc/apt/sources.list.d/nvhpc.list && \ + sudo apt-get update -y && \ + sudo apt-get install -y nvhpc-22-1 && \ + sudo rm -rf /etc/alternatives/cuda && \ + sudo rm -rf /usr/local/cuda && \ + sudo ln -s /opt/nvidia/hpc_sdk/Linux_x86_64/22.1/cuda/11.5 /usr/local/cuda && \ + sudo cp -ans /opt/nvidia/hpc_sdk/Linux_x86_64/22.1/math_libs/11.5/targets/x86_64-linux/include/* /opt/nvidia/hpc_sdk/Linux_x86_64/22.1/cuda/11.5/targets/x86_64-linux/include/ && \ + sudo cp -ans /opt/nvidia/hpc_sdk/Linux_x86_64/22.1/math_libs/11.5/targets/x86_64-linux/lib/* /opt/nvidia/hpc_sdk/Linux_x86_64/22.1/cuda/11.5/targets/x86_64-linux/lib/ && \ + pip3 uninstall -y tensorflow && sudo chmod -R o+w /usr/bin/ && pip3 install --upgrade numpy && \ + sudo apt-get autoclean + +RUN sudo ln /usr/local/bin/pip /usr/bin/pip && \ + pip3 install --upgrade pip && \ + pip3 install lxml && \ + sudo chmod -R o+w /usr/share && \ + pip3 install pyserial && \ + pip3 install returns && \ + pip3 install --upgrade pip && \ + pip3 install torch-scatter pyrender urdfpy pykdtree pybullet scikit-image pytorch-ignite nvisii pytransform3d hydra-core torchmetrics && \ + pip3 install black tabulate gym plotly pytorch_lightning wandb + +RUN pip3 install "git+https://github.com/facebookresearch/pytorch3d.git@stable" + +RUN git clone -b v4.1.4 https://github.com/open-mpi/ompi.git && \ + cd ompi && ./autogen.pl && ./configure && make && sudo make install && cd .. && \ + sudo mkdir -p /opt/hpcx/ompi/lib/x86_64-linux-gnu/openmpi/include && \ + sudo ln -s /opt/hpcx/ompi/include /opt/hpcx/ompi/lib/x86_64-linux-gnu/openmpi/include/openmpi && \ + sudo mkdir -p /opt/hpcx/ompi/lib/x86_64-linux-gnu/openmpi/include && \ + sudo ln -s /opt/hpcx/ompi/include /opt/hpcx/ompi/lib/x86_64-linux-gnu/openmpi/include/openmpi && \ + sudo mkdir -p /opt/hpcx/ompi/lib/x86_64-linux-gnu/openmpi/include/openmpi/opal/mca/hwloc/hwloc201/hwloc && \ + sudo ln -s /opt/hpcx/ompi/include/openmpi/opal/mca/hwloc/hwloc201/hwloc/include /opt/hpcx/ompi/lib/x86_64-linux-gnu/openmpi/include/openmpi/opal/mca/hwloc/hwloc201/hwloc/include && \ + sudo mkdir -p /opt/hpcx/ompi/lib/x86_64-linux-gnu/openmpi/include/openmpi/opal/mca/event/libevent2022/libevent && \ + sudo ln -s /opt/hpcx/ompi/include/openmpi/opal/mca/event/libevent2022/libevent/include /opt/hpcx/ompi/lib/x86_64-linux-gnu/openmpi/include/openmpi/opal/mca/event/libevent2022/libevent/include && \ + git clone --recursive https://github.com/uber/horovod.git && cd horovod && python3 setup.py clean && python3 setup.py bdist_wheel && pip3 install ./dist/horovod-0.26.1-cp38-cp38-linux_x86_64.whl + +RUN pip3 install theseus-ai + +RUN sudo apt update && \ + sudo apt install -y python-is-python3 && \ + sudo apt-get autoclean + +ARG SSH_PRIVATE_KEY +ARG SSH_PUBLIC_KEY + +# +# WHATCH OUT! DO READ THIS! SERIOUS SECURITY BREACH CAN HAPPEN OTHERWISE ! +# +# To ensure your private SSH keys are not stored in a docker image or snapshot +# you should run the whole sequence of commands in a row. +# Otherwise, the private keys will be stored in a snapshot, and finally +# removed in the next one, but you will leave a trace of a binary which +# does contain your **GIT PRIVATE KEYS** that can be used by anybody else and compromise you. +# Be careful ! +# +RUN mkdir -p /home/ros/.ssh && \ + chmod 0700 /home/ros/.ssh && \ + ssh-keyscan github.com > /home/ros/.ssh/known_hosts && \ + echo "${SSH_PRIVATE_KEY}" > /home/ros/.ssh/id_rsa && \ + chmod 600 /home/ros/.ssh/id_rsa && \ + echo "${SSH_PUBLIC_KEY}" > /home/ros/.ssh/id_rsa.pub && \ + chmod 600 /home/ros/.ssh/id_rsa.pub && \ + cd $HOME && git clone --recursive git@github.com:facebookresearch/NGDF.git && \ + cd $HOME/NGDF && conda env create -f ngdf_env.yml && conda activate ngdf && pip install -e . && \ + cd $HOME && curl -LO https://github.com/NVIDIA/cub/archive/1.13.1.tar.gz && tar xzf 1.13.1.tar.gz && export CUB_HOME=$PWD/cub-1.13.1 && \ + cd $HOME && git clone -b v0.7.1 https://github.com/facebookresearch/pytorch3d.git && cd pytorch3d && PYTORCH3D_NO_NINJA=1 pip install -e . && \ + cd $HOME/NGDF/ndf_robot && pip install -e . && \ + cd $HOME/NGDF/acronym && pip install -e . && \ + cd $HOME/NGDF/ndf_robot && source ndf_env.sh && ./scripts/download_demo_weights.sh && \ + export CUDA_HOME=$HOME/miniconda3/envs/ngdf/pkgs/cuda-toolkit && \ + cd $HOME/NGDF/OMG-Planner/ycb_render && pip install -e . && \ + cd $HOME && git clone https://github.com/eigenteam/eigen-git-mirror && \ + cd $HOME/eigen-git-mirror && mkdir -p build && cd build && cmake .. && sudo make install && \ + cd $HOME/NGDF/OMG-Planner/Sophus && mkdir -p build && cd build && cmake .. && make -j8 && sudo make install && \ + cd $HOME/NGDF/OMG-Planner/layers && pip install -e . && \ + cd $HOME/NGDF/OMG-Planner/orocos_kinematics_dynamics/sip-4.19.3 && python3 configure.py && make && sudo make install && \ + export ROS_PYTHON_VERSION=3 && cd $HOME/NGDF/OMG-Planner/orocos_kinematics_dynamics/orocos_kdl && mkdir -p build && cd build && cmake .. && make -j8 && sudo make install && \ + cd $HOME/NGDF/OMG-Planner/orocos_kinematics_dynamics/python_orocos_kdl && mkdir -p build && cd build && cmake .. && make -j8 && cp PyKDL.so $HOME/miniconda3/envs/ngdf/lib/python3.7/site-packages && \ + cd $HOME/NGDF/differentiable-robot-model && \ + git remote add parent https://github.com/facebookresearch/differentiable-robot-model.git && \ + git fetch parent && pip install -e . && \ + cd $HOME/NGDF/OMG-Planner && pip install -r requirements.txt && pip install -e . && \ + cd $HOME/NGDF/differentiable-robot-model && pip install -e . && \ + cd $HOME/NGDF/contact_graspnet && source compile_pointnet_tfops.sh && cd ../../.. && pip install -e . && \ + cd $HOME/NGDF/theseus && pip install -e . && \ + cd $HOME && git clone --recursive -j8 git://github.com/hjwdzh/Manifold && cd Manifold && mkdir -p build && cd build && cmake .. -DCMAKE_BUILD_TYPE=Release && make && \ + rm -rf /home/ros/.ssh + +ENTRYPOINT ["/usr/bin/lxpanel", "--profile", "LXDE"] diff --git a/docker/dockerfiles/desktop/arduino-cli.yaml b/docker/dockerfiles/desktop/arduino-cli.yaml new file mode 100644 index 0000000..e1c125c --- /dev/null +++ b/docker/dockerfiles/desktop/arduino-cli.yaml @@ -0,0 +1,3 @@ +board_manager: + additional_urls: + - https://dl.espressif.com/dl/package_esp32_index.json \ No newline at end of file diff --git a/docker/dockerfiles/desktop/lxterminal.conf b/docker/dockerfiles/desktop/lxterminal.conf new file mode 100644 index 0000000..a6047b0 --- /dev/null +++ b/docker/dockerfiles/desktop/lxterminal.conf @@ -0,0 +1,53 @@ +[general] +fontname=Bitstream Vera Sans Mono 13 +selchars=-A-Za-z0-9,./?%&#:_ +scrollback=1000 +bgcolor=rgb(32,0,35) +fgcolor=rgb(238,238,236) +palette_color_0=rgb(0,0,0) +palette_color_1=rgb(170,0,0) +palette_color_2=rgb(115,210,22) +palette_color_3=rgb(170,85,0) +palette_color_4=rgb(0,0,170) +palette_color_5=rgb(92,53,102) +palette_color_6=rgb(0,170,170) +palette_color_7=rgb(170,170,170) +palette_color_8=rgb(85,85,85) +palette_color_9=rgb(255,85,85) +palette_color_10=rgb(85,255,85) +palette_color_11=rgb(255,255,85) +palette_color_12=rgb(85,85,255) +palette_color_13=rgb(255,85,255) +palette_color_14=rgb(85,255,255) +palette_color_15=rgb(255,255,255) +color_preset=Custom +disallowbold=false +cursorblinks=false +cursorunderline=false +audiblebell=false +tabpos=top +geometry_columns=80 +geometry_rows=24 +hidescrollbar=false +hidemenubar=false +hideclosebutton=false +hidepointer=false +disablef10=false +disablealt=false +disableconfirm=false + +[shortcut] +new_window_accel=n +new_tab_accel=t +close_tab_accel=w +close_window_accel=q +copy_accel=c +paste_accel=v +name_tab_accel=i +previous_tab_accel=Page_Up +next_tab_accel=Page_Down +move_tab_left_accel=Page_Up +move_tab_right_accel=Page_Down +zoom_in_accel=plus +zoom_out_accel=underscore +zoom_reset_accel=parenright From 38a9e17f1bb89956c7c8e73ad76a85c24a9ab305 Mon Sep 17 00:00:00 2001 From: Pau Carre Cardona Date: Thu, 15 Dec 2022 23:28:19 +0100 Subject: [PATCH 2/2] Add conda --- docker/dockerfiles/desktop/Dockerfile | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/docker/dockerfiles/desktop/Dockerfile b/docker/dockerfiles/desktop/Dockerfile index d1f8a29..6166980 100644 --- a/docker/dockerfiles/desktop/Dockerfile +++ b/docker/dockerfiles/desktop/Dockerfile @@ -161,6 +161,12 @@ RUN sudo apt update && \ ARG SSH_PRIVATE_KEY ARG SSH_PUBLIC_KEY +RUN wget https://repo.anaconda.com/miniconda/Miniconda3-latest-Linux-x86_64.sh -O $HOME/miniconda.sh && \ + bash $HOME/miniconda.sh -b -p $HOME/miniconda && \ + rm -rf miniconda.sh + +ENV PATH $HOME/miniconda/bin:$PATH + # # WHATCH OUT! DO READ THIS! SERIOUS SECURITY BREACH CAN HAPPEN OTHERWISE ! # @@ -171,7 +177,8 @@ ARG SSH_PUBLIC_KEY # does contain your **GIT PRIVATE KEYS** that can be used by anybody else and compromise you. # Be careful ! # -RUN mkdir -p /home/ros/.ssh && \ +RUN conda init && \ + mkdir -p /home/ros/.ssh && \ chmod 0700 /home/ros/.ssh && \ ssh-keyscan github.com > /home/ros/.ssh/known_hosts && \ echo "${SSH_PRIVATE_KEY}" > /home/ros/.ssh/id_rsa && \