sclorg / s2i-python-container

Python container images based on Red Hat Software Collections and intended for OpenShift and general usage, that provide a platform for building and running Python applications. Users can choose between Red Hat Enterprise Linux, Fedora, and CentOS based images.
http://softwarecollections.org
Apache License 2.0
260 stars 325 forks source link

Incorrect py-3 image #596

Closed teplyakoff closed 1 year ago

teplyakoff commented 1 year ago

Container platform

Podman/Docker

Version

latest

OS version of the container image

RHEL 8

Bugzilla, Jira

No response

Description

Image doesn't contain actual code for /s2i/bin/assemble https://github.com/sclorg/s2i-python-container/blob/master/3.9/s2i/bin/assemble#L93 $ docker pull registry.access.redhat.com/ubi8/python-39 && docker run registry.access.redhat.com/ubi8/python-39 cat /usr/libexec/s2i/assemble

You can check that container doesn't contain this code in /s2i/bin/assemble:

if [[ -f pyproject.toml && -z "$DISABLE_PYPROJECT_TOML_PROCESSING" ]]; then
  echo "---> Installing application (via pyproject.toml)..."
  pip install .
fi

Same issue with python 3.10 (https://github.com/sclorg/s2i-python-container/tree/master/3.10#3-prepare-an-application-inside-a-container) $ docker pull registry.fedoraproject.org/f35/python3 && docker run registry.fedoraproject.org/f35/python3 cat /usr/libexec/s2i/assemble

python 3.11 doesn't work at all.. (https://github.com/sclorg/s2i-python-container/tree/master/3.11#3-prepare-an-application-inside-a-container)

docker pull registry.fedoraproject.org/f37/python3
Using default tag: latest
Error response from daemon: manifest for registry.fedoraproject.org/f37/python3:latest not found: manifest unknown: manifest unknown

Reproducer

docker pull registry.access.redhat.com/ubi8/python-39 && docker run registry.access.redhat.com/ubi8/python-39 cat /usr/libexec/s2i/assemble

pkubatrh commented 1 year ago

Red Hat shipped images are not directly built from this repository, the source syncs are only done once in a while (usually every minor release of RHEL).

Does not make sense to keep this open over here, as there is nothing that can be done via this repository. If this issue is critical or in any way time sensitive, please raise a ticket through the regular Red Hat support channels to ensure it receives the proper attention and prioritization to assure a timely resolution.

frenzymadness commented 1 year ago

I was writing my response when Petr closed the issue so I'm sending it anyway. Petr's reply still applies for UBI container images.

Thanks a lot for the report!

Let me take a look at what happened here. It seems that the code is there for 3.9: https://github.com/sclorg/s2i-python-container/blob/1f10d8205fd66a5ccbfe651307f9860893e930b2/3.9/s2i/bin/assemble#L93-L96 So the images are outdated for some reason.

The change is 2 months old and:

As Petr mentioned, it takes some time for the internal images to get rebuilt. The container images based on Centos Stream or Fedora are much newer so you can use those.

The Fedora problem, it's a mistake in the documentation. We moved Fedora container images from Fedora registry to Qay.io so you should use https://quay.io/repository/fedora/python-311 for Python 3.11 on Fedora 37.

I'll keep this issue open until we fix the documentation.

pkubatrh commented 1 year ago

Oh right, I missed the Fedora part. Thanks for doublechecking Lumir.

teplyakoff commented 1 year ago

@frenzymadness Thanks, will wait for doc updates.

Centos Stream or Fedora are much newer

If you do a merge to master - these images updated automatically? Or you wait for another teams that can build and deploy fresh image?

And one more question Is there fresh image for python3.9? maybe in fedora registry or qay.io

zmiklank commented 1 year ago

If you do a merge to master - these images updated automatically?

Yes, this is correct for Fedora, Centos, and Centos Stream images. Push to registry is done automatically via the build-and-push Github Action. All of these images are stored in quay.io.

Is there fresh image for python3.9? maybe in fedora registry or qay.io

There is minimal image available for c9s:

https://quay.io/repository/sclorg/python-39-minimal-c9s

zmiklank commented 1 year ago

PR with updated docs: https://github.com/sclorg/s2i-python-container/pull/597

teplyakoff commented 1 year ago

There is minimal image available for c9s: https://quay.io/repository/sclorg/python-39-minimal-c9s

So you have to fix docs for 3.9 right? https://github.com/sclorg/s2i-python-container/tree/master/3.9-minimal I see there FROM python-39-minimal not FROM quay.io/sclorg/python-39-minimal-c9s

And about multi stage building https://github.com/sclorg/s2i-python-container/tree/master/3.9-minimal#build-on-full-image-run-on-minimal-image FROM python-39 as builder <-- it is not fresh image (registry.access.redhat.com/ubi8/python-39) FROM python-39-minimal <-- this is fresh (quay.io/sclorg/python-39-minimal-c9s) I can't use python-39-minimal-c9s only for building, because it can't build everything error: command 'gcc' failed: No such file or directory

Maybe you can publish full fresh image to quay.io like you did with minimal one?

frenzymadness commented 1 year ago

Yes, you are right, we are gonna publish the full image for Python 3.9 on C9S.

teplyakoff commented 1 year ago

Hi, thanks! Pulling py3-minimal is ok as before

$ docker pull quay.io/sclorg/python-39-minimal-c9s
Using default tag: latest
latest: Pulling from sclorg/python-39-minimal-c9s
331497745b32: Already exists 
f0600229f1f0: Already exists 
Digest: sha256:f1f040e3bc6c00140dd4b93b90f2a1d0d5cb89c6fc17d06907b2bc6f5ad6ae8c
Status: Downloaded newer image for quay.io/sclorg/python-39-minimal-c9s:latest
quay.io/sclorg/python-39-minimal-c9s:latest

full py-39 is not ok:

$ docker pull quay.io/sclorg/python-39-c9s
Using default tag: latest
Error response from daemon: unauthorized: access to the requested resource is not authorized

image

zmiklank commented 1 year ago

@teplyakoff the repository was not created. Please try now, it should be fixed.

frenzymadness commented 1 year ago

All the images we produce directly from Github to Quay.io should be up to date as the latest run of build and push action finished successfully.