Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
53 commits
Select commit Hold shift + click to select a range
7b39b1c
switch to pre-build image
marc-hanheide Sep 20, 2024
770679c
remove possibility to push from the main branch and make the dev cont…
marc-hanheide Sep 20, 2024
5577e84
Merge pull request #3 from LCAS/marc-hanheide-patch-prebuild
gcielniak Sep 23, 2024
019079f
tutorial files added for session 2
gcielniak Sep 29, 2024
eefc4d8
Merge pull request #5 from LCAS/session_2_tasks
gcielniak Sep 29, 2024
b6435bd
Update README.md
gcielniak Sep 29, 2024
7fa8211
restructured tutorial package and launch file added
gcielniak Oct 2, 2024
2e9d070
Merge pull request #6 from LCAS/workshop_3_draft
gcielniak Oct 2, 2024
261164d
data logging and visualisation
gcielniak Oct 3, 2024
4e27c87
Update README.md
gcielniak Oct 4, 2024
1b19be6
Merge pull request #7 from LCAS/workshop_3_draft
gcielniak Oct 4, 2024
75012b6
workshop 4 files
gcielniak Oct 8, 2024
b860cb1
Merge pull request #8 from LCAS/workshop_4
gcielniak Oct 8, 2024
1f609e3
Update README.md
gcielniak Oct 10, 2024
a79a7b7
double counting filtering
gcielniak Oct 11, 2024
6d91e58
Merge pull request #9 from LCAS/workshop_4
gcielniak Oct 11, 2024
7bf416a
Update README.md
gcielniak Oct 16, 2024
0717b03
workshop 6 files
gcielniak Nov 4, 2024
34358ba
Merge pull request #11 from LCAS/workshop_6
gcielniak Nov 4, 2024
7a3ccec
workshop 7 files
gcielniak Nov 8, 2024
54bf3a8
two-sample test added
gcielniak Nov 10, 2024
9fdd1ae
Merge pull request #12 from LCAS/workshop_7
gcielniak Nov 10, 2024
f6a1bda
custom simulated world file
gcielniak Nov 11, 2024
db781d6
Merge pull request #13 from LCAS:custom_world
gcielniak Nov 11, 2024
1de3e0a
workflow_dispatch added to make it available in GUI
marc-hanheide Nov 12, 2024
f9b0b24
remove actual build from main branch
marc-hanheide Nov 12, 2024
49e908a
init files
gcielniak Nov 21, 2024
ee55c8a
adding node to waypoint navigator
gcielniak Nov 22, 2024
4bc4dd1
final version, added dependencies
gcielniak Nov 24, 2024
40acc25
Merge pull request #14 from LCAS/waypoint_nav
gcielniak Nov 24, 2024
2ec32a7
package fix
gcielniak Nov 26, 2024
d723b74
Merge pull request #15 from LCAS/package_fix
gcielniak Nov 26, 2024
088a0cd
fix postCreateCommand in devcontainer
gcielniak Dec 1, 2024
c4f9a54
Merge pull request #17 from LCAS/doecker_fix
gcielniak Dec 1, 2024
b45b472
workshop files
gcielniak Dec 1, 2024
4a8828a
Merge pull request #18 from LCAS/workshop_10
gcielniak Dec 1, 2024
7a27ef4
addeneum
gcielniak Dec 1, 2024
9a2d089
Merge pull request #19 from LCAS/workshop_fix
gcielniak Dec 1, 2024
9cbb9b9
depth image processing fix
Dec 2, 2024
e3ef93b
Merge pull request #20 from LCAS/depth_image_fix
gcielniak Dec 2, 2024
bbb9261
allows for simple switch between the real and simulated robot for obj…
Dec 2, 2024
023d594
Merge pull request #21 from LCAS/real_sim_robot_fix
gcielniak Dec 2, 2024
417f766
counter in 3d
gcielniak Dec 8, 2024
826e177
Merge pull request #23 from LCAS/counter_3d
gcielniak Dec 8, 2024
2ec98a0
automated color2depth ratio calculation
gcielniak Dec 10, 2024
c09b0b0
Merge pull request #24 from LCAS/counting_fix
gcielniak Dec 10, 2024
c07d71b
Update Dockerfile and configuration for improved multi-architecture s…
marc-hanheide Dec 15, 2024
19fcc6a
Merge branch 'main' into merge_main
marc-hanheide Dec 15, 2024
0b6ae19
Merge branch 'merge_main' into deployment_refactored
marc-hanheide Dec 15, 2024
233323c
Add GitHub Actions workflow for multi-architecture Docker builds and …
marc-hanheide Dec 15, 2024
9dd6396
Merge branch 'main' into deployment_refactored
marc-hanheide Dec 15, 2024
78721d7
bigfix build target
marc-hanheide Dec 15, 2024
516c493
Update Dockerfile to build additional packages for navigation
marc-hanheide Dec 15, 2024
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
97 changes: 71 additions & 26 deletions .devcontainer/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,55 +1,100 @@
ARG BASE_IMAGE=ros:humble
ARG BASE_IMAGE=lcas.lincoln.ac.uk/lcas/ros:jammy-humble-cuda12.2-opengl

FROM ${BASE_IMAGE} as base

# making the standard global variables available for target-specific builds
ARG TARGETARCH

USER root

ENV DEBIAN_FRONTEND=noninteractive

RUN apt-get update \
&& apt-get install -qq -y --no-install-recommends \
git \
python3-pip \
python3-rosdep \
python3-matplotlib \
python3-pandas \
ros-humble-rviz2 \
ros-humble-gazebo-plugins \
ros-humble-nav2-* \
ros-humble-tf-transformations \
ros-humble-rqt* \
ros-humble-find-object-2d \
zenoh-bridge-ros2dds

RUN echo "building for ${TARGETARCH}"
RUN if [ "${TARGETARCH}" = "arm64" ]; then \
add-apt-repository -s -y ppa:openrobotics/gazebo11-non-amd64; \
fi

RUN apt-get update && \
apt-get upgrade -y && \
apt-get install -qq -y --no-install-recommends \
git \
python3-pip \
python3-rosdep \
python3-matplotlib \
python3-pandas && \
apt-get clean && \
rm -rf /var/lib/apt/lists/*

# get the source tree and analyse it for its package.xml only
FROM base as sourcefilter
COPY ./src /tmp/src
COPY ./src /tmp/src/_workspace/src
COPY ./.devcontainer/*repos /tmp/.devcontainer/
RUN cd /tmp/src && vcs import < /tmp/.devcontainer/lcas.repos
RUN if [ "${TARGETARCH}" = "arm64" ]; then \
cd /tmp/src; \
vcs import < /tmp/.devcontainer/gazebo_ros_pkgs.repos; \
fi
RUN cd /tmp/src && vcs pull

# remove everything that isn't package.xml
RUN find /tmp/src -type f \! -name "package.xml" -print | xargs rm -rf

# install all dependencies listed in the package.xml
FROM base as depbuilder
FROM base as depinstaller
# copy the reduced source tree (only package.xml) from previous stage
COPY --from=sourcefilter /tmp/src /tmp/src
RUN rosdep update && apt-get update
RUN cd /tmp/src && rosdep install --from-paths . --ignore-src -r -y && cd && rm -rf /tmp/src
RUN rosdep update --rosdistro=${ROS_DISTRO} && apt-get update
RUN rosdep install --from-paths /tmp/src --ignore-src -r -y && rm -rf /tmp/src && apt-get clean && rm -rf /var/lib/apt/lists/* /tmp/src

FROM depinstaller as depbuilder
COPY .devcontainer/*repos .devcontainer/*.sh /tmp/.devcontainer/

# get the source tree and build it (include gazebo only for arm64 platform as it is not available for arm64)
# see https://github.com/gazebosim/gazebo-classic/issues/3236
RUN mkdir -p /opt/ros/lcas/src && \
cd /opt/ros/lcas/src && \
vcs import < /tmp/.devcontainer/lcas.repos
RUN if [ "${TARGETARCH}" = "arm64" ]; then cd /opt/ros/lcas/src; vcs import < /tmp/.devcontainer/gazebo_ros_pkgs.repos; fi

RUN . /opt/ros/humble/setup.sh && \
apt update && \
rosdep --rosdistro=${ROS_DISTRO} update && \
cd /opt/ros/lcas/src && \
vcs pull && \
rosdep install --from-paths . -i -y && \
apt-get clean && \
rm -rf /var/lib/apt/lists/*

# build the workspace but only until limo_gazebosim to avoid building the hardware specific packages
RUN cd /opt/ros/lcas; colcon build --packages-up-to limo_navigation limo_gazebosim; \
rm -rf /opt/ros/lcas/src/ /opt/ros/lcas/build/ /opt/ros/lcas/log/

FROM depbuilder as final
FROM depbuilder as devcontainer
# add user ros with sudo rights if it doesn't exist
RUN if ! id ros; then \
useradd -ms /bin/bash ros && echo "ros:ros" | chpasswd && adduser ros sudo; \
echo "ALL ALL=(ALL) NOPASSWD: ALL" >> /etc/sudoers; \
echo "source /opt/ros/humble/setup.bash" >> /etc/bash.bashrc; \
else echo "user ros already exists"; \
fi
RUN echo "source /opt/ros/lcas/install/setup.bash" >> ~ros/.bashrc

# add sudo without password
ENV DEBIAN_FRONTEND=noninteractive
FROM devcontainer as compiled

# add commit history to bust cache if and when needed.
ADD "https://api.github.com/repos/LCAS/limo_ros2/commits?per_page=1&sha=humble" .lcas_addons.limo_ros2.commits
COPY ./src /opt/ros/lcas/src/teaching-code/src
RUN . /opt/ros/lcas/install/setup.sh && \
apt update && \
rosdep --rosdistro=${ROS_DISTRO} update && \
rosdep install --from-paths /opt/ros/lcas/src/teaching-code/src --ignore-src -y && \
apt-get clean && \
rm -rf /var/lib/apt/lists/*

COPY .devcontainer/*repos .devcontainer/*.sh /tmp/.devcontainer/
RUN bash /tmp/.devcontainer/install.sh
RUN cd /opt/ros/lcas && colcon build --packages-up-to rob2002_tutorial && \
rm -rf /opt/ros/lcas/src/ /opt/ros/lcas/build/ /opt/ros/lcas/log/

RUN echo "source /opt/ros/lcas/install/setup.bash" >> ~/.bashrc
RUN find /opt/ros/lcas/

USER ros
ENV SHELL=/bin/bash
Original file line number Diff line number Diff line change
Expand Up @@ -6,13 +6,19 @@
// disable the "build" section below in this case
// "image": "lcas.lincoln.ac.uk/devcontainer/lcas/rob2002:cuda-opengl-main",
"build": {
"dockerfile": "../Dockerfile",
"dockerfile": "./Dockerfile",
"args": {
"BASE_IMAGE": "lcas.lincoln.ac.uk/lcas/ros:jammy-humble-cuda12.2-opengl"
// set the base image, add `-arm64` as a suffix if you have an ARM (e.g. Apple Mx) CPU:
"BASE_IMAGE": "lcas.lincoln.ac.uk/lcas/ros:jammy-humble-cuda12.2-opengl-1"
//"BASE_IMAGE": "lcas.lincoln.ac.uk/lcas/ros:jammy-humble-cuda12.2-opengl-arm64-1"
},
"context": "../.."
// change this to linux/arm64 if you have an ARM (e.g. Apple Mx) CPU:
"platform": "linux/amd64",
//"platform": "linux/arm64",
"context": ".."
},

// forward the virtual desktop port
"forwardPorts": [5801],
"portsAttributes": {
"5801": {
Expand Down
6 changes: 6 additions & 0 deletions .devcontainer/gazebo_ros_pkgs.repos
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
repositories:
gazebo_ros_pkgs:
type: git
url: https://github.com/ros-simulation/gazebo_ros_pkgs.git
version: 3.7.0

2 changes: 1 addition & 1 deletion .devcontainer/lcas.repos
Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,5 @@ repositories:
limo_ros2:
type: git
url: https://github.com/LCAS/limo_ros2.git
version: humble
version: v0.0.1

147 changes: 147 additions & 0 deletions .github/workflows/container-build.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,147 @@

name: Build Docker image

on:
workflow_dispatch:
push:
branches: [ deployment ]
tags:
- 'v*'
pull_request:
branches: [ deployment ]

jobs:
build-amd64-docker-image:
if: github.repository_owner == 'LCAS'
runs-on: lcas
strategy:
fail-fast: false
matrix:
include:
- base_image: lcas.lincoln.ac.uk/lcas/ros:jammy-humble-cuda12.2-opengl-1
ros_distro: humble
push_image: lcas.lincoln.ac.uk/devcontainer/rob2002

steps:
- name: Node Js
uses: actions/setup-node@v4
with:
node-version: "^16.13.0 || >=18.0.0"

- uses: actions/checkout@v3
with:
fetch-depth: 1

- name: What
run: echo "BRANCH=${GITHUB_REF##*/}" >> $GITHUB_ENV

