sclorg/s2i-python-container

ERROR: No matching distribution found for numpy==1.19.2

adelton opened this issue · 4 comments

Container platform

OCP 4

Version

4.14.1

OS version of the container image

RHEL 8

Bugzilla, Jira

No response

Description

I try to follow the document at https://developers.redhat.com/developer-sandbox/activities/use-rhods-to-master-nlp.

In Part 9 it describes Building the application inside OpenShift. However, the Deployment of repository https://github.com/rh-aiservices-bu/metrobus-repairs-nlp-workshop with the default builder image Python 3.9 (UBI 8) fails.

Reproducer

On a OCP 4.14.1 sandbox cluster I +Add an "Import from Git".

After I paste URL https://github.com/rh-aiservices-bu/metrobus-repairs-nlp-workshop.git to the Git Repo URL textfield, a message shows up with

Builder Image detected.
A Builder Image is recommended.
Python 3.9 (UBI 8)

builder python

Build and run Python 3.9 applications on UBI 8. For more information about using this builder image, including OpenShift considerations, see https://github.com/sclorg/s2i-python-container/blob/master/3.9/README.md.

Sample repository: https://github.com/sclorg/django-ex.git

When I create the Deployment, the build fails with

ERROR: Could not find a version that satisfies the require....25.1, 1.25.2, 1.26.0b1, 1.26.0rc1, 1.26.0, 1.26.1, 1.26.2)
ERROR: No matching distribution found for numpy==1.19.2
WARNING: You are using pip version 21.3.1; however, version 23.3.1 is available.
You should consider upgrading via the '/opt/app-root/bin/python3.9 -m pip install --upgrade pip' command.
error: build error: building at STEP "RUN /usr/libexec/s2i/assemble": while running runtime: exit status 1

Since the builder image points to this repository in the description, reporting also here, besides rh-aiservices-bu/metrobus-repairs-nlp-workshop#19.

When I Edit Import Strategy and force use of Build Image version 3.6-ubi8, I get

Collecting gunicorn==20.1.0
  Downloading gunicorn-20.1.0-py3-none-any.whl (79 kB)
ERROR: Could not find a version that satisfies the require..., 2.5.2, 2.6.0rc0, 2.6.0rc1, 2.6.0rc2, 2.6.0, 2.6.1, 2.6.2)
ERROR: No matching distribution found for tensorflow==2.7.0
error: build error: building at STEP "RUN /usr/libexec/s2i/assemble": while running runtime: exit status 1

Past vedle pasti.

From a speedy look at the configuration files in the repository, it seems that the dependencies are quite old. However:

  • numpy 1.19.2 from September 2020 does not provide wheels for Python 3.9 which should mean that pip downloads its sources and tries to build/compile it from the source.
  • tensorflow 2.7.0 from November 2021 does not provide wheels for Python 3.6 and neither provide sources so it cannot even be compiled.

@befeleme could you please take a look at this and try to build the project on top of one of the mentioned images?

So it seems the app was built either for Python 3.7 or Python 3.8 which is a bit unfortunate, as they're no longer supported.
I managed to build and run the app on ubi8:python39 with those tweaks:

git diff requirements.txt:

-numpy==1.19.2
+numpy==1.20.3
+werkzeug>=2.2,<3.0

git diff nb-requirements.txt:

-numpy==1.19.2
+numpy==1.20.3

The simple GET and POST requests to the app worked for me. However I can't tell whether upgrading numpy like that will work for every usage in your app.

Because I believe there is nothing to fix in S2I Python container image, I've reposted the above comment to the repo with the project and I'm closing this issue now. Feel free to reopen it if you think I'm wrong.