Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
18 commits
Select commit Hold shift + click to select a range
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .devcontainer/noble/devcontainer.json
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
"--network=host",
"--cap-add=sys_nice", // Grants the container the CAP_SYS_NICE capability, which allows the container to raise process nice values, set real-time scheduling policies, set CPU affinity, and other operations.
"--security-opt", // allow core dumps
"seccomp=unconfined", // allow core dumps
"seccomp=unconfined" // allow core dumps
// Uncomment for containers requiring use of nvidia GPUs
// You will need to install NVIDIA Container Toolkit first
// "--runtime=nvidia",
Expand Down
61 changes: 61 additions & 0 deletions .devcontainer/resolute/devcontainer.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,61 @@
{
"name": "mc-rtc-superbuild-resolute-image",

// See .github/devcontainer/ubuntu-22.04/devcontainer.json to see how this image was built
// This image contains:
// - All of mc-rtc-superbuild dependencies
// - A ccache build cache built from the latest sources
// - A cython build cache built from the latest sources
// - All tools required to build the project
// - A sensible default configuration for vscode
"image": "ghcr.io/mc-rtc/mc-rtc-superbuild:resolute-devcontainer-latest",

"mounts": [
"type=bind,source=/tmp/.X11-unix,target=/tmp/.X11-unix,consistency=cached"
// "source=${localEnv:HOME}${localEnv:USERPROFILE}/docker-ws/mc-rtc-superbuild-noble,target=/home/vscode/workspace,type=bind,consistency=cached"
],

"runArgs": [
"--network=host",
"--cap-add=sys_nice", // Grants the container the CAP_SYS_NICE capability, which allows the container to raise process nice values, set real-time scheduling policies, set CPU affinity, and other operations.
"--security-opt", // allow core dumps
"seccomp=unconfined" // allow core dumps
// Uncomment for containers requiring use of nvidia GPUs
// You will need to install NVIDIA Container Toolkit first
// "--runtime=nvidia",
// "--gpus=all",
],


"containerEnv": {
"DISPLAY": "${localEnv:DISPLAY}"
},

"remoteUser": "vscode",
"workspaceMount": "source=${localWorkspaceFolder},target=/home/vscode/superbuild,type=bind",
"workspaceFolder": "/home/vscode/superbuild",

"features":
{
"ghcr.io/devcontainers/features/node:1": {},
"ghcr.io/arntanguy/nvim-devcontainer-feature/nvim:latest": {},
"ghcr.io/devcontainers/features/github-cli": { "version": "latest" },
"ghcr.io/georgofenbeck/features/lazygit-linuxbinary:1": { "version": "latest" }
},

"customizations": {
"vscode": {
"extensions": [
"twxs.cmake",
"ms-vscode.cmake-tools",
"josetr.cmake-language-support-vscode",
"ms-vscode.cpptools",
"ms-vscode.docker",
"ms-vscode.cpptools-extension-pack",
"ms-vscode-remote.remote-containers",
"ms-python.python",
"GitHub.vscode-github-actions"
]
}
}
}
7 changes: 4 additions & 3 deletions .github/devcontainer/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -193,7 +193,7 @@ RUN --mount=type=cache,target=/var/cache/apt \
# Workaround screen refresh issues with neovim/ncurses
ENV TERM="xterm-256color"
RUN \
if [ "$UBUNTU_VERSION" = "noble" ]; then \
if [ "$UBUNTU_VERSION" = "noble" ] || [ "$UBUNTU_VERSION" = "resolute" ]; then \
apt install --no-install-recommends -y libtinfo6 ncurses-term; \
else \
apt install --no-install-recommends -y libtinfo5 ncurses-term; \
Expand All @@ -203,7 +203,7 @@ RUN \
# Rename ubuntu user to vscode (noble)
# Create a new vscode user (jammy)
RUN \
if [ "$UBUNTU_VERSION" = "noble" ]; then \
if [ "$UBUNTU_VERSION" = "noble" ] || [ "$UBUNTU_VERSION" = "resolute" ]; then \
usermod -l vscode ubuntu \
&& usermod -d /home/vscode -m vscode \
&& groupmod -n vscode ubuntu; \
Expand Down Expand Up @@ -255,7 +255,8 @@ RUN cp $SUPERBUILD_DIR/.devcontainer/docker-entrypoint.sh ~/.docker-entrypoint.s
# CMake configure will install all APT/PIP dependencies (keep downloaded packages in mounted APT cache)
RUN --mount=type=cache,target=/var/cache/apt \
--mount=type=ssh,uid=1000 \
.github/devcontainer/build_superbuild.sh
mkdir -p $CCACHE_IMAGE_DIR \
&& .github/devcontainer/build_superbuild.sh

# mc_rtc configuration copy if MC_RTC_CONTROLLER_CONFIG is set and file exists
RUN mkdir -p ~/.config/mc_rtc && \
Expand Down
1 change: 1 addition & 0 deletions .github/devcontainer/build_superbuild.sh
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ if [ "$BUILD_SUPERBUILD" != "true" ]; then
echo "SUPERBUILD: Skipping build because BUILD_SUPERBUILD=$BUILD_SUPERBUILD"
else
./utils/bootstrap-linux.sh
source ~/.mc-rtc-venv/bin/activate
git config --global user.email "$EMAIL" && git config --global user.name "$NAME"

# CMake configure will install all APT/PIP dependencies (keep downloaded packages in mounted APT cache)
Expand Down
1 change: 1 addition & 0 deletions .github/devcontainer/jammy/devcontainer.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@

"build": {
"dockerfile": "../Dockerfile",
"target": "devcontainer",
"context": "../../..",
"args":
{
Expand Down
7 changes: 4 additions & 3 deletions .github/devcontainer/noble/devcontainer.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,11 @@

"build": {
"dockerfile": "../Dockerfile",
"target": "devcontainer",
"context": "../../..",
"args":
{
"CMAKE_PRESET": "${localEnv:CMAKE_PRESET:relwithdebinfo-noble}",
"CMAKE_PRESET": "${localEnv:CMAKE_PRESET:relwithdebinfo}",
"BUILD_VERSION": "${localEnv:BUILD_VERSION:devcontainer}",
"IMAGE_SOURCE_REPO": "",
"UBUNTU_VERSION": "noble"
Expand Down Expand Up @@ -48,13 +49,13 @@
"GitHub.vscode-github-actions"
]
}
}
},

