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

pyauditor install broken in latest docker image #320

Closed
QuantumDancer opened this issue Nov 22, 2023 · 4 comments · Fixed by #321
Closed

pyauditor install broken in latest docker image #320

QuantumDancer opened this issue Nov 22, 2023 · 4 comments · Fixed by #321
Labels
bug Something isn't working wontfix This will not be worked on

Comments

@QuantumDancer
Copy link
Contributor

After #319 was merged into master, I wanted to try out the latest version of C/T.

I noticed that loading the auditor plugin fails. I could track this back back to a broken install of pyauditor in the docker container:

  • With the latest docker image the pyauditor module is not populated with the classes we export
$ docker run -it --rm --entrypoint /bin/sh matterminers/cobald-tardis:latest
/srv # python
Python 3.10.13 (main, Oct 19 2023, 06:08:04) [GCC 12.2.1 20220924] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import pyauditor
>>> dir(pyauditor)
['__doc__', '__file__', '__loader__', '__name__', '__package__', '__path__', '__spec__']
  • With the latest tagged version it works (i.e. AuditorClientBuilder and other classes are visible)
$ docker run -it --rm --entrypoint /bin/sh matterminers/cobald-tardis:0.8.0
/srv # python
Python 3.10.13 (main, Oct 19 2023, 06:08:04) [GCC 12.2.1 20220924] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import pyauditor
>>> dir(pyauditor)
['AuditorClient', 'AuditorClientBlocking', 'AuditorClientBuilder', 'Component', 'Meta', 'Record', 'Score', '__all__', '__builtins__', '__cached__', '__doc__', '__file__', '__loader__', '__name__', '__package__', '__path__', '__spec__', 'pyauditor']
  • However, installing the latest pyauditor version in a venv also works
$ python -m venv .venv
$ source .venv/bin/activate
$ pip install python-auditor
Successfully installed python-auditor-0.3.0
$ python
Python 3.11.5 (main, Sep  2 2023, 14:16:33) [GCC 13.2.1 20230801] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import pyauditor
>>> dir(pyauditor)
['AuditorClient', 'AuditorClientBlocking', 'AuditorClientBuilder', 'Component', 'Meta', 'Record', 'Score', '__all__', '__builtins__', '__cached__', '__doc__', '__file__', '__loader__', '__name__', '__package__', '__path__', '__spec__', 'pyauditor']
  • I also checked with Python3.10 using the python:3.10 container (as this is the version used by the C/T container), and there it also works

Any idea why this is happening?

@giffels
Copy link
Member

giffels commented Nov 23, 2023

Thanks a lot for your report. I have rebuild the latest image based on the refs/heads/master and the behaviour is exactly the same as you describe.

docker run -it --rm --entrypoint /bin/sh matterminers/cobald-tardis:latest       ST 1   release-0.8.1
/srv # python
Python 3.10.13 (main, Oct 19 2023, 06:08:04) [GCC 12.2.1 20220924] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import pyauditor
>>> dir(pyauditor)
['__doc__', '__file__', '__loader__', '__name__', '__package__', '__path__', '__spec__']

Honestly, I do not have an idea what is broken right now.

@giffels giffels added the bug Something isn't working label Nov 23, 2023
@giffels
Copy link
Member

giffels commented Nov 23, 2023

The problem occurs only if python-auditor is build from source. I have tested in a rockylinux:8 docker container.

[root@bc9de6cca711 /]# python3.11 -m pip install python-auditor==0.3.0 --force --no-binary python-auditor
DEPRECATION: --no-binary currently disables reading from the cache of locally built wheels. In the future --no-binary will not influence the wheel cache. pip 23.1 will enforce this behaviour change. A possible replacement is to use the --no-cache-dir option. You can use the flag --use-feature=no-binary-enable-wheel-cache to test the upcoming behaviour. Discussion can be found at https://github.com/pypa/pip/issues/11453
Collecting python-auditor==0.3.0
  Using cached python_auditor-0.3.0.tar.gz (71 kB)
  Installing build dependencies ... done
  Getting requirements to build wheel ... done
  Preparing metadata (pyproject.toml) ... done
Building wheels for collected packages: python-auditor
  Building wheel for python-auditor (pyproject.toml) ... done
  Created wheel for python-auditor: filename=python_auditor-0.3.0-cp311-cp311-linux_x86_64.whl size=3276991 sha256=b4315d3abc8afd01d36e641e1af3c95da25f6289ef33e52197e81d7f341bd25b
  Stored in directory: /root/.cache/pip/wheels/9f/a6/cd/eb5c4ab67d76a0a279cdb2bd6d3cdf4174c19a9d8b2b5f4e54
