redis-container icon indicating copy to clipboard operation
redis-container copied to clipboard

Add support for Testing Redis 7 in CentOS Stream 10

Open phracek opened this issue 1 year ago • 6 comments

This pull request contains three updates.

  • Adds Dockerfile.c10s for building and testing mariadb-container
  • Updates README's
  • Update build-and-push action

phracek avatar Jul 29 '24 07:07 phracek

Diffs between Dockerfiles.

Differences between Fedora and C10S:

$ diff -u 7/Dockerfile.fedora 7/Dockerfile.c10s
--- 7/Dockerfile.fedora	2024-07-29 09:29:32
+++ 7/Dockerfile.c10s	2024-07-29 09:25:33
@@ -1,4 +1,4 @@
-FROM quay.io/fedora/s2i-core:38
+FROM quay.io/sclorg/s2i-core-c10s:c10s

 # Redis image based on Software Collections packages
 #
@@ -25,10 +25,11 @@
       io.k8s.display-name="Redis $REDIS_VERSION" \
       io.openshift.expose-services="6379:redis" \
       io.openshift.tags="database,redis,redis$REDIS_VERSION,redis-$REDIS_VERSION" \
-      com.redhat.component="$NAME" \
-      name="fedora/$NAME-$REDIS_VERSION" \
+      com.redhat.component="redis-$REDIS_VERSION-container" \
+      name="sclorg/redis-$REDIS_VERSION-c10s" \
       version="$REDIS_VERSION" \
-      usage="podman run -d --name redis_database -p 6379:6379 quay.io/fedora/$NAME-$REDIS_VERSION" \
+      com.redhat.license_terms="https://www.redhat.com/en/about/red-hat-end-user-license-agreements#rhel" \
+      usage="podman run -d --name redis_database -p 6379:6379 quay.io/sclorg/redis-$REDIS_VERSION-c10s" \
       maintainer="SoftwareCollections.org <[email protected]>"

 EXPOSE 6379
@@ -44,9 +45,8 @@
 RUN getent group  redis &> /dev/null || groupadd -r redis &> /dev/null && \
     usermod -l redis -aG redis -c 'Redis Server' default &> /dev/null && \
 # Install gettext for envsubst command
-    dnf install -y yum-utils gettext policycoreutils && \
-    INSTALL_PKGS="redis" && \
-    dnf install -y --setopt=tsflags=nodocs --nogpgcheck $INSTALL_PKGS && \
+    INSTALL_PKGS="policycoreutils gettext redis" && \
+    dnf install -y --setopt=tsflags=nodocs $INSTALL_PKGS && \
     rpm -V $INSTALL_PKGS && \
     dnf -y clean all --enablerepo='*' && \
     redis-server --version | grep -qe "^Redis server v=$REDIS_VERSION\." && echo "Found VERSION $REDIS_VERSION" && \

Diff between C9S and C10S:

$ diff -u 7/Dockerfile.c9s 7/Dockerfile.c10s
--- 7/Dockerfile.c9s	2023-09-07 10:42:23
+++ 7/Dockerfile.c10s	2024-07-29 09:25:33
@@ -1,4 +1,4 @@
-FROM quay.io/sclorg/s2i-core-c9s:c9s
+FROM quay.io/sclorg/s2i-core-c10s:c10s

 # Redis image based on Software Collections packages
 #
@@ -26,10 +26,10 @@
       io.openshift.expose-services="6379:redis" \
       io.openshift.tags="database,redis,redis$REDIS_VERSION,redis-$REDIS_VERSION" \
       com.redhat.component="redis-$REDIS_VERSION-container" \
-      name="sclorg/redis-$REDIS_VERSION-c9s" \
-      version="1" \
+      name="sclorg/redis-$REDIS_VERSION-c10s" \
+      version="$REDIS_VERSION" \
       com.redhat.license_terms="https://www.redhat.com/en/about/red-hat-end-user-license-agreements#rhel" \
-      usage="podman run -d --name redis_database -p 6379:6379 quay.io/sclorg/redis-$REDIS_VERSION-c9s" \
+      usage="podman run -d --name redis_database -p 6379:6379 quay.io/sclorg/redis-$REDIS_VERSION-c10s" \
       maintainer="SoftwareCollections.org <[email protected]>"

 EXPOSE 6379
@@ -45,11 +45,10 @@
 RUN getent group  redis &> /dev/null || groupadd -r redis &> /dev/null && \
     usermod -l redis -aG redis -c 'Redis Server' default &> /dev/null && \
 # Install gettext for envsubst command
-    yum -y module enable redis:$REDIS_VERSION && \
-    INSTALL_PKGS="policycoreutils redis" && \
-    yum install -y --setopt=tsflags=nodocs $INSTALL_PKGS && \
+    INSTALL_PKGS="policycoreutils gettext redis" && \
+    dnf install -y --setopt=tsflags=nodocs $INSTALL_PKGS && \
     rpm -V $INSTALL_PKGS && \
-    yum -y clean all --enablerepo='*' && \
+    dnf -y clean all --enablerepo='*' && \
     redis-server --version | grep -qe "^Redis server v=$REDIS_VERSION\." && echo "Found VERSION $REDIS_VERSION" && \
     mkdir -p /var/lib/redis/data && chown -R redis.0 /var/lib/redis && \
     [[ "$(id redis)" == "uid=1001(redis)"* ]]

Diff between RHEL9 and C10S:

$ diff -u 7/Dockerfile.rhel9 7/Dockerfile.c10s
--- 7/Dockerfile.rhel9	2023-09-07 10:42:23
+++ 7/Dockerfile.c10s	2024-07-29 09:25:33
@@ -1,4 +1,4 @@
-FROM ubi9/s2i-core:1
+FROM quay.io/sclorg/s2i-core-c10s:c10s

 # Redis image based on Software Collections packages
 #
@@ -26,10 +26,10 @@
       io.openshift.expose-services="6379:redis" \
       io.openshift.tags="database,redis,redis$REDIS_VERSION,redis-$REDIS_VERSION" \
       com.redhat.component="redis-$REDIS_VERSION-container" \
-      name="rhel9/redis-$REDIS_VERSION" \
-      version="1" \
+      name="sclorg/redis-$REDIS_VERSION-c10s" \
+      version="$REDIS_VERSION" \
       com.redhat.license_terms="https://www.redhat.com/en/about/red-hat-end-user-license-agreements#rhel" \
-      usage="podman run -d --name redis_database -p 6379:6379 rhel9/redis-$REDIS_VERSION" \
+      usage="podman run -d --name redis_database -p 6379:6379 quay.io/sclorg/redis-$REDIS_VERSION-c10s" \
       maintainer="SoftwareCollections.org <[email protected]>"

 EXPOSE 6379
@@ -45,11 +45,10 @@
 RUN getent group  redis &> /dev/null || groupadd -r redis &> /dev/null && \
     usermod -l redis -aG redis -c 'Redis Server' default &> /dev/null && \
 # Install gettext for envsubst command
-    yum -y module enable redis:$REDIS_VERSION && \
-    INSTALL_PKGS="policycoreutils redis" && \
-    yum install -y --setopt=tsflags=nodocs $INSTALL_PKGS && \
+    INSTALL_PKGS="policycoreutils gettext redis" && \
+    dnf install -y --setopt=tsflags=nodocs $INSTALL_PKGS && \
     rpm -V $INSTALL_PKGS && \
-    yum -y clean all --enablerepo='*' && \
+    dnf -y clean all --enablerepo='*' && \
     redis-server --version | grep -qe "^Redis server v=$REDIS_VERSION\." && echo "Found VERSION $REDIS_VERSION" && \
     mkdir -p /var/lib/redis/data && chown -R redis.0 /var/lib/redis && \
     [[ "$(id redis)" == "uid=1001(redis)"* ]]

phracek avatar Jul 29 '24 08:07 phracek

[test]

phracek avatar Jul 29 '24 08:07 phracek

Tests passed locally:

==============================================
Tests were run for image quay.io/sclorg/redis-7-c10s:7
==============================================
Test cases results:

 [PASSED] for 'redis_tests' run_container_creation_tests (00:00:01)
 [PASSED] for 'redis_tests' run_tests_no_root (00:00:05)
 [PASSED] for 'redis_tests' run_tests_no_pass (00:00:04)
 [PASSED] for 'redis_tests' run_tests_no_pass_altuid (00:00:04)
 [PASSED] for 'redis_tests' run_tests_no_root_altuid (00:00:04)
 [PASSED] for 'redis_tests' run_change_password_test (00:00:03)
 [PASSED] for 'redis_tests' run_doc_test (00:00:00)
 [PASSED] for 'redis_tests' run_bind_address_test (00:00:02)
 [PASSED] for 'redis_tests' run_no_bind_address_test (00:00:04)

Tests for quay.io/sclorg/redis-7-c10s:7 succeeded.

phracek avatar Jul 29 '24 09:07 phracek

We will be dropping Redis from c10s soon, we need to plan for a Valkey container instead.

https://issues.redhat.com/browse/RHEL-29939

notroj avatar Jul 29 '24 10:07 notroj

We will be dropping Redis from c10s soon, we need to plan for a Valkey container instead.

https://issues.redhat.com/browse/RHEL-29939

@notroj I know about it. I would like to add this and later on as soon as Valkey is present. Let's migrate it, If it makes sense. Or we will create a new repository, called valkey-container? @hhorak WDYT

phracek avatar Jul 31 '24 14:07 phracek

  • The redis package will be gone from the compose hopefully in the next week (we were blocked by one dependency). So I'm not sure it's worth the effort trying to get this working for a very short period of time
  • We shouldn't package valkey into a redis container to just keep that existing... yep, +1 to a valkey-container repo.

notroj avatar Jul 31 '24 15:07 notroj

Closing as it will be replaced by valkey-container soon. in repository https://github.com/sclorg/valkey-container

phracek avatar Aug 06 '24 12:08 phracek