From 8250d60ea8ca9225ad8950552cd99e705b1096c5 Mon Sep 17 00:00:00 2001 From: Michael Wrock Date: Thu, 24 Oct 2024 14:52:04 -0700 Subject: [PATCH 01/16] Initial commit --- README.md | 1 + 1 file changed, 1 insertion(+) create mode 100644 README.md diff --git a/README.md b/README.md new file mode 100644 index 000000000..4d53294bd --- /dev/null +++ b/README.md @@ -0,0 +1 @@ +# moveit_pro_empty_ws \ No newline at end of file From 865257f68ed272cc28b83b5aeb73c992f6d9abee Mon Sep 17 00:00:00 2001 From: Michael Wrock Date: Thu, 24 Oct 2024 15:06:35 -0700 Subject: [PATCH 02/16] added required files --- .github/workflows/ci.yaml | 30 ++++++++ .github/workflows/format.yaml | 17 +++++ .pre-commit-config.yaml | 85 +++++++++++++++++++++++ .prettierrc.cjs | 5 ++ CONTRIBUTING.md | 7 ++ Dockerfile | 124 ++++++++++++++++++++++++++++++++++ LICENSE | 29 ++++++++ README.md | 8 ++- colcon-defaults.yaml | 19 ++++++ docker-compose.yaml | 106 +++++++++++++++++++++++++++++ 10 files changed, 429 insertions(+), 1 deletion(-) create mode 100644 .github/workflows/ci.yaml create mode 100644 .github/workflows/format.yaml create mode 100644 .pre-commit-config.yaml create mode 100644 .prettierrc.cjs create mode 100644 CONTRIBUTING.md create mode 100644 Dockerfile create mode 100644 LICENSE create mode 100644 colcon-defaults.yaml create mode 100644 docker-compose.yaml diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml new file mode 100644 index 000000000..69ccf1f55 --- /dev/null +++ b/.github/workflows/ci.yaml @@ -0,0 +1,30 @@ +name: CI +on: + push: + branches: [main] + pull_request: + workflow_dispatch: + inputs: + image_tag: + description: 'The tag of the image to use for the container' + required: false + default: '' + # Run every 6 hours Mon-Fri + schedule: + - cron: "0 */6 * * 1-5" + +jobs: + integration-test-in-studio-container: + uses: PickNikRobotics/moveit_pro_ci/.github/workflows/workspace_integration_test.yaml@virtual-buffer + with: + image_tag: ${{ github.event.inputs.image_tag || null }} + colcon_test_args: "--executor sequential" + secrets: inherit + + ensure-no-ssh-in-gitmodules: + name: Ensure no SSH URLs in .gitmodules + runs-on: ubuntu-22.04 + steps: + - uses: actions/checkout@v3 + - name: Check .gitmodules file for Git-over-SSH URLs + run: "! grep 'git@' .gitmodules" diff --git a/.github/workflows/format.yaml b/.github/workflows/format.yaml new file mode 100644 index 000000000..8107c1735 --- /dev/null +++ b/.github/workflows/format.yaml @@ -0,0 +1,17 @@ +name: Format + +on: + workflow_dispatch: + pull_request: + push: + branches: + - main + +jobs: + pre-commit: + name: pre-commit + runs-on: ubuntu-22.04 + steps: + - uses: actions/checkout@v3 + - uses: actions/setup-python@v3 + - uses: pre-commit/action@v3.0.0 diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml new file mode 100644 index 000000000..23e59a05a --- /dev/null +++ b/.pre-commit-config.yaml @@ -0,0 +1,85 @@ +# To use: +# +# pre-commit run -a +# +# Or: +# +# pre-commit install # (runs every time you commit in git) +# +# To update this file: +# +# pre-commit autoupdate +# +# See https://github.com/pre-commit/pre-commit +repos: + # Standard hooks + - repo: https://github.com/pre-commit/pre-commit-hooks + rev: v3.4.0 + hooks: + - id: check-ast + - id: check-case-conflict + - id: check-docstring-first + - id: check-merge-conflict + - id: check-symlinks + - id: check-yaml + args: ["--unsafe"] # Fixes errors parsing custom YAML constructors like ur_description's !degrees + - id: debug-statements + - id: end-of-file-fixer + exclude: (\.(svg|stl|dae))$ + - id: mixed-line-ending + - id: fix-byte-order-marker + + - repo: https://github.com/psf/black + rev: 22.3.0 + hooks: + - id: black + + - repo: https://github.com/codespell-project/codespell + rev: v2.0.0 + hooks: + - id: codespell + args: ["--write-changes", "-L", "atleast,inout,ether"] # Provide a comma-separated list of misspelled words that codespell should ignore (for example: '-L', 'word1,word2,word3'). + exclude: \.(svg|pyc|stl|dae|lock)$ + + - repo: https://github.com/pre-commit/mirrors-clang-format + rev: v14.0.6 + hooks: + - id: clang-format + files: \.(c|cc|cxx|cpp|frag|glsl|h|hpp|hxx|ih|ispc|ipp|java|m|proto|vert)$ + # -i arg is included by default by the hook + args: ["-fallback-style=none"] + + - repo: https://github.com/adrienverge/yamllint + rev: v1.27.1 + hooks: + - id: yamllint + args: + [ + "--no-warnings", + "--config-data", + "{extends: default, rules: {line-length: disable, braces: {max-spaces-inside: 1}}}", + ] + types: [text] + files: \.(yml|yaml)$ + + - repo: https://github.com/tcort/markdown-link-check + rev: v3.10.3 + hooks: + - id: markdown-link-check + + # NOTE: Broken on arm64. Will need to bump once https://github.com/hadolint/hadolint/issues/840 is fixed. + - repo: https://github.com/hadolint/hadolint + rev: v2.10.0 + hooks: + - id: hadolint-docker + + - repo: https://github.com/pre-commit/mirrors-prettier + rev: "v3.1.0" + hooks: + # Use Prettier to lint XML files because, well.. its rules are prettier than most linters, as the name implies. + # Also we use it in the UI, so it's familiar. + - id: prettier + additional_dependencies: + - "prettier@3.1.0" + - "@prettier/plugin-xml@3.3.1" + files: \.(xml)$ diff --git a/.prettierrc.cjs b/.prettierrc.cjs new file mode 100644 index 000000000..4e04acc26 --- /dev/null +++ b/.prettierrc.cjs @@ -0,0 +1,5 @@ +module.exports = { + plugins: [require.resolve("@prettier/plugin-xml")], + xmlWhitespaceSensitivity: "ignore", + xmlQuoteAttributes: "double" +} diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md new file mode 100644 index 000000000..be449dc44 --- /dev/null +++ b/CONTRIBUTING.md @@ -0,0 +1,7 @@ +Any contribution that you make to this repository will +be under the 3-Clause BSD License, as dictated by that +[license](https://opensource.org/licenses/BSD-3-Clause). + +# Contributing to this Repository + +Thanks for getting involved! If you want to add to this repository, please reach out to support@picknik.ai. diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 000000000..8006e4e09 --- /dev/null +++ b/Dockerfile @@ -0,0 +1,124 @@ +# Docker image for extending MoveIt Pro with a custom overlay. +# +# Example build command (with defaults): +# +# docker build -f ./Dockerfile . +# + +# Specify the MoveIt Pro release to build on top of. +ARG MOVEIT_STUDIO_BASE_IMAGE +ARG USERNAME=studio-user +ARG USER_UID=1000 +ARG USER_GID=1000 + +################################################## +# Starting from the specified MoveIt Pro release # +################################################## +# The image tag is specified in the argument itself. +# hadolint ignore=DL3006 +FROM ${MOVEIT_STUDIO_BASE_IMAGE} AS base + +# Create a non-root user +ARG USERNAME +ARG USER_UID +ARG USER_GID + +# Copy source code from the workspace's ROS 2 packages to a workspace inside the container +ARG USER_WS=/home/${USERNAME}/user_ws +ENV USER_WS=${USER_WS} +RUN mkdir -p ${USER_WS}/src ${USER_WS}/build ${USER_WS}/install ${USER_WS}/log +COPY ./src ${USER_WS}/src + +# Also mkdir with user permission directories which will be mounted later to avoid docker creating them as root +WORKDIR $USER_WS +# hadolint ignore=DL3008 +RUN --mount=type=cache,target=/var/cache/apt,sharing=locked \ + --mount=type=cache,target=/var/lib/apt,sharing=locked \ + groupadd --gid $USER_GID ${USERNAME} && \ + useradd --uid $USER_UID --gid $USER_GID --shell /bin/bash --create-home ${USERNAME} && \ + apt-get update && \ + apt-get install -q -y --no-install-recommends sudo && \ + echo ${USERNAME} ALL=\(root\) NOPASSWD:ALL > /etc/sudoers.d/${USERNAME} && \ + chmod 0440 /etc/sudoers.d/${USERNAME} && \ + cp -r /etc/skel/. /home/${USERNAME} && \ + mkdir -p \ + /home/${USERNAME}/.ccache \ + /home/${USERNAME}/.config \ + /home/${USERNAME}/.ignition \ + /home/${USERNAME}/.colcon \ + /home/${USERNAME}/.ros && \ + chown -R $USER_UID:$USER_GID /home/${USERNAME} /opt/overlay_ws/ + +# IMPORTANT: Optionally install Nvidia drivers for improved simulator performance with Nvidia GPUs. +# To do this you must +# 1. Uncomment the ENV and RUN entries below +# 2. Replace the 'nvidia-driver-555' apt package with the Nvidia driver version on your host, e.g. nvidia-driver-535, nvidia-driver-555. Use nvidia-smi on your host to determine the driver version. +# After rebuilding via `moveit_pro build` verify the drivers are active in your container by running `nvidia_smi` inside of `moveit_pro shell`. +# ENV DEBIAN_FRONTEND=noninteractive +# RUN apt update && apt install -y software-properties-common +# RUN --mount=type=cache,target=/var/cache/apt,sharing=locked \ +# --mount=type=cache,target=/var/lib/apt,sharing=locked \ +# add-apt-repository ppa:graphics-drivers/ppa && \ +# apt update && apt upgrade -y && apt install -y nvidia-driver-555 + +# Install additional dependencies +# You can also add any necessary apt-get install, pip install, etc. commands at this point. +# NOTE: The /opt/overlay_ws folder contains MoveIt Pro binary packages and the source file. +# hadolint ignore=SC1091 +RUN --mount=type=cache,target=/var/cache/apt,sharing=locked \ + --mount=type=cache,target=/var/lib/apt,sharing=locked \ + . /opt/overlay_ws/install/setup.sh && \ + apt-get update && \ + rosdep install -q -y \ + --from-paths src \ + --ignore-src + +# Set up colcon defaults for the new user +USER ${USERNAME} +RUN colcon mixin add default \ + https://raw.githubusercontent.com/colcon/colcon-mixin-repository/master/index.yaml && \ + colcon mixin update && \ + colcon metadata add default \ + https://raw.githubusercontent.com/colcon/colcon-metadata-repository/master/index.yaml && \ + colcon metadata update +COPY colcon-defaults.yaml /home/${USERNAME}/.colcon/defaults.yaml + +# hadolint ignore=DL3002 +USER root + +################################################################### +# Target for the developer build which does not compile any code. # +################################################################### +FROM base AS user-overlay-dev + +ARG USERNAME +ARG USER_WS=/home/${USERNAME}/user_ws +ENV USER_WS=${USER_WS} + +# Install any additional packages for development work +# hadolint ignore=DL3008 +RUN --mount=type=cache,target=/var/cache/apt,sharing=locked \ + --mount=type=cache,target=/var/lib/apt,sharing=locked \ + apt-get update && \ + apt-get install -y --no-install-recommends \ + less \ + gdb \ + nano + +# Set up the user's .bashrc file and shell. +CMD ["/usr/bin/bash"] + +######################################### +# Target for compiled, deployable image # +######################################### +FROM base AS user-overlay + +ARG USERNAME +ARG USER_WS=/home/${USERNAME}/user_ws +ENV USER_WS=${USER_WS} + +# Compile the workspace +WORKDIR $USER_WS + +# Set up the user's .bashrc file and shell. +CMD ["/usr/bin/bash"] diff --git a/LICENSE b/LICENSE new file mode 100644 index 000000000..7c2e04ebe --- /dev/null +++ b/LICENSE @@ -0,0 +1,29 @@ +BSD 3-Clause License + +Copyright (c) 2023 PickNik Inc. +All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are met: + +* Redistributions of source code must retain the above copyright notice, this + list of conditions and the following disclaimer. + +* Redistributions in binary form must reproduce the above copyright notice, + this list of conditions and the following disclaimer in the documentation + and/or other materials provided with the distribution. + +* Neither the name of the copyright holder nor the names of its + contributors may be used to endorse or promote products derived from + this software without specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE +FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR +SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER +CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. diff --git a/README.md b/README.md index 4d53294bd..bfa767723 100644 --- a/README.md +++ b/README.md @@ -1 +1,7 @@ -# moveit_pro_empty_ws \ No newline at end of file +# MoveIt Pro Workspace + +This is a minimal user workspace that can be used to build customized MoveIt Pro workspaces. + +You may fork this repository and add the MoveIt Pro configurations and ROS 2 packages of your choosing to the `src` folder. + +For more information, refer to the [MoveIt Pro Documentation](https://docs.picknik.ai/). diff --git a/colcon-defaults.yaml b/colcon-defaults.yaml new file mode 100644 index 000000000..9aedbf87e --- /dev/null +++ b/colcon-defaults.yaml @@ -0,0 +1,19 @@ +# Contains colcon default settings for user overlay containers. +build: + # Enable this for bidirectional syncing from the UI + symlink-install: true + mixin: + # Enable ccache support + - ccache + # Multithreaded linker to speed up linking step during compilation + - lld + - compile-commands + # Debug info and build testing for dev workflows + - rel-with-deb-info + - build-testing-on + - coverage-gcc + - coverage-pytest +test: + event-handlers: + - console_direct+ + - desktop_notification+ diff --git a/docker-compose.yaml b/docker-compose.yaml new file mode 100644 index 000000000..2c94baf98 --- /dev/null +++ b/docker-compose.yaml @@ -0,0 +1,106 @@ +# Docker Compose file for user overlays of the MoveIt Pro images. + +services: + # Sets common properties for other services. Should not be instantiated directly. + base: + # Extend the installed MoveIt Pro docker compose file. + # Change this to match your environment, if MoveIt Pro was installed to a different location. + extends: + file: /opt/moveit_pro/docker-compose.yaml + service: base + image: moveit-pro-overlay + build: + context: . + target: user-overlay + args: + - USER_UID=${STUDIO_USER_UID:-1000} + - USER_GID=${STUDIO_USER_GID:-1000} + - USERNAME=${STUDIO_USERNAME:-studio-user} + - MOVEIT_STUDIO_BASE_IMAGE=picknikciuser/moveit-studio:${STUDIO_DOCKER_TAG:-main} + + # Starts the MoveIt Pro Agent and the Bridge between the Agent and the Web UI + agent_bridge: + extends: base + privileged: true + # This service relies on cgroup_rules defined in base which allow the user to use the host's network video4linux and usb_device devices. + depends_on: + rest_api: + condition: service_healthy + volumes: + # Allow the user to run graphical programs from within the docker container. + - /tmp/.X11-unix:/tmp/.X11-unix:ro + # Allow access to host hardware e.g. RealSense cameras + - /dev:/dev + deploy: + restart_policy: + condition: any + delay: 2s + command: agent_bridge.app + + # Starts the REST API for the Web UI. + rest_api: + extends: base + healthcheck: + test: "curl -f http://localhost:3200/objectives" + interval: 5s + timeout: 1m + command: rest_api.app + + # Starts the robot drivers. + drivers: + extends: base + privileged: true + # Ensures the drivers container has RT priority + ulimits: + rtprio: 99 + devices: + - "/dev/ttyUSB0:/dev/ttyUSB0" # Allow access to the gripper. + command: robot.app + + # Starts the web UI frontend. + web_ui: + image: picknikciuser/moveit-studio-frontend:${STUDIO_DOCKER_TAG:-main} + ports: + - "80:80" + network_mode: host + + # Starts RViz for visualization. + rviz: + extends: base + profiles: + - rviz + command: bash -c "ros2 launch moveit_studio_agent developer_rviz.launch.py" + + # Starts MoveIt Setup Assistant for creating MoveIt configurations. + setup_assistant: + extends: base + profiles: + - setup_assistant + command: bash -c "ros2 launch moveit_setup_assistant setup_assistant.launch.py" + + # Developer specific configuration + dev: + extends: base + build: + target: user-overlay-dev + image: moveit-studio-overlay-dev + stdin_open: true + tty: true + privileged: true + volumes: + # Mount the source code, colcon generated artifacts, and ccache + - ./src/:/home/${STUDIO_USERNAME:-studio-user}/user_ws/src:rw + - ./build/:/home/${STUDIO_USERNAME:-studio-user}/user_ws/build:rw + - ./install/:/home/${STUDIO_USERNAME:-studio-user}/user_ws/install:rw + - ./log/:/home/${STUDIO_USERNAME:-studio-user}/user_ws/log:rw + - ./.ccache/:/home/${STUDIO_USERNAME:-studio-user}/.ccache:rw + - ${HOME}/.ros/log_moveit_pro:/home/${STUDIO_USERNAME:-studio-user}/.ros/log + # Allow access to host hardware e.g. RealSense cameras + - /dev:/dev + command: sleep infinity + # Making a separate profile prevents this service from being built when using `docker compose build` + # and launched when using `docker compose up`. + profiles: ["dev"] + +volumes: + ignition_resources: From 7ed6cc3682c9025b25144b46203e21fdff79b389 Mon Sep 17 00:00:00 2001 From: David Sobek Date: Wed, 4 Dec 2024 09:15:45 -0700 Subject: [PATCH 03/16] Template docker-compose.yaml for merging --- docker-compose.yaml | 99 ++++----------------------------------------- 1 file changed, 8 insertions(+), 91 deletions(-) diff --git a/docker-compose.yaml b/docker-compose.yaml index 2c94baf98..48a13f7d9 100644 --- a/docker-compose.yaml +++ b/docker-compose.yaml @@ -1,106 +1,23 @@ -# Docker Compose file for user overlays of the MoveIt Pro images. +# Docker Compose file that will be merged with /opt/moveit_pro/docker-compose.yaml. +# For more details on how merging works, see https://docs.docker.com/compose/how-tos/multiple-compose-files/merge/#merging-rules. +# Services that are listed under `/opt/moveit_pro/docker-compose.yaml` are mirrored here for merging. +# Feel free to remove services here that are unmodified. services: - # Sets common properties for other services. Should not be instantiated directly. + # The base image that all MoveIt Pro services extend off of. Builds the user workspace. base: - # Extend the installed MoveIt Pro docker compose file. - # Change this to match your environment, if MoveIt Pro was installed to a different location. - extends: - file: /opt/moveit_pro/docker-compose.yaml - service: base - image: moveit-pro-overlay build: - context: . - target: user-overlay + # List any arguments for building the user workspace here. args: - - USER_UID=${STUDIO_USER_UID:-1000} - - USER_GID=${STUDIO_USER_GID:-1000} - - USERNAME=${STUDIO_USERNAME:-studio-user} - - MOVEIT_STUDIO_BASE_IMAGE=picknikciuser/moveit-studio:${STUDIO_DOCKER_TAG:-main} - # Starts the MoveIt Pro Agent and the Bridge between the Agent and the Web UI + # Starts the MoveIt Pro Agent and the Bridge between the Agent and the Web UI. agent_bridge: - extends: base - privileged: true - # This service relies on cgroup_rules defined in base which allow the user to use the host's network video4linux and usb_device devices. - depends_on: - rest_api: - condition: service_healthy - volumes: - # Allow the user to run graphical programs from within the docker container. - - /tmp/.X11-unix:/tmp/.X11-unix:ro - # Allow access to host hardware e.g. RealSense cameras - - /dev:/dev - deploy: - restart_policy: - condition: any - delay: 2s - command: agent_bridge.app - - # Starts the REST API for the Web UI. - rest_api: - extends: base - healthcheck: - test: "curl -f http://localhost:3200/objectives" - interval: 5s - timeout: 1m - command: rest_api.app # Starts the robot drivers. drivers: - extends: base - privileged: true - # Ensures the drivers container has RT priority - ulimits: - rtprio: 99 - devices: - - "/dev/ttyUSB0:/dev/ttyUSB0" # Allow access to the gripper. - command: robot.app # Starts the web UI frontend. web_ui: - image: picknikciuser/moveit-studio-frontend:${STUDIO_DOCKER_TAG:-main} - ports: - - "80:80" - network_mode: host - - # Starts RViz for visualization. - rviz: - extends: base - profiles: - - rviz - command: bash -c "ros2 launch moveit_studio_agent developer_rviz.launch.py" - - # Starts MoveIt Setup Assistant for creating MoveIt configurations. - setup_assistant: - extends: base - profiles: - - setup_assistant - command: bash -c "ros2 launch moveit_setup_assistant setup_assistant.launch.py" - # Developer specific configuration + # Developer specific configuration when running `moveit_pro dev`. dev: - extends: base - build: - target: user-overlay-dev - image: moveit-studio-overlay-dev - stdin_open: true - tty: true - privileged: true - volumes: - # Mount the source code, colcon generated artifacts, and ccache - - ./src/:/home/${STUDIO_USERNAME:-studio-user}/user_ws/src:rw - - ./build/:/home/${STUDIO_USERNAME:-studio-user}/user_ws/build:rw - - ./install/:/home/${STUDIO_USERNAME:-studio-user}/user_ws/install:rw - - ./log/:/home/${STUDIO_USERNAME:-studio-user}/user_ws/log:rw - - ./.ccache/:/home/${STUDIO_USERNAME:-studio-user}/.ccache:rw - - ${HOME}/.ros/log_moveit_pro:/home/${STUDIO_USERNAME:-studio-user}/.ros/log - # Allow access to host hardware e.g. RealSense cameras - - /dev:/dev - command: sleep infinity - # Making a separate profile prevents this service from being built when using `docker compose build` - # and launched when using `docker compose up`. - profiles: ["dev"] - -volumes: - ignition_resources: From 4e4fb8796e78e6f479ec749da047febf2f379c31 Mon Sep 17 00:00:00 2001 From: David Sobek Date: Wed, 4 Dec 2024 09:55:17 -0700 Subject: [PATCH 04/16] remove docker compose yaml --- docker-compose.yaml | 106 -------------------------------------------- 1 file changed, 106 deletions(-) delete mode 100644 docker-compose.yaml diff --git a/docker-compose.yaml b/docker-compose.yaml deleted file mode 100644 index 2c94baf98..000000000 --- a/docker-compose.yaml +++ /dev/null @@ -1,106 +0,0 @@ -# Docker Compose file for user overlays of the MoveIt Pro images. - -services: - # Sets common properties for other services. Should not be instantiated directly. - base: - # Extend the installed MoveIt Pro docker compose file. - # Change this to match your environment, if MoveIt Pro was installed to a different location. - extends: - file: /opt/moveit_pro/docker-compose.yaml - service: base - image: moveit-pro-overlay - build: - context: . - target: user-overlay - args: - - USER_UID=${STUDIO_USER_UID:-1000} - - USER_GID=${STUDIO_USER_GID:-1000} - - USERNAME=${STUDIO_USERNAME:-studio-user} - - MOVEIT_STUDIO_BASE_IMAGE=picknikciuser/moveit-studio:${STUDIO_DOCKER_TAG:-main} - - # Starts the MoveIt Pro Agent and the Bridge between the Agent and the Web UI - agent_bridge: - extends: base - privileged: true - # This service relies on cgroup_rules defined in base which allow the user to use the host's network video4linux and usb_device devices. - depends_on: - rest_api: - condition: service_healthy - volumes: - # Allow the user to run graphical programs from within the docker container. - - /tmp/.X11-unix:/tmp/.X11-unix:ro - # Allow access to host hardware e.g. RealSense cameras - - /dev:/dev - deploy: - restart_policy: - condition: any - delay: 2s - command: agent_bridge.app - - # Starts the REST API for the Web UI. - rest_api: - extends: base - healthcheck: - test: "curl -f http://localhost:3200/objectives" - interval: 5s - timeout: 1m - command: rest_api.app - - # Starts the robot drivers. - drivers: - extends: base - privileged: true - # Ensures the drivers container has RT priority - ulimits: - rtprio: 99 - devices: - - "/dev/ttyUSB0:/dev/ttyUSB0" # Allow access to the gripper. - command: robot.app - - # Starts the web UI frontend. - web_ui: - image: picknikciuser/moveit-studio-frontend:${STUDIO_DOCKER_TAG:-main} - ports: - - "80:80" - network_mode: host - - # Starts RViz for visualization. - rviz: - extends: base - profiles: - - rviz - command: bash -c "ros2 launch moveit_studio_agent developer_rviz.launch.py" - - # Starts MoveIt Setup Assistant for creating MoveIt configurations. - setup_assistant: - extends: base - profiles: - - setup_assistant - command: bash -c "ros2 launch moveit_setup_assistant setup_assistant.launch.py" - - # Developer specific configuration - dev: - extends: base - build: - target: user-overlay-dev - image: moveit-studio-overlay-dev - stdin_open: true - tty: true - privileged: true - volumes: - # Mount the source code, colcon generated artifacts, and ccache - - ./src/:/home/${STUDIO_USERNAME:-studio-user}/user_ws/src:rw - - ./build/:/home/${STUDIO_USERNAME:-studio-user}/user_ws/build:rw - - ./install/:/home/${STUDIO_USERNAME:-studio-user}/user_ws/install:rw - - ./log/:/home/${STUDIO_USERNAME:-studio-user}/user_ws/log:rw - - ./.ccache/:/home/${STUDIO_USERNAME:-studio-user}/.ccache:rw - - ${HOME}/.ros/log_moveit_pro:/home/${STUDIO_USERNAME:-studio-user}/.ros/log - # Allow access to host hardware e.g. RealSense cameras - - /dev:/dev - command: sleep infinity - # Making a separate profile prevents this service from being built when using `docker compose build` - # and launched when using `docker compose up`. - profiles: ["dev"] - -volumes: - ignition_resources: From 4ec060ad73159e9327af660eb40512f17fb64c07 Mon Sep 17 00:00:00 2001 From: Michael Wrock Date: Wed, 1 Jan 2025 10:39:20 -0800 Subject: [PATCH 05/16] Update docker-compose.yaml --- docker-compose.yaml | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/docker-compose.yaml b/docker-compose.yaml index 48a13f7d9..7fe7e4edf 100644 --- a/docker-compose.yaml +++ b/docker-compose.yaml @@ -9,6 +9,13 @@ services: build: # List any arguments for building the user workspace here. args: + # IMPORTANT: Optionally install Nvidia drivers for improved simulator performance with Nvidia GPUs. + # To do this you must + # 1. Uncomment the BASE and NVIDIA_DRIVER_PACKAGE build args below + # 2. Replace the 'nvidia-driver-555' apt package with the Nvidia driver version on your host, e.g. nvidia-driver-535, nvidia-driver-555. Use nvidia-smi on your host to determine the driver version. + # After rebuilding via `moveit_pro build` verify the drivers are active in your container by running `nvidia_smi` inside of `moveit_pro shell`. + # - BASE=nvidia + # - NVIDIA_DRIVER_PACKAGE=nvidia-driver-555 # Starts the MoveIt Pro Agent and the Bridge between the Agent and the Web UI. agent_bridge: From 488f7e47f1b8c517239f861d176367d073908f49 Mon Sep 17 00:00:00 2001 From: Sebastian Jahr Date: Mon, 27 Jan 2025 12:05:16 +0100 Subject: [PATCH 06/16] Add clang-format file (#12) --- .clang-format | 79 +++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 79 insertions(+) create mode 100644 .clang-format diff --git a/.clang-format b/.clang-format new file mode 100644 index 000000000..23011a85f --- /dev/null +++ b/.clang-format @@ -0,0 +1,79 @@ +--- +BasedOnStyle: Google +ColumnLimit: 120 +MaxEmptyLinesToKeep: 1 + +# Allow us to adhere to https://google.github.io/styleguide/cppguide.html#Names_and_Order_of_Includes +IncludeBlocks: Preserve +SortIncludes: true + +Standard: Auto +IndentWidth: 2 +TabWidth: 2 +UseTab: Never +AccessModifierOffset: -2 +ConstructorInitializerIndentWidth: 2 +NamespaceIndentation: None +ContinuationIndentWidth: 4 +IndentCaseLabels: true +IndentFunctionDeclarationAfterType: false + +AlignEscapedNewlinesLeft: false +AlignTrailingComments: true + +AllowAllParametersOfDeclarationOnNextLine: false +ExperimentalAutoDetectBinPacking: false +ObjCSpaceBeforeProtocolList: true +Cpp11BracedListStyle: false + +AllowShortBlocksOnASingleLine: true +AllowShortIfStatementsOnASingleLine: false +AllowShortLoopsOnASingleLine: false +AllowShortFunctionsOnASingleLine: None +AllowShortCaseLabelsOnASingleLine: false + +AlwaysBreakTemplateDeclarations: true +AlwaysBreakBeforeMultilineStrings: false +BreakBeforeBinaryOperators: false +BreakBeforeTernaryOperators: false +BreakConstructorInitializersBeforeComma: true + +BinPackParameters: true +ConstructorInitializerAllOnOneLineOrOnePerLine: true +DerivePointerBinding: false +PointerBindsToType: true + +PenaltyExcessCharacter: 50 +PenaltyBreakBeforeFirstCallParameter: 30 +PenaltyBreakComment: 1000 +PenaltyBreakFirstLessLess: 10 +PenaltyBreakString: 100 +PenaltyReturnTypeOnItsOwnLine: 50 + +SpacesBeforeTrailingComments: 2 +SpacesInParentheses: false +SpacesInAngles: false +SpaceInEmptyParentheses: false +SpacesInCStyleCastParentheses: false +SpaceAfterCStyleCast: false +SpaceAfterControlStatementKeyword: true +SpaceBeforeAssignmentOperators: true + +# Configure each individual brace in BraceWrapping +BreakBeforeBraces: Custom + +# Control of individual brace wrapping cases +BraceWrapping: + AfterCaseLabel: true + AfterClass: true + AfterControlStatement: true + AfterEnum: true + AfterFunction: true + AfterNamespace: true + AfterStruct: true + AfterUnion: true + BeforeCatch: true + BeforeElse: true + IndentBraces: false +IncludeBlocks: Preserve +... From ef69e397768b758cb33f5718b2c6e4ee8855b7ee Mon Sep 17 00:00:00 2001 From: Paul Gesel Date: Fri, 14 Feb 2025 10:22:13 -0700 Subject: [PATCH 07/16] Fix .gitattributes file Signed-off-by: Paul Gesel --- .gitattributes | 12 ++++++++++++ 1 file changed, 12 insertions(+) create mode 100644 .gitattributes diff --git a/.gitattributes b/.gitattributes new file mode 100644 index 000000000..a17717cc6 --- /dev/null +++ b/.gitattributes @@ -0,0 +1,12 @@ +# Add Git LFS support for common 3D file formats +*.onnx filter=lfs diff=lfs merge=lfs -text +*.stl filter=lfs diff=lfs merge=lfs -text +*.STL filter=lfs diff=lfs merge=lfs -text +*.obj filter=lfs diff=lfs merge=lfs -text +*.fbx filter=lfs diff=lfs merge=lfs -text +*.dae filter=lfs diff=lfs merge=lfs -text +*.gltf filter=lfs diff=lfs merge=lfs -text +*.glb filter=lfs diff=lfs merge=lfs -text +*.ply filter=lfs diff=lfs merge=lfs -text +*.3ds filter=lfs diff=lfs merge=lfs -text +*.blend filter=lfs diff=lfs merge=lfs -text From eee84be8be74fc366dc9b0913013a4e5ac03a8b0 Mon Sep 17 00:00:00 2001 From: Sebastian Jahr Date: Wed, 5 Mar 2025 10:03:38 +0100 Subject: [PATCH 08/16] Add src directory --- src/.gitkeep | 0 1 file changed, 0 insertions(+), 0 deletions(-) create mode 100644 src/.gitkeep diff --git a/src/.gitkeep b/src/.gitkeep new file mode 100644 index 000000000..e69de29bb From 63041c38fd10e87ce02ca409af268e77114aae3e Mon Sep 17 00:00:00 2001 From: Sebastian Jahr Date: Fri, 7 Mar 2025 16:45:31 +0100 Subject: [PATCH 09/16] Create .gitignore --- .gitignore | 4 ++++ 1 file changed, 4 insertions(+) create mode 100644 .gitignore diff --git a/.gitignore b/.gitignore new file mode 100644 index 000000000..d034d0064 --- /dev/null +++ b/.gitignore @@ -0,0 +1,4 @@ +build/ +install/ +log/ +.ccache/ From 22c3b6b09f3f013f17c10d5afbe05199f679f0db Mon Sep 17 00:00:00 2001 From: David Sobek <43018208+dsobek@users.noreply.github.com> Date: Thu, 13 Mar 2025 12:01:09 -0600 Subject: [PATCH 10/16] Adjust yaml lint to allow for different sequence indent options --- .pre-commit-config.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 23e59a05a..e170af965 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -57,7 +57,7 @@ repos: [ "--no-warnings", "--config-data", - "{extends: default, rules: {line-length: disable, braces: {max-spaces-inside: 1}}}", + "{extends: default, rules: {line-length: disable, braces: {max-spaces-inside: 1}, indentation: {spaces: consistent, indent-sequences: whatever}}}", ] types: [text] files: \.(yml|yaml)$ From fc683b0352318e3b82a60a1fb0f210c322b94b21 Mon Sep 17 00:00:00 2001 From: David Yackzan Date: Thu, 8 May 2025 10:51:28 -0600 Subject: [PATCH 11/16] Make all docker-compose services mappings It seems like in some version of docker-compose, the services must be followed by an empty curly bracket `{}` to be valid syntax or docker-compose will fail with an error message like `services must be a mapping`. --- docker-compose.yaml | 20 +++++--------------- 1 file changed, 5 insertions(+), 15 deletions(-) diff --git a/docker-compose.yaml b/docker-compose.yaml index 7fe7e4edf..9988e5118 100644 --- a/docker-compose.yaml +++ b/docker-compose.yaml @@ -5,26 +5,16 @@ # Feel free to remove services here that are unmodified. services: # The base image that all MoveIt Pro services extend off of. Builds the user workspace. - base: - build: - # List any arguments for building the user workspace here. - args: - # IMPORTANT: Optionally install Nvidia drivers for improved simulator performance with Nvidia GPUs. - # To do this you must - # 1. Uncomment the BASE and NVIDIA_DRIVER_PACKAGE build args below - # 2. Replace the 'nvidia-driver-555' apt package with the Nvidia driver version on your host, e.g. nvidia-driver-535, nvidia-driver-555. Use nvidia-smi on your host to determine the driver version. - # After rebuilding via `moveit_pro build` verify the drivers are active in your container by running `nvidia_smi` inside of `moveit_pro shell`. - # - BASE=nvidia - # - NVIDIA_DRIVER_PACKAGE=nvidia-driver-555 + base: {} # Starts the MoveIt Pro Agent and the Bridge between the Agent and the Web UI. - agent_bridge: + agent_bridge: {} # Starts the robot drivers. - drivers: + drivers: {} # Starts the web UI frontend. - web_ui: + web_ui: {} # Developer specific configuration when running `moveit_pro dev`. - dev: + dev: {} From bc5980be71410c0a76b5454fa02f29bfa699b9d4 Mon Sep 17 00:00:00 2001 From: Ezra Brooks Date: Wed, 30 Jul 2025 14:16:52 -0600 Subject: [PATCH 12/16] Fix caching of dependency steps in Docker build `log` wasn't ignored in the build context and was causing cache busts. --- .dockerignore | 4 ++++ 1 file changed, 4 insertions(+) create mode 100644 .dockerignore diff --git a/.dockerignore b/.dockerignore new file mode 100644 index 000000000..5d4eed38d --- /dev/null +++ b/.dockerignore @@ -0,0 +1,4 @@ +.git +build +install +log From bf166bf5f718bad35bea41078e5ddad476970ef0 Mon Sep 17 00:00:00 2001 From: shaur-k Date: Tue, 11 Mar 2025 00:06:44 -0600 Subject: [PATCH 13/16] fix(docker): build kit volume mounting --- Dockerfile | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/Dockerfile b/Dockerfile index 8006e4e09..ab66b73fb 100644 --- a/Dockerfile +++ b/Dockerfile @@ -26,8 +26,6 @@ ARG USER_GID # Copy source code from the workspace's ROS 2 packages to a workspace inside the container ARG USER_WS=/home/${USERNAME}/user_ws ENV USER_WS=${USER_WS} -RUN mkdir -p ${USER_WS}/src ${USER_WS}/build ${USER_WS}/install ${USER_WS}/log -COPY ./src ${USER_WS}/src # Also mkdir with user permission directories which will be mounted later to avoid docker creating them as root WORKDIR $USER_WS @@ -67,6 +65,7 @@ RUN --mount=type=cache,target=/var/cache/apt,sharing=locked \ # hadolint ignore=SC1091 RUN --mount=type=cache,target=/var/cache/apt,sharing=locked \ --mount=type=cache,target=/var/lib/apt,sharing=locked \ + --mount=type=bind,target=${USER_WS}/,source=. \ . /opt/overlay_ws/install/setup.sh && \ apt-get update && \ rosdep install -q -y \ From f2f6fe9495e3b9db8e7f3b7cbf89523001391e81 Mon Sep 17 00:00:00 2001 From: Shaur Kumar Date: Tue, 2 Sep 2025 10:44:30 -0600 Subject: [PATCH 14/16] fix: aligning the docker files from example ws --- .pre-commit-config.yaml | 11 +++- Dockerfile | 140 ++++++++++++++++++++++++++++++++++++---- 2 files changed, 137 insertions(+), 14 deletions(-) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index e170af965..579519466 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -11,6 +11,7 @@ # pre-commit autoupdate # # See https://github.com/pre-commit/pre-commit +exclude: ^src/external_dependencies/ repos: # Standard hooks - repo: https://github.com/pre-commit/pre-commit-hooks @@ -57,7 +58,7 @@ repos: [ "--no-warnings", "--config-data", - "{extends: default, rules: {line-length: disable, braces: {max-spaces-inside: 1}, indentation: {spaces: consistent, indent-sequences: whatever}}}", + "{extends: default, rules: {line-length: disable, braces: {max-spaces-inside: 1}, indentation: disable, empty-lines: {max-end: 0, max-start: 1}}}", ] types: [text] files: \.(yml|yaml)$ @@ -69,9 +70,13 @@ repos: # NOTE: Broken on arm64. Will need to bump once https://github.com/hadolint/hadolint/issues/840 is fixed. - repo: https://github.com/hadolint/hadolint - rev: v2.10.0 + rev: v2.11.0 hooks: - - id: hadolint-docker + - id: hadolint + name: "Lint Dockerfiles" + language: docker_image + types: ["dockerfile"] + entry: hadolint/hadolint:2.11.0 hadolint - repo: https://github.com/pre-commit/mirrors-prettier rev: "v3.1.0" diff --git a/Dockerfile b/Dockerfile index ab66b73fb..8a28fcbda 100644 --- a/Dockerfile +++ b/Dockerfile @@ -47,17 +47,9 @@ RUN --mount=type=cache,target=/var/cache/apt,sharing=locked \ /home/${USERNAME}/.ros && \ chown -R $USER_UID:$USER_GID /home/${USERNAME} /opt/overlay_ws/ -# IMPORTANT: Optionally install Nvidia drivers for improved simulator performance with Nvidia GPUs. -# To do this you must -# 1. Uncomment the ENV and RUN entries below -# 2. Replace the 'nvidia-driver-555' apt package with the Nvidia driver version on your host, e.g. nvidia-driver-535, nvidia-driver-555. Use nvidia-smi on your host to determine the driver version. -# After rebuilding via `moveit_pro build` verify the drivers are active in your container by running `nvidia_smi` inside of `moveit_pro shell`. -# ENV DEBIAN_FRONTEND=noninteractive -# RUN apt update && apt install -y software-properties-common -# RUN --mount=type=cache,target=/var/cache/apt,sharing=locked \ -# --mount=type=cache,target=/var/lib/apt,sharing=locked \ -# add-apt-repository ppa:graphics-drivers/ppa && \ -# apt update && apt upgrade -y && apt install -y nvidia-driver-555 +# Add user to dialout group to enable communication with serial USB devices (gripper, FTS, ...) +# Add user to video group to enable communication with cameras +RUN usermod -aG dialout,video ${USERNAME} # Install additional dependencies # You can also add any necessary apt-get install, pip install, etc. commands at this point. @@ -121,3 +113,129 @@ WORKDIR $USER_WS # Set up the user's .bashrc file and shell. CMD ["/usr/bin/bash"] + +################################################## +# Starting from the specified MoveIt Pro release with CUDA GPU # +################################################## +# The image tag is specified in the argument itself. +# hadolint ignore=DL3006 +FROM ${MOVEIT_STUDIO_BASE_IMAGE} AS base-gpu + +# Create a non-root user +ARG USERNAME +ARG USER_UID +ARG USER_GID + +# hadolint ignore=DL3008 +RUN --mount=type=cache,target=/var/cache/apt,sharing=locked \ + --mount=type=cache,target=/var/lib/apt,sharing=locked \ + apt-get update && apt-get install wget -y -q --no-install-recommends && \ + wget --progress=dot:giga https://developer.download.nvidia.com/compute/cuda/repos/ubuntu2204/x86_64/cuda-keyring_1.1-1_all.deb && \ + dpkg -i cuda-keyring_1.1-1_all.deb && \ + apt-get update && \ + apt-get install -q -y --no-install-recommends \ + libcudnn9-cuda-12 \ + libcudnn9-dev-cuda-12 \ + libcublas-12-6 \ + cuda-cudart-12-6 \ + libcurand-12-6 \ + libcufft-12-6 \ + libnvinfer10 \ + libnvinfer-plugin10 \ + libnvonnxparsers10 \ + libtree + +# Misleading name: onnxruntime_gpu is actually specifically the CUDA package. This is only shipped for x86-64 +RUN if [ "$(uname -m)" = "x86_64" ]; then pip3 install --no-cache-dir onnxruntime_gpu==1.19.0; fi + +# Copy source code from the workspace's ROS 2 packages to a workspace inside the container +ARG USER_WS=/home/${USERNAME}/user_ws +ENV USER_WS=${USER_WS} + +# Also mkdir with user permission directories which will be mounted later to avoid docker creating them as root +WORKDIR $USER_WS +# hadolint ignore=DL3008 +RUN --mount=type=cache,target=/var/cache/apt,sharing=locked \ + --mount=type=cache,target=/var/lib/apt,sharing=locked \ + groupadd --gid $USER_GID ${USERNAME} && \ + useradd --uid $USER_UID --gid $USER_GID --shell /bin/bash --create-home ${USERNAME} && \ + apt-get update && \ + apt-get install -q -y --no-install-recommends sudo && \ + echo ${USERNAME} ALL=\(root\) NOPASSWD:ALL > /etc/sudoers.d/${USERNAME} && \ + chmod 0440 /etc/sudoers.d/${USERNAME} && \ + cp -r /etc/skel/. /home/${USERNAME} && \ + mkdir -p \ + /home/${USERNAME}/.ccache \ + /home/${USERNAME}/.config \ + /home/${USERNAME}/.ignition \ + /home/${USERNAME}/.colcon \ + /home/${USERNAME}/.ros && \ + chown -R $USER_UID:$USER_GID /home/${USERNAME} /opt/overlay_ws/ + +# Install additional dependencies +# You can also add any necessary apt-get install, pip install, etc. commands at this point. +# NOTE: The /opt/overlay_ws folder contains MoveIt Pro binary packages and the source file. +# hadolint ignore=SC1091 +RUN --mount=type=cache,target=/var/cache/apt,sharing=locked \ + --mount=type=cache,target=/var/lib/apt,sharing=locked \ + --mount=type=bind,target=${USER_WS}/,source=. \ + . /opt/overlay_ws/install/setup.sh && \ + apt-get update && \ + rosdep install -q -y \ + --from-paths src \ + --ignore-src + +# Set up colcon defaults for the new user +USER ${USERNAME} +RUN colcon mixin add default \ + https://raw.githubusercontent.com/colcon/colcon-mixin-repository/master/index.yaml && \ + colcon mixin update && \ + colcon metadata add default \ + https://raw.githubusercontent.com/colcon/colcon-metadata-repository/master/index.yaml && \ + colcon metadata update +COPY colcon-defaults.yaml /home/${USERNAME}/.colcon/defaults.yaml + +# hadolint ignore=DL3002 +USER root + +# Set up the user's .bashrc file and shell. +CMD ["/usr/bin/bash"] + +################################################################### +# Target for the developer build which does not compile any code. # +################################################################### +FROM base-gpu AS user-overlay-gpu-dev + +ARG USERNAME +ARG USER_WS=/home/${USERNAME}/user_ws +ENV USER_WS=${USER_WS} + +# Install any additional packages for development work +# hadolint ignore=DL3008 +RUN --mount=type=cache,target=/var/cache/apt,sharing=locked \ + --mount=type=cache,target=/var/lib/apt,sharing=locked \ + apt-get update && \ + apt-get install -y --no-install-recommends \ + less \ + gdb \ + nano + +# Set up the user's .bashrc file and shell. +CMD ["/usr/bin/bash"] + +######################################### +# Target for compiled, deployable image with GPU support # +######################################### +FROM base-gpu AS user-overlay-gpu + +ARG USERNAME +ARG USER_WS=/home/${USERNAME}/user_ws +ENV USER_WS=${USER_WS} + +ENV LD_LIBRARY_PATH=/usr/local/lib/python3.10/dist-packages/onnxruntime/capi:/usr/lib/x86_64-linux-gnu:/usr/local/cuda-12.6/targets/x86_64-linux/lib:$LD_LIBRARY_PATH + +# Compile the workspace +WORKDIR $USER_WS + +# Set up the user's .bashrc file and shell. +CMD ["/usr/bin/bash"] From fd975dc9d9510257059ba1cf2ca1de8d9a27a8c1 Mon Sep 17 00:00:00 2001 From: Joshua Whitley Date: Thu, 12 Feb 2026 18:44:50 -0700 Subject: [PATCH 15/16] Update Dockerfile and docker-compose to match example_ws (#53) --- Dockerfile | 141 ++++---------------------------------------- docker-compose.yaml | 12 +++- 2 files changed, 20 insertions(+), 133 deletions(-) diff --git a/Dockerfile b/Dockerfile index 8a28fcbda..5355ec61a 100644 --- a/Dockerfile +++ b/Dockerfile @@ -6,8 +6,8 @@ # # Specify the MoveIt Pro release to build on top of. -ARG MOVEIT_STUDIO_BASE_IMAGE -ARG USERNAME=studio-user +ARG MOVEIT_PRO_BASE_IMAGE=picknikciuser/moveit-studio:${MOVEIT_DOCKER_TAG:-main}-${MOVEIT_ROS_DISTRO:-humble} +ARG USERNAME=moveit-pro-user ARG USER_UID=1000 ARG USER_GID=1000 @@ -16,7 +16,7 @@ ARG USER_GID=1000 ################################################## # The image tag is specified in the argument itself. # hadolint ignore=DL3006 -FROM ${MOVEIT_STUDIO_BASE_IMAGE} AS base +FROM ${MOVEIT_PRO_BASE_IMAGE} AS base # Create a non-root user ARG USERNAME @@ -51,13 +51,17 @@ RUN --mount=type=cache,target=/var/cache/apt,sharing=locked \ # Add user to video group to enable communication with cameras RUN usermod -aG dialout,video ${USERNAME} +# Add user to the realtime group to enable RT limits +RUN groupadd realtime && \ + usermod -a -G realtime ${USERNAME} + # Install additional dependencies # You can also add any necessary apt-get install, pip install, etc. commands at this point. # NOTE: The /opt/overlay_ws folder contains MoveIt Pro binary packages and the source file. # hadolint ignore=SC1091 RUN --mount=type=cache,target=/var/cache/apt,sharing=locked \ --mount=type=cache,target=/var/lib/apt,sharing=locked \ - --mount=type=bind,target=${USER_WS}/,source=. \ + --mount=type=bind,target=${USER_WS}/src,source=./src \ . /opt/overlay_ws/install/setup.sh && \ apt-get update && \ rosdep install -q -y \ @@ -94,7 +98,8 @@ RUN --mount=type=cache,target=/var/cache/apt,sharing=locked \ apt-get install -y --no-install-recommends \ less \ gdb \ - nano + nano \ + tmux # Set up the user's .bashrc file and shell. CMD ["/usr/bin/bash"] @@ -113,129 +118,3 @@ WORKDIR $USER_WS # Set up the user's .bashrc file and shell. CMD ["/usr/bin/bash"] - -################################################## -# Starting from the specified MoveIt Pro release with CUDA GPU # -################################################## -# The image tag is specified in the argument itself. -# hadolint ignore=DL3006 -FROM ${MOVEIT_STUDIO_BASE_IMAGE} AS base-gpu - -# Create a non-root user -ARG USERNAME -ARG USER_UID -ARG USER_GID - -# hadolint ignore=DL3008 -RUN --mount=type=cache,target=/var/cache/apt,sharing=locked \ - --mount=type=cache,target=/var/lib/apt,sharing=locked \ - apt-get update && apt-get install wget -y -q --no-install-recommends && \ - wget --progress=dot:giga https://developer.download.nvidia.com/compute/cuda/repos/ubuntu2204/x86_64/cuda-keyring_1.1-1_all.deb && \ - dpkg -i cuda-keyring_1.1-1_all.deb && \ - apt-get update && \ - apt-get install -q -y --no-install-recommends \ - libcudnn9-cuda-12 \ - libcudnn9-dev-cuda-12 \ - libcublas-12-6 \ - cuda-cudart-12-6 \ - libcurand-12-6 \ - libcufft-12-6 \ - libnvinfer10 \ - libnvinfer-plugin10 \ - libnvonnxparsers10 \ - libtree - -# Misleading name: onnxruntime_gpu is actually specifically the CUDA package. This is only shipped for x86-64 -RUN if [ "$(uname -m)" = "x86_64" ]; then pip3 install --no-cache-dir onnxruntime_gpu==1.19.0; fi - -# Copy source code from the workspace's ROS 2 packages to a workspace inside the container -ARG USER_WS=/home/${USERNAME}/user_ws -ENV USER_WS=${USER_WS} - -# Also mkdir with user permission directories which will be mounted later to avoid docker creating them as root -WORKDIR $USER_WS -# hadolint ignore=DL3008 -RUN --mount=type=cache,target=/var/cache/apt,sharing=locked \ - --mount=type=cache,target=/var/lib/apt,sharing=locked \ - groupadd --gid $USER_GID ${USERNAME} && \ - useradd --uid $USER_UID --gid $USER_GID --shell /bin/bash --create-home ${USERNAME} && \ - apt-get update && \ - apt-get install -q -y --no-install-recommends sudo && \ - echo ${USERNAME} ALL=\(root\) NOPASSWD:ALL > /etc/sudoers.d/${USERNAME} && \ - chmod 0440 /etc/sudoers.d/${USERNAME} && \ - cp -r /etc/skel/. /home/${USERNAME} && \ - mkdir -p \ - /home/${USERNAME}/.ccache \ - /home/${USERNAME}/.config \ - /home/${USERNAME}/.ignition \ - /home/${USERNAME}/.colcon \ - /home/${USERNAME}/.ros && \ - chown -R $USER_UID:$USER_GID /home/${USERNAME} /opt/overlay_ws/ - -# Install additional dependencies -# You can also add any necessary apt-get install, pip install, etc. commands at this point. -# NOTE: The /opt/overlay_ws folder contains MoveIt Pro binary packages and the source file. -# hadolint ignore=SC1091 -RUN --mount=type=cache,target=/var/cache/apt,sharing=locked \ - --mount=type=cache,target=/var/lib/apt,sharing=locked \ - --mount=type=bind,target=${USER_WS}/,source=. \ - . /opt/overlay_ws/install/setup.sh && \ - apt-get update && \ - rosdep install -q -y \ - --from-paths src \ - --ignore-src - -# Set up colcon defaults for the new user -USER ${USERNAME} -RUN colcon mixin add default \ - https://raw.githubusercontent.com/colcon/colcon-mixin-repository/master/index.yaml && \ - colcon mixin update && \ - colcon metadata add default \ - https://raw.githubusercontent.com/colcon/colcon-metadata-repository/master/index.yaml && \ - colcon metadata update -COPY colcon-defaults.yaml /home/${USERNAME}/.colcon/defaults.yaml - -# hadolint ignore=DL3002 -USER root - -# Set up the user's .bashrc file and shell. -CMD ["/usr/bin/bash"] - -################################################################### -# Target for the developer build which does not compile any code. # -################################################################### -FROM base-gpu AS user-overlay-gpu-dev - -ARG USERNAME -ARG USER_WS=/home/${USERNAME}/user_ws -ENV USER_WS=${USER_WS} - -# Install any additional packages for development work -# hadolint ignore=DL3008 -RUN --mount=type=cache,target=/var/cache/apt,sharing=locked \ - --mount=type=cache,target=/var/lib/apt,sharing=locked \ - apt-get update && \ - apt-get install -y --no-install-recommends \ - less \ - gdb \ - nano - -# Set up the user's .bashrc file and shell. -CMD ["/usr/bin/bash"] - -######################################### -# Target for compiled, deployable image with GPU support # -######################################### -FROM base-gpu AS user-overlay-gpu - -ARG USERNAME -ARG USER_WS=/home/${USERNAME}/user_ws -ENV USER_WS=${USER_WS} - -ENV LD_LIBRARY_PATH=/usr/local/lib/python3.10/dist-packages/onnxruntime/capi:/usr/lib/x86_64-linux-gnu:/usr/local/cuda-12.6/targets/x86_64-linux/lib:$LD_LIBRARY_PATH - -# Compile the workspace -WORKDIR $USER_WS - -# Set up the user's .bashrc file and shell. -CMD ["/usr/bin/bash"] diff --git a/docker-compose.yaml b/docker-compose.yaml index 9988e5118..ce6e08906 100644 --- a/docker-compose.yaml +++ b/docker-compose.yaml @@ -3,7 +3,9 @@ # Services that are listed under `/opt/moveit_pro/docker-compose.yaml` are mirrored here for merging. # Feel free to remove services here that are unmodified. +# services: + # The base image that all MoveIt Pro services extend off of. Builds the user workspace. base: {} @@ -11,10 +13,16 @@ services: agent_bridge: {} # Starts the robot drivers. - drivers: {} + drivers: + volumes: + # Allow access to host hardware e.g. RealSense cameras + - /dev:/dev # Starts the web UI frontend. web_ui: {} # Developer specific configuration when running `moveit_pro dev`. - dev: {} + dev: + volumes: + # Allow access to host hardware e.g. RealSense cameras + - /dev:/dev From 9fa9e0f07cf6c9796937093f70575393e5ad7d77 Mon Sep 17 00:00:00 2001 From: Joshua Whitley Date: Fri, 15 May 2026 12:25:52 -0600 Subject: [PATCH 16/16] Update main With Changes from example_ws (#54) --- .gitattributes | 4 ++++ .pre-commit-config.yaml | 16 ++++++++-------- 2 files changed, 12 insertions(+), 8 deletions(-) diff --git a/.gitattributes b/.gitattributes index a17717cc6..c66085013 100644 --- a/.gitattributes +++ b/.gitattributes @@ -10,3 +10,7 @@ *.ply filter=lfs diff=lfs merge=lfs -text *.3ds filter=lfs diff=lfs merge=lfs -text *.blend filter=lfs diff=lfs merge=lfs -text +*.gtlf filter=lfs diff=lfs merge=lfs -text +*.png filter=lfs diff=lfs merge=lfs -text +*.jpg filter=lfs diff=lfs merge=lfs -text +*.jpeg filter=lfs diff=lfs merge=lfs -text diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 579519466..954131d01 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -15,7 +15,7 @@ exclude: ^src/external_dependencies/ repos: # Standard hooks - repo: https://github.com/pre-commit/pre-commit-hooks - rev: v3.4.0 + rev: v6.0.0 hooks: - id: check-ast - id: check-case-conflict @@ -31,12 +31,12 @@ repos: - id: fix-byte-order-marker - repo: https://github.com/psf/black - rev: 22.3.0 + rev: 25.9.0 hooks: - id: black - repo: https://github.com/codespell-project/codespell - rev: v2.0.0 + rev: v2.4.1 hooks: - id: codespell args: ["--write-changes", "-L", "atleast,inout,ether"] # Provide a comma-separated list of misspelled words that codespell should ignore (for example: '-L', 'word1,word2,word3'). @@ -51,7 +51,7 @@ repos: args: ["-fallback-style=none"] - repo: https://github.com/adrienverge/yamllint - rev: v1.27.1 + rev: v1.37.1 hooks: - id: yamllint args: @@ -64,22 +64,22 @@ repos: files: \.(yml|yaml)$ - repo: https://github.com/tcort/markdown-link-check - rev: v3.10.3 + rev: v3.14.1 hooks: - id: markdown-link-check # NOTE: Broken on arm64. Will need to bump once https://github.com/hadolint/hadolint/issues/840 is fixed. - repo: https://github.com/hadolint/hadolint - rev: v2.11.0 + rev: v2.14.0 hooks: - id: hadolint name: "Lint Dockerfiles" language: docker_image types: ["dockerfile"] - entry: hadolint/hadolint:2.11.0 hadolint + entry: hadolint/hadolint:v2.14.0 hadolint - repo: https://github.com/pre-commit/mirrors-prettier - rev: "v3.1.0" + rev: "v4.0.0-alpha.8" hooks: # Use Prettier to lint XML files because, well.. its rules are prettier than most linters, as the name implies. # Also we use it in the UI, so it's familiar.