Skip to content

Commit 865257f

Browse files
committed
added required files
1 parent 8250d60 commit 865257f

File tree

10 files changed

+429
-1
lines changed

10 files changed

+429
-1
lines changed

.github/workflows/ci.yaml

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
name: CI
2+
on:
3+
push:
4+
branches: [main]
5+
pull_request:
6+
workflow_dispatch:
7+
inputs:
8+
image_tag:
9+
description: 'The tag of the image to use for the container'
10+
required: false
11+
default: ''
12+
# Run every 6 hours Mon-Fri
13+
schedule:
14+
- cron: "0 */6 * * 1-5"
15+
16+
jobs:
17+
integration-test-in-studio-container:
18+
uses: PickNikRobotics/moveit_pro_ci/.github/workflows/workspace_integration_test.yaml@virtual-buffer
19+
with:
20+
image_tag: ${{ github.event.inputs.image_tag || null }}
21+
colcon_test_args: "--executor sequential"
22+
secrets: inherit
23+
24+
ensure-no-ssh-in-gitmodules:
25+
name: Ensure no SSH URLs in .gitmodules
26+
runs-on: ubuntu-22.04
27+
steps:
28+
- uses: actions/checkout@v3
29+
- name: Check .gitmodules file for Git-over-SSH URLs
30+
run: "! grep 'git@' .gitmodules"

.github/workflows/format.yaml

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
name: Format
2+
3+
on:
4+
workflow_dispatch:
5+
pull_request:
6+
push:
7+
branches:
8+
- main
9+
10+
jobs:
11+
pre-commit:
12+
name: pre-commit
13+
runs-on: ubuntu-22.04
14+
steps:
15+
- uses: actions/checkout@v3
16+
- uses: actions/setup-python@v3
17+
- uses: pre-commit/action@v3.0.0

.pre-commit-config.yaml

Lines changed: 85 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,85 @@
1+
# To use:
2+
#
3+
# pre-commit run -a
4+
#
5+
# Or:
6+
#
7+
# pre-commit install # (runs every time you commit in git)
8+
#
9+
# To update this file:
10+
#
11+
# pre-commit autoupdate
12+
#
13+
# See https://github.com/pre-commit/pre-commit
14+
repos:
15+
# Standard hooks
16+
- repo: https://github.com/pre-commit/pre-commit-hooks
17+
rev: v3.4.0
18+
hooks:
19+
- id: check-ast
20+
- id: check-case-conflict
21+
- id: check-docstring-first
22+
- id: check-merge-conflict
23+
- id: check-symlinks
24+
- id: check-yaml
25+
args: ["--unsafe"] # Fixes errors parsing custom YAML constructors like ur_description's !degrees
26+
- id: debug-statements
27+
- id: end-of-file-fixer
28+
exclude: (\.(svg|stl|dae))$
29+
- id: mixed-line-ending
30+
- id: fix-byte-order-marker
31+
32+
- repo: https://github.com/psf/black
33+
rev: 22.3.0
34+
hooks:
35+
- id: black
36+
37+
- repo: https://github.com/codespell-project/codespell
38+
rev: v2.0.0
39+
hooks:
40+
- id: codespell
41+
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').
42+
exclude: \.(svg|pyc|stl|dae|lock)$
43+
44+
- repo: https://github.com/pre-commit/mirrors-clang-format
45+
rev: v14.0.6
46+
hooks:
47+
- id: clang-format
48+
files: \.(c|cc|cxx|cpp|frag|glsl|h|hpp|hxx|ih|ispc|ipp|java|m|proto|vert)$
49+
# -i arg is included by default by the hook
50+
args: ["-fallback-style=none"]
51+
52+
- repo: https://github.com/adrienverge/yamllint
53+
rev: v1.27.1
54+
hooks:
55+
- id: yamllint
56+
args:
57+
[
58+
"--no-warnings",
59+
"--config-data",
60+
"{extends: default, rules: {line-length: disable, braces: {max-spaces-inside: 1}}}",
61+
]
62+
types: [text]
63+
files: \.(yml|yaml)$
64+
65+
- repo: https://github.com/tcort/markdown-link-check
66+
rev: v3.10.3
67+
hooks:
68+
- id: markdown-link-check
69+
70+
# NOTE: Broken on arm64. Will need to bump once https://github.com/hadolint/hadolint/issues/840 is fixed.
71+
- repo: https://github.com/hadolint/hadolint
72+
rev: v2.10.0
73+
hooks:
74+
- id: hadolint-docker
75+
76+
- repo: https://github.com/pre-commit/mirrors-prettier
77+
rev: "v3.1.0"
78+
hooks:
79+
# Use Prettier to lint XML files because, well.. its rules are prettier than most linters, as the name implies.
80+
# Also we use it in the UI, so it's familiar.
81+
- id: prettier
82+
additional_dependencies:
83+
- "prettier@3.1.0"
84+
- "@prettier/plugin-xml@3.3.1"
85+
files: \.(xml)$

