From 8f77d9582c534b579332387dafa4e476d2254dca Mon Sep 17 00:00:00 2001 From: nils Date: Sat, 10 May 2025 14:28:08 +0200 Subject: [PATCH 01/19] Fix dep (requirement.txt) to versions present in apt --- constraints.txt | 72 ++++++++++++++++++++++++++++--------------------- 1 file changed, 42 insertions(+), 30 deletions(-) diff --git a/constraints.txt b/constraints.txt index f904f5c8627..7d6af5d0d1d 100644 --- a/constraints.txt +++ b/constraints.txt @@ -1,36 +1,48 @@ -alabaster==0.7.12 -Babel==2.14.0 -certifi==2020.6.20 -chardet==4.0.0 -doc8==1.1.1 -docutils==0.20.1 -idna==2.10 -imagesize==1.3.0 -Jinja2==3.0.3 -MarkupSafe==2.0.1 -packaging==21.3 -pbr==5.8.0 +alabaster==0.7.16 +atomicwrites==1.4.1 +attrs==25.3.0 +babel==2.17.0 +certifi==2025.4.26 +charset-normalizer==3.4.2 +click==8.1.8 +codespell==2.4.1 +doc8==1.1.2 +docutils==0.21.2 +idna==3.10 +imagesize==1.4.1 +iniconfig==2.1.0 +Jinja2==3.1.6 +MarkupSafe==3.0.2 +more-itertools==10.7.0 +packaging==25.0 +pbr==6.1.1 +pluggy==1.5.0 polib==1.2.0 -Pygments==2.17.2 -pyparsing==2.4.7 +py==1.11.0 +Pygments==2.19.1 pytest==8.3.5 -pytz==2022.1 -requests==2.25.1 -restructuredtext_lint==1.3.2 -snowballstemmer==2.2.0 -Sphinx==7.2.6 +PyYAML==6.0.2 +regex==2024.11.6 +requests==2.32.3 +restructuredtext_lint==1.4.0 +roman-numerals-py==3.1.0 +setuptools==80.3.1 +six==1.17.0 +snowballstemmer==3.0.0.1 +Sphinx==8.2.3 sphinx-copybutton==0.5.2 -sphinx-lint==0.9.1 +sphinx-lint==1.0.0 sphinx-multiversion==0.2.4 -sphinx-rtd-theme==2.0.0 -sphinx-tabs==3.4.5 -sphinxcontrib-applehelp==1.0.4 -sphinxcontrib-devhelp==1.0.2 -sphinxcontrib-htmlhelp==2.0.1 +sphinx-rtd-theme==3.0.2 +sphinx-tabs==3.4.7 +sphinx_tamer==0.2.0 +sphinxcontrib-applehelp==2.0.0 +sphinxcontrib-devhelp==2.0.0 +sphinxcontrib-htmlhelp==2.1.0 sphinxcontrib-jquery==4.1 sphinxcontrib-jsmath==1.0.1 -sphinxcontrib-mermaid==0.9.2 -sphinxcontrib-qthelp==1.0.3 -sphinxcontrib-serializinghtml==1.1.10 -stevedore==3.5.0 -urllib3==1.26.5 +sphinxcontrib-mermaid==1.0.0 +sphinxcontrib-qthelp==2.0.0 +sphinxcontrib-serializinghtml==2.0.0 +stevedore==5.4.1 +urllib3==2.4.0 From 0313f680c1d69261ff0be7e585964b814002debc Mon Sep 17 00:00:00 2001 From: nils Date: Sat, 10 May 2025 14:32:25 +0200 Subject: [PATCH 02/19] Update Dockerfile Devcontainer.json --- .devcontainer/devcontainer.json | 4 ++-- docker/image/Dockerfile | 14 ++++++++++---- 2 files changed, 12 insertions(+), 6 deletions(-) diff --git a/.devcontainer/devcontainer.json b/.devcontainer/devcontainer.json index f8f35c4f99d..e512ea85535 100644 --- a/.devcontainer/devcontainer.json +++ b/.devcontainer/devcontainer.json @@ -1,11 +1,11 @@ { "name": "ROS 2 Documentation", "build": { - "dockerfile": "../docker/image/Dockerfile" + "dockerfile": "../docker/image/Dockerfile", + "context": ".." }, "workspaceMount": "source=${localWorkspaceFolder},target=/tmp/doc_repository,type=bind", "workspaceFolder": "/tmp/doc_repository", - "postCreateCommand": "pip3 install --no-warn-script-location --user -r requirements.txt -c constraints.txt", "features": { "ghcr.io/devcontainers/features/git:1": {} }, diff --git a/docker/image/Dockerfile b/docker/image/Dockerfile index 74d0a843ff5..d8e8d1374d6 100644 --- a/docker/image/Dockerfile +++ b/docker/image/Dockerfile @@ -3,7 +3,7 @@ # # docker build -f docker/image/Dockerfile . -FROM ubuntu:jammy +FROM ubuntu:noble ARG user=rosindex ARG uid=1000 @@ -20,7 +20,8 @@ RUN apt-get update && \ graphviz \ locales \ make \ - python3-pip && \ + python3-pip \ + python3-venv && \ rm -rf /var/lib/apt/lists/* RUN locale-gen en_US en_US.UTF-8 @@ -32,8 +33,13 @@ ENV HOME=/home/$user ENV PATH=/home/$user/.local/bin:$PATH WORKDIR /tmp/doc_repository -USER $user # https://build.ros.org/job/doc_ros2doc/ relies on "make multiversion" to build the official documentation. # Do not remove "make multiversion" from CMD, as it is the entrypoint for the container. -CMD ["bash", "-c", "pip3 install --no-warn-script-location --user -r requirements.txt -c constraints.txt && make multiversion"] +CMD ["bash", "-c", "source /opt/ros2doc/bin/activate && make multiversion"] +RUN python3 -m venv /opt/ros2doc +COPY requirements.txt constraints.txt . +RUN . /opt/ros2doc/bin/activate && pip3 install -r requirements.txt -c constraints.txt + +RUN echo "source /opt/ros2doc/bin/activate" >> /home/$user/.bashrc +USER $user From 142b2d88ef794e3c83568b669e51b1fa2ae813ed Mon Sep 17 00:00:00 2001 From: nils Date: Sat, 10 May 2025 14:32:50 +0200 Subject: [PATCH 03/19] Update workflows --- .github/workflows/docker-image.yml | 2 +- .github/workflows/test.yml | 8 ++++---- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/.github/workflows/docker-image.yml b/.github/workflows/docker-image.yml index 2e750b9cac6..c7c042d1f00 100644 --- a/.github/workflows/docker-image.yml +++ b/.github/workflows/docker-image.yml @@ -9,7 +9,7 @@ on: jobs: validate: - runs-on: ubuntu-22.04 + runs-on: ubuntu-24.04 steps: - name: Checkout uses: actions/checkout@v4 diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 8a0c0e71f4d..69fdd9a2bfe 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -4,7 +4,7 @@ on: pull_request jobs: test: - runs-on: ubuntu-22.04 + runs-on: ubuntu-24.04 steps: - name: Checkout uses: actions/checkout@v4 @@ -24,7 +24,7 @@ jobs: run: make test-tools lint: - runs-on: ubuntu-22.04 + runs-on: ubuntu-24.04 steps: - name: Checkout uses: actions/checkout@v4 @@ -41,7 +41,7 @@ jobs: run: make lint spellcheck: - runs-on: ubuntu-22.04 + runs-on: ubuntu-24.04 steps: - name: Checkout uses: actions/checkout@v4 @@ -59,7 +59,7 @@ jobs: build: needs: [test, lint] - runs-on: ubuntu-22.04 + runs-on: ubuntu-24.04 steps: - name: Checkout uses: actions/checkout@v4 From 2e940d9c164ded631cbfa1a0fd980c66fcca4c25 Mon Sep 17 00:00:00 2001 From: nils Date: Sat, 10 May 2025 14:33:33 +0200 Subject: [PATCH 04/19] Update conf.py --- conf.py | 5 ++++- requirements.txt | 1 + 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/conf.py b/conf.py index 1754ea079e9..0532287d682 100644 --- a/conf.py +++ b/conf.py @@ -86,6 +86,7 @@ 'sphinx_tabs.tabs', 'sphinx_rtd_theme', 'sphinx_sitemap_ros', + 'sphinxcontrib.googleanalytics', 'sphinxcontrib.mermaid', ] @@ -109,6 +110,9 @@ # See: https://sphinx-copybutton.readthedocs.io/en/latest/use.html#automatic-exclusion-of-prompts-from-the-copies copybutton_exclude = '.linenos, .gp, .go' +# Google Analytics configuration +googleanalytics_id = 'G-EVD5Z6G6NH' +googleanalytics_enabled = True # -- Options for HTML output ---------------------------------------------- # The theme to use for HTML and HTML Help pages. See the documentation for @@ -116,7 +120,6 @@ # html_theme = 'sphinx_rtd_theme' html_theme_options = { - 'analytics_id': 'G-EVD5Z6G6NH', 'collapse_navigation': False, 'sticky_navigation': True, 'navigation_depth': -1, diff --git a/requirements.txt b/requirements.txt index f9e4d129f85..8c9ac3f27a9 100644 --- a/requirements.txt +++ b/requirements.txt @@ -11,3 +11,4 @@ sphinx-rtd-theme sphinx-tabs sphinxcontrib-mermaid sphinx-tamer +sphinxcontrib-googleanalytics From 5970d72bf812e1230a6fd6a81cc5157631056d0e Mon Sep 17 00:00:00 2001 From: nils Date: Sat, 10 May 2025 14:34:14 +0200 Subject: [PATCH 05/19] Fix constraints to latest version available via pip --- constraints.txt | 1 + 1 file changed, 1 insertion(+) diff --git a/constraints.txt b/constraints.txt index 7d6af5d0d1d..1e3e88b3c80 100644 --- a/constraints.txt +++ b/constraints.txt @@ -38,6 +38,7 @@ sphinx-tabs==3.4.7 sphinx_tamer==0.2.0 sphinxcontrib-applehelp==2.0.0 sphinxcontrib-devhelp==2.0.0 +sphinxcontrib-googleanalytics==0.4 sphinxcontrib-htmlhelp==2.1.0 sphinxcontrib-jquery==4.1 sphinxcontrib-jsmath==1.0.1 From ae14f82541b1fe3eda6c2dbbaa6aadb3559b129a Mon Sep 17 00:00:00 2001 From: nils Date: Sat, 10 May 2025 14:39:56 +0200 Subject: [PATCH 06/19] Update python version in workflows. --- .github/workflows/test.yml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 69fdd9a2bfe..92a763623d3 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -12,7 +12,7 @@ jobs: - name: Setup Python uses: actions/setup-python@v5 with: - python-version: '3.10' + python-version: '3.12.2' - name: Install dependencies with pip run: pip install --no-warn-script-location --user -r requirements.txt -c constraints.txt @@ -32,7 +32,7 @@ jobs: - name: Setup Python uses: actions/setup-python@v5 with: - python-version: '3.10' + python-version: '3.12.2' - name: Install dependencies with pip run: pip install --no-warn-script-location --user -r requirements.txt -c constraints.txt @@ -49,7 +49,7 @@ jobs: - name: Setup Python uses: actions/setup-python@v5 with: - python-version: '3.10' + python-version: '3.12.2' - name: Install dependencies with pip run: pip install --no-warn-script-location --user -r requirements.txt -c constraints.txt @@ -67,7 +67,7 @@ jobs: - name: Setup Python uses: actions/setup-python@v5 with: - python-version: '3.10' + python-version: '3.12.2' - name: Setup Graphviz uses: ts-graphviz/setup-graphviz@v2 From eb40f14e0f7f2417dd80f64a52a61d2324112329 Mon Sep 17 00:00:00 2001 From: nils Date: Sat, 10 May 2025 14:55:46 +0200 Subject: [PATCH 07/19] Adapt Readme to noble --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 3dffb339573..586d9c66df6 100644 --- a/README.md +++ b/README.md @@ -37,7 +37,7 @@ pip install -r requirements.txt -c constraints.txt ### Pinned versions -For development we currently use Jammy (Ubuntu 22.04) as our build platform. +For development we currently use Noble (Ubuntu 22.04) as our build platform. And all python versions are pinned in the constraints file to make sure that things are reproducible. To upgrade the system validate that things are working and then use `pip freeze > constraints.txt` to lock in the versions to upgrade. From 83f83974091764748ffcd7eacd67e242394a23a7 Mon Sep 17 00:00:00 2001 From: Nils-Christian Iseke <48475933+Nils-ChristianIseke@users.noreply.github.com> Date: Thu, 19 Jun 2025 16:32:57 +0200 Subject: [PATCH 08/19] Update README.md Co-authored-by: Christophe Bedard Signed-off-by: Nils-Christian Iseke <48475933+Nils-ChristianIseke@users.noreply.github.com> --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 586d9c66df6..27420b9c519 100644 --- a/README.md +++ b/README.md @@ -37,7 +37,7 @@ pip install -r requirements.txt -c constraints.txt ### Pinned versions -For development we currently use Noble (Ubuntu 22.04) as our build platform. +For development we currently use Noble (Ubuntu 24.04) as our build platform. And all python versions are pinned in the constraints file to make sure that things are reproducible. To upgrade the system validate that things are working and then use `pip freeze > constraints.txt` to lock in the versions to upgrade. From 631330842ccf0bdf1b9668ea0e6f7f94c8bbf3cc Mon Sep 17 00:00:00 2001 From: Nils-Christian Iseke <48475933+Nils-ChristianIseke@users.noreply.github.com> Date: Thu, 19 Jun 2025 16:34:32 +0200 Subject: [PATCH 09/19] Update requirements.txt Co-authored-by: Christophe Bedard Signed-off-by: Nils-Christian Iseke <48475933+Nils-ChristianIseke@users.noreply.github.com> --- requirements.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/requirements.txt b/requirements.txt index 8c9ac3f27a9..f952c4882fb 100644 --- a/requirements.txt +++ b/requirements.txt @@ -9,6 +9,6 @@ sphinx-lint sphinx-multiversion sphinx-rtd-theme sphinx-tabs -sphinxcontrib-mermaid sphinx-tamer sphinxcontrib-googleanalytics +sphinxcontrib-mermaid From b29c4c5048441cde6eb61a878be255347efd13ec Mon Sep 17 00:00:00 2001 From: Nils-Christian Iseke <48475933+Nils-ChristianIseke@users.noreply.github.com> Date: Thu, 19 Jun 2025 16:37:29 +0200 Subject: [PATCH 10/19] Use Python 3.12 Signed-off-by: Nils-Christian Iseke <48475933+Nils-ChristianIseke@users.noreply.github.com> --- .github/workflows/test.yml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 92a763623d3..622303411ac 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -12,7 +12,7 @@ jobs: - name: Setup Python uses: actions/setup-python@v5 with: - python-version: '3.12.2' + python-version: '3.12' - name: Install dependencies with pip run: pip install --no-warn-script-location --user -r requirements.txt -c constraints.txt @@ -32,7 +32,7 @@ jobs: - name: Setup Python uses: actions/setup-python@v5 with: - python-version: '3.12.2' + python-version: '3.12' - name: Install dependencies with pip run: pip install --no-warn-script-location --user -r requirements.txt -c constraints.txt @@ -49,7 +49,7 @@ jobs: - name: Setup Python uses: actions/setup-python@v5 with: - python-version: '3.12.2' + python-version: '3.12' - name: Install dependencies with pip run: pip install --no-warn-script-location --user -r requirements.txt -c constraints.txt @@ -67,7 +67,7 @@ jobs: - name: Setup Python uses: actions/setup-python@v5 with: - python-version: '3.12.2' + python-version: '3.12' - name: Setup Graphviz uses: ts-graphviz/setup-graphviz@v2 From f19afabcc2b192382ae54d7ccebeb3702c38e00d Mon Sep 17 00:00:00 2001 From: Nils-Christian Iseke <48475933+Nils-ChristianIseke@users.noreply.github.com> Date: Thu, 19 Jun 2025 16:41:48 +0200 Subject: [PATCH 11/19] Update devcontainer.json Signed-off-by: Nils-Christian Iseke <48475933+Nils-ChristianIseke@users.noreply.github.com> --- .devcontainer/devcontainer.json | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/.devcontainer/devcontainer.json b/.devcontainer/devcontainer.json index e512ea85535..3c1596db1c9 100644 --- a/.devcontainer/devcontainer.json +++ b/.devcontainer/devcontainer.json @@ -1,8 +1,7 @@ { "name": "ROS 2 Documentation", "build": { - "dockerfile": "../docker/image/Dockerfile", - "context": ".." + "dockerfile": "../docker/image/Dockerfile" }, "workspaceMount": "source=${localWorkspaceFolder},target=/tmp/doc_repository,type=bind", "workspaceFolder": "/tmp/doc_repository", From 18906abf4a608f50744f0e79dd82573ed7c2695d Mon Sep 17 00:00:00 2001 From: Nils-Christian Iseke <48475933+Nils-ChristianIseke@users.noreply.github.com> Date: Thu, 19 Jun 2025 16:43:06 +0200 Subject: [PATCH 12/19] Update devcontainer.json Signed-off-by: Nils-Christian Iseke <48475933+Nils-ChristianIseke@users.noreply.github.com> --- .devcontainer/devcontainer.json | 1 + 1 file changed, 1 insertion(+) diff --git a/.devcontainer/devcontainer.json b/.devcontainer/devcontainer.json index 3c1596db1c9..f8f35c4f99d 100644 --- a/.devcontainer/devcontainer.json +++ b/.devcontainer/devcontainer.json @@ -5,6 +5,7 @@ }, "workspaceMount": "source=${localWorkspaceFolder},target=/tmp/doc_repository,type=bind", "workspaceFolder": "/tmp/doc_repository", + "postCreateCommand": "pip3 install --no-warn-script-location --user -r requirements.txt -c constraints.txt", "features": { "ghcr.io/devcontainers/features/git:1": {} }, From 20d39a0927d208b0e40fcb9af20b01859c864da1 Mon Sep 17 00:00:00 2001 From: Nils-Christian Iseke <48475933+Nils-ChristianIseke@users.noreply.github.com> Date: Sat, 21 Jun 2025 11:55:51 +0200 Subject: [PATCH 13/19] Update Dockerfile Signed-off-by: Nils-Christian Iseke <48475933+Nils-ChristianIseke@users.noreply.github.com> --- docker/image/Dockerfile | 1 - 1 file changed, 1 deletion(-) diff --git a/docker/image/Dockerfile b/docker/image/Dockerfile index d8e8d1374d6..46fa99257e0 100644 --- a/docker/image/Dockerfile +++ b/docker/image/Dockerfile @@ -33,7 +33,6 @@ ENV HOME=/home/$user ENV PATH=/home/$user/.local/bin:$PATH WORKDIR /tmp/doc_repository - # https://build.ros.org/job/doc_ros2doc/ relies on "make multiversion" to build the official documentation. # Do not remove "make multiversion" from CMD, as it is the entrypoint for the container. CMD ["bash", "-c", "source /opt/ros2doc/bin/activate && make multiversion"] From 465cf8ef7690debee3896fd050bdc7f7f550118c Mon Sep 17 00:00:00 2001 From: Nils-Christian Iseke <48475933+Nils-ChristianIseke@users.noreply.github.com> Date: Sat, 21 Jun 2025 11:57:18 +0200 Subject: [PATCH 14/19] Update Dockerfile Signed-off-by: Nils-Christian Iseke <48475933+Nils-ChristianIseke@users.noreply.github.com> --- docker/image/Dockerfile | 1 - 1 file changed, 1 deletion(-) diff --git a/docker/image/Dockerfile b/docker/image/Dockerfile index 46fa99257e0..872be527000 100644 --- a/docker/image/Dockerfile +++ b/docker/image/Dockerfile @@ -40,5 +40,4 @@ RUN python3 -m venv /opt/ros2doc COPY requirements.txt constraints.txt . RUN . /opt/ros2doc/bin/activate && pip3 install -r requirements.txt -c constraints.txt -RUN echo "source /opt/ros2doc/bin/activate" >> /home/$user/.bashrc USER $user From 6570887537cd2da0a32bd228e6f97c50173f3626 Mon Sep 17 00:00:00 2001 From: Christophe Bedard Date: Mon, 6 Oct 2025 09:42:50 -0700 Subject: [PATCH 15/19] Bump constraints.txt and document how it was generated Signed-off-by: Christophe Bedard --- constraints.txt | 39 ++++++++++++++++----------------------- docker/image/Dockerfile | 10 ++++++++++ 2 files changed, 26 insertions(+), 23 deletions(-) diff --git a/constraints.txt b/constraints.txt index 1e3e88b3c80..56ae59259be 100644 --- a/constraints.txt +++ b/constraints.txt @@ -1,34 +1,27 @@ -alabaster==0.7.16 -atomicwrites==1.4.1 -attrs==25.3.0 +alabaster==1.0.0 babel==2.17.0 -certifi==2025.4.26 -charset-normalizer==3.4.2 -click==8.1.8 +certifi==2025.10.5 +charset-normalizer==3.4.3 +click==8.3.0 codespell==2.4.1 -doc8==1.1.2 +doc8==2.0.0 docutils==0.21.2 idna==3.10 imagesize==1.4.1 iniconfig==2.1.0 Jinja2==3.1.6 -MarkupSafe==3.0.2 -more-itertools==10.7.0 +MarkupSafe==3.0.3 packaging==25.0 -pbr==6.1.1 -pluggy==1.5.0 +pluggy==1.6.0 polib==1.2.0 -py==1.11.0 -Pygments==2.19.1 -pytest==8.3.5 -PyYAML==6.0.2 -regex==2024.11.6 -requests==2.32.3 +Pygments==2.19.2 +pytest==8.4.2 +PyYAML==6.0.3 +regex==2025.9.18 +requests==2.32.5 restructuredtext_lint==1.4.0 roman-numerals-py==3.1.0 -setuptools==80.3.1 -six==1.17.0 -snowballstemmer==3.0.0.1 +snowballstemmer==3.0.1 Sphinx==8.2.3 sphinx-copybutton==0.5.2 sphinx-lint==1.0.0 @@ -38,12 +31,12 @@ sphinx-tabs==3.4.7 sphinx_tamer==0.2.0 sphinxcontrib-applehelp==2.0.0 sphinxcontrib-devhelp==2.0.0 -sphinxcontrib-googleanalytics==0.4 +sphinxcontrib-googleanalytics==0.5 sphinxcontrib-htmlhelp==2.1.0 sphinxcontrib-jquery==4.1 sphinxcontrib-jsmath==1.0.1 sphinxcontrib-mermaid==1.0.0 sphinxcontrib-qthelp==2.0.0 sphinxcontrib-serializinghtml==2.0.0 -stevedore==5.4.1 -urllib3==2.4.0 +stevedore==5.5.0 +urllib3==2.5.0 diff --git a/docker/image/Dockerfile b/docker/image/Dockerfile index 872be527000..9323ce0865c 100644 --- a/docker/image/Dockerfile +++ b/docker/image/Dockerfile @@ -37,6 +37,16 @@ WORKDIR /tmp/doc_repository # Do not remove "make multiversion" from CMD, as it is the entrypoint for the container. CMD ["bash", "-c", "source /opt/ros2doc/bin/activate && make multiversion"] RUN python3 -m venv /opt/ros2doc +# constraints.txt was generated with: +# $ cd ros2_documentation +# $ docker run -v $PWD:/ros2_documentation -it ubuntu:24.04 +# (docker)$ cd /ros2_documentation +# (docker)$ apt update +# (docker)$ apt install -y python3-pip python3-venv +# (docker)$ python3 -m venv venv-constraints +# (docker)$ . ./venv-constraints/bin/activate +# (docker)$ pip3 install -U -r requirements.txt +# (docker)$ pip3 freeze > constraints.txt COPY requirements.txt constraints.txt . RUN . /opt/ros2doc/bin/activate && pip3 install -r requirements.txt -c constraints.txt From d65b06115e2f6acfb546d2c8885b1e721017785a Mon Sep 17 00:00:00 2001 From: Christophe Bedard Date: Mon, 6 Oct 2025 09:53:44 -0700 Subject: [PATCH 16/19] Document how to use the Dockerfile/image Signed-off-by: Christophe Bedard --- docker/image/Dockerfile | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/docker/image/Dockerfile b/docker/image/Dockerfile index 9323ce0865c..2b84384d4ed 100644 --- a/docker/image/Dockerfile +++ b/docker/image/Dockerfile @@ -1,7 +1,11 @@ # This dockerfile is expecting to be run with the following build command # (from the root of the git repository): # -# docker build -f docker/image/Dockerfile . +# $ docker build -f docker/image/Dockerfile . -t ros2_documentation +# +# Then, to use the image to build the docs: +# +# $ docker run --rm --user $(id -u):$(id -g) -v $(pwd):/tmp/doc_repository ros2_documentation FROM ubuntu:noble From b983b7902f7947973dad539f8808cd5be649a427 Mon Sep 17 00:00:00 2001 From: Christophe Bedard Date: Mon, 6 Oct 2025 12:19:17 -0700 Subject: [PATCH 17/19] Add trailing slash to destination path of COPY To resolve this error: Step 17/19 : COPY requirements.txt constraints.txt . When using COPY with more than one source file, the destination must be a directory and end with a / Signed-off-by: Christophe Bedard --- docker/image/Dockerfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docker/image/Dockerfile b/docker/image/Dockerfile index 2b84384d4ed..77ad39d09d2 100644 --- a/docker/image/Dockerfile +++ b/docker/image/Dockerfile @@ -51,7 +51,7 @@ RUN python3 -m venv /opt/ros2doc # (docker)$ . ./venv-constraints/bin/activate # (docker)$ pip3 install -U -r requirements.txt # (docker)$ pip3 freeze > constraints.txt -COPY requirements.txt constraints.txt . +COPY requirements.txt constraints.txt ./ RUN . /opt/ros2doc/bin/activate && pip3 install -r requirements.txt -c constraints.txt USER $user From 63bd2719162bf15c0d2f8adafd3a0e3539a94119 Mon Sep 17 00:00:00 2001 From: Christophe Bedard Date: Mon, 6 Oct 2025 17:14:25 -0700 Subject: [PATCH 18/19] Set Docker build context and update cmd in devcontainer.json Signed-off-by: Christophe Bedard --- .devcontainer/devcontainer.json | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/.devcontainer/devcontainer.json b/.devcontainer/devcontainer.json index f8f35c4f99d..56bc984bbcd 100644 --- a/.devcontainer/devcontainer.json +++ b/.devcontainer/devcontainer.json @@ -1,11 +1,12 @@ { "name": "ROS 2 Documentation", "build": { - "dockerfile": "../docker/image/Dockerfile" + "dockerfile": "../docker/image/Dockerfile", + "context": ".." }, "workspaceMount": "source=${localWorkspaceFolder},target=/tmp/doc_repository,type=bind", "workspaceFolder": "/tmp/doc_repository", - "postCreateCommand": "pip3 install --no-warn-script-location --user -r requirements.txt -c constraints.txt", + "postCreateCommand": ". /opt/ros2doc/bin/activate && pip3 install -r requirements.txt -c constraints.txt", "features": { "ghcr.io/devcontainers/features/git:1": {} }, From 2239c1f8de1f4b377fe9953ac61bccef018d86c3 Mon Sep 17 00:00:00 2001 From: Christophe Bedard Date: Tue, 7 Oct 2025 11:54:00 -0700 Subject: [PATCH 19/19] Switch from venv to --break-system-packages Signed-off-by: Christophe Bedard --- .devcontainer/devcontainer.json | 5 ++--- docker/image/Dockerfile | 18 +++++++----------- 2 files changed, 9 insertions(+), 14 deletions(-) diff --git a/.devcontainer/devcontainer.json b/.devcontainer/devcontainer.json index 56bc984bbcd..71da134d51a 100644 --- a/.devcontainer/devcontainer.json +++ b/.devcontainer/devcontainer.json @@ -1,12 +1,11 @@ { "name": "ROS 2 Documentation", "build": { - "dockerfile": "../docker/image/Dockerfile", - "context": ".." + "dockerfile": "../docker/image/Dockerfile" }, "workspaceMount": "source=${localWorkspaceFolder},target=/tmp/doc_repository,type=bind", "workspaceFolder": "/tmp/doc_repository", - "postCreateCommand": ". /opt/ros2doc/bin/activate && pip3 install -r requirements.txt -c constraints.txt", + "postCreateCommand": "pip3 install --no-warn-script-location --user --break-system-packages -r requirements.txt -c constraints.txt", "features": { "ghcr.io/devcontainers/features/git:1": {} }, diff --git a/docker/image/Dockerfile b/docker/image/Dockerfile index 77ad39d09d2..01899715893 100644 --- a/docker/image/Dockerfile +++ b/docker/image/Dockerfile @@ -1,11 +1,11 @@ # This dockerfile is expecting to be run with the following build command # (from the root of the git repository): # -# $ docker build -f docker/image/Dockerfile . -t ros2_documentation +# $ docker build -f docker/image/Dockerfile --build-arg user=$(id -un) --build-arg uid=$(id -u) -t ros2_documentation . # # Then, to use the image to build the docs: # -# $ docker run --rm --user $(id -u):$(id -g) -v $(pwd):/tmp/doc_repository ros2_documentation +# $ docker run --rm -v $(pwd):/tmp/doc_repository ros2_documentation FROM ubuntu:noble @@ -24,8 +24,7 @@ RUN apt-get update && \ graphviz \ locales \ make \ - python3-pip \ - python3-venv && \ + python3-pip && \ rm -rf /var/lib/apt/lists/* RUN locale-gen en_US en_US.UTF-8 @@ -37,11 +36,11 @@ ENV HOME=/home/$user ENV PATH=/home/$user/.local/bin:$PATH WORKDIR /tmp/doc_repository +USER $user + # https://build.ros.org/job/doc_ros2doc/ relies on "make multiversion" to build the official documentation. # Do not remove "make multiversion" from CMD, as it is the entrypoint for the container. -CMD ["bash", "-c", "source /opt/ros2doc/bin/activate && make multiversion"] -RUN python3 -m venv /opt/ros2doc -# constraints.txt was generated with: +# The constraints.txt file was generated with: # $ cd ros2_documentation # $ docker run -v $PWD:/ros2_documentation -it ubuntu:24.04 # (docker)$ cd /ros2_documentation @@ -51,7 +50,4 @@ RUN python3 -m venv /opt/ros2doc # (docker)$ . ./venv-constraints/bin/activate # (docker)$ pip3 install -U -r requirements.txt # (docker)$ pip3 freeze > constraints.txt -COPY requirements.txt constraints.txt ./ -RUN . /opt/ros2doc/bin/activate && pip3 install -r requirements.txt -c constraints.txt - -USER $user +CMD ["bash", "-c", "pip3 install --no-warn-script-location --user --break-system-packages -r requirements.txt -c constraints.txt && make multiversion"]