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

Support c10s #150

Merged
merged 3 commits into from
Aug 21, 2024
Merged

Support c10s #150

merged 3 commits into from
Aug 21, 2024

Conversation

phracek
Copy link
Member

@phracek phracek commented Aug 7, 2024

This pull request is separated into two pull requests

  • Add support for CentOS Stream 10 support
  • Update documentation

This pull request is blocked by devexp-db/distgen#142

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 Aug 20, 2024

[test]

@phracek
Copy link
Member Author

phracek commented Aug 20, 2024

Differences between Dockerfiles are shown below.
Distgen is used for generation. :)

Diff 7/Dockerfile.fedora and 7/Dockerfile.c10s:

$ diff -u 7/Dockerfile.fedora 7/Dockerfile.c10s
--- 7/Dockerfile.fedora	2024-08-20 16:42:47
+++ 7/Dockerfile.c10s	2024-08-20 16:42:47
@@ -1,4 +1,4 @@
-FROM quay.io/fedora/s2i-core:39
+FROM quay.io/sclorg/s2i-core-c10s:c10s
 EXPOSE 8080
 EXPOSE 8443

@@ -8,7 +8,6 @@
 Varnish Cache stores web pages in memory so web servers don't have to create \
 the same web page over and over again. Varnish Cache serves pages much faster \
 than any application server; giving the website a significant speed up." \
-    VERSION=0 \
     VARNISH_VCL=/etc/varnish/default.vcl \
     VARNISH_CONFIGURATION_PATH=/etc/varnish \
     VARNISH_VERSION=7
@@ -18,22 +17,23 @@
       io.k8s.description="$DESCRIPTION" \
       io.k8s.display-name="Varnish 7" \
       io.openshift.expose-services="8080:http,8443:https" \
-      io.openshift.tags="builder,varnish" \
-      version="$VERSION" \
-      com.redhat.component="varnish" \
-      usage="s2i build https://github.com/sclorg/varnish-container.git --context-dir=7/test/test-app/ quay.io/fedora/varnish-7 sample-server" \
-      name="fedora/varnish-7" \
+      io.openshift.tags="builder,varnish7,varnish-7" \
+      com.redhat.component="varnish-7-container" \
+      com.redhat.license_terms="https://www.redhat.com/en/about/red-hat-end-user-license-agreements#rhel" \
+      version="1" \
+      usage="s2i build https://github.com/sclorg/varnish-container.git --context-dir=7/test/test-app/ quay.io/sclorg/varnish-7-c10s sample-server" \
+      name="sclorg/varnish-7-c10s" \
       maintainer="Uhliarik Lubos <luhliari@redhat.com>"

-RUN INSTALL_PKGS="gettext hostname nss_wrapper bind-utils varnish" && \
-    dnf -y --setopt=tsflags=nodocs install $INSTALL_PKGS && \
+RUN INSTALL_PKGS="gettext hostname nss_wrapper bind-utils varnish gcc" && \
+    yum -y --setopt=tsflags=nodocs install $INSTALL_PKGS && \
     rpm -V $INSTALL_PKGS && \
     fix-permissions $VARNISH_CONFIGURATION_PATH && \
     fix-permissions /var/lib/varnish && \
     varnishd -V 2>&1 | grep -qe "varnish-$VARNISH_VERSION\." && echo "Found VERSION $VARNISH_VERSION" && \
     rm -f /etc/profile.d/lang.sh && \
     rm -f /etc/profile.d/lang.csh && \
-    dnf -y clean all --enablerepo='*'
+    yum -y clean all --enablerepo='*'

 # Copy the S2I scripts from the specific language image to $STI_SCRIPTS_PATH

Diff 6/Dockerfile.c9s and 7/Dockerfile.c10s:

$ diff -u 6/Dockerfile.c9s 7/Dockerfile.c10s
--- 6/Dockerfile.c9s	2024-08-20 16:42:45
+++ 7/Dockerfile.c10s	2024-08-20 16:42:47
@@ -1,4 +1,4 @@
-FROM quay.io/sclorg/s2i-core-c9s:c9s
+FROM quay.io/sclorg/s2i-core-c10s:c10s
 EXPOSE 8080
 EXPOSE 8443

@@ -10,19 +10,19 @@
 than any application server; giving the website a significant speed up." \
     VARNISH_VCL=/etc/varnish/default.vcl \
     VARNISH_CONFIGURATION_PATH=/etc/varnish \
-    VARNISH_VERSION=6
+    VARNISH_VERSION=7

 LABEL summary="$SUMMARY" \
       description="$DESCRIPTION" \
       io.k8s.description="$DESCRIPTION" \
-      io.k8s.display-name="Varnish 6" \
+      io.k8s.display-name="Varnish 7" \
       io.openshift.expose-services="8080:http,8443:https" \
-      io.openshift.tags="builder,varnish6,varnish-6" \
-      com.redhat.component="varnish-6-container" \
+      io.openshift.tags="builder,varnish7,varnish-7" \
+      com.redhat.component="varnish-7-container" \
       com.redhat.license_terms="https://www.redhat.com/en/about/red-hat-end-user-license-agreements#rhel" \
       version="1" \