"runArgs": [
"--network=host",
"--cap-add=sys_nice", // Grants the container the CAP_SYS_NICE capability, which allows the container to raise process nice values, set real-time scheduling policies, set CPU affinity, and other operations.
"--security-opt", // allow core dumps
"seccomp=unconfined", // allow core dumps
"seccomp=unconfined" // allow core dumps
// Uncomment for containers requiring use of nvidia GPUs
// You will need to install NVIDIA Container Toolkit first
// "--runtime=nvidia",
Expand Down
71 changes: 71 additions & 0 deletions .github/devcontainer/resolute/devcontainer.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,71 @@
{
"name": "mc-rtc-superbuild-resolute-build",

"build": {
"dockerfile": "../Dockerfile",
"target": "devcontainer",
"context": "../../..",
"args":
{
"CMAKE_PRESET": "${localEnv:CMAKE_PRESET:relwithdebinfo}",
"BUILD_VERSION": "${localEnv:BUILD_VERSION:devcontainer}",
"IMAGE_SOURCE_REPO": "",
"UBUNTU_VERSION": "resolute",
// FIXME
"BUILD_SUPERBUILD": "false"
},
"options":
[
// "${localEnv:SSH_OPT:''}"
"${localEnv:SSH_OPT:--ssh=default}"
]
},

"containerEnv": {
"DISPLAY": "${localEnv:DISPLAY}"
},

"mounts": [
"type=bind,source=/tmp/.X11-unix,target=/tmp/.X11-unix,consistency=cached",
"source=${localEnv:HOME}${localEnv:USERPROFILE}/devcontainers/volumes/mc-rtc-superbuild-resolute,target=/home/vscode/workspace,type=bind,consistency=cached"
],

"features":
{
"ghcr.io/devcontainers/features/node:1": {},
// "ghcr.io/arntanguy/nvim-devcontainer-feature/nvim:latest": {},
"ghcr.io/devcontainers/features/github-cli": { "version": "latest" },
"ghcr.io/georgofenbeck/features/lazygit-linuxbinary:1": { "version": "latest" }
},

"customizations": {
"vscode": {
"extensions": [
"twxs.cmake",
"ms-vscode.cmake-tools",
"josetr.cmake-language-support-vscode",
"ms-vscode.cpptools",
"ms-vscode.docker",
"ms-vscode.cpptools-extension-pack",
"ms-vscode-remote.remote-containers",
"ms-python.python",
"GitHub.vscode-github-actions"
]
}
},

"runArgs": [
"--network=host",
"--cap-add=sys_nice", // Grants the container the CAP_SYS_NICE capability, which allows the container to raise process nice values, set real-time scheduling policies, set CPU affinity, and other operations.
"--security-opt", // allow core dumps
"seccomp=unconfined" // allow core dumps
// Uncomment for containers requiring use of nvidia GPUs
// You will need to install NVIDIA Container Toolkit first
// "--runtime=nvidia",
// "--gpus=all",
],

"remoteUser": "vscode",
"workspaceMount": "source=${localWorkspaceFolder},target=/home/vscode/superbuild,type=bind",
"workspaceFolder": "/home/vscode/superbuild"
}
16 changes: 12 additions & 4 deletions .github/workflows/jammy-ci.yml → .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
name: CI Ubuntu Jammy
name: CI Ubuntu

on:
repository_dispatch:
types:
- build-jammy
- build
push:
branches:
- 'main'
Expand All @@ -21,15 +21,21 @@ concurrency:

jobs:
run:
name: "${{ matrix.os }}, use apt: ${{ matrix.use-mc-rtc-apt-mirror }} (stable: ${{ matrix.use-mc-rtc-apt-mirror-stable }})"
strategy:
fail-fast: false
matrix:
use-mc-rtc-apt-mirror: [ON, OFF]
use-mc-rtc-apt-mirror-stable: [ON, OFF]
# TODO: add ubuntu-26.04 once the github runner is available
os: [ ubuntu-22.04, ubuntu-24.04 ]
exclude:
- use-mc-rtc-apt-mirror: OFF
use-mc-rtc-apt-mirror-stable: ON
runs-on: ubuntu-22.04
# TODO: generate packages for 24.04
- os: ubuntu-24.04
use-mc-rtc-apt-mirror: ON
runs-on: ${{ matrix.os }}
steps:
- name: Maximize build space
shell: bash
Expand All @@ -54,14 +60,16 @@ jobs:
shell: bash
run: |
./utils/bootstrap-linux.sh
- name: Install system dependencies
- name: Configure superbuild
shell: bash
run: |
source ~/.mc-rtc-venv/bin/activate
mkdir -p ${TMPDIR-/tmp}/build-mc-rtc
cmake -S ${GITHUB_WORKSPACE} -B ${TMPDIR-/tmp}/build-mc-rtc -DCMAKE_BUILD_TYPE=RelWithDebInfo -DVERBOSE_TEST_OUTPUT=ON -DUSE_MC_RTC_APT_MIRROR=${{ matrix.use-mc-rtc-apt-mirror }} -DUSE_MC_RTC_APT_MIRROR_STABLE=${{ matrix.use-mc-rtc-apt-mirror-stable }}
- name: Install mc_rtc and related projects
shell: bash
run: |
source ~/.mc-rtc-venv/bin/activate
git config --global user.name "GitHub Actions"
git config --global user.email "actions@example.com"
cmake --build ${TMPDIR-/tmp}/build-mc-rtc --config RelWithDebInfo
11 changes: 7 additions & 4 deletions .github/workflows/devcontainer-ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ on:
types:
- build-jammy
- build-noble
- build-resolute
push:
branches:
- 'main'
Expand All @@ -22,18 +23,20 @@ jobs:
strategy:
fail-fast: false
matrix:
os: [jammy, noble]
os: [jammy, noble, resolute]
uses: jrl-umi3218/github-actions/.github/workflows/superbuild-devcontainer.yml@master
with:
runner: ubuntu-24.04
free-disk-space: true
os: ${{ matrix.os }}
preset: relwithdebinfo${{ matrix.os == 'noble' && '-noble' || '' }}
preset: relwithdebinfo
include-preset-in-name: false
build-standalone-release: true
build-standalone-devel: true
build-devcontainer: true
container-repository: ghcr.io/mc-rtc/mc-rtc-superbuild
push: ${{ github.ref == 'refs/heads/main' && github.repository == 'mc-rtc/mc-rtc-superbuild' }}
# container-repository: ghcr.io/mc-rtc/mc-rtc-superbuild
# push: ${{ github.ref == 'refs/heads/main' && github.repository == 'mc-rtc/mc-rtc-superbuild' }}
container-repository: ghcr.io/arntanguy/mc-rtc-superbuild
push: ${{ github.ref == 'refs/heads/topic/noble' }}
secrets:
SSH_KEY: ${{ secrets.SSH_KEY }}
2 changes: 2 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -104,6 +104,8 @@ if(EMSCRIPTEN)
)
endif()

