Skip to content

Python 3.12-minimal container failed on OpenShift 4 - RHEL8 #733

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

Closed
phracek opened this issue Mar 20, 2025 · 5 comments · Fixed by #735
Closed

Python 3.12-minimal container failed on OpenShift 4 - RHEL8 #733

phracek opened this issue Mar 20, 2025 · 5 comments · Fixed by #735
Assignees

Comments

@phracek
Copy link
Member

phracek commented Mar 20, 2025

During the testing of Python 3.12-minimal container on OpenShift 4 it failed here on RHEL8:

Test case is test_python_s2i_templates

oc logs python-testing-1-build
Defaulted container "sti-build" out of: sti-build, git-clone (init), manage-dockerfile (init)
time="2025-03-20T08:28:08Z" level=info msg="Not using native diff for overlay, this may cause degraded performance for building images: kernel has CONFIG_OVERLAY_FS_REDIRECT_DIR enabled"
I0320 08:28:08.338558       1 defaults.go:112] Defaulting to storage driver "overlay" with options [mountopt=metacopy=on].
Caching blobs under "/var/cache/blobs".
Trying to pull image-registry.openshift-image-registry.svc:5000/sclorg-test-4629/python@sha256:06a1ef8dfc82cc22114550bbf2914c85e9549079162068e8c131e2bcba548085...
Getting image source signatures
Copying blob sha256:7a1e0f1f31b61f0bc901296ee31cafa41421bd891d223364c5020477d49c2d6f
Copying blob sha256:852b811a113703f0c469163373fa2237a966be9a782dce057b3d7e192b850cd3
Copying blob sha256:6eebbc5dc79bf3abdcc431ac042a9f754151b8daebe3aea4fe0db5e28524cebd
Copying blob sha256:0b96e6533c2a1bdceac1eac765552cfca501a958ee490ff34c37240e9c1baf05
Copying blob sha256:79371a42698d61c5677fb7cbd724af0792e37d41e0879e0d656b6f8a7ea9fa62
Copying blob sha256:4aad2e2c9fecdacbd3e92836a32aad2fa1a65bc60b9fa9cba6d23d63562cb583
Copying config sha256:973c2e3a274e9d46033e6fc7da752a8af9d7d86ee9b712c7d72782627c6d5cba
Writing manifest to image destination
Generating dockerfile with builder image image-registry.openshift-image-registry.svc:5000/sclorg-test-4629/python@sha256:06a1ef8dfc82cc22114550bbf2914c85e9549079162068e8c131e2bcba548085
Replaced Dockerfile FROM image image-registry.openshift-image-registry.svc:5000/sclorg-test-4629/python@sha256:06a1ef8dfc82cc22114550bbf2914c85e9549079162068e8c131e2bcba548085
Adding transient rw bind mount for /run/secrets/rhsm
[1/3] STEP 1/9: FROM image-registry.openshift-image-registry.svc:5000/sclorg-test-4629/python@sha256:06a1ef8dfc82cc22114550bbf2914c85e9549079162068e8c131e2bcba548085 AS appimage544e53b3c66f48648f9c49b644769194
[1/3] STEP 2/9: LABEL "io.openshift.build.source-location"="https://github.com/sclorg/django-ex.git"       "io.openshift.build.image"="image-registry.openshift-image-registry.svc:5000/sclorg-test-4629/python@sha256:06a1ef8dfc82cc22114550bbf2914c85e9549079162068e8c131e2bcba548085"       "io.openshift.build.commit.author"="Petr Hracek <[email protected]>"       "io.openshift.build.commit.date"="Wed Jun 5 15:09:22 2024 +0200"       "io.openshift.build.commit.id"="587173e8ddfbf060a2ecd9cb636504b57c5dad66"       "io.openshift.build.commit.ref"="2.2.x"       "io.openshift.build.commit.message"="Update django.json"
[1/3] STEP 3/9: ENV OPENSHIFT_BUILD_NAME="python-testing-1"     OPENSHIFT_BUILD_NAMESPACE="sclorg-test-4629"     OPENSHIFT_BUILD_SOURCE="https://github.com/sclorg/django-ex.git"     OPENSHIFT_BUILD_REFERENCE="2.2.x"     OPENSHIFT_BUILD_COMMIT="587173e8ddfbf060a2ecd9cb636504b57c5dad66"     PIP_INDEX_URL=""
[1/3] STEP 4/9: USER root
[1/3] STEP 5/9: COPY upload/src /tmp/src
[1/3] STEP 6/9: RUN chown -R 1001:0 /tmp/src
[1/3] STEP 7/9: USER 1001
[1/3] STEP 8/9: RUN /usr/libexec/s2i/assemble
---> Installing application source ...
---> Installing dependencies ...
Collecting Django<3.0,>=2.2.12 (from -r requirements.txt (line 1))
  Downloading Django-2.2.28-py3-none-any.whl.metadata (3.6 kB)
