Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update CI scripts to use Ubuntu Noble distros and bump action scripts to latest versions #1709

Merged
merged 8 commits into from
Aug 9, 2024

Conversation

MichaelOrlov
Copy link
Contributor

@MichaelOrlov MichaelOrlov commented Jun 12, 2024

  • Use Ubuntu Noble distros for ci jobs on rolling.
  • Bump actions-ros-lint to v0.1.3 and actions/checkout to v4.
  • Exclude cppcheck from CI due to a known issue that the new versions are very slow.
    See Disable cppcheck 2.x. ament/ament_lint#345 for details.

@MichaelOrlov MichaelOrlov marked this pull request as ready for review June 12, 2024 06:43
@MichaelOrlov MichaelOrlov requested a review from a team as a code owner June 12, 2024 06:43
@MichaelOrlov MichaelOrlov requested review from gbiggs, hidmic, clalancette and christophebedard and removed request for a team, gbiggs and hidmic June 12, 2024 06:43
Copy link
Contributor

@clalancette clalancette left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It looks reasonable to me. Is it expected that https://github.com/ros2/rosbag2/actions/runs/9477957056/job/26113440902?pr=1709 fails right now?

@MichaelOrlov
Copy link
Contributor Author

@clalancette No. the build_and_test CI job is not expected to fail. It fails with the following error messages

