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

Upgrade base system to Ubuntu 24.04 #1076

Open
wants to merge 11 commits into
base: master
Choose a base branch
from
Open

Conversation

gouttegd
Copy link
Contributor

This PR updates the base system of all our images to the latest LTR version of Ubuntu, 24.04.

  • Some system packages that were previously implicitly installed now need to be explicitly asked for (e.g. libpcre3, needed for Konclude, or npm, needed to install Obographviz).
  • The OBO Dashboard must now be installed with --break-system-packages, otherwise pip will by default refuse to install it system-wide (the idea is that only APT tools are allowed to install anything system-wide).
  • We can no longer have virtualenv in the builder image, as it messes with the installation of our Python packages.
  • The odk.py script has some issues with Python 3.12 that need fixing.

closes #1008

This should have been done right after the 1.5 release, so let's do it
now.
The NodeJs package manager (NPM) is no longer automatically installed
when we install NodeJS, so we ask for it explicitly.

We need it to install Obographviz.

Ideally it should be possible to install both NPM and Obographviz in
the builder image and then to transfer only Obographviz to the final
ODKFull image, thereby reducing the clutter in ODKFull, but this will
need further investigation.
This is a runtime dependency of Konclude (even the statically compiled
one that we use on x86_64). It was probably automatically pulled by
another package on Ubuntu 22.04, but it is not on 22.04, so we need to
ask for it explicitly.
Pip is now by default refusing to install anything in the system-wide
Python library path, which is considered the "private garden" of the
underlying operating system (e.g., on Ubuntu, only APT tools should add
Python packages to the system-wide path).

This may be fine in general, in a user-facing scenario, but not for the
ODK which is in effect a "read-only" system overall. The OBO Dashboard
is part of the tools/libraries we provide with the ODK and there is no
reason for us to package it separately inside a virtual environment (the
recommended way of installing non-system Python packages) -- the entire
ODK is already a "virtual environment".

Ultimately the right thing to do here would be for the OBO Dashboard
upstream to make proper releases, which we could then install at the
same time as any other Python packages.
The odk.py script has some issues when we run it under Python 3.12, we
fix them here.
Installing virtualenv in the builder image has nafarious consequences
when we try to later install Python packages.

That's because the Ubuntu package for virtualenv automatically installs
platformdirs version 2.5.1, which then prevents us from installing the
platformdirs 4.x that we need as a dependency for some of our packages.

The only reason we had virtualenv in the builder image was that we use
it to run the update-constraints workflow (in which we try to install
all our Python packages in a virtualenv). So here, we

1) remove virtualenv from the builder image;

2) amend the update-constraints.sh script to make it install virtualenv
   itself.
PIP emits a warning when we attempt to install executable scripts in a
location that is not in the system PATH.

In this instance the warning is not warranted. The scripts are installed
in a staging location ON PURPOSE -- they are later copied over to the
final ODK images, where the scripts will end up in the system PATH.

So we shut that warning down.
Get freshly frozen Python constraints for the newer version of Python
provided in Ubuntu 24.04.
@gouttegd gouttegd self-assigned this Jun 24, 2024
@gouttegd
Copy link
Contributor Author

(For those keeping track, this the same PR as #1067 modulo the wording of some commit messages and freshly updated Python constraints.)

@gouttegd gouttegd requested a review from matentzn June 24, 2024 16:46
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.

Upgrade the base system to 24.04
2 participants