-      usage="s2i build https://github.com/sclorg/varnish-container.git --context-dir=6/test/test-app/ quay.io/sclorg/varnish-6-c9s sample-server" \
-      name="sclorg/varnish-6-c9s" \
+      usage="s2i build https://github.com/sclorg/varnish-container.git --context-dir=7/test/test-app/ quay.io/sclorg/varnish-7-c10s sample-server" \
+      name="sclorg/varnish-7-c10s" \
       maintainer="Uhliarik Lubos <luhliari@redhat.com>"

 RUN INSTALL_PKGS="gettext hostname nss_wrapper bind-utils varnish gcc" && \
@@ -36,10 +36,10 @@
     yum -y clean all --enablerepo='*'

 # Copy the S2I scripts from the specific language image to $STI_SCRIPTS_PATH
-COPY 6/s2i/bin/ $STI_SCRIPTS_PATH
+COPY 7/s2i/bin/ $STI_SCRIPTS_PATH

 # Copy extra files to the image.
-COPY 6/root/ /
+COPY 7/root/ /

 RUN chmod -R a+rwx ${APP_ROOT}/etc && \
     chown -R 1001:0 ${APP_ROOT}

Diff 6/Dockerfile.rhel9 and 7/Dockerfile.c10s:

$ diff -u 6/Dockerfile.rhel9 7/Dockerfile.c10s
--- 6/Dockerfile.rhel9	2024-08-20 16:42:45
+++ 7/Dockerfile.c10s	2024-08-20 16:42:47
@@ -1,4 +1,4 @@
-FROM ubi9/s2i-core:1
+FROM quay.io/sclorg/s2i-core-c10s:c10s
 EXPOSE 8080
 EXPOSE 8443

@@ -10,19 +10,19 @@
 than any application server; giving the website a significant speed up." \
     VARNISH_VCL=/etc/varnish/default.vcl \
     VARNISH_CONFIGURATION_PATH=/etc/varnish \
-    VARNISH_VERSION=6
+    VARNISH_VERSION=7

 LABEL summary="$SUMMARY" \
       description="$DESCRIPTION" \
       io.k8s.description="$DESCRIPTION" \
-      io.k8s.display-name="Varnish 6" \
+      io.k8s.display-name="Varnish 7" \
       io.openshift.expose-services="8080:http,8443:https" \
-      io.openshift.tags="builder,varnish6,varnish-6" \
-      com.redhat.component="varnish-6-container" \
+      io.openshift.tags="builder,varnish7,varnish-7" \
+      com.redhat.component="varnish-7-container" \
       com.redhat.license_terms="https://www.redhat.com/en/about/red-hat-end-user-license-agreements#rhel" \
       version="1" \
-      usage="s2i build https://github.com/sclorg/varnish-container.git --context-dir=6/test/test-app/ rhel9/varnish-6 sample-server" \
-      name="rhel9/varnish-6" \
+      usage="s2i build https://github.com/sclorg/varnish-container.git --context-dir=7/test/test-app/ quay.io/sclorg/varnish-7-c10s sample-server" \
+      name="sclorg/varnish-7-c10s" \
       maintainer="Uhliarik Lubos <luhliari@redhat.com>"

 RUN INSTALL_PKGS="gettext hostname nss_wrapper bind-utils varnish gcc" && \
@@ -36,10 +36,10 @@
     yum -y clean all --enablerepo='*'

 # Copy the S2I scripts from the specific language image to $STI_SCRIPTS_PATH
-COPY 6/s2i/bin/ $STI_SCRIPTS_PATH
+COPY 7/s2i/bin/ $STI_SCRIPTS_PATH

 # Copy extra files to the image.
-COPY 6/root/ /
+COPY 7/root/ /

 RUN chmod -R a+rwx ${APP_ROOT}/etc && \
     chown -R 1001:0 ${APP_ROOT}

@phracek
Copy link
Member Author

phracek commented Aug 21, 2024

Differences between dockerfiles.

Difference between 7/Dockerfile.fedora and 7/Dockerfile.c10s:

$ diff -u 7/Dockerfile.fedora 7/Dockerfile.c10s
--- 7/Dockerfile.fedora	2024-08-20 16:42:47
+++ 7/Dockerfile.c10s	2024-08-20 16:42:47
@@ -1,4 +1,4 @@
-FROM quay.io/fedora/s2i-core:39
+FROM quay.io/sclorg/s2i-core-c10s:c10s
 EXPOSE 8080
 EXPOSE 8443

@@ -8,7 +8,6 @@
 Varnish Cache stores web pages in memory so web servers don't have to create \
 the same web page over and over again. Varnish Cache serves pages much faster \
 than any application server; giving the website a significant speed up." \
-    VERSION=0 \
     VARNISH_VCL=/etc/varnish/default.vcl \
     VARNISH_CONFIGURATION_PATH=/etc/varnish \
     VARNISH_VERSION=7
@@ -18,22 +17,23 @@
       io.k8s.description="$DESCRIPTION" \
       io.k8s.display-name="Varnish 7" \
       io.openshift.expose-services="8080:http,8443:https" \
-      io.openshift.tags="builder,varnish" \
-      version="$VERSION" \
-      com.redhat.component="varnish" \
-      usage="s2i build https://github.com/sclorg/varnish-container.git --context-dir=7/test/test-app/ quay.io/fedora/varnish-7 sample-server" \
-      name="fedora/varnish-7" \
+      io.openshift.tags="builder,varnish7,varnish-7" \
+      com.redhat.component="varnish-7-container" \
+      com.redhat.license_terms="https://www.redhat.com/en/about/red-hat-end-user-license-agreements#rhel" \
+      version="1" \
+      usage="s2i build https://github.com/sclorg/varnish-container.git --context-dir=7/test/test-app/ quay.io/sclorg/varnish-7-c10s sample-server" \
+      name="sclorg/varnish-7-c10s" \
       maintainer="Uhliarik Lubos <luhliari@redhat.com>"

-RUN INSTALL_PKGS="gettext hostname nss_wrapper bind-utils varnish" && \
-    dnf -y --setopt=tsflags=nodocs install $INSTALL_PKGS && \
+RUN INSTALL_PKGS="gettext hostname nss_wrapper bind-utils varnish gcc" && \
+    yum -y --setopt=tsflags=nodocs install $INSTALL_PKGS && \
     rpm -V $INSTALL_PKGS && \
     fix-permissions $VARNISH_CONFIGURATION_PATH && \
     fix-permissions /var/lib/varnish && \
     varnishd -V 2>&1 | grep -qe "varnish-$VARNISH_VERSION\." && echo "Found VERSION $VARNISH_VERSION" && \
     rm -f /etc/profile.d/lang.sh && \
     rm -f /etc/profile.d/lang.csh && \
-    dnf -y clean all --enablerepo='*'
+    yum -y clean all --enablerepo='*'

 # Copy the S2I scripts from the specific language image to $STI_SCRIPTS_PATH
 COPY 7/s2i/bin/ $STI_SCRIPTS_PATH

Difference between 6/Dockerfile.rhel9 and 7/Dockerfile.c10s:

$ diff -u 6/Dockerfile.rhel9 7/Dockerfile.c10s
--- 6/Dockerfile.rhel9	2024-08-20 16:42:45
+++ 7/Dockerfile.c10s	2024-08-20 16:42:47
@@ -1,4 +1,4 @@
-FROM ubi9/s2i-core:1
+FROM quay.io/sclorg/s2i-core-c10s:c10s
 EXPOSE 8080
 EXPOSE 8443

@@ -10,19 +10,19 @@
 than any application server; giving the website a significant speed up." \
     VARNISH_VCL=/etc/varnish/default.vcl \
     VARNISH_CONFIGURATION_PATH=/etc/varnish \
-    VARNISH_VERSION=6
+    VARNISH_VERSION=7

 LABEL summary="$SUMMARY" \
       description="$DESCRIPTION" \
       io.k8s.description="$DESCRIPTION" \
-      io.k8s.display-name="Varnish 6" \
+      io.k8s.display-name="Varnish 7" \
       io.openshift.expose-services="8080:http,8443:https" \
-      io.openshift.tags="builder,varnish6,varnish-6" \
-      com.redhat.component="varnish-6-container" \
+      io.openshift.tags="builder,varnish7,varnish-7" \
+      com.redhat.component="varnish-7-container" \
       com.redhat.license_terms="https://www.redhat.com/en/about/red-hat-end-user-license-agreements#rhel" \
       version="1" \
-      usage="s2i build https://github.com/sclorg/varnish-container.git --context-dir=6/test/test-app/ rhel9/varnish-6 sample-server" \
-      name="rhel9/varnish-6" \
+      usage="s2i build https://github.com/sclorg/varnish-container.git --context-dir=7/test/test-app/ quay.io/sclorg/varnish-7-c10s sample-server" \
+      name="sclorg/varnish-7-c10s" \
       maintainer="Uhliarik Lubos <luhliari@redhat.com>"

 RUN INSTALL_PKGS="gettext hostname nss_wrapper bind-utils varnish gcc" && \
@@ -36,10 +36,10 @@
     yum -y clean all --enablerepo='*'

 # Copy the S2I scripts from the specific language image to $STI_SCRIPTS_PATH
-COPY 6/s2i/bin/ $STI_SCRIPTS_PATH
+COPY 7/s2i/bin/ $STI_SCRIPTS_PATH

 # Copy extra files to the image.
-COPY 6/root/ /
+COPY 7/root/ /

 RUN chmod -R a+rwx ${APP_ROOT}/etc && \
     chown -R 1001:0 ${APP_ROOT}

@phracek
Copy link
Member Author

phracek commented Aug 21, 2024

@uhliarik PTAL and let me know if something is not correct. Tests PASSED ;)

@uhliarik
Copy link
Member

@phracek LGTM. This change makes sense, since in c10s we have varnish 7.

@phracek phracek merged commit 7a8c97e into master Aug 21, 2024
6 checks passed
@phracek phracek deleted the support_c10s branch August 21, 2024 12:34
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