Skip to content

Redo how we install pip packaging. - #764

Merged
clalancette merged 5 commits into
masterfrom
clalancette/redo-pip-packages
Mar 27, 2024
Merged

clalancette merged 5 commits into
masterfrom
clalancette/redo-pip-packages

Conversation

@clalancette

Copy link
Copy Markdown
Contributor

The current way we install packages in main is really a mess. Some of the packages have pinned versions, some do not. Some of the packages are installed only if they are not installed by the underlying OS, some are not.

This commit partially cleans this up. In particular, for all pip packages that are not colcon-related, we have a tuple which contains the package name, the import name, and the (optional) version we want installed. For every pip package name, we see if we can import it (using the import name); if we can, then we don't need to install it and we skip it. If we do need to install it, then we add it to the list and add the version to the constraints.

This should mean that this code works on all of Ubuntu, RHEL, and Windows. On Ubuntu and RHEL, almost all packages are installed via the Dockerfiles (the one exception being colcon). For Windows, almost nothing is installed by the chef scripts, so most things will be installed here.

A further cleanup here would to also install colcon from packages rather than pip, but this is large enough as it is. If this is acceptable, we can do that in a followup.

Along with some other fixes, this change allows us to actually launch an Ubuntu 24.04 job (it still won't pass tests, but that is due to code-related reasons which we are fixing separately).

While this can be merged independently, in order for Ubuntu 24.04 to work we also need to merge in #762 and #763

The current way we install packages in __main__ is really
a mess.  Some of the packages have pinned versions, some do
not.  Some of the packages are installed only if they are
not installed by the underlying OS, some are not.

This commit partially cleans this up.  In particular, for
all pip packages that are *not* colcon-related, we have a tuple
which contains the package name, the import name, and the (optional)
version we want installed.  For every pip package name, we see
if we can import it (using the import name); if we can,
then we don't need to install it and we skip it.  If we
*do* need to install it, then we add it to the list and add
the version to the constraints.

This should mean that this code works on all of Ubuntu, RHEL,
and Windows.  On Ubuntu and RHEL, almost all packages are
installed via the Dockerfiles (the one exception being colcon).
For Windows, almost nothing is installed by the chef scripts,
so most things will be installed here.

A further cleanup here would to also install colcon from
packages rather than pip, but this is large enough as it is.
If this is acceptable, we can do that in a followup.

Along with some other fixes, this change allows us to actually
launch an Ubuntu 24.04 job (it still won't pass tests, but that
is due to code-related reasons which we are fixing separately).

Signed-off-by: Chris Lalancette <[email protected]>
@clalancette

clalancette commented Mar 25, 2024 •

Copy link
Copy Markdown
Contributor Author

Full CI on this one:

  • Linux Build Status
  • Linux-aarch64 Build Status
  • Windows Build Status
  • RHEL Build Status
  • Windows Debug Build Status

@nuclearsandwich nuclearsandwich left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Thanks for splitting this out. I've got an inline comment or two but none are blocking.

Comment thread linux_docker_resources/Dockerfile Resolved
Comment thread ros2_batch_job/__main__.py Resolved
@clalancette
clalancette force-pushed the clalancette/redo-pip-packages branch from 2e6847d to 77d5a45 Compare March 26, 2024 16:40
That is, even if we aren't going to install a package
(since it was already installed), make sure to add the
the number to the constraints file so that other installations
won't upgrade it.

While we are here, print out the constraints in use for
debugging further down the line.

Signed-off-by: Chris Lalancette <[email protected]>
@clalancette
clalancette force-pushed the clalancette/redo-pip-packages branch from 2ce1dd9 to 156121c Compare March 26, 2024 17:20
@clalancette

clalancette commented Mar 26, 2024 •

Copy link
Copy Markdown
Contributor Author

After the latest work which should fix the outstanding issues, here is another try at CI:

  • Linux Build Status
  • Linux-aarch64 Build Status
  • Windows Build Status
  • RHEL Build Status
  • Windows Debug Build Status

@clalancette

Copy link
Copy Markdown
Contributor Author

Another try at Windows after the addition of the latest set of packages, which should make this exactly the same as the nightlies now:

  • Windows Build Status
  • Windows Debug Build Status

Comment thread ros2_batch_job/__main__.py Resolved
Co-authored-by: Scott K Logan <[email protected]>
Signed-off-by: Chris Lalancette <[email protected]>
@clalancette

clalancette commented Mar 27, 2024 •

Copy link
Copy Markdown
Contributor Author

One more really quick Linux run, just to ensure that the latest change works:

  • Linux Build Status

@clalancette

Copy link
Copy Markdown
Contributor Author

OK. There are more failures on Windows Debug than I would like, but it has also been broken for about a week so I'm not super surprised. The remaining failures mostly seem to revolve around timeouts in cpplint/cppcheck, which we can probably increase the timeouts for. None of it seems connected with the change in Python packages here. So in order to make progress on switching to Noble, I'm going to merge this one in; we'll work on improving Windows Debug in the next few weeks.

Thank you to everyone for the reviews.

@clalancette
clalancette merged commit 112a277 into master Mar 27, 2024
@clalancette
clalancette deleted the clalancette/redo-pip-packages branch March 27, 2024 18:56
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.

3 participants