From 0a91ce32cb22f28a25d6784bfd5e812d868d2aad Mon Sep 17 00:00:00 2001 From: haixuanTao Date: Fri, 27 Sep 2024 17:54:52 +0200 Subject: [PATCH 1/6] CI: Fix Ubuntu 22 error in ROS2 --- .github/workflows/ci.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index d3cba5b90..0be3897be 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -157,7 +157,7 @@ jobs: # ROS2 bridge examples ros2-bridge-examples: name: "ROS2 Bridge Examples" - runs-on: ubuntu-latest + runs-on: ubuntu-22.04 timeout-minutes: 45 steps: - uses: actions/checkout@v3 From ee45beb61bec6278541d4fdd62f83f430ec4d5b4 Mon Sep 17 00:00:00 2001 From: haixuanTao Date: Fri, 27 Sep 2024 18:19:57 +0200 Subject: [PATCH 2/6] Replace extract with downcast for ros2-beidge --- .../extensions/ros2-bridge/python/src/typed/mod.rs | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/libraries/extensions/ros2-bridge/python/src/typed/mod.rs b/libraries/extensions/ros2-bridge/python/src/typed/mod.rs index 2b841589e..e3b4133df 100644 --- a/libraries/extensions/ros2-bridge/python/src/typed/mod.rs +++ b/libraries/extensions/ros2-bridge/python/src/typed/mod.rs @@ -36,13 +36,15 @@ mod tests { use arrow::pyarrow::FromPyArrow; use arrow::pyarrow::ToPyArrow; + use eyre::eyre; use pyo3::types::IntoPyDict; use pyo3::types::PyAnyMethods; use pyo3::types::PyDict; use pyo3::types::PyList; + use pyo3::types::PyListMethods; use pyo3::types::PyModule; use pyo3::types::PyTuple; - use pyo3::PyNativeType; + use pyo3::Python; use serde::de::DeserializeSeed; use serde::Serialize; @@ -71,9 +73,14 @@ mod tests { let my_module = PyModule::import_bound(py, "test_utils")?; - let arrays: &PyList = my_module.getattr("TEST_ARRAYS")?.extract()?; + let arrays = my_module.getattr("TEST_ARRAYS")?; + let arrays = arrays + .downcast::() + .map_err(|err| eyre!("Could not downcast PyAny. Err: {}", err))?; for array_wrapper in arrays.iter() { - let arrays: &PyTuple = array_wrapper.extract()?; + let arrays = array_wrapper.downcast::().map_err(|err| { + eyre!("Could not downcast expected tuple test array. Err: {}", err) + })?; let package_name: String = arrays.get_item(0)?.extract()?; let message_name: String = arrays.get_item(1)?.extract()?; println!("Checking {}::{}", package_name, message_name); From af6cceaf72637f12483084e3c69da8af98abe61b Mon Sep 17 00:00:00 2001 From: haixuanTao Date: Sat, 28 Sep 2024 10:10:04 +0200 Subject: [PATCH 3/6] Fix CI not enough storage by using the CLI to run python example --- .github/workflows/ci.yml | 45 ++++++++++++++++++---------------------- 1 file changed, 20 insertions(+), 25 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 0be3897be..857ca0c8e 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -73,7 +73,7 @@ jobs: name: "Examples" strategy: matrix: - platform: [ubuntu-latest, macos-latest, windows-latest] + platform: [ubuntu-22.04, macos-latest, windows-latest] fail-fast: false runs-on: ${{ matrix.platform }} timeout-minutes: 60 @@ -133,27 +133,6 @@ jobs: if: runner.os == 'Linux' run: cargo run --example rust-dataflow -- dataflow_socket.yml - # python examples - - uses: actions/setup-python@v2 - if: runner.os != 'Windows' - with: - python-version: "3.8" - - uses: actions/setup-python@v2 - if: runner.os == 'Windows' - with: - python-version: "3.10" - - name: "Python Dataflow example" - run: cargo run --example python-dataflow - - uses: conda-incubator/setup-miniconda@v3 - with: - auto-activate-base: true - activate-environment: "" - - name: "Python Operator Dataflow example" - shell: bash -l {0} - run: | - conda deactivate - cargo run --example python-operator-dataflow - # ROS2 bridge examples ros2-bridge-examples: name: "ROS2 Bridge Examples" @@ -270,7 +249,7 @@ jobs: with: # this might remove tools that are actually needed, # if set to "true" but frees about 6 GB - tool-cache: false + tool-cache: true # all of these default to true, but feel free to set to # "false" if necessary for your workflow @@ -279,7 +258,7 @@ jobs: haskell: true large-packages: false docker-images: true - swap-storage: false + swap-storage: true - uses: Swatinem/rust-cache@v2 with: cache-provider: buildjet @@ -338,11 +317,27 @@ jobs: dora start dataflow.yml --name ci-python-test --detach sleep 10 dora stop --name ci-python-test --grace-duration 5s - dora build ../examples/python-dataflow/dataflow_dynamic.yml + + # Run Python Node Example + + dora build ../examples/python-dataflow/dataflow.yml + dora start ../examples/python-dataflow/dataflow.yml --name ci-python --detach + sleep 5 + dora stop --name ci-python --grace-duration 5s + + # Run Python Dynamic Node Example + dora start ../examples/python-dataflow/dataflow_dynamic.yml --name ci-python-dynamic --detach opencv-plot --name plot sleep 5 dora stop --name ci-python-dynamic --grace-duration 5s + + # Run Python Operator Example + + dora start ../examples/python-operator-dataflow/dataflow.yml --name ci-python-operator --detach + sleep 5 + dora stop --name ci-python-operator --grace-duration 5s + dora destroy - name: "Test CLI (C)" From e63d95ce8b58f8ed9c7cd4f6464ef3f84b0d8c79 Mon Sep 17 00:00:00 2001 From: haixuanTao Date: Mon, 7 Oct 2024 09:44:17 +0200 Subject: [PATCH 4/6] CI: Adding time before stopping python dataflow so that we don't need to interrupt the dataflow --- .github/workflows/ci.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 857ca0c8e..fc0ea5624 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -322,20 +322,20 @@ jobs: dora build ../examples/python-dataflow/dataflow.yml dora start ../examples/python-dataflow/dataflow.yml --name ci-python --detach - sleep 5 + sleep 25 dora stop --name ci-python --grace-duration 5s # Run Python Dynamic Node Example dora start ../examples/python-dataflow/dataflow_dynamic.yml --name ci-python-dynamic --detach opencv-plot --name plot - sleep 5 + sleep 25 dora stop --name ci-python-dynamic --grace-duration 5s # Run Python Operator Example dora start ../examples/python-operator-dataflow/dataflow.yml --name ci-python-operator --detach - sleep 5 + sleep 25 dora stop --name ci-python-operator --grace-duration 5s dora destroy From 64fcc5b6ae4d8d232bd1fe08ca20f8711d0c2be9 Mon Sep 17 00:00:00 2001 From: haixuanTao Date: Mon, 7 Oct 2024 10:05:19 +0200 Subject: [PATCH 5/6] Add more time for the dataflow to stop --- .github/workflows/ci.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index fc0ea5624..bab50dd68 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -322,20 +322,20 @@ jobs: dora build ../examples/python-dataflow/dataflow.yml dora start ../examples/python-dataflow/dataflow.yml --name ci-python --detach - sleep 25 + sleep 35 dora stop --name ci-python --grace-duration 5s # Run Python Dynamic Node Example dora start ../examples/python-dataflow/dataflow_dynamic.yml --name ci-python-dynamic --detach opencv-plot --name plot - sleep 25 + sleep 35 dora stop --name ci-python-dynamic --grace-duration 5s # Run Python Operator Example dora start ../examples/python-operator-dataflow/dataflow.yml --name ci-python-operator --detach - sleep 25 + sleep 35 dora stop --name ci-python-operator --grace-duration 5s dora destroy From d98bab8f31f5365d61232286ada1263489a879cd Mon Sep 17 00:00:00 2001 From: haixuanTao Date: Mon, 7 Oct 2024 10:24:03 +0200 Subject: [PATCH 6/6] Fix CI by lowering the time spent running the python example --- .github/workflows/ci.yml | 6 +++--- node-hub/opencv-video-capture/opencv_video_capture/main.py | 4 ++-- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index bab50dd68..7aaac68c7 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -322,20 +322,20 @@ jobs: dora build ../examples/python-dataflow/dataflow.yml dora start ../examples/python-dataflow/dataflow.yml --name ci-python --detach - sleep 35 + sleep 80 dora stop --name ci-python --grace-duration 5s # Run Python Dynamic Node Example dora start ../examples/python-dataflow/dataflow_dynamic.yml --name ci-python-dynamic --detach opencv-plot --name plot - sleep 35 + sleep 80 dora stop --name ci-python-dynamic --grace-duration 5s # Run Python Operator Example dora start ../examples/python-operator-dataflow/dataflow.yml --name ci-python-operator --detach - sleep 35 + sleep 80 dora stop --name ci-python-operator --grace-duration 5s dora destroy diff --git a/node-hub/opencv-video-capture/opencv_video_capture/main.py b/node-hub/opencv-video-capture/opencv_video_capture/main.py index ab32b3069..71bc5edee 100644 --- a/node-hub/opencv-video-capture/opencv_video_capture/main.py +++ b/node-hub/opencv-video-capture/opencv_video_capture/main.py @@ -76,8 +76,8 @@ def main(): for event in node: - # Run this example in the CI for 20 seconds only. - if RUNNER_CI and time.time() - start_time > 20: + # Run this example in the CI for 10 seconds only. + if RUNNER_CI and time.time() - start_time > 10: break event_type = event["type"]