- name: Docker Login LCAS
if: ${{ github.event_name != 'pull_request' }}
uses: docker/login-action@v3
with:
registry: lcas.lincoln.ac.uk
username: ${{ secrets.LCAS_REGISTRY_PUSHER }}
password: ${{ secrets.LCAS_REGISTRY_TOKEN }}

- name: Docker meta
id: meta_public
uses: docker/metadata-action@v5
with:
# list of Docker images to use as base name for tags
images: |
${{ matrix.push_image }}
${{ matrix.push_image }}-amd64
# generate Docker tags based on the following events/attributes
tags: |
type=raw,value=staging
type=raw,enable=${{ github.event_name != 'pull_request' }},value=latest
type=ref,enable=${{ github.event_name != 'pull_request' }},event=branch
type=semver,pattern={{version}}
type=semver,pattern={{major}}.{{minor}}
type=semver,pattern={{major}}

- name: Build Public Docker Image
uses: docker/build-push-action@v6
with:
context: .
file: .devcontainer/Dockerfile
platforms: linux/amd64
pull: true
push: true
tags: ${{ steps.meta_public.outputs.tags }}
labels: ${{ steps.meta_public.outputs.labels }}
target: compiled
build-args: |
BASE_IMAGE=${{ matrix.base_image }}
BRANCH=${{ env.BRANCH }}
ROS_DISTRO=${{ matrix.ros_distro }}


