Skip to content
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

Add support for Testing Redis 7 in CentOS Stream 10 #181

Closed
wants to merge 4 commits into from

Conversation

phracek
Copy link
Member

@phracek phracek commented Jul 29, 2024

This pull request contains three updates.

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

Signed-off-by: Petr "Stone" Hracek <phracek@redhat.com>
Small rewrite in Dockerfile.fedora

Signed-off-by: Petr "Stone" Hracek <phracek@redhat.com>
Signed-off-by: Petr "Stone" Hracek <phracek@redhat.com>
Signed-off-by: Petr "Stone" Hracek <phracek@redhat.com>
@phracek
Copy link
Member Author

phracek commented Jul 29, 2024

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 <sclorg@redhat.com>"

 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 <sclorg@redhat.com>"

 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 <sclorg@redhat.com>"

 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
Copy link
Member Author

phracek commented Jul 29, 2024

[test]

@phracek
Copy link
Member Author

phracek commented Jul 29, 2024

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.

@notroj
Copy link

notroj commented Jul 29, 2024

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

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

@phracek
Copy link
Member Author

phracek commented Jul 31, 2024

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

@notroj
Copy link

notroj commented Jul 31, 2024

  • 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.

@phracek
Copy link
Member Author

phracek commented Aug 6, 2024

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

@phracek phracek closed this Aug 6, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants