From 40b60a7ec9e8ea8c99ee5b5b2ee3516db6662eca Mon Sep 17 00:00:00 2001 From: mik-p Date: Fri, 26 Jan 2024 14:54:30 +1100 Subject: [PATCH] fix ros1 bug --- README.md | 26 ++++++++++++++++++++++---- images/datascience/noetic/Dockerfile | 2 +- images/minimal/noetic/Dockerfile | 2 +- images/scipy/noetic/Dockerfile | 2 +- images/tensorflow/noetic/Dockerfile | 2 +- templates/Dockerfile.j2 | 6 +++++- 6 files changed, 31 insertions(+), 9 deletions(-) diff --git a/README.md b/README.md index a84c958..42630f3 100644 --- a/README.md +++ b/README.md @@ -2,17 +2,31 @@ [![Binder](https://mybinder.org/badge_logo.svg)](https://mybinder.org/v2/gh/MPO-Web-Consulting/ros-notebook/HEAD) [![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](./LICENSE) -[![ros](https://img.shields.io/badge/ROS-Noetic-blue.svg)](http://wiki.ros.org/noetic) [![Open in Visual Studio Code](https://img.shields.io/badge/vscode-dev-blue)](https://open.vscode.dev/MPO-Web-Consulting/ros-notebook) -ros-notebook is a community maintained [Jupyter Docker Stack](https://jupyter-docker-stacks.readthedocs.io/en/latest/contributing/stacks.html) image that adds [ROS](https://www.ros.org/) to the `datascience-notebook`. +ros-notebook is a community maintained [Jupyter Docker Stack](https://jupyter-docker-stacks.readthedocs.io/en/latest/contributing/stacks.html) image that adds [ROS](https://www.ros.org/) to the common notebook containers such as the `datascience-notebook`. + +## Tags + +| ROS | Jupyter | +| --- | ------- | +[![ros](https://img.shields.io/badge/ROS-Noetic-blue.svg)](http://wiki.ros.org/noetic) | ![minimal-notebook](https://img.shields.io/badge/Minimal-grey.svg) ![scipy-notebook](https://img.shields.io/badge/Scipy-grey.svg) ![datascience-notebook](https://img.shields.io/badge/Data--Science-grey.svg) ![tensorflow-notebook](https://img.shields.io/badge/Tensorflow-grey.svg) +[![ros](https://img.shields.io/badge/ROS-Foxy-blue.svg)](http://wiki.ros.org/foxy) | ![minimal-notebook](https://img.shields.io/badge/Minimal-grey.svg) ![scipy-notebook](https://img.shields.io/badge/Scipy-grey.svg) ![datascience-notebook](https://img.shields.io/badge/Data--Science-grey.svg) ![tensorflow-notebook](https://img.shields.io/badge/Tensorflow-grey.svg) +[![ros](https://img.shields.io/badge/ROS-Humble-blue.svg)](http://wiki.ros.org/humble) | ![minimal-notebook](https://img.shields.io/badge/Minimal-grey.svg) ![scipy-notebook](https://img.shields.io/badge/Scipy-grey.svg) ![datascience-notebook](https://img.shields.io/badge/Data--Science-grey.svg) ![tensorflow-notebook](https://img.shields.io/badge/Tensorflow-grey.svg) +[![ros](https://img.shields.io/badge/ROS-Rolling-blue.svg)](http://wiki.ros.org/rolling) | ![minimal-notebook](https://img.shields.io/badge/Minimal-grey.svg) ![scipy-notebook](https://img.shields.io/badge/Scipy-grey.svg) ![datascience-notebook](https://img.shields.io/badge/Data--Science-grey.svg) ![tensorflow-notebook](https://img.shields.io/badge/Tensorflow-grey.svg) + +tags are formed as follows: + +`-` + +where `` is the ROS version and `` is the type of notebook. For example, `noetic-minimal` is a ROS Noetic image based on the `minimal-notebook`. ## Usage An example `Dockerfile` for a custom notebook image: ```dockerfile -FROM ghcr.io/mpo-web-consulting/ros-notebook:latest +FROM ghcr.io/mpo-web-consulting/ros-notebook:noetic-minimal # add your customizations here USER root @@ -26,7 +40,11 @@ RUN mamba install -y tensorflow && \ USER ${NB_UID} ``` -## Generate the Images and actions +## Generate Images and Actions + +The images and actions are generated from templates using [Jinja2](https://jinja.palletsprojects.com/en/3.0.x/). The templates are located in the `templates` directory. The images are defined in `images.yaml`. + +Use the following commands to generate the images and github actions files: ```bash # generate Dockerfiles for all images diff --git a/images/datascience/noetic/Dockerfile b/images/datascience/noetic/Dockerfile index e61ae37..ce2fa5c 100644 --- a/images/datascience/noetic/Dockerfile +++ b/images/datascience/noetic/Dockerfile @@ -26,7 +26,7 @@ RUN set -eux; \ rm -rf "$GNUPGHOME" # setup sources.list -RUN echo "deb [ signed-by=/usr/share/keyrings/ros1-latest-archive-keyring.gpg ] http://packages.ros.org/ros1/ubuntu focal main" > /etc/apt/sources.list.d/ros1-latest.list +RUN echo "deb [ signed-by=/usr/share/keyrings/ros1-latest-archive-keyring.gpg ] http://packages.ros.org/ros/ubuntu focal main" > /etc/apt/sources.list.d/ros1-latest.list # setup environment ENV LANG C.UTF-8 diff --git a/images/minimal/noetic/Dockerfile b/images/minimal/noetic/Dockerfile index 85e0c44..b89e305 100644 --- a/images/minimal/noetic/Dockerfile +++ b/images/minimal/noetic/Dockerfile @@ -26,7 +26,7 @@ RUN set -eux; \ rm -rf "$GNUPGHOME" # setup sources.list -RUN echo "deb [ signed-by=/usr/share/keyrings/ros1-latest-archive-keyring.gpg ] http://packages.ros.org/ros1/ubuntu focal main" > /etc/apt/sources.list.d/ros1-latest.list +RUN echo "deb [ signed-by=/usr/share/keyrings/ros1-latest-archive-keyring.gpg ] http://packages.ros.org/ros/ubuntu focal main" > /etc/apt/sources.list.d/ros1-latest.list # setup environment ENV LANG C.UTF-8 diff --git a/images/scipy/noetic/Dockerfile b/images/scipy/noetic/Dockerfile index c8952bb..4d9d465 100644 --- a/images/scipy/noetic/Dockerfile +++ b/images/scipy/noetic/Dockerfile @@ -26,7 +26,7 @@ RUN set -eux; \ rm -rf "$GNUPGHOME" # setup sources.list -RUN echo "deb [ signed-by=/usr/share/keyrings/ros1-latest-archive-keyring.gpg ] http://packages.ros.org/ros1/ubuntu focal main" > /etc/apt/sources.list.d/ros1-latest.list +RUN echo "deb [ signed-by=/usr/share/keyrings/ros1-latest-archive-keyring.gpg ] http://packages.ros.org/ros/ubuntu focal main" > /etc/apt/sources.list.d/ros1-latest.list # setup environment ENV LANG C.UTF-8 diff --git a/images/tensorflow/noetic/Dockerfile b/images/tensorflow/noetic/Dockerfile index 1b1fb8d..3f0cef7 100644 --- a/images/tensorflow/noetic/Dockerfile +++ b/images/tensorflow/noetic/Dockerfile @@ -26,7 +26,7 @@ RUN set -eux; \ rm -rf "$GNUPGHOME" # setup sources.list -RUN echo "deb [ signed-by=/usr/share/keyrings/ros1-latest-archive-keyring.gpg ] http://packages.ros.org/ros1/ubuntu focal main" > /etc/apt/sources.list.d/ros1-latest.list +RUN echo "deb [ signed-by=/usr/share/keyrings/ros1-latest-archive-keyring.gpg ] http://packages.ros.org/ros/ubuntu focal main" > /etc/apt/sources.list.d/ros1-latest.list # setup environment ENV LANG C.UTF-8 diff --git a/templates/Dockerfile.j2 b/templates/Dockerfile.j2 index 898091e..d08bd44 100644 --- a/templates/Dockerfile.j2 +++ b/templates/Dockerfile.j2 @@ -26,7 +26,11 @@ RUN set -eux; \ rm -rf "$GNUPGHOME" # setup sources.list -RUN echo "deb [ signed-by=/usr/share/keyrings/{{TEMPLATE_ROS_GENERATION}}-latest-archive-keyring.gpg ] http://packages.ros.org/{{TEMPLATE_ROS_GENERATION}}/ubuntu {{TEMPLATE_UBUNTU_CODENAME}} main" > /etc/apt/sources.list.d/{{TEMPLATE_ROS_GENERATION}}-latest.list +{% set package_url_spec = 'ros' -%} +{% if TEMPLATE_ROS_GENERATION == 'ros2' -%} +{% set package_url_spec = 'ros2' -%} +{% endif -%} +RUN echo "deb [ signed-by=/usr/share/keyrings/{{TEMPLATE_ROS_GENERATION}}-latest-archive-keyring.gpg ] http://packages.ros.org/{{package_url_spec}}/ubuntu {{TEMPLATE_UBUNTU_CODENAME}} main" > /etc/apt/sources.list.d/{{TEMPLATE_ROS_GENERATION}}-latest.list # setup environment ENV LANG C.UTF-8