Collecting django-debug-toolbar==2.2 (from -r requirements.txt (line 2))
  Downloading django_debug_toolbar-2.2-py3-none-any.whl.metadata (3.0 kB)
Collecting gunicorn==20.0.4 (from -r requirements.txt (line 3))
  Downloading gunicorn-20.0.4-py2.py3-none-any.whl.metadata (3.5 kB)
Collecting psycopg2-binary==2.9.5 (from -r requirements.txt (line 4))
  Downloading psycopg2-binary-2.9.5.tar.gz (384 kB)
  Installing build dependencies: started
  Installing build dependencies: finished with status 'done'
  Getting requirements to build wheel: started
  Getting requirements to build wheel: finished with status 'error'
  error: subprocess-exited-with-error

  × Getting requirements to build wheel did not run successfully.
  │ exit code: 1
  ╰─> [34 lines of output]
      /tmp/pip-build-env-jxmnwnfa/overlay/lib/python3.12/site-packages/setuptools/dist.py:751: SetuptoolsDeprecationWarning: License classifiers are deprecated.
      !!

              ********************************************************************************
              Please consider removing the following classifiers in favor of a SPDX license expression:

              License :: OSI Approved :: GNU Library or Lesser General Public License (LGPL)

              See https://packaging.python.org/en/latest/guides/writing-pyproject-toml/#license for details.
              ********************************************************************************

      !!
        self._finalize_license_expression()
      running egg_info
      writing psycopg2_binary.egg-info/PKG-INFO
      writing dependency_links to psycopg2_binary.egg-info/dependency_links.txt
      writing top-level names to psycopg2_binary.egg-info/top_level.txt

      Error: pg_config executable not found.

      pg_config is required to build psycopg2 from source.  Please add the directory
      containing pg_config to the $PATH or specify the full executable path with the
      option:

          python setup.py build_ext --pg-config /path/to/pg_config build ...

      or with the pg_config option in 'setup.cfg'.

      If you prefer to avoid building psycopg2 from source, please install the PyPI
      'psycopg2-binary' package instead.

      For further information please check the 'doc/src/install.rst' file (also at
      <https://www.psycopg.org/docs/install.html>).

      [end of output]

  note: This error originates from a subprocess, and is likely not a problem with pip.

[notice] A new release of pip is available: 24.2 -> 25.0.1
[notice] To update, run: pip install --upgrade pip
error: subprocess-exited-with-error

× Getting requirements to build wheel did not run successfully.
│ exit code: 1
╰─> See above for output.

note: This error originates from a subprocess, and is likely not a problem with pip.
error: build error: building at STEP "RUN /usr/libexec/s2i/assemble": while running runtime: exit status 1

@phracek phracek changed the title Python 3.12-minimal container failed on OpenShift 4 Python 3.12-minimal container failed on OpenShift 4 - RHEL8 Mar 20, 2025
@phracek
Copy link
Member Author

phracek commented Mar 20, 2025

Does it make sense to increase version? https://github.com/sclorg/django-ex/blob/2.2.x/requirements.txt#L4

@phracek
Copy link
Member Author

phracek commented Mar 20, 2025

Adding these three packages libpg-devel, gcc, python3.12-devel solves the problem, but I guess this is not the right approach.

@phracek
Copy link
Member Author

phracek commented Mar 20, 2025

I guess, this file https://github.com/sclorg/django-ex/blob/2.2.x/requirements.txt should be modified so it is able to consume as version 3.11 as version 3.12.

@frenzymadness
Copy link
Member

Container image with Python 3.12 should not use Django 2.2.x with the old psycopg-binary package. That's the reason why we implemented this: #731

Where is the definition telling the test to use 2.2.x branch for Python 3.12? We should fix it as we did it in the mentioned PR.

@phracek
Copy link
Member Author

phracek commented Mar 20, 2025

phracek added a commit that referenced this issue Mar 20, 2025
in case of VERSIONS '3.11' and '3.12' use branch '4.2.X'
otherwise use branch '2.2.X'

Fixes: #733

Signed-off-by: Petr "Stone" Hracek <[email protected]>
phracek added a commit that referenced this issue Mar 20, 2025
in case of VERSIONS '3.11' and '3.12' use branch '4.2.X'
otherwise use branch '2.2.X'

Fixes: #733

Signed-off-by: Petr "Stone" Hracek <[email protected]>
phracek added a commit that referenced this issue Mar 20, 2025
in case of VERSIONS '3.11' and '3.12' use branch '4.2.X'
otherwise use branch '2.2.X'

Fixes: #733

Signed-off-by: Petr "Stone" Hracek <[email protected]>
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 a pull request may close this issue.

3 participants