include(cmake/detect-system.cmake)
include(cmake/python.cmake)
include(cmake/project.cmake)

if(APPLE)
Expand Down
28 changes: 2 additions & 26 deletions CMakePresets.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,8 @@
"CMAKE_BUILD_TYPE": "RelWithDebInfo",
"SOURCE_DESTINATION": "${sourceDir}/../workspace/devel",
"BUILD_DESTINATION": "${sourceDir}/../workspace/build/projects",
"CMAKE_INSTALL_PREFIX": "${sourceDir}/../workspace/install"
"CMAKE_INSTALL_PREFIX": "${sourceDir}/../workspace/install",
"MC_RTC_SUPERBUILD_VERBOSE": "ON"
}
},
{
Expand All @@ -23,22 +24,6 @@
"cacheVariables": {
"BUILD_TESTING": "OFF"
}
},
{
"name": "relwithdebinfo-noble",
"displayName": "RelWithDebInfo (noble, ROS, no Python)",
"inherits": [
"relwithdebinfo"
],
"cacheVariables": {
"PYTHON_BINDING": "OFF",
"WITH_ROS_SUPPORT": "ON"
},
"condition": {
"type": "equals",
"lhs": "$env{UBUNTU_VERSION}",
"rhs": "noble"
}
}
],
"buildPresets": [
Expand All @@ -59,15 +44,6 @@
"targets": [
"install"
]
},
{
"name": "relwithdebinfo-noble",
"displayName": "RelWithDebInfo (ubuntu noble)",
"configurePreset": "relwithdebinfo-noble",
"configuration": "RelWithDebInfo",
"targets": [
"install"
]
}
]
}
7 changes: 6 additions & 1 deletion cmake/command-prefix.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@ function(GetCommandPrefix VAR WRITE_TO)
APPEND
CMAKE_COMMAND_PREFIX
ROS_DISTRO=$ENV{ROS_DISTRO}
PYTHONPATH=$ENV{PYTHONPATH}
ROS_ROOT=$ENV{ROS_ROOT}
ROS_ETC_DIR=$ENV{ROS_ETC_DIR}
ROS_PARALLEL_JOBS="$ENV{ROS_PARALLEL_JOBS}"
Expand Down Expand Up @@ -48,6 +47,10 @@ function(GetCommandPrefix VAR WRITE_TO)
"LDFLAGS=-s USE_PTHREADS=1 -s DISABLE_EXCEPTION_CATCHING=0"
)
endif()
# python
list(APPEND CMAKE_COMMAND_PREFIX PATH=$ENV{VIRTUAL_ENV}/bin:$ENV{PATH}
VIRTUAL_ENV=$ENV{VIRTUAL_ENV} PYTHONPATH=$ENV{PYTHONPATH}
)
list(TRANSFORM CMAKE_COMMAND_PREFIX REPLACE " " "\\\\ " OUTPUT_VARIABLE
CMAKE_COMMAND_PREFIX
) # restore backslash before spaces in env variables
Expand All @@ -58,4 +61,6 @@ function(GetCommandPrefix VAR WRITE_TO)
${CMAKE_CURRENT_FUNCTION_LIST_DIR}/scripts/cmake-with-prefix.cmake --
PARENT_SCOPE
)
# FIXME
message(STATUS "CMAKE_COMMAND_PREFIX IS ${CMAKE_COMMAND_PREFIX}")
endfunction()
13 changes: 13 additions & 0 deletions cmake/detect-system.cmake
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
macro(detect_distro OUT_VAR)
find_program(LSB_RELEASE lsb_release)
if(NOT LSB_RELEASE)
message(FATAL_ERROR "lsb_release must be installed before running this script")
endif()
execute_process(
COMMAND lsb_release -sc
OUTPUT_VARIABLE ${OUT_VAR}
OUTPUT_STRIP_TRAILING_WHITESPACE
)
endmacro()

detect_distro(DISTRO)
Loading
Loading