Project

General

Profile

Actions

Idea #21453

closed

Install Python package virtualenvs under /usr/lib/PKGNAME

Added by Brett Smith 11 months ago. Updated 8 months ago.

Status:
Resolved
Priority:
Normal
Assigned To:
Category:
Deployment
Start date:
02/13/2024
Due date:
Story points:
0.5
Release:
Release relationship:
Auto

Description

Background: We used to ship Python packages that actually integrated with the distro packages, so we installed Python stuff under /usr/share/python3/dist/PKGNAME because that's where you put system-wide Python libraries.

When we switched to shipping an entire virtualenv, we didn't change this path. It doesn't hurt anything but it's kind of weird. So as of Arvados 2.7, we ship an entire virtualenv under /usr/share/python3/dist/PKGNAME.

As part of #20846, we updated the build process to consistently specify a minor version of Python, to avoid accidental breakage if Python got upgraded. As part of that change, the path we install under is now /usr/share/python3.NN/dist/PKGNAME. This is even weirder because /usr/share/python3.NN isn't really an established path for anything.

Since we're updating the path anyway, we might as well just make it /usr/lib/PKGNAME. This follows established convention better, it's easier to follow, and it's a very straightforward change.

This should be documented in the upgrade notes. If people have custom scripts that point to one of our shipped virtualenvs, they'll need to update those paths. This is already true after #20846, so making the path nicer makes the upgrade note nicer too.


Subtasks 1 (0 open1 closed)

Task #21502: Review 21453-python-package-pathResolvedBrett Smith02/13/2024Actions

Related issues 1 (0 open1 closed)

Related to Arvados - Idea #20846: Support Ubuntu 22.04 LTSResolvedBrett Smith10/30/2023Actions
Actions #1

Updated by Brett Smith 11 months ago

  • Related to Idea #20846: Support Ubuntu 22.04 LTS added
Actions #2

Updated by Peter Amstutz 11 months ago

Just to be pendantic, /usr/share is supposed to be "architecture independent" files, but I believe the virtualenv can include binary wheels and stuff that's architecture specific, so it might be better suited to go under /usr/lib/PKGNAME?

https://refspecs.linuxfoundation.org/FHS_3.0/fhs/index.html

Actions #3

Updated by Brett Smith 11 months ago

  • Description updated (diff)
  • Subject changed from Install Python package virtualenvs under /usr/share/PKGNAME to Install Python package virtualenvs under /usr/lib/PKGNAME
Actions #4

Updated by Brett Smith 10 months ago

  • Status changed from New to In Progress

21453-python-package-path @ 8c33c582e6fa415dbdca5204f5926fe09de34e3b - build-packages-debian12: #38 - Can't test all package builds because of #21501

  • All agreed upon points are implemented / addressed.
    • Yes
  • Anything not implemented (discovered or discussed during work) has a follow-up story.
    • N/A
  • Code is tested and passing, both automated and manual, what manual testing was done is described
    • In addition to the Jenkins build above, I also built and tested the package locally. I then extracted the contents and confirmed it had the desired layout, with correct shebang lines for scripts under /usr/bin.
  • Documentation has been updated.
    • Yes
  • Behaves appropriately at the intended scale (describe intended scale).
    • No change in scale
  • Considered backwards and forwards compatibility issues between client and server.
    • As described in the story, #20846 already changed the location of the virtualenv. This story improves the location and adds documentation.
  • Follows our coding standards and GUI style guidelines.
    • Yes
Actions #5

Updated by Peter Amstutz 10 months ago

  • Target version changed from Development 2024-02-14 sprint to Development 2024-02-28 sprint
Actions #6

Updated by Lucas Di Pentima 10 months ago

Even though the run-test pipeline succeeded (developer-run-tests: #4042 ), I think these files should be fixed to use the new path:

  • build/package-testing/test-package-python3-arvados-python-client.sh:L10
  • docker/jobs/Dockerfile:L23
  • sdk/cwl/tests/arvados-tests.sh:L27

The rest LGTM, thanks!

Actions #7

Updated by Brett Smith 10 months ago

Lucas Di Pentima wrote in #note-6:

Even though the run-test pipeline succeeded (developer-run-tests: #4042 ), I think these files should be fixed to use the new path:

These are all good catches, thank you, and done. To explain:

  • build/package-testing/test-package-python3-arvados-python-client.sh:L10

This test ran as part of build-packages-debian12, but because of #21526, it tested an already-built package with the old path, not the newly built one. We would have to do something dramatic to get the tests to the test the new package as intended.

Now that I've fixed this path, it's possible that build-packages jobs are going to start failing, because they're going to run the new test code against an old package. If that happens, the quickest fix is to push some commit that affects sdk/python to force a new package build. I'm sure I can find some ancient Python 2 compatibility import to clean up to help that process along.

  • docker/jobs/Dockerfile:L23

This only runs as part of docker-jobs-image, and isn't tested in any way as far as I know. Because this job only takes one Git hash as a parameter, I don't know if it's even possible to run it in a way that builds from a development package.

  • sdk/cwl/tests/arvados-tests.sh:L27

These run as part of the arvados-cwl-conformance-tests Jenkins job, which is not part of either developer-run-tests or build-packages. It's also affected by the "no way to select packages installed by a Dockerfile" issue as arvados/jobs.

Actions #8

Updated by Brett Smith 10 months ago

  • % Done changed from 0 to 100
  • Status changed from In Progress to Resolved
Actions #9

Updated by Peter Amstutz 8 months ago

  • Release set to 70
Actions

Also available in: Atom PDF