From e479d5030b5c4b611f6c2df2014b8e4d0afa77c5 Mon Sep 17 00:00:00 2001 From: Paul Makles Date: Mon, 6 Nov 2023 12:57:31 +0000 Subject: [PATCH 01/15] chore: configuration required for deploying docs --- documentation/package-lock.json | 6 ++++++ documentation/web/docusaurus.config.js | 11 ++++++----- 2 files changed, 12 insertions(+), 5 deletions(-) create mode 100644 documentation/package-lock.json diff --git a/documentation/package-lock.json b/documentation/package-lock.json new file mode 100644 index 000000000..74392f8ab --- /dev/null +++ b/documentation/package-lock.json @@ -0,0 +1,6 @@ +{ + "name": "documentation", + "lockfileVersion": 3, + "requires": true, + "packages": {} +} diff --git a/documentation/web/docusaurus.config.js b/documentation/web/docusaurus.config.js index 850441567..edffea3f0 100644 --- a/documentation/web/docusaurus.config.js +++ b/documentation/web/docusaurus.config.js @@ -10,15 +10,16 @@ const config = { tagline: "LASR Web Documentation", // Set the production url of your site here - url: "https://your-docusaurus-test-site.com", + url: "https://lasr-at-home.github.io/", // Set the // pathname under which your site is served // For GitHub pages deployment, it is often '//' - baseUrl: "/", + baseUrl: "/docs/", // GitHub pages deployment config. // If you aren't using GitHub pages, you don't need these. - organizationName: "facebook", // Usually your GitHub org/user name. - projectName: "docusaurus", // Usually your repo name. + organizationName: "lasr-at-home", // Usually your GitHub org/user name. + projectName: "docs", // Usually your repo name. + trailingSlash: false, onBrokenLinks: "throw", onBrokenMarkdownLinks: "warn", @@ -40,7 +41,7 @@ const config = { routeBasePath: "/", sidebarPath: require.resolve("./sidebars.js"), editUrl: - 'https://github.com/lasr-at-home/base/blob/main/common/document_lasr/web', + "https://github.com/lasr-at-home/base/blob/main/common/document_lasr/web", }, }), ], From e09203982dfe5e15c79d425f1422c02bf15c0917 Mon Sep 17 00:00:00 2001 From: Paul Makles Date: Sat, 11 Nov 2023 11:49:39 +0000 Subject: [PATCH 02/15] docs: update container documentation --- documentation/web/docs/guides/container.md | 138 +++++++++++--------- documentation/web/docs/guides/virtualenv.md | 13 +- 2 files changed, 83 insertions(+), 68 deletions(-) diff --git a/documentation/web/docs/guides/container.md b/documentation/web/docs/guides/container.md index c117b3b44..c10938ad5 100644 --- a/documentation/web/docs/guides/container.md +++ b/documentation/web/docs/guides/container.md @@ -10,14 +10,14 @@ To build the container, ensure you have a copy of the TIAGo Melodic container an git clone https://github.com/lasr-at-home/containers.git ~/containers cd ~/containers -# copy base container to tiago_pal_melodic.sif to current directory +# copy TIAGo container to tiago_noetic_opensource.sif to current directory sudo apptainer build robocup_container.sif robocup_container.def ``` -:::note +:::danger -This also works with the open source container. +This likely doesn't work with the proprietary PAL container for the time being. ::: @@ -29,24 +29,33 @@ You can save a lot of time debugging build errors by redirecting all output to a rm build.log 2>/dev/null; sudo apptainer build robocup_container.sif robocup_container.def 2>&1 | tee build.log ``` +### Checking when container was built + +You can quickly check what container you're using by running the following: + +```bash +$ cat /.build_info +RoboCup Container (Version: 0001, Bootstrapped from: oss, Build date: 09-11-2023, Build took: 0 days 0 hours 8 minutes 36 seconds) +``` + ### Testing new dependencies -If you'd like to test new dependencies without rebuilding the entire container, you can use the `stage2` definition file. +If you'd like to test new dependencies without rebuilding the entire container, you can use the `test_container_template` definition file. After building the RoboCup container, you can then run: ```bash -sudo apptainer build stage2.sif stage2.def +sudo apptainer build test_container_template.sif test_container_template.def # .. with log: -rm build.log 2>/dev/null; sudo apptainer build stage2.sif stage2.def 2>&1 | tee build.log +rm build.log 2>/dev/null; sudo apptainer build test_container_template.sif test_container_template.def 2>&1 | tee build.log ``` ## Container This section goes over how the container is built. -We use the TIAGo Melodic container as a base which uses Ubuntu 18.04 as a base itself. +We use the TIAGo Noetic container as a base which uses Ubuntu 21.04 as a base itself. ### Install packages from repositories @@ -54,53 +63,32 @@ We use the TIAGo Melodic container as a base which uses Ubuntu 18.04 as a base i 2. Install additional apt packages - | Package | Description | - |:-:|---| - | ros-melodic-audio-common | provides various ROS packages for capturing and playing back audio | - | python3-numpy | numpy package for Python 3.6 | - | python3-opencv | cv2 package for Python 3.6 | - | libasound-dev
libportaudio2
libportaudiocpp0
portaudio19-dev | libraries required to build PyAudio wheel | - | ffmpeg | record, convert, and stream audio / video | + | Package | Description | + | :----------------------------------------------------------------------: | ------------------------------------------------------------------ | + | ros-melodic-audio-common | provides various ROS packages for capturing and playing back audio | + | python3-numpy | numpy package for Python 3.6 | + | python3-opencv | cv2 package for Python 3.6 | + | libasound-dev
libportaudio2
libportaudiocpp0
portaudio19-dev | libraries required to build PyAudio wheel | + | ffmpeg | record, convert, and stream audio / video | + | python3-testresources
python3-empy | dependencies for catkin_virtualenv | + | ca-certificates
curl
gnupg | generic requirements required by most things | + | bc | arithmetic for the terminal, used in container build script | - :::caution +:::caution - Software packages on PAL repositories are quite old, there are situations where it is advisable to install software through alternative means. +Software packages on PAL repositories are quite old, there are situations where it is advisable to install software through alternative means. - ::: +::: -3. Install Node.js 16 +3. Install Node.js 20 (LTS as of 09-11-2023) All available distributions are [listed here](https://github.com/nodesource/distributions). - :::caution - - Node.js 16 is the latest that may be installed for Ubuntu 18.04. Their build system is currently broken for Node.js 18 and later. When upgrading to noetic, Node.js should be pinned to LTS. - - ::: - -4. Install additional Python 3.6 packages - - | Package | Version | Description | - |:-:|:-:|---| - | rosnumpy | 0.0.5.2 | conversion helper between ROS and numpy † | - | scipy | 1.5.4 | mathematics library | - | black | 22.8.0 | Python code formatter | - | scikit-build | 0.16.7 | build system for CPython C/C++/Fortran/Cython extensions using CMake | - | scikit-learn | 0.24.2 | machine learning and data mining | - | nvidia-ml-py3 | 7.352.0 | bindings for NVIDIA Management Library | - | torch | 1.9.1+cpu | neural networks | - | torchvision | 0.10.1+cpu | torch extension for vision | - | torchaudio | 0.9.1 | torch extension for audio | - - † This library does not work on Python 3.10, ROS packages upgrading to newer Python versions must find a substitute. - - ‡ Installed with CPU support only, [see this page for more information](https://pytorch.org/get-started/previous-versions/#linux-and-windows-17). - -5. Create a temporary `/deps` folder which will be used to build additional dependencies in. +4. Create a temporary `/deps` folder which will be used to build additional dependencies in. -### Install Python 3.10 from source +### Install Python from source -We install Python 3.10 to take advantage of modern Python libraries which no longer support Python 3.6, we can selectively choose to use it for some of our packages through the use of [catkin virtualenv](/guides/virtualenv). This build step is derived from the [Python documentation](https://devguide.python.org/getting-started/setup-building/). +We install Python 3.9 and 3.10 to take advantage of modern Python libraries which no longer support Python 3.8, we can selectively choose to use it for some of our packages through the use of [catkin virtualenv](/guides/virtualenv). This build step is derived from the [Python documentation](https://devguide.python.org/getting-started/setup-building/). 1. Install dependencies required for build. @@ -118,13 +106,13 @@ We install Python 3.10 to take advantage of modern Python libraries which no lon 4. Install additional global packages. - | Package | Version | Description | - |:-:|:-:|---| - | pyyaml | 6.0.1 | provides yaml package (required by rospy) | - | rospkg | 1.5.0 | environment agnostic ROS package utilities (required by rospy) | - | pip | 23.2.1 | Python package manager | - | setuptools | 68.0.0 | Python build tools | - | wheel | 0.41.1 | Python build tools | + | Package | Version | Description | + | :--------: | :-----: | -------------------------------------------------------------- | + | pyyaml | 6.0.1 | provides yaml package (required by rospy) | + | rospkg | 1.5.0 | environment agnostic ROS package utilities (required by rospy) | + | pip | 23.2.1 | Python package manager | + | setuptools | 68.0.0 | Python build tools | + | wheel | 0.41.1 | Python build tools | :::note @@ -138,6 +126,8 @@ apt install software-properties-common -y && apt-add-repository ppa:deadsnakes/p && apt update && apt install python3.8 python3.8-dev python3-setuptools [.. etc] ``` +NB. update our definition to use this if Ubuntu 21.04 is still supported. + ::: :::warning @@ -150,16 +140,32 @@ Python 3.11+ is incompatible with rospy (Melodic & Noetic) 1. Reconfigure Python symlinks - - `/usr/bin/python` is made to point to Python 2.7 - - `/usr/local/bin/python3` is removed to restore Python 3.6 for `python3` + - `/usr/bin/python` is made to point to Python 3.8 + - `/usr/local/bin/python3` is removed to restore Python 3.8 for `python3` + +2. ~~Install additional Python 3.6 packages~~ + + :::caution -2. Force catkin build tool to use Python 3.10 + As Python 3.6 is no longer available in the base container, this has been momentarily removed. - This step is necessary to get `catkin_virtualenv` to work properly. + ::: - We create a folder `/path/python3.10` which contains a single symlink for `python3` which we can then prepend to the PATH when invoking catkin. + | Package | Version | Description | + | :-----------: | :--------: | -------------------------------------------------------------------- | + | rosnumpy | 0.0.5.2 | conversion helper between ROS and numpy † | + | scipy | 1.5.4 | mathematics library | + | black | 22.8.0 | Python code formatter | + | scikit-build | 0.16.7 | build system for CPython C/C++/Fortran/Cython extensions using CMake | + | scikit-learn | 0.24.2 | machine learning and data mining | + | nvidia-ml-py3 | 7.352.0 | bindings for NVIDIA Management Library | + | torch | 1.9.1+cpu | neural networks | + | torchvision | 0.10.1+cpu | torch extension for vision | + | torchaudio | 0.9.1 | torch extension for audio | - We only want to override `catkin build` so this should be sufficient. + † This library does not work on Python 3.10, ROS packages upgrading to newer Python versions must find a substitute. + + ‡ Installed with CPU support only, [see this page for more information](https://pytorch.org/get-started/previous-versions/#linux-and-windows-17). ### Create overlay workspace for additional ROS packages @@ -167,9 +173,10 @@ Python 3.11+ is incompatible with rospy (Melodic & Noetic) 2. Clone ROS packages we want to build from source - | Package | Description | Source | - |:-:|---|---| - | catkin_virtualenv | Bundle python requirements in a catkin package via virtualenv | [locusrobotics/catkin_virtualenv](https://github.com/locusrobotics/catkin_virtualenv) @ `4af9970` | + | Package | Description | Source | + | :-----------------: | --------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------- | + | catkin_virtualenv | Bundle python requirements in a catkin package via virtualenv | [locusrobotics/catkin_virtualenv](https://github.com/locusrobotics/catkin_virtualenv) @ `4af9970` | + | video_stream_opencv | Package providing various utilities concerning capturing and playing videos | [ros-drivers/video_stream_opencv](https://github.com/ros-drivers/video_stream_opencv) @ `65949bd` | 3. Build the workspace @@ -187,4 +194,11 @@ Python 3.11+ is incompatible with rospy (Melodic & Noetic) 1. Remove the build folder `/deps` -2. Remove extraneous environment variables +2. Generate build information for future reference + + ```bash + $ cat /.build_info + RoboCup Container (Version: 0001, Bootstrapped from: oss, Build date: 09-11-2023, Build took: 0 days 0 hours 8 minutes 36 seconds) + ``` + +3. Remove extraneous environment variables diff --git a/documentation/web/docs/guides/virtualenv.md b/documentation/web/docs/guides/virtualenv.md index 6d3876378..6246eb8c5 100644 --- a/documentation/web/docs/guides/virtualenv.md +++ b/documentation/web/docs/guides/virtualenv.md @@ -15,8 +15,8 @@ Find the line in the definition file where Python dependencies are declared: ```diff # Additional Python packages + # pyyaml: yaml library -- python3.6 -m pip install rosnumpy==0.0.5.2 scipy==1.5.4 -+ python3.6 -m pip install rosnumpy==0.0.5.2 scipy==1.5.4 pyyaml==6.0.1 +- python3.8 -m pip install rosnumpy==0.0.5.2 scipy==1.5.4 ++ python3.8 -m pip install rosnumpy==0.0.5.2 scipy==1.5.4 pyyaml==6.0.1 ``` Then update the container maintenance document accordingly, you can do this by going to [Container Maintenance](/guides/container) and then clicking edit page at the bottom. @@ -25,7 +25,7 @@ Then update the container maintenance document accordingly, you can do this by g :::caution -Using catkin_virtualenv requires that catkin itself uses Python 3.7 or later during the build process, this is already managed for you by the container however may prove to be an issue if building a new container. +Using catkin_virtualenv requires that catkin itself uses Python 3.8 or later during the build process, this is already managed for you by the container however may prove to be an issue if building a new container. ::: @@ -33,8 +33,9 @@ Using catkin_virtualenv requires that catkin itself uses Python 3.7 or later dur The following Python versions are available in the container: -- Python 2.7 -- Python 3.6 +- Python 2.7 (do not use) +- Python 3.8 (from TIAGo container) +- Python 3.9 - Python 3.10 (recommended) ::: @@ -159,6 +160,6 @@ If you want to update packages or install new packages, delete the `requirements :::tip -This also integrates with the `document_lasr` package, you can regenerate your README to include / update your Python dependencies. +This also integrates with the `documentation` package, you can regenerate your README to include / update your Python dependencies. ::: From 37bc24c1dc224347d168c2e0777afdfc2a528b48 Mon Sep 17 00:00:00 2001 From: Paul Makles Date: Sat, 11 Nov 2023 12:06:41 +0000 Subject: [PATCH 03/15] ci: first draft of documentation build through actions --- .github/workflows/documentation.yml | 40 +++++++++++++++++++++++++++++ documentation/CMakeLists.txt | 1 + documentation/scripts/build.py | 7 +++++ 3 files changed, 48 insertions(+) create mode 100644 .github/workflows/documentation.yml create mode 100755 documentation/scripts/build.py diff --git a/.github/workflows/documentation.yml b/.github/workflows/documentation.yml new file mode 100644 index 000000000..d1a1f881b --- /dev/null +++ b/.github/workflows/documentation.yml @@ -0,0 +1,40 @@ +name: Build & Deploy Documentation + +on: + push: + pull_request: + branches: [main] + +jobs: + build: + runs-on: ubuntu-latest + + container: + image: ubuntu:jammy + + steps: + - name: Checkout repository and submodules + uses: actions/checkout@v3 + with: + path: "src/lasr-base" + submodules: recursive + + - name: Use Node.js + uses: actions/setup-node@v3 + with: + node-version: 20 + + - uses: ros-tooling/setup-ros@v0.7 + with: + required-ros-distributions: noetic + + - run: "source /opt/ros/noetic/setup.bash && rosnode --help" + + - name: Build documentation package + run: catkin build documentation + + - run: "source devel/setup.bash" + + - name: Build documentation + run: rosrun documentation build.py +# if: github.event_name != 'pull_request' && github.ref_name == 'master' diff --git a/documentation/CMakeLists.txt b/documentation/CMakeLists.txt index bbdfb8354..8dbcc7c7f 100644 --- a/documentation/CMakeLists.txt +++ b/documentation/CMakeLists.txt @@ -158,6 +158,7 @@ include_directories( catkin_install_python(PROGRAMS scripts/dev.py scripts/view.py + scripts/build.py scripts/generate_readme.py scripts/generate_all_lasr.py DESTINATION ${CATKIN_PACKAGE_BIN_DESTINATION} diff --git a/documentation/scripts/build.py b/documentation/scripts/build.py new file mode 100755 index 000000000..3d61ee75c --- /dev/null +++ b/documentation/scripts/build.py @@ -0,0 +1,7 @@ +#!/usr/bin/env python3 +import document_lasr +import subprocess + +document_lasr.configure_web() +subprocess.call("npm i", shell=True) +subprocess.call("npm run build", shell=True) From 17db0275d67ad39043f26bae9ea0e28c93a13364 Mon Sep 17 00:00:00 2001 From: Paul Makles Date: Sat, 11 Nov 2023 12:07:23 +0000 Subject: [PATCH 04/15] ci: remove submodules --- .github/workflows/documentation.yml | 1 - 1 file changed, 1 deletion(-) diff --git a/.github/workflows/documentation.yml b/.github/workflows/documentation.yml index d1a1f881b..1a8e83caa 100644 --- a/.github/workflows/documentation.yml +++ b/.github/workflows/documentation.yml @@ -17,7 +17,6 @@ jobs: uses: actions/checkout@v3 with: path: "src/lasr-base" - submodules: recursive - name: Use Node.js uses: actions/setup-node@v3 From 6b32f0510a0a94159fcd8402670298c6e199a499 Mon Sep 17 00:00:00 2001 From: Paul Makles Date: Sat, 11 Nov 2023 12:11:06 +0000 Subject: [PATCH 05/15] ci: use ubuntu 20.04 --- .github/workflows/documentation.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/documentation.yml b/.github/workflows/documentation.yml index 1a8e83caa..e97b9344a 100644 --- a/.github/workflows/documentation.yml +++ b/.github/workflows/documentation.yml @@ -10,7 +10,7 @@ jobs: runs-on: ubuntu-latest container: - image: ubuntu:jammy + image: ubuntu:hirsute steps: - name: Checkout repository and submodules From d17bca16e5011bbadcbf09fa3dd7530b1c94c827 Mon Sep 17 00:00:00 2001 From: Paul Makles Date: Sat, 11 Nov 2023 12:12:35 +0000 Subject: [PATCH 06/15] ci: try using ros:noetic container image --- .github/workflows/documentation.yml | 18 ++++++------------ 1 file changed, 6 insertions(+), 12 deletions(-) diff --git a/.github/workflows/documentation.yml b/.github/workflows/documentation.yml index e97b9344a..fbf5a6c14 100644 --- a/.github/workflows/documentation.yml +++ b/.github/workflows/documentation.yml @@ -10,7 +10,7 @@ jobs: runs-on: ubuntu-latest container: - image: ubuntu:hirsute + image: ros:noetic steps: - name: Checkout repository and submodules @@ -18,22 +18,16 @@ jobs: with: path: "src/lasr-base" - - name: Use Node.js - uses: actions/setup-node@v3 - with: - node-version: 20 - - - uses: ros-tooling/setup-ros@v0.7 - with: - required-ros-distributions: noetic - - - run: "source /opt/ros/noetic/setup.bash && rosnode --help" - - name: Build documentation package run: catkin build documentation - run: "source devel/setup.bash" + - name: Use Node.js + uses: actions/setup-node@v3 + with: + node-version: 20 + - name: Build documentation run: rosrun documentation build.py # if: github.event_name != 'pull_request' && github.ref_name == 'master' From 883c6ce200ed276f36cf52f59133f1febbea72e7 Mon Sep 17 00:00:00 2001 From: Paul Makles Date: Sat, 11 Nov 2023 12:15:25 +0000 Subject: [PATCH 07/15] ci: catkin tools isn't available in container --- .github/workflows/documentation.yml | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/.github/workflows/documentation.yml b/.github/workflows/documentation.yml index fbf5a6c14..fc52af38e 100644 --- a/.github/workflows/documentation.yml +++ b/.github/workflows/documentation.yml @@ -18,8 +18,10 @@ jobs: with: path: "src/lasr-base" + - run: "source /opt/ros/noetic/setup.bash && rosnode --help" + - name: Build documentation package - run: catkin build documentation + run: catkin_make --pkg documentation - run: "source devel/setup.bash" From a844f529d84a91dc727b95569cde99da8423c109 Mon Sep 17 00:00:00 2001 From: Paul Makles Date: Sat, 11 Nov 2023 12:16:40 +0000 Subject: [PATCH 08/15] ci: remove extranous source line --- .github/workflows/documentation.yml | 2 -- 1 file changed, 2 deletions(-) diff --git a/.github/workflows/documentation.yml b/.github/workflows/documentation.yml index fc52af38e..736e910c3 100644 --- a/.github/workflows/documentation.yml +++ b/.github/workflows/documentation.yml @@ -18,8 +18,6 @@ jobs: with: path: "src/lasr-base" - - run: "source /opt/ros/noetic/setup.bash && rosnode --help" - - name: Build documentation package run: catkin_make --pkg documentation From 4eac5b354852ebf86a17e0bf31488463ab4483f1 Mon Sep 17 00:00:00 2001 From: Paul Makles Date: Sat, 11 Nov 2023 12:22:29 +0000 Subject: [PATCH 09/15] ci: try the one-liner ROS installer --- .github/workflows/documentation.yml | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/.github/workflows/documentation.yml b/.github/workflows/documentation.yml index 736e910c3..db52e6925 100644 --- a/.github/workflows/documentation.yml +++ b/.github/workflows/documentation.yml @@ -7,10 +7,7 @@ on: jobs: build: - runs-on: ubuntu-latest - - container: - image: ros:noetic + runs-on: ubuntu-20.04 steps: - name: Checkout repository and submodules @@ -18,6 +15,12 @@ jobs: with: path: "src/lasr-base" + - name: Install ROS + run: | + wget -c https://raw.githubusercontent.com/qboticslabs/ros_install_noetic/master/ros_install_noetic.sh && chmod +x ./ros_install_noetic.sh && ./ros_install_noetic.sh + + - run: "source /opt/ros/noetic/setup.bash" + - name: Build documentation package run: catkin_make --pkg documentation From b39450e6ed3a2845672f1ae395adbfa577b3f4fd Mon Sep 17 00:00:00 2001 From: Paul Makles Date: Sat, 11 Nov 2023 12:27:34 +0000 Subject: [PATCH 10/15] ci: use the official ROS noetic installation guide --- .github/workflows/documentation.yml | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-) diff --git a/.github/workflows/documentation.yml b/.github/workflows/documentation.yml index db52e6925..434ef054f 100644 --- a/.github/workflows/documentation.yml +++ b/.github/workflows/documentation.yml @@ -15,9 +15,21 @@ jobs: with: path: "src/lasr-base" - - name: Install ROS + - name: Install ROS Noetic run: | - wget -c https://raw.githubusercontent.com/qboticslabs/ros_install_noetic/master/ros_install_noetic.sh && chmod +x ./ros_install_noetic.sh && ./ros_install_noetic.sh + sudo add-apt-repository universe + sudo add-apt-repository restricted + sudo add-apt-repository multiverse + + sudo apt update + + sudo sh -c 'echo "deb http://packages.ros.org/ros/ubuntu $(lsb_release -sc) main" > /etc/apt/sources.list.d/ros-latest.list' + + sudo apt install curl # if you haven't already installed curl + curl -s https://raw.githubusercontent.com/ros/rosdistro/master/ros.asc | sudo apt-key add - + + sudo apt update + sudo apt install ros-noetic-ros-base - run: "source /opt/ros/noetic/setup.bash" From 537de20018d7a38d9f1551f45f269ff7a1a44bab Mon Sep 17 00:00:00 2001 From: Paul Makles Date: Sat, 11 Nov 2023 12:32:02 +0000 Subject: [PATCH 11/15] ci: install catkin tools --- .github/workflows/documentation.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/documentation.yml b/.github/workflows/documentation.yml index 434ef054f..33db50498 100644 --- a/.github/workflows/documentation.yml +++ b/.github/workflows/documentation.yml @@ -29,12 +29,12 @@ jobs: curl -s https://raw.githubusercontent.com/ros/rosdistro/master/ros.asc | sudo apt-key add - sudo apt update - sudo apt install ros-noetic-ros-base + sudo apt install ros-noetic-ros-base python3-catkin-tools - run: "source /opt/ros/noetic/setup.bash" - name: Build documentation package - run: catkin_make --pkg documentation + run: catkin build documentation - run: "source devel/setup.bash" From 3ca6ccd9d1628b1798e1360332a403cb6f3d3aa8 Mon Sep 17 00:00:00 2001 From: Paul Makles Date: Sat, 11 Nov 2023 12:34:35 +0000 Subject: [PATCH 12/15] ci: try sourcing before commands --- .github/workflows/documentation.yml | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/.github/workflows/documentation.yml b/.github/workflows/documentation.yml index 33db50498..b290fad65 100644 --- a/.github/workflows/documentation.yml +++ b/.github/workflows/documentation.yml @@ -31,12 +31,10 @@ jobs: sudo apt update sudo apt install ros-noetic-ros-base python3-catkin-tools - - run: "source /opt/ros/noetic/setup.bash" - - name: Build documentation package - run: catkin build documentation - - - run: "source devel/setup.bash" + run: | + source /opt/ros/noetic/setup.bash + catkin build documentation - name: Use Node.js uses: actions/setup-node@v3 @@ -44,5 +42,9 @@ jobs: node-version: 20 - name: Build documentation - run: rosrun documentation build.py + run: | + source /opt/ros/noetic/setup.bash + source devel/setup.bash + rosrun documentation build.py + # if: github.event_name != 'pull_request' && github.ref_name == 'master' From eb804b8e1568603656ea24b4dc547195e77cd6d9 Mon Sep 17 00:00:00 2001 From: Paul Makles Date: Sat, 11 Nov 2023 12:40:41 +0000 Subject: [PATCH 13/15] ci: deploy to github pages (no stage check yet) --- .github/workflows/documentation.yml | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/.github/workflows/documentation.yml b/.github/workflows/documentation.yml index b290fad65..04811a2ee 100644 --- a/.github/workflows/documentation.yml +++ b/.github/workflows/documentation.yml @@ -47,4 +47,10 @@ jobs: source devel/setup.bash rosrun documentation build.py + - name: Deploy to GitHub Pages + uses: peaceiris/actions-gh-pages@v3 + with: + github_token: ${{ secrets.GITHUB_TOKEN }} + publish_dir: ./src/lasr-base/documentation/web/build + external_repository: lasr-at-home/docs # if: github.event_name != 'pull_request' && github.ref_name == 'master' From d79966446626b33a13d157bb474d263e4ddf8e95 Mon Sep 17 00:00:00 2001 From: Paul Makles Date: Sat, 11 Nov 2023 12:46:05 +0000 Subject: [PATCH 14/15] ci: use deploy key --- .github/workflows/documentation.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/documentation.yml b/.github/workflows/documentation.yml index 04811a2ee..641cb8289 100644 --- a/.github/workflows/documentation.yml +++ b/.github/workflows/documentation.yml @@ -50,7 +50,7 @@ jobs: - name: Deploy to GitHub Pages uses: peaceiris/actions-gh-pages@v3 with: - github_token: ${{ secrets.GITHUB_TOKEN }} + deploy_key: ${{ secrets.DOCS_DEPLOY_KEY }} publish_dir: ./src/lasr-base/documentation/web/build external_repository: lasr-at-home/docs # if: github.event_name != 'pull_request' && github.ref_name == 'master' From 17ac2d619f7d6c177763eaa016bd6a4070d773ab Mon Sep 17 00:00:00 2001 From: Paul Makles Date: Sat, 11 Nov 2023 12:52:34 +0000 Subject: [PATCH 15/15] ci: only deploy if on main --- .github/workflows/documentation.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/documentation.yml b/.github/workflows/documentation.yml index 641cb8289..4c38eb089 100644 --- a/.github/workflows/documentation.yml +++ b/.github/workflows/documentation.yml @@ -49,8 +49,8 @@ jobs: - name: Deploy to GitHub Pages uses: peaceiris/actions-gh-pages@v3 + if: github.event_name != 'pull_request' && github.ref_name == 'main' with: deploy_key: ${{ secrets.DOCS_DEPLOY_KEY }} publish_dir: ./src/lasr-base/documentation/web/build external_repository: lasr-at-home/docs -# if: github.event_name != 'pull_request' && github.ref_name == 'master'