build-arm64-docker-image:
if: github.repository_owner == 'LCAS'
runs-on:
- lcas-runc
- runc
strategy:
fail-fast: false
matrix:
include:
- base_image: lcas.lincoln.ac.uk/lcas/ros:jammy-humble-cuda12.2-opengl-arm64-1
ros_distro: humble
push_image: lcas.lincoln.ac.uk/devcontainer/rob2002-arm64

steps:
- name: Node Js
uses: actions/setup-node@v4
with:
node-version: "^16.13.0 || >=18.0.0"

- uses: actions/checkout@v3
with:
fetch-depth: 1

- name: What
run: echo "BRANCH=${GITHUB_REF##*/}" >> $GITHUB_ENV

- name: Docker Login LCAS
if: ${{ github.event_name != 'pull_request' }}
uses: docker/login-action@v3
with:
registry: lcas.lincoln.ac.uk
username: ${{ secrets.LCAS_REGISTRY_PUSHER }}
password: ${{ secrets.LCAS_REGISTRY_TOKEN }}

- name: Docker meta
id: meta_public
uses: docker/metadata-action@v5
with:
flavor: |
latest=false
# list of Docker images to use as base name for tags
images: |
${{ matrix.push_image }}
# generate Docker tags based on the following events/attributes
tags: |
type=raw,value=staging
type=raw,enable=${{ github.event_name != 'pull_request' }},value=latest
type=ref,enable=${{ github.event_name != 'pull_request' }},event=branch
type=semver,pattern={{version}}
type=semver,pattern={{major}}.{{minor}}
type=semver,pattern={{major}}

- name: Build Public Docker Image
uses: docker/build-push-action@v6
with:
context: .
file: .devcontainer/Dockerfile
platforms: linux/arm64
pull: true
push: true
tags: ${{ steps.meta_public.outputs.tags }}
labels: ${{ steps.meta_public.outputs.labels }}
target: compiled
build-args: |
BASE_IMAGE=${{ matrix.base_image }}
BRANCH=${{ env.BRANCH }}
ROS_DISTRO=${{ matrix.ros_distro }}

28 changes: 4 additions & 24 deletions .github/workflows/dev-container.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,19 +12,9 @@ on:

jobs:
build_devcontainer:
# only run for LCAS repositories
if: github.repository_owner == 'LCAS' || github.repository_owner == 'lcas'
runs-on: lcas
strategy:
matrix:
config:
- cuda-opengl
steps:
- name: Node Js
uses: actions/setup-node@v4
with:
node-version: "^16.13.0 || >=18.0.0"
runs-on: ubuntu-latest

steps:
- name: Checkout from github
uses: actions/checkout@v3
- name: extract the github reference
Expand All @@ -48,20 +38,10 @@ jobs:
password: ${{ secrets.LCAS_REGISTRY_TOKEN }}

- name: Build dev container task
if: ${{ github.event_name == 'pull_request' }}
uses: devcontainers/ci@v0.3
with:
imageName: lcas.lincoln.ac.uk/devcontainer/${{ steps.docker_image_name.outputs.docker_image }}
configFile: ./.devcontainer/${{ matrix.config }}/devcontainer.json
configFile: ./.devcontainer/devcontainer.json
push: never
imageTag: ${{ matrix.config }}-${{ env.BRANCH }}
#runCmd: "bash .devcontainer/run-ci.sh"
- name: Build and push dev container image
if: ${{ github.event_name != 'pull_request' }}
uses: devcontainers/ci@v0.3
with:
imageName: lcas.lincoln.ac.uk/devcontainer/${{ steps.docker_image_name.outputs.docker_image }}
configFile: ./.devcontainer/${{ matrix.config }}/devcontainer.json
push: always
imageTag: ${{ matrix.config }}-${{ env.BRANCH }}
imageTag: ci
#runCmd: "bash .devcontainer/run-ci.sh"
Loading
Loading