diff --git a/3.12-minimal/Dockerfile.rhel8 b/3.12-minimal/Dockerfile.rhel8 deleted file mode 100644 index b9a9c6cb..00000000 --- a/3.12-minimal/Dockerfile.rhel8 +++ /dev/null @@ -1,108 +0,0 @@ -FROM ubi8/ubi-minimal:latest - - -EXPOSE 8080 - -ENV PYTHON_VERSION=3.12 \ - PYTHONUNBUFFERED=1 \ - PYTHONIOENCODING=UTF-8 \ - LC_ALL=en_US.UTF-8 \ - LANG=en_US.UTF-8 \ - CNB_STACK_ID=com.redhat.stacks.ubi8-python-312 \ - 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="el8" - -# /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 - -# RHEL7 base images automatically set these envvars to run scl_enable. RHEl8 -# images, however, don't as most images don't need SCLs any more. But we want -# to run it even on RHEL8, because we set the virtualenv environment as part of -# that script -ENV BASH_ENV=${APP_ROOT}/etc/scl_enable \ - ENV=${APP_ROOT}/etc/scl_enable \ - PROMPT_COMMAND=". ${APP_ROOT}/etc/scl_enable" - -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.12" \ - io.openshift.expose-services="8080:http" \ - io.openshift.tags="builder,python,python312,python-312,rh-python312" \ - com.redhat.component="python-312-container" \ - name="ubi8/python-312-minimal" \ - version="1" \ - usage="s2i build https://github.com/sclorg/s2i-python-container.git --context-dir=3.12-minimal/test/setup-test-app/ ubi8/python-312-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.ubi8-python-312-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.12 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.12-minimal/s2i/bin/ $STI_SCRIPTS_PATH - -# Copy extra files to the image. -COPY 3.12-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.12-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.12 -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/imagestreams/imagestreams.yaml b/imagestreams/imagestreams.yaml index 5d9ce4e8..117192a5 100644 --- a/imagestreams/imagestreams.yaml +++ b/imagestreams/imagestreams.yaml @@ -10,29 +10,39 @@ https://github.com/sclorg/s2i-python-container/blob/master/APP_VERSION/README.md. imagestream_files: - filename: python-centos.json - latest: "3.9-ubi9" + latest: "3.12-ubi9" distros: - name: UBI 8 - app_versions: ["3.6", "3.8", "3.9", "3.12"] + app_versions: ["3.6", "3.9", "3.11", "3.12"] - name: UBI 9 - app_versions: ["3.9", "3.12"] + app_versions: ["3.9", "3.11", "3.12", "3.12-minimal"] + + - name: UBI 10 + app_versions: ["3.12-minimal"] - filename: python-rhel.json - latest: "3.11-ubi8" + latest: "3.12-ubi8" distros: - name: UBI 8 - app_versions: ["3.6", "3.8", "3.9", "3.11", "3.12"] + app_versions: ["3.6", "3.9", "3.11", "3.12"] - name: UBI 9 - app_versions: ["3.9", "3.11", "3.12"] + app_versions: ["3.9", "3.11", "3.12", "3.12-minimal"] + + - name: UBI 10 + app_versions: ["3.12-minimal"] - filename: python-rhel-aarch64.json - latest: "3.9-ubi8" + latest: "3.12-ubi8" distros: - name: UBI 8 - app_versions: ["3.6", "3.8", "3.9", "3.12"] + app_versions: ["3.6", "3.9", "3.11", "3.12"] - name: UBI 9 - app_versions: ["3.9", "3.12"] + app_versions: ["3.9", "3.11", "3.12", "3.12-minimal"] + + - name: UBI 10 + app_versions: ["3.12-minimal"] + ... diff --git a/imagestreams/python-centos.json b/imagestreams/python-centos.json index b22e55c3..2b7f3264 100644 --- a/imagestreams/python-centos.json +++ b/imagestreams/python-centos.json @@ -29,38 +29,38 @@ } }, { - "name": "3.8-ubi8", + "name": "3.9-ubi8", "annotations": { - "openshift.io/display-name": "Python 3.8 (UBI 8)", + "openshift.io/display-name": "Python 3.9 (UBI 8)", "openshift.io/provider-display-name": "Red Hat, Inc.", - "description": "Build and run Python 3.8 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.8/README.md.", + "description": "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.", "iconClass": "icon-python", "tags": "builder,python", - "version": "3.8", + "version": "3.9", "sampleRepo": "https://github.com/sclorg/django-ex.git" }, "from": { "kind": "DockerImage", - "name": "registry.access.redhat.com/ubi8/python-38:latest" + "name": "registry.access.redhat.com/ubi8/python-39:latest" }, "referencePolicy": { "type": "Local" } }, { - "name": "3.9-ubi8", + "name": "3.11-ubi8", "annotations": { - "openshift.io/display-name": "Python 3.9 (UBI 8)", + "openshift.io/display-name": "Python 3.11 (UBI 8)", "openshift.io/provider-display-name": "Red Hat, Inc.", - "description": "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.", + "description": "Build and run Python 3.11 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.11/README.md.", "iconClass": "icon-python", "tags": "builder,python", - "version": "3.9", + "version": "3.11", "sampleRepo": "https://github.com/sclorg/django-ex.git" }, "from": { "kind": "DockerImage", - "name": "registry.access.redhat.com/ubi8/python-39:latest" + "name": "registry.access.redhat.com/ubi8/python-311:latest" }, "referencePolicy": { "type": "Local" @@ -104,6 +104,25 @@ "type": "Local" } }, + { + "name": "3.11-ubi9", + "annotations": { + "openshift.io/display-name": "Python 3.11 (UBI 9)", + "openshift.io/provider-display-name": "Red Hat, Inc.", + "description": "Build and run Python 3.11 applications on UBI 9. For more information about using this builder image, including OpenShift considerations, see https://github.com/sclorg/s2i-python-container/blob/master/3.11/README.md.", + "iconClass": "icon-python", + "tags": "builder,python", + "version": "3.11", + "sampleRepo": "https://github.com/sclorg/django-ex.git" + }, + "from": { + "kind": "DockerImage", + "name": "registry.access.redhat.com/ubi9/python-311:latest" + }, + "referencePolicy": { + "type": "Local" + } + }, { "name": "3.12-ubi9", "annotations": { @@ -123,20 +142,58 @@ "type": "Local" } }, + { + "name": "3.12-minimal-ubi9", + "annotations": { + "openshift.io/display-name": "Python 3.12-minimal (UBI 9)", + "openshift.io/provider-display-name": "Red Hat, Inc.", + "description": "Build and run Python 3.12-minimal applications on UBI 9. For more information about using this builder image, including OpenShift considerations, see https://github.com/sclorg/s2i-python-container/blob/master/3.12-minimal/README.md.", + "iconClass": "icon-python", + "tags": "builder,python", + "version": "3.12-minimal", + "sampleRepo": "https://github.com/sclorg/django-ex.git" + }, + "from": { + "kind": "DockerImage", + "name": "registry.access.redhat.com/ubi9/python-312-minimal:latest" + }, + "referencePolicy": { + "type": "Local" + } + }, + { + "name": "3.12-minimal-ubi10", + "annotations": { + "openshift.io/display-name": "Python 3.12-minimal (UBI 10)", + "openshift.io/provider-display-name": "Red Hat, Inc.", + "description": "Build and run Python 3.12-minimal applications on UBI 10. For more information about using this builder image, including OpenShift considerations, see https://github.com/sclorg/s2i-python-container/blob/master/3.12-minimal/README.md.", + "iconClass": "icon-python", + "tags": "builder,python", + "version": "3.12-minimal", + "sampleRepo": "https://github.com/sclorg/django-ex.git" + }, + "from": { + "kind": "DockerImage", + "name": "registry.access.redhat.com/ubi10/python-312-minimal:latest" + }, + "referencePolicy": { + "type": "Local" + } + }, { "name": "latest", "annotations": { - "openshift.io/display-name": "Python 3.9 (Latest)", + "openshift.io/display-name": "Python 3.12 (Latest)", "openshift.io/provider-display-name": "Red Hat, Inc.", - "description": "Build and run Python 3.9 applications on UBI 9. 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.\n\nWARNING: By selecting this tag, your application will automatically update to use the latest version available on OpenShift, including major version updates.\n", + "description": "Build and run Python 3.12 applications on UBI 9. For more information about using this builder image, including OpenShift considerations, see https://github.com/sclorg/s2i-python-container/blob/master/3.12/README.md.\n\nWARNING: By selecting this tag, your application will automatically update to use the latest version available on OpenShift, including major version updates.\n", "iconClass": "icon-python", "tags": "builder,python", - "version": "3.9", + "version": "3.12", "sampleRepo": "https://github.com/sclorg/django-ex.git" }, "from": { "kind": "ImageStreamTag", - "name": "3.9-ubi9" + "name": "3.12-ubi9" }, "referencePolicy": { "type": "Local" diff --git a/imagestreams/python-rhel-aarch64.json b/imagestreams/python-rhel-aarch64.json index 003f00ad..84aec37e 100644 --- a/imagestreams/python-rhel-aarch64.json +++ b/imagestreams/python-rhel-aarch64.json @@ -29,38 +29,38 @@ } }, { - "name": "3.8-ubi8", + "name": "3.9-ubi8", "annotations": { - "openshift.io/display-name": "Python 3.8 (UBI 8)", + "openshift.io/display-name": "Python 3.9 (UBI 8)", "openshift.io/provider-display-name": "Red Hat, Inc.", - "description": "Build and run Python 3.8 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.8/README.md.", + "description": "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.", "iconClass": "icon-python", "tags": "builder,python", - "version": "3.8", + "version": "3.9", "sampleRepo": "https://github.com/sclorg/django-ex.git" }, "from": { "kind": "DockerImage", - "name": "registry.redhat.io/ubi8/python-38:latest" + "name": "registry.redhat.io/ubi8/python-39:latest" }, "referencePolicy": { "type": "Local" } }, { - "name": "3.9-ubi8", + "name": "3.11-ubi8", "annotations": { - "openshift.io/display-name": "Python 3.9 (UBI 8)", + "openshift.io/display-name": "Python 3.11 (UBI 8)", "openshift.io/provider-display-name": "Red Hat, Inc.", - "description": "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.", + "description": "Build and run Python 3.11 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.11/README.md.", "iconClass": "icon-python", "tags": "builder,python", - "version": "3.9", + "version": "3.11", "sampleRepo": "https://github.com/sclorg/django-ex.git" }, "from": { "kind": "DockerImage", - "name": "registry.redhat.io/ubi8/python-39:latest" + "name": "registry.redhat.io/ubi8/python-311:latest" }, "referencePolicy": { "type": "Local" @@ -104,6 +104,25 @@ "type": "Local" } }, + { + "name": "3.11-ubi9", + "annotations": { + "openshift.io/display-name": "Python 3.11 (UBI 9)", + "openshift.io/provider-display-name": "Red Hat, Inc.", + "description": "Build and run Python 3.11 applications on UBI 9. For more information about using this builder image, including OpenShift considerations, see https://github.com/sclorg/s2i-python-container/blob/master/3.11/README.md.", + "iconClass": "icon-python", + "tags": "builder,python", + "version": "3.11", + "sampleRepo": "https://github.com/sclorg/django-ex.git" + }, + "from": { + "kind": "DockerImage", + "name": "registry.redhat.io/ubi9/python-311:latest" + }, + "referencePolicy": { + "type": "Local" + } + }, { "name": "3.12-ubi9", "annotations": { @@ -123,20 +142,58 @@ "type": "Local" } }, + { + "name": "3.12-minimal-ubi9", + "annotations": { + "openshift.io/display-name": "Python 3.12-minimal (UBI 9)", + "openshift.io/provider-display-name": "Red Hat, Inc.", + "description": "Build and run Python 3.12-minimal applications on UBI 9. For more information about using this builder image, including OpenShift considerations, see https://github.com/sclorg/s2i-python-container/blob/master/3.12-minimal/README.md.", + "iconClass": "icon-python", + "tags": "builder,python", + "version": "3.12-minimal", + "sampleRepo": "https://github.com/sclorg/django-ex.git" + }, + "from": { + "kind": "DockerImage", + "name": "registry.redhat.io/ubi9/python-312-minimal:latest" + }, + "referencePolicy": { + "type": "Local" + } + }, + { + "name": "3.12-minimal-ubi10", + "annotations": { + "openshift.io/display-name": "Python 3.12-minimal (UBI 10)", + "openshift.io/provider-display-name": "Red Hat, Inc.", + "description": "Build and run Python 3.12-minimal applications on UBI 10. For more information about using this builder image, including OpenShift considerations, see https://github.com/sclorg/s2i-python-container/blob/master/3.12-minimal/README.md.", + "iconClass": "icon-python", + "tags": "builder,python", + "version": "3.12-minimal", + "sampleRepo": "https://github.com/sclorg/django-ex.git" + }, + "from": { + "kind": "DockerImage", + "name": "registry.redhat.io/ubi10/python-312-minimal:latest" + }, + "referencePolicy": { + "type": "Local" + } + }, { "name": "latest", "annotations": { - "openshift.io/display-name": "Python 3.9 (Latest)", + "openshift.io/display-name": "Python 3.12 (Latest)", "openshift.io/provider-display-name": "Red Hat, Inc.", - "description": "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.\n\nWARNING: By selecting this tag, your application will automatically update to use the latest version available on OpenShift, including major version updates.\n", + "description": "Build and run Python 3.12 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.12/README.md.\n\nWARNING: By selecting this tag, your application will automatically update to use the latest version available on OpenShift, including major version updates.\n", "iconClass": "icon-python", "tags": "builder,python", - "version": "3.9", + "version": "3.12", "sampleRepo": "https://github.com/sclorg/django-ex.git" }, "from": { "kind": "ImageStreamTag", - "name": "3.9-ubi8" + "name": "3.12-ubi8" }, "referencePolicy": { "type": "Local" diff --git a/imagestreams/python-rhel.json b/imagestreams/python-rhel.json index 3de159b4..84aec37e 100644 --- a/imagestreams/python-rhel.json +++ b/imagestreams/python-rhel.json @@ -28,25 +28,6 @@ "type": "Local" } }, - { - "name": "3.8-ubi8", - "annotations": { - "openshift.io/display-name": "Python 3.8 (UBI 8)", - "openshift.io/provider-display-name": "Red Hat, Inc.", - "description": "Build and run Python 3.8 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.8/README.md.", - "iconClass": "icon-python", - "tags": "builder,python", - "version": "3.8", - "sampleRepo": "https://github.com/sclorg/django-ex.git" - }, - "from": { - "kind": "DockerImage", - "name": "registry.redhat.io/ubi8/python-38:latest" - }, - "referencePolicy": { - "type": "Local" - } - }, { "name": "3.9-ubi8", "annotations": { @@ -161,20 +142,58 @@ "type": "Local" } }, + { + "name": "3.12-minimal-ubi9", + "annotations": { + "openshift.io/display-name": "Python 3.12-minimal (UBI 9)", + "openshift.io/provider-display-name": "Red Hat, Inc.", + "description": "Build and run Python 3.12-minimal applications on UBI 9. For more information about using this builder image, including OpenShift considerations, see https://github.com/sclorg/s2i-python-container/blob/master/3.12-minimal/README.md.", + "iconClass": "icon-python", + "tags": "builder,python", + "version": "3.12-minimal", + "sampleRepo": "https://github.com/sclorg/django-ex.git" + }, + "from": { + "kind": "DockerImage", + "name": "registry.redhat.io/ubi9/python-312-minimal:latest" + }, + "referencePolicy": { + "type": "Local" + } + }, + { + "name": "3.12-minimal-ubi10", + "annotations": { + "openshift.io/display-name": "Python 3.12-minimal (UBI 10)", + "openshift.io/provider-display-name": "Red Hat, Inc.", + "description": "Build and run Python 3.12-minimal applications on UBI 10. For more information about using this builder image, including OpenShift considerations, see https://github.com/sclorg/s2i-python-container/blob/master/3.12-minimal/README.md.", + "iconClass": "icon-python", + "tags": "builder,python", + "version": "3.12-minimal", + "sampleRepo": "https://github.com/sclorg/django-ex.git" + }, + "from": { + "kind": "DockerImage", + "name": "registry.redhat.io/ubi10/python-312-minimal:latest" + }, + "referencePolicy": { + "type": "Local" + } + }, { "name": "latest", "annotations": { - "openshift.io/display-name": "Python 3.11 (Latest)", + "openshift.io/display-name": "Python 3.12 (Latest)", "openshift.io/provider-display-name": "Red Hat, Inc.", - "description": "Build and run Python 3.11 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.11/README.md.\n\nWARNING: By selecting this tag, your application will automatically update to use the latest version available on OpenShift, including major version updates.\n", + "description": "Build and run Python 3.12 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.12/README.md.\n\nWARNING: By selecting this tag, your application will automatically update to use the latest version available on OpenShift, including major version updates.\n", "iconClass": "icon-python", "tags": "builder,python", - "version": "3.11", + "version": "3.12", "sampleRepo": "https://github.com/sclorg/django-ex.git" }, "from": { "kind": "ImageStreamTag", - "name": "3.11-ubi8" + "name": "3.12-ubi8" }, "referencePolicy": { "type": "Local" diff --git a/specs/multispec.yml b/specs/multispec.yml index a1a09020..f5dba869 100644 --- a/specs/multispec.yml +++ b/specs/multispec.yml @@ -252,7 +252,6 @@ matrix: - fedora-40-x86_64 - centos-stream-10-x86_64 - centos-stream-9-x86_64 - - rhel-8-x86_64 - rhel-9-x86_64 - rhel-10-x86_64 version: "3.12-minimal" diff --git a/test/run-openshift-remote-cluster b/test/run-openshift-remote-cluster index 7f8f1779..ba32e357 100755 --- a/test/run-openshift-remote-cluster +++ b/test/run-openshift-remote-cluster @@ -14,9 +14,9 @@ source "${THISDIR}/test-lib-python.sh" source "${THISDIR}/test-lib-remote-openshift.sh" TEST_LIST="\ +test_python_imagestream test_python_s2i_app_ex_standalone test_python_s2i_app_ex -test_python_imagestream test_python_s2i_templates test_latest_imagestreams " diff --git a/test/test-lib-python.sh b/test/test-lib-python.sh index a520978a..4ed8cad0 100644 --- a/test/test-lib-python.sh +++ b/test/test-lib-python.sh @@ -12,16 +12,13 @@ source "${THISDIR}/test-lib.sh" source "${THISDIR}/test-lib-openshift.sh" function ct_pull_or_import_postgresql() { - if [[ "${VERSION}" == *"minimal"* ]]; then - VERSION=$(echo "${VERSION}" | cut -d "-" -f 1) - fi - if [[ "${VERSION}" == "3.11" ]] || [[ "${VERSION}" == "3.12" ]]; then + if [[ "${VERSION}" == "3.11" ]] || [[ "${VERSION}" == "3.12" ]] || [[ "${VERSION}" == "3.12-minimal" ]]; then postgresql_image="quay.io/sclorg/postgresql-12-c8s" image_short="postgresql:12" image_tag="${image_short}" else - postgresql_image="quay.io/centos7/postgresql-10-centos7:centos7" - image_short="postgresql:10-centos7" + postgresql_image="quay.io/sclorg/postgresql-10-c8s:c8s" + image_short="postgresql:10-c8s" image_tag="postgresql:10" fi # Variable CVP is set by CVP pipeline @@ -40,29 +37,28 @@ function ct_pull_or_import_postgresql() { # Check the imagestream function test_python_imagestream() { - local tag="-ubi7" - if [ "${OS}" == "rhel8" ]; then - tag="-ubi8" - elif [ "${OS}" == "rhel9" ]; then + local tag="-ubi8" + if [ "${OS}" == "rhel9" ]; then tag="-ubi9" + elif [ "${OS}" == "rhel10" ]; then + tag="-ubi10" fi - if [[ "${VERSION}" == *"minimal"* ]]; then - VERSION=$(echo "${VERSION}" | cut -d "-" -f 1) - fi - if [[ "${VERSION}" == "3.11" ]] || [[ "${VERSION}" == "3.12" ]]; then + + # On RHEL10 we have only 3.12-minimal image + if [[ "${VERSION}" == "3.11" ]] || [[ "${VERSION}" == "3.12" ]] || [[ "${VERSION}" == "3.12-minimal" ]]; then branch="4.2.x" postgresql_image="quay.io/sclorg/postgresql-12-c8s|postgresql:12" postgresql_version="12" else branch="master" - postgresql_image="quay.io/centos7/postgresql-10-centos7:centos7|postgresql:10" + postgresql_image="quay.io/sclorg/postgresql-10-c8s:c8s|postgresql:10" postgresql_version="10" fi TEMPLATES=" django-postgresql.json \ django-postgresql-persistent.json" for template in $TEMPLATES; do - ct_os_test_image_stream_quickstart "${THISDIR}/imagestreams/python-${OS%[0-9]*}.json" \ + ct_os_test_image_stream_quickstart "${THISDIR}/imagestreams/python-${OS//[0-9]/}.json" \ "https://raw.githubusercontent.com/sclorg/django-ex/${branch}/openshift/templates/${template}" \ "${IMAGE_NAME}" \ 'python' \ @@ -111,7 +107,7 @@ django-postgresql-persistent.json" postgresql_version="12" branch="4.2.x" else - postgresql_image="quay.io/centos7/postgresql-10-centos7:centos7|postgresql:10" + postgresql_image="quay.io/sclorg/postgresql-10-c8s:c8s|postgresql:10" postgresql_version="10" branch="2.2.x" fi diff --git a/test/test_deploy_templates.py b/test/test_deploy_templates.py index 6fdf643a..0deb7324 100644 --- a/test/test_deploy_templates.py +++ b/test/test_deploy_templates.py @@ -18,10 +18,12 @@ BRANCH_TO_TEST = "2.2.x" -DEPLOYED_PSQL_IMAGE = "quay.io/centos7/postgresql-10-centos7:centos7" +DEPLOYED_PSQL_IMAGE = "quay.io/sclorg/postgresql-10-c8s:c8s" IMAGE_TAG = "postgresql:10" PSQL_VERSION = "10" +if "minimal" in VERSION: + VERSION = VERSION.replace("-minimal", "") if Version(VERSION) >= Version("3.11"): BRANCH_TO_TEST = "4.2.x" DEPLOYED_PSQL_IMAGE = "quay.io/sclorg/postgresql-12-c8s" @@ -47,8 +49,6 @@ def teardown_method(self): ] ) def test_python_template_inside_cluster(self, template): - if OS == "rhel10": - pytest.skip("Do NOT test on rhel10. It is not released yet.") assert self.oc_api.upload_image(DEPLOYED_PSQL_IMAGE, IMAGE_TAG) service_name = f"python-{SHORT_VERSION}-test" template_url = self.oc_api.get_raw_url_for_json( diff --git a/test/test_helm_python_django_app.py b/test/test_helm_python_django_app.py index 09bba4bc..d0770398 100644 --- a/test/test_helm_python_django_app.py +++ b/test/test_helm_python_django_app.py @@ -13,11 +13,11 @@ OS = os.getenv("TARGET").lower() TAG = TAGS.get(OS) -DEPLOYED_PSQL_IMAGE = "quay.io/centos7/postgresql-10-centos7:centos7" +DEPLOYED_PSQL_IMAGE = "quay.io/sclorg/postgresql-10-c8s:c8s" IMAGE_TAG = "postgresql:10" PSQL_VERSION = "10" -if VERSION == "3.11" or VERSION == "3.12": +if VERSION == "3.11" or VERSION == "3.12" or VERSION == "3.12-minimal": DEPLOYED_PSQL_IMAGE = "quay.io/sclorg/postgresql-12-c8s" IMAGE_TAG = "postgresql:12" PSQL_VERSION = "12" @@ -38,11 +38,6 @@ def teardown_method(self): self.hc_api.delete_project() def test_django_application_helm_test(self): - if OS == "rhel10": - pytest.skip("Do NOT test on rhel10. It is not released yet.") - new_version = VERSION - if "minimal" in VERSION: - new_version = VERSION.replace("-minimal", "") self.hc_api.package_name = "redhat-python-imagestreams" assert self.hc_api.helm_package() assert self.hc_api.helm_installation() @@ -50,7 +45,7 @@ def test_django_application_helm_test(self): assert self.hc_api.helm_package() assert self.hc_api.helm_installation( values={ - "python_version": f"{new_version}{TAG}", + "python_version": f"{VERSION}{TAG}", "namespace": self.hc_api.namespace, "source_repository_ref": BRANCH_TO_TEST, } diff --git a/test/test_helm_python_django_psql_persistent.py b/test/test_helm_python_django_psql_persistent.py index 2f717a32..5eff424b 100644 --- a/test/test_helm_python_django_psql_persistent.py +++ b/test/test_helm_python_django_psql_persistent.py @@ -14,7 +14,7 @@ OS = os.getenv("TARGET").lower() TAG = TAGS.get(OS) -if VERSION == "3.11" or VERSION == "3.12": +if VERSION == "3.11" or VERSION == "3.12" or VERSION == "3.12-minimal": BRANCH_TO_TEST = "4.2.x" @@ -33,11 +33,6 @@ def teardown_method(self): self.hc_api.delete_project() def test_django_psql_helm_test(self): - if OS == "rhel10": - pytest.skip("Do NOT test on rhel10. It is not released yet.") - new_version = VERSION - if "minimal" in VERSION: - new_version = VERSION.replace("-minimal", "") self.hc_api.package_name = "redhat-postgresql-imagestreams" assert self.hc_api.helm_package() assert self.hc_api.helm_installation() @@ -48,7 +43,7 @@ def test_django_psql_helm_test(self): assert self.hc_api.helm_package() assert self.hc_api.helm_installation( values={ - "python_version": f"{new_version}{TAG}", + "python_version": f"{VERSION}{TAG}", "namespace": self.hc_api.namespace, "source_repository_ref": BRANCH_TO_TEST, } diff --git a/test/test_helm_python_imagestreams.py b/test/test_helm_python_imagestreams.py index 05e34be4..e5977ed5 100644 --- a/test/test_helm_python_imagestreams.py +++ b/test/test_helm_python_imagestreams.py @@ -25,6 +25,7 @@ def teardown_method(self): @pytest.mark.parametrize( "version,registry", [ + ("3.12-minimal-ubi10", "registry.redhat.io/ubi10/python-312-minimal:latest"), ("3.12-ubi9", "registry.redhat.io/ubi9/python-312:latest"), ("3.12-ubi8", "registry.redhat.io/ubi8/python-312:latest"), ("3.11-ubi9", "registry.redhat.io/ubi9/python-311:latest"), diff --git a/test/test_imagestreams_quickstart.py b/test/test_imagestreams_quickstart.py index 3a89ba98..8950e4f9 100644 --- a/test/test_imagestreams_quickstart.py +++ b/test/test_imagestreams_quickstart.py @@ -18,10 +18,12 @@ IMAGE_NAME = os.getenv("IMAGE_NAME") OS = os.getenv("TARGET").lower() -DEPLOYED_PSQL_IMAGE = "quay.io/centos7/postgresql-10-centos7:centos7" +DEPLOYED_PSQL_IMAGE = "quay.io/sclorg/postgresql-10-c8s:c8s" IMAGE_TAG = "postgresql:10" PSQL_VERSION = "10" +if "minimal" in VERSION: + VERSION = VERSION.replace("-minimal", "") if Version(VERSION) >= Version("3.11"): BRANCH_TO_TEST = "4.2.x" DEPLOYED_PSQL_IMAGE = "quay.io/sclorg/postgresql-12-c8s" @@ -50,8 +52,6 @@ def teardown_method(self): ] ) def test_python_template_inside_cluster(self, template): - if OS == "rhel10": - pytest.skip("Do not test on RHEL10. Imagestreams are not ready yet.") if self.oc_api.shared_cluster: assert self.oc_api.upload_image_to_external_registry(DEPLOYED_PSQL_IMAGE, IMAGE_TAG) else: diff --git a/test/test_python_ex_template.py b/test/test_python_ex_template.py index fd1bf8ab..765c690b 100644 --- a/test/test_python_ex_template.py +++ b/test/test_python_ex_template.py @@ -17,6 +17,8 @@ OS = os.getenv("TARGET").lower() BRANCH_TO_TEST = "2.2.x" +if "minimal" in VERSION: + VERSION = VERSION.replace("-minimal", "") if Version(VERSION) >= Version("3.11"): BRANCH_TO_TEST = "4.2.x" SHORT_VERSION = VERSION.replace(".", "") @@ -31,8 +33,6 @@ def teardown_method(self): self.oc_api.delete_project() def test_python_ex_template_inside_cluster(self): - if OS == "rhel10": - pytest.skip("Do NOT test on rhel10. It is not released yet.") service_name = f"python-{SHORT_VERSION}-test" assert self.oc_api.deploy_s2i_app( image_name=IMAGE_NAME, app=f"https://github.com/sclorg/django-ex.git#{BRANCH_TO_TEST}",