024-06-12T07:33:28.6183572Z �[36;1msource /opt/ros/rolling/setup.sh && colcon test --mixin linters-skip --packages-select ${rosbag2_packages} --packages-skip rosbag2_performance_benchmarking --event-handlers console_cohesion+ --return-code-on-test-failure --ctest-args "-L xfail" --pytest-args "-m xfail"�[0m
2024-06-12T07:33:28.6188804Z shell: bash --noprofile --norc -e -o pipefail {0}
2024-06-12T07:33:28.6189206Z ##[endgroup]
2024-06-12T07:33:31.0730529Z usage: colcon [-h] [--log-base LOG_BASE] [--log-level LOG_LEVEL]
2024-06-12T07:33:31.0731792Z               {build,coveragepy-result,extension-points,extensions,graph,info,lcov-result,list,metadata,mixin,test,test-result,version-check}
2024-06-12T07:33:31.0732754Z               ...
2024-06-12T07:33:31.0733154Z colcon: error: Mixin 'linters-skip' is not available for 'test'
2024-06-12T07:33:31.1123681Z ##[error]Process completed with exit code 2.
2024-06-12T07:33:31.1170348Z ##[group]Run rosbag2_path=$(colcon list -p --packages-select rosbag2)/..
2024-06-12T07:33:31.1171017Z �[36;1mrosbag2_path=$(colcon list -p --packages-select rosbag2)/..�[0m
2024-06-12T07:33:31.1171490Z �[36;1msudo pip uninstall -y mypy�[0m
2024-06-12T07:33:31.1171928Z �[36;1msudo apt update && sudo apt -y install mypy=0.942-1ubuntu1�[0m
2024-06-12T07:33:31.1172357Z �[36;1msource install/setup.sh�[0m
2024-06-12T07:33:31.1172750Z �[36;1mstubgen -p rosbag2_py -o ${rosbag2_path}/rosbag2_py�[0m
2024-06-12T07:33:31.1173154Z �[36;1mcd ${rosbag2_path}�[0m
2024-06-12T07:33:31.1173438Z �[36;1mgit diff --exit-code�[0m
2024-06-12T07:33:31.1173854Z shell: bash --noprofile --norc -e -o pipefail {0}
2024-06-12T07:33:31.1174204Z ##[endgroup]
2024-06-12T07:33:33.0851536Z error: externally-managed-environment
2024-06-12T07:33:33.0851942Z 
2024-06-12T07:33:33.0852173Z × This environment is externally managed
2024-06-12T07:33:33.0853015Z ╰─> To install Python packages system-wide, try apt install
2024-06-12T07:33:33.0854037Z     python3-xyz, where xyz is the package you are trying to
2024-06-12T07:33:33.0854756Z     install.
2024-06-12T07:33:33.0855135Z     
2024-06-12T07:33:33.0855881Z     If you wish to install a non-Debian-packaged Python package,
2024-06-12T07:33:33.0856986Z     create a virtual environment using python3 -m venv path/to/venv.
2024-06-12T07:33:33.0857902Z     Then use path/to/venv/bin/python and path/to/venv/bin/pip. Make
2024-06-12T07:33:33.0858959Z     sure you have python3-full installed.
2024-06-12T07:33:33.0859337Z     
2024-06-12T07:33:33.0860325Z     If you wish to install a non-Debian packaged Python application,
2024-06-12T07:33:33.0860886Z     it may be easiest to use pipx install xyz, which will manage a
2024-06-12T07:33:33.0861426Z     virtual environment for you. Make sure you have pipx installed.
2024-06-12T07:33:33.0861830Z     
2024-06-12T07:33:33.0862151Z     See /usr/share/doc/python3.12/README.venv for more information.
2024-06-12T07:33:33.0862660Z 
2024-06-12T07:33:33.0863678Z note: If you believe this is a mistake, please contact your Python installation or OS distribution provider. You can override this, at the risk of breaking your Python installation or OS, by passing --break-system-packages.

@christophebedard
Copy link
Member

Add --break-system-packages to the pip command.

@clalancette
Copy link
Contributor

Add --break-system-packages to the pip command.

Oh, you'll also have to update the apt install mypy command to get rid of the version number, since it is different in Noble.

@MichaelOrlov
Copy link
Contributor Author

@clalancette We have to pin mypy to some version it could be the same version as by default in Noble. However it should be pinned to have a consistency with readme instruction in rosbag2_py package for generating and verifying .*pyi files.

I've pinned mypy to the 1.9.0-4ubuntu1 version as mentioned in the https://packages.ubuntu.com/search?keywords=mypy for Ubuntu 24.04 noble.
Will see if CI will pass.

@clalancette
Copy link
Contributor

@clalancette We have to pin mypy to some version it could be the same version as by default in Noble. However it should be pinned to have a consistency with readme instruction in rosbag2_py package for generating and verifying .*pyi files.

The thing is, you know for certain it is going to be that version; your Dockerfile is using Ubuntu 24.04, and the only supported Ubuntu for Rolling currently is Ubuntu 24.04.

That said, you can pin it if you want, I just think it is unnecessary.

@MichaelOrlov
Copy link
Contributor Author

The new version of mypy causing a lot of discrepancies in checking existing *.pyi files.
On the other hand the old version of the mypy can't be installed on the Ubuntu 24.04 Noble since apt throws an error
E: Version '0.942-1ubuntu1' for 'mypy' was not found

@r7vme I would appreciate your assistance with the resolution of issue with the mypy installation and *.pyi files verification on CI.

@r7vme
Copy link
Contributor

r7vme commented Jul 26, 2024

@MichaelOrlov you can pull two commits from this PR #1763 to fix issues with new mypy version.

  1. Re-generated pyi files with mypy 1.9 (default Ubuntu 24.04 version)
  2. Updated readme to allow developers on Ubuntu 22.04 to install mypy 1.9
  3. Unpinned mypy version in CI

MichaelOrlov and others added 8 commits August 9, 2024 11:42
Signed-off-by: Michael Orlov <michael.orlov@apex.ai>
Signed-off-by: Michael Orlov <michael.orlov@apex.ai>
See ament/ament_lint#345 for details.

Signed-off-by: Michael Orlov <michael.orlov@apex.ai>
- Also add `--break-system-packages` to avoid error during pip uninstall

Signed-off-by: Michael Orlov <michael.orlov@apex.ai>
Addressing the error message:
Found existing installation: mypy 1.9.0
ERROR: Cannot uninstall mypy 1.9.0, RECORD file not found. Hint:
The package was installed by debian.

Signed-off-by: Michael Orlov <michael.orlov@apex.ai>
This reverts commit b5aa018

Signed-off-by: Michael Orlov <michael.orlov@apex.ai>
* Apply new stubgen changes

Signed-off-by: Roman Sokolkov <rsokolkov@gmail.com>

* Update CI script and README.md

Signed-off-by: Roman Sokolkov <rsokolkov@gmail.com>

---------

Signed-off-by: Roman Sokolkov <rsokolkov@gmail.com>
- Rationale: On Ubuntu 22.04 is an older version of the pip3 and python
version which doesn't have this flag.
- Also removed sudo before "pip3 install -U mypy==1.9" in README.md

Signed-off-by: Michael Orlov <michael.orlov@apex.ai>
@MichaelOrlov
Copy link
Contributor Author

Have to rebase on the latest rolling since the build_and_test job was failing due to treating warnings as errors and using deprecated rcpputils::fs::create_temp_directory from tests.

@MichaelOrlov
Copy link
Contributor Author

The CI is green, merging without running CI on the build farm since changes only in git workflow, readme file and generated pyi files.

@MichaelOrlov MichaelOrlov merged commit 27a6b60 into rolling Aug 9, 2024
12 checks passed
@MichaelOrlov MichaelOrlov deleted the morlov/update_ci_scripts branch August 9, 2024 19:48
@MichaelOrlov
Copy link
Contributor Author

https://github.com/Mergifyio backport jazzy

Copy link

mergify bot commented Aug 9, 2024

backport jazzy

✅ Backports have been created

mergify bot pushed a commit that referenced this pull request Aug 9, 2024
… to latest versions (#1709)

* Use Ubuntu Noble distros for ci jobs on rolling

Signed-off-by: Michael Orlov <michael.orlov@apex.ai>

* Bump actions-ros-lint to version 0.1.3 and actions/checkout to v4

Signed-off-by: Michael Orlov <michael.orlov@apex.ai>

* Exclude cppcheck from CI due to known issue that it is very slow

See ament/ament_lint#345 for details.

Signed-off-by: Michael Orlov <michael.orlov@apex.ai>

* Bump mypy to version 1.9.0-4ubuntu1 to be aligned with Noble

- Also add `--break-system-packages` to avoid error during pip uninstall

Signed-off-by: Michael Orlov <michael.orlov@apex.ai>

* Remove "sudo pip uninstall -y mypy" since it is not installed with pip

Addressing the error message:
Found existing installation: mypy 1.9.0
ERROR: Cannot uninstall mypy 1.9.0, RECORD file not found. Hint:
The package was installed by debian.

Signed-off-by: Michael Orlov <michael.orlov@apex.ai>

* Revert "Bump mypy to version 1.9.0-4ubuntu1 to be aligned with Noble"

This reverts commit b5aa018

Signed-off-by: Michael Orlov <michael.orlov@apex.ai>

* Fixes for new mypy (Ubuntu 24.04) (#1763)

* Apply new stubgen changes

Signed-off-by: Roman Sokolkov <rsokolkov@gmail.com>

* Update CI script and README.md

Signed-off-by: Roman Sokolkov <rsokolkov@gmail.com>

---------

Signed-off-by: Roman Sokolkov <rsokolkov@gmail.com>

* Remove "--break-system-packages" flag from mypy install in README.md

- Rationale: On Ubuntu 22.04 is an older version of the pip3 and python
version which doesn't have this flag.
- Also removed sudo before "pip3 install -U mypy==1.9" in README.md

Signed-off-by: Michael Orlov <michael.orlov@apex.ai>

---------

Signed-off-by: Michael Orlov <michael.orlov@apex.ai>
Signed-off-by: Roman Sokolkov <rsokolkov@gmail.com>
Co-authored-by: Roman <rsokolkov@gmail.com>
(cherry picked from commit 27a6b60)
MichaelOrlov added a commit that referenced this pull request Aug 9, 2024
… scripts to latest versions (backport #1709) (#1779)

* Update CI scripts to use Ubuntu Noble distros and bump action scripts to latest versions (#1709)

* Use Ubuntu Noble distros for ci jobs on rolling

Signed-off-by: Michael Orlov <michael.orlov@apex.ai>

* Bump actions-ros-lint to version 0.1.3 and actions/checkout to v4

Signed-off-by: Michael Orlov <michael.orlov@apex.ai>

* Exclude cppcheck from CI due to known issue that it is very slow

See ament/ament_lint#345 for details.

Signed-off-by: Michael Orlov <michael.orlov@apex.ai>

* Bump mypy to version 1.9.0-4ubuntu1 to be aligned with Noble

- Also add `--break-system-packages` to avoid error during pip uninstall

Signed-off-by: Michael Orlov <michael.orlov@apex.ai>

* Remove "sudo pip uninstall -y mypy" since it is not installed with pip

Addressing the error message:
Found existing installation: mypy 1.9.0
ERROR: Cannot uninstall mypy 1.9.0, RECORD file not found. Hint:
The package was installed by debian.

Signed-off-by: Michael Orlov <michael.orlov@apex.ai>

* Revert "Bump mypy to version 1.9.0-4ubuntu1 to be aligned with Noble"

This reverts commit b5aa018

Signed-off-by: Michael Orlov <michael.orlov@apex.ai>

* Fixes for new mypy (Ubuntu 24.04) (#1763)

* Apply new stubgen changes

Signed-off-by: Roman Sokolkov <rsokolkov@gmail.com>

* Update CI script and README.md

Signed-off-by: Roman Sokolkov <rsokolkov@gmail.com>

---------

Signed-off-by: Roman Sokolkov <rsokolkov@gmail.com>

* Remove "--break-system-packages" flag from mypy install in README.md

- Rationale: On Ubuntu 22.04 is an older version of the pip3 and python
version which doesn't have this flag.
- Also removed sudo before "pip3 install -U mypy==1.9" in README.md

Signed-off-by: Michael Orlov <michael.orlov@apex.ai>

---------

Signed-off-by: Michael Orlov <michael.orlov@apex.ai>
Signed-off-by: Roman Sokolkov <rsokolkov@gmail.com>
Co-authored-by: Roman <rsokolkov@gmail.com>
(cherry picked from commit 27a6b60)

* Update github CI scripts to use jazzy instead of rolling

Signed-off-by: Michael Orlov <michael.orlov@apex.ai>

---------

Signed-off-by: Michael Orlov <michael.orlov@apex.ai>
Co-authored-by: Michael Orlov <michael.orlov@apex.ai>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants