diff --git a/.github/workflows/build-and-push.yml b/.github/workflows/build-and-push.yml index 5c96a405..7146b903 100644 --- a/.github/workflows/build-and-push.yml +++ b/.github/workflows/build-and-push.yml @@ -142,6 +142,38 @@ jobs: tag: "314" image_name: "python-314-minimal" + - dockerfile: "3.14/Dockerfile.c9s" + docker_context: "3.14" + registry_namespace: "sclorg" + quayio_username: "QUAY_IMAGE_SCLORG_BUILDER_USERNAME" + quayio_token: "QUAY_IMAGE_SCLORG_BUILDER_TOKEN" + tag: "c9s" + image_name: "python-314-c9s" + + - dockerfile: "3.14-minimal/Dockerfile.c9s" + docker_context: "3.14-minimal" + registry_namespace: "sclorg" + quayio_username: "QUAY_IMAGE_SCLORG_BUILDER_USERNAME" + quayio_token: "QUAY_IMAGE_SCLORG_BUILDER_TOKEN" + tag: "c9s" + image_name: "python-314-minimal-c9s" + + - dockerfile: "3.14/Dockerfile.c10s" + docker_context: "3.14" + registry_namespace: "sclorg" + quayio_username: "QUAY_IMAGE_SCLORG_BUILDER_USERNAME" + quayio_token: "QUAY_IMAGE_SCLORG_BUILDER_TOKEN" + tag: "c10s" + image_name: "python-314-c10s" + + - dockerfile: "3.14-minimal/Dockerfile.c10s" + docker_context: "3.14-minimal" + registry_namespace: "sclorg" + quayio_username: "QUAY_IMAGE_SCLORG_BUILDER_USERNAME" + quayio_token: "QUAY_IMAGE_SCLORG_BUILDER_TOKEN" + tag: "c10s" + image_name: "python-314-minimal-c10s" + steps: - name: Build and push to quay.io registry uses: sclorg/build-and-push-action@v4 diff --git a/3.14-minimal/Dockerfile.c10s b/3.14-minimal/Dockerfile.c10s new file mode 100644 index 00000000..5c1cf880 --- /dev/null +++ b/3.14-minimal/Dockerfile.c10s @@ -0,0 +1,104 @@ +FROM quay.io/centos/centos:stream10-minimal + + +EXPOSE 8080 + +ENV PYTHON_VERSION=3.14 \ + PYTHONUNBUFFERED=1 \ + PYTHONIOENCODING=UTF-8 \ + LC_ALL=en_US.UTF-8 \ + LANG=en_US.UTF-8 \ + CNB_STACK_ID=com.redhat.stacks.ubi10-python-314 \ + CNB_USER_ID=1001 \ + CNB_GROUP_ID=0 \ + PIP_NO_CACHE_DIR=off \ + # The following variables are usually available from parent s2i images \ + STI_SCRIPTS_PATH=/usr/libexec/s2i \ + APP_ROOT=/opt/app-root \ + HOME=/opt/app-root/src \ + PLATFORM="el10" + +# /opt/app-root/bin - the main venv +# /opt/app-root/src/bin - app-specific binaries +# /opt/app-root/src/.local/bin - tools like pipenv +ENV PATH=$APP_ROOT/bin:$HOME/bin:$HOME/.local/bin:$PATH + +# Ensure the virtual environment is active in interactive shells +ENV BASH_ENV=${APP_ROOT}/bin/activate \ + ENV=${APP_ROOT}/bin/activate \ + PROMPT_COMMAND=". ${APP_ROOT}/bin/activate" + +ENV SUMMARY="Minimal platform for building and running Python $PYTHON_VERSION applications" \ + DESCRIPTION="Python $PYTHON_VERSION available as container is a base platform for \ +building and running various Python $PYTHON_VERSION applications and frameworks. \ +Python is an easy to learn, powerful programming language. It has efficient high-level \ +data structures and a simple but effective approach to object-oriented programming. \ +Python's elegant syntax and dynamic typing, together with its interpreted nature, \ +make it an ideal language for scripting and rapid application development in many areas \ +on most platforms." + +LABEL summary="$SUMMARY" \ + description="$DESCRIPTION" \ + io.k8s.description="$DESCRIPTION" \ + io.k8s.display-name="Python 3.14" \ + io.openshift.expose-services="8080:http" \ + io.openshift.tags="builder,python,python314,python-314,rh-python314" \ + com.redhat.component="python-314-container" \ + name="sclorg/python-314-minimal-c10s" \ + usage="s2i build https://github.com/sclorg/s2i-python-container.git --context-dir=3.14-minimal/test/setup-test-app/ ubi10/python-314-minimal python-sample-app" \ + com.redhat.license_terms="https://www.redhat.com/en/about/red-hat-end-user-license-agreements#UBI" \ + io.buildpacks.stack.id="com.redhat.stacks.ubi10-python-314-minimal" \ + maintainer="SoftwareCollections.org " + +# Very minimal set of packages +# Python is obvious in the Python container :) +# glibc-langpack-en is needed to set locale to en_US and disable warning about it +# findutils - find command is needed for fix-permissions script +# nss_wrapper - used in generate_container_user script +RUN INSTALL_PKGS="python3.14 glibc-langpack-en findutils nss_wrapper-libs" && \ + microdnf -y --setopt=tsflags=nodocs --setopt=install_weak_deps=0 install $INSTALL_PKGS && \ + microdnf -y clean all --enablerepo='*' + +# Copy the S2I scripts from the specific language image to $STI_SCRIPTS_PATH. +COPY 3.14-minimal/s2i/bin/ $STI_SCRIPTS_PATH + +# Copy extra files to the image. +COPY 3.14-minimal/root/ / + +# Python 3.7+ only +# Yes, the directory below is already copied by the previous command. +# The problem here is that the wheels directory is copied as a symlink. +# Only if you specify symlink directly as a source, COPY copies all the +# files from the symlink destination. +COPY 3.14-minimal/root/opt/wheels /opt/wheels + +# This command sets (and also creates if necessary) +# the home directory - it has to be done here so the latter +# fix-permissions fixes this directory as well. +WORKDIR ${HOME} + +# - Create a Python virtual environment for use by any application to avoid +# potential conflicts with Python packages preinstalled in the main Python +# installation. +# - In order to drop the root user, we have to make some directories world +# writable as OpenShift default security model is to run the container +# under random UID. +RUN \ + python3.14 -m venv ${APP_ROOT} && \ + # We have to upgrade pip to a newer version because \ + # pip < 19.3 does not support manylinux2014 wheels. Only manylinux2014 (and later) wheels \ + # support platforms like ppc64le, aarch64 or armv7 \ + # We are newly using wheel from one of the latest stable Fedora releases (from RPM python-pip-wheel) \ + # because it's tested better then whatever version from PyPI and contains useful patches. \ + # We have to do it here so the permissions are correctly fixed and pip is able \ + # to reinstall itself in the next build phases in the assemble script if user wants the latest version \ + ${APP_ROOT}/bin/pip install /opt/wheels/pip-* && \ + rm -r /opt/wheels && \ + chown -R 1001:0 ${APP_ROOT} && \ + fix-permissions ${APP_ROOT} -P && \ + rpm-file-permissions + +USER 1001 + +# Set the default CMD to print the usage of the language image. +CMD $STI_SCRIPTS_PATH/usage diff --git a/3.14-minimal/Dockerfile.c9s b/3.14-minimal/Dockerfile.c9s new file mode 100644 index 00000000..9c9883b8 --- /dev/null +++ b/3.14-minimal/Dockerfile.c9s @@ -0,0 +1,104 @@ +FROM quay.io/centos/centos:stream9-minimal + + +EXPOSE 8080 + +ENV PYTHON_VERSION=3.14 \ + PYTHONUNBUFFERED=1 \ + PYTHONIOENCODING=UTF-8 \ + LC_ALL=en_US.UTF-8 \ + LANG=en_US.UTF-8 \ + CNB_STACK_ID=com.redhat.stacks.ubi9-python-314 \ + CNB_USER_ID=1001 \ + CNB_GROUP_ID=0 \ + PIP_NO_CACHE_DIR=off \ + # The following variables are usually available from parent s2i images \ + STI_SCRIPTS_PATH=/usr/libexec/s2i \ + APP_ROOT=/opt/app-root \ + HOME=/opt/app-root/src \ + PLATFORM="el9" + +# /opt/app-root/bin - the main venv +# /opt/app-root/src/bin - app-specific binaries +# /opt/app-root/src/.local/bin - tools like pipenv +ENV PATH=$APP_ROOT/bin:$HOME/bin:$HOME/.local/bin:$PATH + +# Ensure the virtual environment is active in interactive shells +ENV BASH_ENV=${APP_ROOT}/bin/activate \ + ENV=${APP_ROOT}/bin/activate \ + PROMPT_COMMAND=". ${APP_ROOT}/bin/activate" + +ENV SUMMARY="Minimal platform for building and running Python $PYTHON_VERSION applications" \ + DESCRIPTION="Python $PYTHON_VERSION available as container is a base platform for \ +building and running various Python $PYTHON_VERSION applications and frameworks. \ +Python is an easy to learn, powerful programming language. It has efficient high-level \ +data structures and a simple but effective approach to object-oriented programming. \ +Python's elegant syntax and dynamic typing, together with its interpreted nature, \ +make it an ideal language for scripting and rapid application development in many areas \ +on most platforms." + +LABEL summary="$SUMMARY" \ + description="$DESCRIPTION" \ + io.k8s.description="$DESCRIPTION" \ + io.k8s.display-name="Python 3.14" \ + io.openshift.expose-services="8080:http" \ + io.openshift.tags="builder,python,python314,python-314,rh-python314" \ + com.redhat.component="python-314-container" \ + name="sclorg/python-314-minimal-c9s" \ + usage="s2i build https://github.com/sclorg/s2i-python-container.git --context-dir=3.14-minimal/test/setup-test-app/ ubi9/python-314-minimal python-sample-app" \ + com.redhat.license_terms="https://www.redhat.com/en/about/red-hat-end-user-license-agreements#UBI" \ + io.buildpacks.stack.id="com.redhat.stacks.ubi9-python-314-minimal" \ + maintainer="SoftwareCollections.org " + +# Very minimal set of packages +# Python is obvious in the Python container :) +# glibc-langpack-en is needed to set locale to en_US and disable warning about it +# findutils - find command is needed for fix-permissions script +# nss_wrapper - used in generate_container_user script +RUN INSTALL_PKGS="python3.14 glibc-langpack-en findutils nss_wrapper-libs" && \ + microdnf -y --setopt=tsflags=nodocs --setopt=install_weak_deps=0 install $INSTALL_PKGS && \ + microdnf -y clean all --enablerepo='*' + +# Copy the S2I scripts from the specific language image to $STI_SCRIPTS_PATH. +COPY 3.14-minimal/s2i/bin/ $STI_SCRIPTS_PATH + +# Copy extra files to the image. +COPY 3.14-minimal/root/ / + +# Python 3.7+ only +# Yes, the directory below is already copied by the previous command. +# The problem here is that the wheels directory is copied as a symlink. +# Only if you specify symlink directly as a source, COPY copies all the +# files from the symlink destination. +COPY 3.14-minimal/root/opt/wheels /opt/wheels + +# This command sets (and also creates if necessary) +# the home directory - it has to be done here so the latter +# fix-permissions fixes this directory as well. +WORKDIR ${HOME} + +# - Create a Python virtual environment for use by any application to avoid +# potential conflicts with Python packages preinstalled in the main Python +# installation. +# - In order to drop the root user, we have to make some directories world +# writable as OpenShift default security model is to run the container +# under random UID. +RUN \ + python3.14 -m venv ${APP_ROOT} && \ + # We have to upgrade pip to a newer version because \ + # pip < 19.3 does not support manylinux2014 wheels. Only manylinux2014 (and later) wheels \ + # support platforms like ppc64le, aarch64 or armv7 \ + # We are newly using wheel from one of the latest stable Fedora releases (from RPM python-pip-wheel) \ + # because it's tested better then whatever version from PyPI and contains useful patches. \ + # We have to do it here so the permissions are correctly fixed and pip is able \ + # to reinstall itself in the next build phases in the assemble script if user wants the latest version \ + ${APP_ROOT}/bin/pip install /opt/wheels/pip-* && \ + rm -r /opt/wheels && \ + chown -R 1001:0 ${APP_ROOT} && \ + fix-permissions ${APP_ROOT} -P && \ + rpm-file-permissions + +USER 1001 + +# Set the default CMD to print the usage of the language image. +CMD $STI_SCRIPTS_PATH/usage diff --git a/3.14-minimal/Dockerfile.rhel10 b/3.14-minimal/Dockerfile.rhel10 new file mode 100644 index 00000000..cad80210 --- /dev/null +++ b/3.14-minimal/Dockerfile.rhel10 @@ -0,0 +1,104 @@ +FROM ubi10-minimal:latest + + +EXPOSE 8080 + +ENV PYTHON_VERSION=3.14 \ + PYTHONUNBUFFERED=1 \ + PYTHONIOENCODING=UTF-8 \ + LC_ALL=en_US.UTF-8 \ + LANG=en_US.UTF-8 \ + CNB_STACK_ID=com.redhat.stacks.ubi10-python-314 \ + CNB_USER_ID=1001 \ + CNB_GROUP_ID=0 \ + PIP_NO_CACHE_DIR=off \ + # The following variables are usually available from parent s2i images \ + STI_SCRIPTS_PATH=/usr/libexec/s2i \ + APP_ROOT=/opt/app-root \ + HOME=/opt/app-root/src \ + PLATFORM="el10" + +# /opt/app-root/bin - the main venv +# /opt/app-root/src/bin - app-specific binaries +# /opt/app-root/src/.local/bin - tools like pipenv +ENV PATH=$APP_ROOT/bin:$HOME/bin:$HOME/.local/bin:$PATH + +# Ensure the virtual environment is active in interactive shells +ENV BASH_ENV=${APP_ROOT}/bin/activate \ + ENV=${APP_ROOT}/bin/activate \ + PROMPT_COMMAND=". ${APP_ROOT}/bin/activate" + +ENV SUMMARY="Minimal platform for building and running Python $PYTHON_VERSION applications" \ + DESCRIPTION="Python $PYTHON_VERSION available as container is a base platform for \ +building and running various Python $PYTHON_VERSION applications and frameworks. \ +Python is an easy to learn, powerful programming language. It has efficient high-level \ +data structures and a simple but effective approach to object-oriented programming. \ +Python's elegant syntax and dynamic typing, together with its interpreted nature, \ +make it an ideal language for scripting and rapid application development in many areas \ +on most platforms." + +LABEL summary="$SUMMARY" \ + description="$DESCRIPTION" \ + io.k8s.description="$DESCRIPTION" \ + io.k8s.display-name="Python 3.14" \ + io.openshift.expose-services="8080:http" \ + io.openshift.tags="builder,python,python314,python-314,rh-python314" \ + com.redhat.component="python-314-container" \ + name="ubi10/python-314-minimal" \ + usage="s2i build https://github.com/sclorg/s2i-python-container.git --context-dir=3.14-minimal/test/setup-test-app/ ubi10/python-314-minimal python-sample-app" \ + com.redhat.license_terms="https://www.redhat.com/en/about/red-hat-end-user-license-agreements#UBI" \ + io.buildpacks.stack.id="com.redhat.stacks.ubi10-python-314-minimal" \ + maintainer="SoftwareCollections.org " + +# Very minimal set of packages +# Python is obvious in the Python container :) +# glibc-langpack-en is needed to set locale to en_US and disable warning about it +# findutils - find command is needed for fix-permissions script +# nss_wrapper - used in generate_container_user script +RUN INSTALL_PKGS="python3.14 glibc-langpack-en findutils nss_wrapper-libs" && \ + microdnf -y --setopt=tsflags=nodocs --setopt=install_weak_deps=0 install $INSTALL_PKGS && \ + microdnf -y clean all --enablerepo='*' + +# Copy the S2I scripts from the specific language image to $STI_SCRIPTS_PATH. +COPY 3.14-minimal/s2i/bin/ $STI_SCRIPTS_PATH + +# Copy extra files to the image. +COPY 3.14-minimal/root/ / + +# Python 3.7+ only +# Yes, the directory below is already copied by the previous command. +# The problem here is that the wheels directory is copied as a symlink. +# Only if you specify symlink directly as a source, COPY copies all the +# files from the symlink destination. +COPY 3.14-minimal/root/opt/wheels /opt/wheels + +# This command sets (and also creates if necessary) +# the home directory - it has to be done here so the latter +# fix-permissions fixes this directory as well. +WORKDIR ${HOME} + +# - Create a Python virtual environment for use by any application to avoid +# potential conflicts with Python packages preinstalled in the main Python +# installation. +# - In order to drop the root user, we have to make some directories world +# writable as OpenShift default security model is to run the container +# under random UID. +RUN \ + python3.14 -m venv ${APP_ROOT} && \ + # We have to upgrade pip to a newer version because \ + # pip < 19.3 does not support manylinux2014 wheels. Only manylinux2014 (and later) wheels \ + # support platforms like ppc64le, aarch64 or armv7 \ + # We are newly using wheel from one of the latest stable Fedora releases (from RPM python-pip-wheel) \ + # because it's tested better then whatever version from PyPI and contains useful patches. \ + # We have to do it here so the permissions are correctly fixed and pip is able \ + # to reinstall itself in the next build phases in the assemble script if user wants the latest version \ + ${APP_ROOT}/bin/pip install /opt/wheels/pip-* && \ + rm -r /opt/wheels && \ + chown -R 1001:0 ${APP_ROOT} && \ + fix-permissions ${APP_ROOT} -P && \ + rpm-file-permissions + +USER 1001 + +# Set the default CMD to print the usage of the language image. +CMD $STI_SCRIPTS_PATH/usage diff --git a/3.14-minimal/Dockerfile.rhel9 b/3.14-minimal/Dockerfile.rhel9 new file mode 100644 index 00000000..0eea5238 --- /dev/null +++ b/3.14-minimal/Dockerfile.rhel9 @@ -0,0 +1,104 @@ +FROM ubi9/ubi-minimal:latest + + +EXPOSE 8080 + +ENV PYTHON_VERSION=3.14 \ + PYTHONUNBUFFERED=1 \ + PYTHONIOENCODING=UTF-8 \ + LC_ALL=en_US.UTF-8 \ + LANG=en_US.UTF-8 \ + CNB_STACK_ID=com.redhat.stacks.ubi9-python-314 \ + CNB_USER_ID=1001 \ + CNB_GROUP_ID=0 \ + PIP_NO_CACHE_DIR=off \ + # The following variables are usually available from parent s2i images \ + STI_SCRIPTS_PATH=/usr/libexec/s2i \ + APP_ROOT=/opt/app-root \ + HOME=/opt/app-root/src \ + PLATFORM="el9" + +# /opt/app-root/bin - the main venv +# /opt/app-root/src/bin - app-specific binaries +# /opt/app-root/src/.local/bin - tools like pipenv +ENV PATH=$APP_ROOT/bin:$HOME/bin:$HOME/.local/bin:$PATH + +# Ensure the virtual environment is active in interactive shells +ENV BASH_ENV=${APP_ROOT}/bin/activate \ + ENV=${APP_ROOT}/bin/activate \ + PROMPT_COMMAND=". ${APP_ROOT}/bin/activate" + +ENV SUMMARY="Minimal platform for building and running Python $PYTHON_VERSION applications" \ + DESCRIPTION="Python $PYTHON_VERSION available as container is a base platform for \ +building and running various Python $PYTHON_VERSION applications and frameworks. \ +Python is an easy to learn, powerful programming language. It has efficient high-level \ +data structures and a simple but effective approach to object-oriented programming. \ +Python's elegant syntax and dynamic typing, together with its interpreted nature, \ +make it an ideal language for scripting and rapid application development in many areas \ +on most platforms." + +LABEL summary="$SUMMARY" \ + description="$DESCRIPTION" \ + io.k8s.description="$DESCRIPTION" \ + io.k8s.display-name="Python 3.14" \ + io.openshift.expose-services="8080:http" \ + io.openshift.tags="builder,python,python314,python-314,rh-python314" \ + com.redhat.component="python-314-container" \ + name="ubi9/python-314-minimal" \ + usage="s2i build https://github.com/sclorg/s2i-python-container.git --context-dir=3.14-minimal/test/setup-test-app/ ubi9/python-314-minimal python-sample-app" \ + com.redhat.license_terms="https://www.redhat.com/en/about/red-hat-end-user-license-agreements#UBI" \ + io.buildpacks.stack.id="com.redhat.stacks.ubi9-python-314-minimal" \ + maintainer="SoftwareCollections.org " + +# Very minimal set of packages +# Python is obvious in the Python container :) +# glibc-langpack-en is needed to set locale to en_US and disable warning about it +# findutils - find command is needed for fix-permissions script +# nss_wrapper - used in generate_container_user script +RUN INSTALL_PKGS="python3.14 glibc-langpack-en findutils nss_wrapper-libs" && \ + microdnf -y --setopt=tsflags=nodocs --setopt=install_weak_deps=0 install $INSTALL_PKGS && \ + microdnf -y clean all --enablerepo='*' + +# Copy the S2I scripts from the specific language image to $STI_SCRIPTS_PATH. +COPY 3.14-minimal/s2i/bin/ $STI_SCRIPTS_PATH + +# Copy extra files to the image. +COPY 3.14-minimal/root/ / + +# Python 3.7+ only +# Yes, the directory below is already copied by the previous command. +# The problem here is that the wheels directory is copied as a symlink. +# Only if you specify symlink directly as a source, COPY copies all the +# files from the symlink destination. +COPY 3.14-minimal/root/opt/wheels /opt/wheels + +# This command sets (and also creates if necessary) +# the home directory - it has to be done here so the latter +# fix-permissions fixes this directory as well. +WORKDIR ${HOME} + +# - Create a Python virtual environment for use by any application to avoid +# potential conflicts with Python packages preinstalled in the main Python +# installation. +# - In order to drop the root user, we have to make some directories world +# writable as OpenShift default security model is to run the container +# under random UID. +RUN \ + python3.14 -m venv ${APP_ROOT} && \ + # We have to upgrade pip to a newer version because \ + # pip < 19.3 does not support manylinux2014 wheels. Only manylinux2014 (and later) wheels \ + # support platforms like ppc64le, aarch64 or armv7 \ + # We are newly using wheel from one of the latest stable Fedora releases (from RPM python-pip-wheel) \ + # because it's tested better then whatever version from PyPI and contains useful patches. \ + # We have to do it here so the permissions are correctly fixed and pip is able \ + # to reinstall itself in the next build phases in the assemble script if user wants the latest version \ + ${APP_ROOT}/bin/pip install /opt/wheels/pip-* && \ + rm -r /opt/wheels && \ + chown -R 1001:0 ${APP_ROOT} && \ + fix-permissions ${APP_ROOT} -P && \ + rpm-file-permissions + +USER 1001 + +# Set the default CMD to print the usage of the language image. +CMD $STI_SCRIPTS_PATH/usage diff --git a/3.14/Dockerfile.c9s b/3.14/Dockerfile.c9s new file mode 100644 index 00000000..329aeaa7 --- /dev/null +++ b/3.14/Dockerfile.c9s @@ -0,0 +1,89 @@ +# This image provides a Python 3.14 environment you can use to run your Python +# applications. +FROM quay.io/sclorg/s2i-base-c9s:c9s + +EXPOSE 8080 + +ENV PYTHON_VERSION=3.14 \ + PATH=$HOME/.local/bin/:$PATH \ + PYTHONUNBUFFERED=1 \ + PYTHONIOENCODING=UTF-8 \ + LC_ALL=en_US.UTF-8 \ + LANG=en_US.UTF-8 \ + PIP_NO_CACHE_DIR=off + +ENV NAME=python3 \ + ARCH=x86_64 + +ENV SUMMARY="Platform for building and running Python $PYTHON_VERSION applications" \ + DESCRIPTION="Python $PYTHON_VERSION available as container is a base platform for \ +building and running various Python $PYTHON_VERSION applications and frameworks. \ +Python is an easy to learn, powerful programming language. It has efficient high-level \ +data structures and a simple but effective approach to object-oriented programming. \ +Python's elegant syntax and dynamic typing, together with its interpreted nature, \ +make it an ideal language for scripting and rapid application development in many areas \ +on most platforms." + +LABEL summary="$SUMMARY" \ + description="$DESCRIPTION" \ + io.k8s.description="$DESCRIPTION" \ + io.k8s.display-name="Python 3.14" \ + io.openshift.expose-services="8080:http" \ + io.openshift.tags="builder,python,python314,python-314,rh-python314" \ + com.redhat.component="$NAME" \ + name="sclorg/python-314-c9s" \ + usage="s2i build https://github.com/sclorg/s2i-python-container.git --context-dir=3.14/test/setup-test-app/ $FGC/$NAME python-sample-app" \ + maintainer="SoftwareCollections.org " + +RUN INSTALL_PKGS="python3.14 python3.14-devel python3.14-pip nss_wrapper-libs httpd \ + httpd-devel mod_ssl mod_auth_gssapi mod_ldap mod_session \ + atlas-devel gcc-gfortran libffi-devel libtool-ltdl enchant \ + krb5-devel" && \ + yum -y --setopt=tsflags=nodocs install $INSTALL_PKGS && \ + rpm -V $INSTALL_PKGS && \ + yum -y clean all --enablerepo='*' + +# Copy the S2I scripts from the specific language image to $STI_SCRIPTS_PATH. +COPY 3.14/s2i/bin/ $STI_SCRIPTS_PATH + +# Copy extra files to the image. +COPY 3.14/root/ / + +# Python 3.7+ only +# Yes, the directory below is already copied by the previous command. +# The problem here is that the wheels directory is copied as a symlink. +# Only if you specify symlink directly as a source, COPY copies all the +# files from the symlink destination. +COPY 3.14/root/opt/wheels /opt/wheels +# - Create a Python virtual environment for use by any application to avoid +# potential conflicts with Python packages preinstalled in the main Python +# installation. +# - In order to drop the root user, we have to make some directories world +# writable as OpenShift default security model is to run the container +# under random UID. +RUN python3.14 -m venv ${APP_ROOT} && \ +# Python 3.7+ only code, Python <3.7 installs pip from PyPI in the assemble script. \ +# We have to upgrade pip to a newer verison because \ +# pip < 19.3 does not support manylinux2014 wheels. Only manylinux2014 (and later) wheels \ +# support platforms like ppc64le, aarch64 or armv7 \ +# We are newly using wheel from one of the latest stable Fedora releases (from RPM python-pip-wheel) \ +# because it's tested better then whatever version from PyPI and contains useful patches. \ +# We have to do it here (in the macro) so the permissions are correctly fixed and pip is able \ +# to reinstall itself in the next build phases in the assemble script if user wants the latest version \ +${APP_ROOT}/bin/pip install /opt/wheels/pip-* && \ +rm -r /opt/wheels && \ +chown -R 1001:0 ${APP_ROOT} && \ +fix-permissions ${APP_ROOT} -P && \ +# The following echo adds the unset command for the variables set below to the \ +# venv activation script. This prevents the virtual environment from being \ +# activated multiple times and also every time the prompt is rendered. \ +echo "unset BASH_ENV PROMPT_COMMAND ENV" >> ${APP_ROOT}/bin/activate +# Ensure the virtualenv is activated in interactive shells +ENV BASH_ENV="${APP_ROOT}/bin/activate" \ + ENV="${APP_ROOT}/bin/activate" \ + PROMPT_COMMAND=". ${APP_ROOT}/bin/activate" + +USER 1001 + +# Set the default CMD to print the usage of the language image. +CMD $STI_SCRIPTS_PATH/usage diff --git a/3.14/Dockerfile.rhel9 b/3.14/Dockerfile.rhel9 new file mode 100644 index 00000000..44854fd9 --- /dev/null +++ b/3.14/Dockerfile.rhel9 @@ -0,0 +1,95 @@ +# This image provides a Python 3.14 environment you can use to run your Python +# applications. +FROM ubi9/s2i-base:1 + +EXPOSE 8080 + +ENV PYTHON_VERSION=3.14 \ + PATH=$HOME/.local/bin/:$PATH \ + PYTHONUNBUFFERED=1 \ + PYTHONIOENCODING=UTF-8 \ + LC_ALL=en_US.UTF-8 \ + LANG=en_US.UTF-8 \ + CNB_STACK_ID=com.redhat.stacks.ubi9-python-314 \ + CNB_USER_ID=1001 \ + CNB_GROUP_ID=0 \ + PIP_NO_CACHE_DIR=off + +ENV SUMMARY="Platform for building and running Python $PYTHON_VERSION applications" \ + DESCRIPTION="Python $PYTHON_VERSION available as container is a base platform for \ +building and running various Python $PYTHON_VERSION applications and frameworks. \ +Python is an easy to learn, powerful programming language. It has efficient high-level \ +data structures and a simple but effective approach to object-oriented programming. \ +Python's elegant syntax and dynamic typing, together with its interpreted nature, \ +make it an ideal language for scripting and rapid application development in many areas \ +on most platforms." + +LABEL summary="$SUMMARY" \ + description="$DESCRIPTION" \ + io.k8s.description="$DESCRIPTION" \ + io.k8s.display-name="Python 3.14" \ + io.openshift.expose-services="8080:http" \ + io.openshift.tags="builder,python,python314,python-314,rh-python314" \ + com.redhat.component="python-314-container" \ + name="ubi9/python-314" \ + usage="s2i build https://github.com/sclorg/s2i-python-container.git --context-dir=3.14/test/setup-test-app/ ubi9/python-314 python-sample-app" \ + com.redhat.license_terms="https://www.redhat.com/en/about/red-hat-end-user-license-agreements#UBI" \ + io.buildpacks.stack.id="com.redhat.stacks.ubi9-python-314" \ + maintainer="SoftwareCollections.org " + +RUN INSTALL_PKGS="python3.14 python3.14-devel python3.14-pip nss_wrapper-libs httpd \ + httpd-devel mod_ssl mod_auth_gssapi mod_ldap mod_session \ + atlas-devel gcc-gfortran libffi-devel libtool-ltdl enchant \ + krb5-devel" && \ + yum -y --setopt=tsflags=nodocs install $INSTALL_PKGS && \ + rpm -V $INSTALL_PKGS && \ + # Remove redhat-logos-httpd (httpd dependency) to keep image size smaller. + rpm -e --nodeps redhat-logos-httpd && \ + yum -y clean all --enablerepo='*' + +# Copy the S2I scripts from the specific language image to $STI_SCRIPTS_PATH. +COPY 3.14/s2i/bin/ $STI_SCRIPTS_PATH + +# Copy extra files to the image. +COPY 3.14/root/ / + +# Python 3.7+ only +# Yes, the directory below is already copied by the previous command. +# The problem here is that the wheels directory is copied as a symlink. +# Only if you specify symlink directly as a source, COPY copies all the +# files from the symlink destination. +COPY 3.14/root/opt/wheels /opt/wheels +# - Create a Python virtual environment for use by any application to avoid +# potential conflicts with Python packages preinstalled in the main Python +# installation. +# - In order to drop the root user, we have to make some directories world +# writable as OpenShift default security model is to run the container +# under random UID. +RUN \ + python3.14 -m venv ${APP_ROOT} && \ + # Python 3.7+ only code, Python <3.7 installs pip from PyPI in the assemble script. \ + # We have to upgrade pip to a newer verison because \ + # pip < 19.3 does not support manylinux2014 wheels. Only manylinux2014 (and later) wheels \ + # support platforms like ppc64le, aarch64 or armv7 \ + # We are newly using wheel from one of the latest stable Fedora releases (from RPM python-pip-wheel) \ + # because it's tested better then whatever version from PyPI and contains useful patches. \ + # We have to do it here (in the macro) so the permissions are correctly fixed and pip is able \ + # to reinstall itself in the next build phases in the assemble script if user wants the latest version \ + ${APP_ROOT}/bin/pip install /opt/wheels/pip-* && \ + rm -r /opt/wheels && \ + chown -R 1001:0 ${APP_ROOT} && \ + fix-permissions ${APP_ROOT} -P && \ + rpm-file-permissions && \ + # The following echo adds the unset command for the variables set below to the \ + # venv activation script. This prevents the virtual environment from being \ + # activated multiple times and also every time the prompt is rendered. \ + echo "unset BASH_ENV PROMPT_COMMAND ENV" >> ${APP_ROOT}/bin/activate +# Ensure the virtualenv is activated in interactive shells +ENV BASH_ENV="${APP_ROOT}/bin/activate" \ + ENV="${APP_ROOT}/bin/activate" \ + PROMPT_COMMAND=". ${APP_ROOT}/bin/activate" + +USER 1001 + +# Set the default CMD to print the usage of the language image. +CMD $STI_SCRIPTS_PATH/usage diff --git a/README.md b/README.md index 12550ef0..1b9d3d3d 100644 --- a/README.md +++ b/README.md @@ -52,8 +52,8 @@ Table start |3.12-minimal|
`quay.io/sclorg/python-312-minimal-c9s`
|
`quay.io/sclorg/python-312-minimal-c10s`
||
`registry.redhat.io/rhel8/python-312-minimal`
|
`registry.redhat.io/rhel9/python-312-minimal`
|
`registry.redhat.io/rhel10/python-312-minimal`
| |3.13||
`quay.io/sclorg/python-313-c10s`
|
`quay.io/fedora/python-313`
|||| |3.13-minimal||
`quay.io/sclorg/python-313-minimal-c10s`
|
`quay.io/fedora/python-313-minimal`
|||| -|3.14|||
`quay.io/fedora/python-314`
|||| -|3.14-minimal|||
`quay.io/fedora/python-314-minimal`
|||| +|3.14|
`quay.io/sclorg/python-314-c9s`
||
`quay.io/fedora/python-314`
||
`registry.redhat.io/rhel9/python-314`
|| +|3.14-minimal|
`quay.io/sclorg/python-314-minimal-c9s`
|
`quay.io/sclorg/python-314-minimal-c10s`
|
`quay.io/fedora/python-314-minimal`
||
`registry.redhat.io/rhel9/python-314-minimal`
|
`registry.redhat.io/rhel10/python-314-minimal`
| diff --git a/specs/multispec.yml b/specs/multispec.yml index 395dc1e2..1d7de8d9 100644 --- a/specs/multispec.yml +++ b/specs/multispec.yml @@ -44,11 +44,12 @@ specs: 'mod_auth_gssapi', 'mod_ldap', 'mod_session', 'atlas-devel', 'gcc-gfortran', 'libffi-devel', 'libtool-ltdl', 'enchant', 'krb5-devel'] - ubi_versions: ['3.9', '3.11', '3.12'] + ubi_versions: ['3.9', '3.11', '3.12', '3.14'] extra_pkgs: "3.9": ['python3', 'python3-devel', 'python3-setuptools', 'python3-pip'] "3.11": ['python3.11', 'python3.11-devel', 'python3.11-pip'] "3.12": ['python3.12', 'python3.12-devel', 'python3.12-pip'] + "3.14": ['python3.14', 'python3.14-devel', 'python3.14-pip'] rhel10: distros: @@ -65,9 +66,10 @@ specs: 'mod_auth_gssapi', 'mod_ldap', 'mod_session', 'atlas-devel', 'gcc-gfortran', 'libffi-devel', 'libtool-ltdl', 'enchant', 'krb5-devel'] - ubi_versions: ['3.12'] + ubi_versions: ['3.12', '3.14'] extra_pkgs: "3.12": ['python3.12', 'python3.12-devel', 'python3.12-pip'] + "3.14": ['python3.14', 'python3.14-devel', 'python3.14-pip'] c9s: @@ -88,6 +90,7 @@ specs: "3.9": ['python3', 'python3-devel', 'python3-setuptools', 'python3-pip'] "3.11": ['python3.11', 'python3.11-devel', 'python3.11-pip'] "3.12": ['python3.12', 'python3.12-devel', 'python3.12-pip'] + "3.14": ['python3.14', 'python3.14-devel', 'python3.14-pip'] c10s: distros: @@ -107,6 +110,7 @@ specs: extra_pkgs: "3.12": ['python3', 'python3-devel', 'python3-setuptools', 'python3-pip'] "3.13": ['python3.13', 'python3.13-devel', 'python3.13-pip'] + "3.14": ['python3.14', 'python3.14-devel', 'python3.14-pip'] fedora42: distros: @@ -288,7 +292,13 @@ matrix: version: "3.13-minimal" - distros: - fedora-43-x86_64 + - centos-stream-9-x86_64 + - rhel-9-x86_64 version: "3.14" - distros: - fedora-43-x86_64 + - centos-stream-10-x86_64 + - centos-stream-9-x86_64 + - rhel-9-x86_64 + - rhel-10-x86_64 version: "3.14-minimal" diff --git a/test/conftest.py b/test/conftest.py index a29a98df..bed51b9c 100644 --- a/test/conftest.py +++ b/test/conftest.py @@ -116,3 +116,5 @@ def skip_helm_charts_tests(): VARS.VERSION == "3.12-minimal" and VARS.OS == "rhel8" ): skip(f"Skipping Helm Charts tests for {VARS.VERSION} on {VARS.OS}.") + if VARS.VERSION in ("3.14", "3.14-minimal"): + skip(f"Skipping Helm Charts tests for {VARS.VERSION} on {VARS.OS}. The image is not GA available yet.") diff --git a/test/test_ocp_imagestreams_quickstart.py b/test/test_ocp_imagestreams_quickstart.py index ac59aabd..50138108 100644 --- a/test/test_ocp_imagestreams_quickstart.py +++ b/test/test_ocp_imagestreams_quickstart.py @@ -20,6 +20,8 @@ def teardown_method(self): "template", ["django.json", "django-postgresql-persistent.json"] ) def test_python_template_inside_cluster(self, template): + if VARS.VERSION in ("3.14", "3.14-minimal"): + pytest.skip(f"Testing templates for {VARS.VERSION} is not yet GA.") if self.oc_api.shared_cluster: assert self.oc_api.upload_image_to_external_registry( VARS.DEPLOYED_PSQL_IMAGE, VARS.IMAGE_TAG