.prettierrc.cjs

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
module.exports = {
2+
plugins: [require.resolve("@prettier/plugin-xml")],
3+
xmlWhitespaceSensitivity: "ignore",
4+
xmlQuoteAttributes: "double"
5+
}

CONTRIBUTING.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
Any contribution that you make to this repository will
2+
be under the 3-Clause BSD License, as dictated by that
3+
[license](https://opensource.org/licenses/BSD-3-Clause).
4+
5+
# Contributing to this Repository
6+
7+
Thanks for getting involved! If you want to add to this repository, please reach out to support@picknik.ai.

Dockerfile

Lines changed: 124 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,124 @@
1+
# Docker image for extending MoveIt Pro with a custom overlay.
2+
#
3+
# Example build command (with defaults):
4+
#
5+
# docker build -f ./Dockerfile .
6+
#
7+
8+
# Specify the MoveIt Pro release to build on top of.
9+
ARG MOVEIT_STUDIO_BASE_IMAGE
10+
ARG USERNAME=studio-user
11+
ARG USER_UID=1000
12+
ARG USER_GID=1000
13+
14+
##################################################
15+
# Starting from the specified MoveIt Pro release #
16+
##################################################
17+
# The image tag is specified in the argument itself.
18+
# hadolint ignore=DL3006
19+
FROM ${MOVEIT_STUDIO_BASE_IMAGE} AS base
20+
21+
# Create a non-root user
22+
ARG USERNAME
23+
ARG USER_UID
24+
ARG USER_GID
25+
26+
# Copy source code from the workspace's ROS 2 packages to a workspace inside the container
27+
ARG USER_WS=/home/${USERNAME}/user_ws
28+
ENV USER_WS=${USER_WS}
29+
RUN mkdir -p ${USER_WS}/src ${USER_WS}/build ${USER_WS}/install ${USER_WS}/log
30+
COPY ./src ${USER_WS}/src
31+
32+
# Also mkdir with user permission directories which will be mounted later to avoid docker creating them as root
33+
WORKDIR $USER_WS
34+
# hadolint ignore=DL3008
35+
RUN --mount=type=cache,target=/var/cache/apt,sharing=locked \
36+
--mount=type=cache,target=/var/lib/apt,sharing=locked \
37+
groupadd --gid $USER_GID ${USERNAME} && \
38+
useradd --uid $USER_UID --gid $USER_GID --shell /bin/bash --create-home ${USERNAME} && \
39+
apt-get update && \
40+
apt-get install -q -y --no-install-recommends sudo && \
41+
echo ${USERNAME} ALL=\(root\) NOPASSWD:ALL > /etc/sudoers.d/${USERNAME} && \
42+
chmod 0440 /etc/sudoers.d/${USERNAME} && \
43+
cp -r /etc/skel/. /home/${USERNAME} && \
44+
mkdir -p \
45+
/home/${USERNAME}/.ccache \
46+
/home/${USERNAME}/.config \
47+
/home/${USERNAME}/.ignition \
48+
/home/${USERNAME}/.colcon \
49+
/home/${USERNAME}/.ros && \
50+
chown -R $USER_UID:$USER_GID /home/${USERNAME} /opt/overlay_ws/
51+
52+
# IMPORTANT: Optionally install Nvidia drivers for improved simulator performance with Nvidia GPUs.
53+
# To do this you must
54+
# 1. Uncomment the ENV and RUN entries below
55+
# 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.
56+
# After rebuilding via `moveit_pro build` verify the drivers are active in your container by running `nvidia_smi` inside of `moveit_pro shell`.
57+
# ENV DEBIAN_FRONTEND=noninteractive
58+
# RUN apt update && apt install -y software-properties-common
59+
# RUN --mount=type=cache,target=/var/cache/apt,sharing=locked \
60+
# --mount=type=cache,target=/var/lib/apt,sharing=locked \
61+
# add-apt-repository ppa:graphics-drivers/ppa && \
62+
# apt update && apt upgrade -y && apt install -y nvidia-driver-555
63+
64+
# Install additional dependencies
65+
# You can also add any necessary apt-get install, pip install, etc. commands at this point.
66+
# NOTE: The /opt/overlay_ws folder contains MoveIt Pro binary packages and the source file.
67+
# hadolint ignore=SC1091
68+
RUN --mount=type=cache,target=/var/cache/apt,sharing=locked \
69+
--mount=type=cache,target=/var/lib/apt,sharing=locked \
70+
. /opt/overlay_ws/install/setup.sh && \
71+
apt-get update && \
72+
rosdep install -q -y \
73+
--from-paths src \
74+
--ignore-src
75+
76+
# Set up colcon defaults for the new user
77+
USER ${USERNAME}
78+
RUN colcon mixin add default \
79+
https://raw.githubusercontent.com/colcon/colcon-mixin-repository/master/index.yaml && \
80+
colcon mixin update && \
81+
colcon metadata add default \
82+
https://raw.githubusercontent.com/colcon/colcon-metadata-repository/master/index.yaml && \
83+
colcon metadata update
84+
COPY colcon-defaults.yaml /home/${USERNAME}/.colcon/defaults.yaml
85+
86+
# hadolint ignore=DL3002
87+
USER root
88+
89+
###################################################################
90+
# Target for the developer build which does not compile any code. #
91+
###################################################################
92+
FROM base AS user-overlay-dev
93+
94+
ARG USERNAME
95+
ARG USER_WS=/home/${USERNAME}/user_ws
96+
ENV USER_WS=${USER_WS}
97+
98+
# Install any additional packages for development work
99+
# hadolint ignore=DL3008
100+
RUN --mount=type=cache,target=/var/cache/apt,sharing=locked \
101+
--mount=type=cache,target=/var/lib/apt,sharing=locked \
102+
apt-get update && \
103+
apt-get install -y --no-install-recommends \
104+
less \
105+
gdb \
106+
nano
107+
108+
# Set up the user's .bashrc file and shell.
109+
CMD ["/usr/bin/bash"]
110+
111+
#########################################
112+
# Target for compiled, deployable image #
113+
#########################################
114+
FROM base AS user-overlay
115+
116+
ARG USERNAME
117+
ARG USER_WS=/home/${USERNAME}/user_ws
118+
ENV USER_WS=${USER_WS}
119+
120+
# Compile the workspace
121+
WORKDIR $USER_WS
122+
123+
# Set up the user's .bashrc file and shell.
124+
CMD ["/usr/bin/bash"]

LICENSE

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
BSD 3-Clause License
2+
3+
Copyright (c) 2023 PickNik Inc.
4+
All rights reserved.
5+
6+
Redistribution and use in source and binary forms, with or without
7+
modification, are permitted provided that the following conditions are met:
8+
9+
* Redistributions of source code must retain the above copyright notice, this
10+
list of conditions and the following disclaimer.
11+
12+
* Redistributions in binary form must reproduce the above copyright notice,
13+
this list of conditions and the following disclaimer in the documentation
14+
and/or other materials provided with the distribution.
15+
16+
* Neither the name of the copyright holder nor the names of its
17+
contributors may be used to endorse or promote products derived from
18+
this software without specific prior written permission.
19+
20+
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
21+
AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
22+
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
23+
DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
24+
FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
25+
DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
26+
SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
27+
CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
28+
OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
29+
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

README.md

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1,7 @@
1-
# moveit_pro_empty_ws
1+
# MoveIt Pro Workspace
2+
3+
This is a minimal user workspace that can be used to build customized MoveIt Pro workspaces.
4+
5+
You may fork this repository and add the MoveIt Pro configurations and ROS 2 packages of your choosing to the `src` folder.
6+
7+
For more information, refer to the [MoveIt Pro Documentation](https://docs.picknik.ai/).

colcon-defaults.yaml

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
# Contains colcon default settings for user overlay containers.
2+
build:
3+
# Enable this for bidirectional syncing from the UI
4+
symlink-install: true
5+
mixin:
6+
# Enable ccache support
7+
- ccache
8+
# Multithreaded linker to speed up linking step during compilation
9+
- lld
10+
- compile-commands
11+
# Debug info and build testing for dev workflows
12+
- rel-with-deb-info
13+
- build-testing-on
14+
- coverage-gcc
15+
- coverage-pytest
16+
test:
17+
event-handlers:
18+
- console_direct+
19+
- desktop_notification+

0 commit comments

Comments
 (0)