Successfully built python-auditor
Installing collected packages: python-auditor
  Attempting uninstall: python-auditor
    Found existing installation: python-auditor 0.3.0
    Uninstalling python-auditor-0.3.0:
      Successfully uninstalled python-auditor-0.3.0
Successfully installed python-auditor-0.3.0
WARNING: Running pip as the 'root' user can result in broken permissions and conflicting behaviour with the system package manager. It is recommended to use a virtual environment instead: https://pip.pypa.io/warnings/venv
[root@bc9de6cca711 /]# python3.11
Python 3.11.5 (main, Oct 25 2023, 16:19:59) [GCC 8.5.0 20210514 (Red Hat 8.5.0-20)] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import pyauditor
>>> dir(pyauditor)
['__doc__', '__file__', '__loader__', '__name__', '__package__', '__path__', '__spec__']
>>>
[root@bc9de6cca711 /]# python3.11 -m pip install python-auditor==0.3.0 --force
Collecting python-auditor==0.3.0
  Using cached python_auditor-0.3.0-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (3.2 MB)
Installing collected packages: python-auditor
  Attempting uninstall: python-auditor
    Found existing installation: python-auditor 0.3.0
    Uninstalling python-auditor-0.3.0:
      Successfully uninstalled python-auditor-0.3.0
Successfully installed python-auditor-0.3.0
WARNING: Running pip as the 'root' user can result in broken permissions and conflicting behaviour with the system package manager. It is recommended to use a virtual environment instead: https://pip.pypa.io/warnings/venv
[root@bc9de6cca711 /]# python3.11
Python 3.11.5 (main, Oct 25 2023, 16:19:59) [GCC 8.5.0 20210514 (Red Hat 8.5.0-20)] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import pyauditor
>>> dir(pyauditor)
['AuditorClient', 'AuditorClientBlocking', 'AuditorClientBuilder', 'Component', 'Meta', 'Record', 'Score', '__all__', '__builtins__', '__cached__', '__doc__', '__file__', '__loader__', '__name__', '__package__', '__path__', '__spec__', 'pyauditor']

For some reason the cobald-tardis container builds python-auditor from source instead of installing the binary. So, I guess the problem is not in our container builds.

@giffels giffels added the wontfix This will not be worked on label Nov 23, 2023
@QuantumDancer
Copy link
Contributor Author

Ah, interesting, thanks for pointing this out! I will investigate why building from source does not work.

@QuantumDancer
Copy link
Contributor Author

We could track the issue down to a new version of one of the build tools (maturin) which apparently is not working right now for our setup.

See ALU-Schumacher/AUDITOR#565 for more details.

I've created a bugfix release which seems to work:

$ pip install python-auditor==0.3.1 --no-cache --no-binary python-auditor
Collecting python-auditor==0.3.1
  Downloading python_auditor-0.3.1.tar.gz (71 kB)
     ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 71.1/71.1 kB 5.9 MB/s eta 0:00:00
  Installing build dependencies ... done
  Getting requirements to build wheel ... done
  Preparing metadata (pyproject.toml) ... done
Building wheels for collected packages: python-auditor
  Building wheel for python-auditor (pyproject.toml) ... done
  Created wheel for python-auditor: filename=python_auditor-0.3.1-cp311-cp311-linux_x86_64.whl size=5256496 sha256=a1a00fca8e478e2596cf5cd5d62bd54a12fe5e444409018286002b6a5b398c02
  Stored in directory: /tmp/pip-ephem-wheel-cache-fxl31yzi/wheels/e1/ac/58/0d926e8b28bb9e8564a5e65e9c3ba7e4eb8855600fbafd92c3
Successfully built python-auditor
Installing collected packages: python-auditor
Successfully installed python-auditor-0.3.1

[notice] A new release of pip is available: 23.2.1 -> 23.3.1
[notice] To update, run: pip install --upgrade pip

$ python                                                                 
Python 3.11.5 (main, Sep  2 2023, 14:16:33) [GCC 13.2.1 20230801] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import pyauditor
>>> dir(pyauditor)
['AuditorClient', 'AuditorClientBlocking', 'AuditorClientBuilder', 'Component', 'Meta', 'Record', 'Score', '__all__', '__builtins__', '__cached__', '__doc__', '__file__', '__loader__', '__name__', '__package__', '__path__', '__spec__', 'pyauditor']

And just as a side note: Pyauditor is build from source in the cobald-tardis container because the pyauditor wheel is build using manylinux, which links against glibc, but the cobald-tardis container is based on alpine linux, which does not contain glibc.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working wontfix This will not be worked on
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants