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

Enable building and testing Perl 5.40 in C10S #315

Merged
merged 12 commits into from
Aug 21, 2024
Merged

Conversation

phracek
Copy link
Member

@phracek phracek commented Aug 9, 2024

This pull request enables building and testing Perl 5.40 container in C10S

The pull request is separated into several commits:

  1. git move 5.38 to 5.40
  2. Copy sources back to 5.38 and commit
  3. Fix symlinks in test directory
  4. Copy Dockerfile.c9s to Dockerfile.c10s
  5. Make Dockerfiles a bit similar
  6. Fix Test suite
  7. Update Documentation and enable 5.40 in Makefile
  8. Update build-and-push action

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>
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>
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 9, 2024

Differences between Dockerfiles for faster analysis.

Difference between Fedora and C10S:

$ diff -u Dockerfile.fedora Dockerfile.c10s
--- Dockerfile.fedora	2024-08-09 12:44:04
+++ Dockerfile.c10s	2024-08-09 12:45:28
@@ -1,15 +1,13 @@
-FROM quay.io/fedora/s2i-base:40
+FROM quay.io/sclorg/s2i-base-c10s:c10s

 # This image provides a Perl 5.40 environment you can use to run your Perl applications.
+
 EXPOSE 8080

 # Image metadata
 ENV PERL_VERSION=5.40 \
     PERL_SHORT_VER=540 \
-    VERSION=0 \
-    NAME=perl \
-    PATH=/opt/app-root/src/extlib/bin:$PATH \
-    PERL5LIB=/opt/app-root/src/extlib/lib/perl5
+    NAME=perl

 ENV SUMMARY="Platform for building and running Perl $PERL_VERSION applications" \
     DESCRIPTION="Perl $PERL_VERSION available as container is a base platform for \
@@ -25,18 +23,21 @@
       io.k8s.description="$DESCRIPTION" \
       io.k8s.display-name="Apache 2.4 with mod_fcgid and Perl $PERL_VERSION" \
       io.openshift.expose-services="8080:http" \
-      io.openshift.tags="builder,${NAME},${NAME}${PERL_SHORT_VER}" \
+      io.openshift.tags="builder,${NAME},${NAME}${PERL_SHORT_VER}","${NAME}-${PERL_SHORT_VER}" \
       io.openshift.s2i.scripts-url="image:///usr/libexec/s2i" \
       io.s2i.scripts-url="image:///usr/libexec/s2i" \
-      name="fedora/$NAME-$PERL_SHORT_VER" \
-      com.redhat.component="$NAME" \
-      version="$VERSION" \
+      name="sclorg/${NAME}-${PERL_SHORT_VER}-c10s" \
+      com.redhat.component="${NAME}-${PERL_SHORT_VER}-container" \
+      version="1" \
+      com.redhat.license_terms="https://www.redhat.com/en/about/red-hat-end-user-license-agreements#UBI" \
       maintainer="SoftwareCollections.org <sclorg@redhat.com>" \
       help="For more information visit https://github.com/sclorg/s2i-${NAME}-container" \
-      usage="s2i build <SOURCE-REPOSITORY> quay.io/fedora/$NAME-$PERL_SHORT_VER <APP-NAME>"
+      usage="s2i build <SOURCE-REPOSITORY> quay.io/sclorg/${NAME}-${PERL_SHORT_VER}-c10s:latest <APP-NAME>"

+# Deselect a default stream
 RUN INSTALL_PKGS="perl perl-devel mod_fcgid perl-App-cpanminus perl-FCGI patch" && \
-    dnf install -y --setopt=tsflags=nodocs  $INSTALL_PKGS && \
+    dnf -y --allowerasing distrosync && \
+    dnf install -y --setopt=tsflags=nodocs $INSTALL_PKGS && \
     rpm -V $INSTALL_PKGS && \
     perl -v | grep -qe "v$PERL_VERSION\." && echo "Found VERSION $PERL_VERSION" && \
     dnf -y clean all --enablerepo='*'
@@ -51,7 +52,7 @@
 # writeable as OpenShift default security model is to run the container under
 # random UID.
 RUN mkdir -p ${APP_ROOT}/etc/httpd.d && \
-    sed -i -f ${APP_ROOT}/etc/httpdconf-fed.sed /etc/httpd/conf/httpd.conf && \
+    sed -i -f ${APP_ROOT}/etc/httpdconf.sed /etc/httpd/conf/httpd.conf && \
     chmod -R og+rwx /var/run/httpd /run/mod_fcgid ${APP_ROOT}/etc/httpd.d && \
     chown -R 1001:0 ${APP_ROOT} && chmod -R ug+rwx ${APP_ROOT} && \
     rpm-file-permissions

Difference between C9S and C10S

$ diff -u Dockerfile.c9s Dockerfile.c10s
--- Dockerfile.c9s	2024-08-09 12:44:13
+++ Dockerfile.c10s	2024-08-09 12:45:28
@@ -1,4 +1,4 @@
-FROM quay.io/sclorg/s2i-base-c9s:c9s
+FROM quay.io/sclorg/s2i-base-c10s:c10s

 # This image provides a Perl 5.40 environment you can use to run your Perl applications.

@@ -26,13 +26,13 @@
       io.openshift.tags="builder,${NAME},${NAME}${PERL_SHORT_VER}","${NAME}-${PERL_SHORT_VER}" \
       io.openshift.s2i.scripts-url="image:///usr/libexec/s2i" \
       io.s2i.scripts-url="image:///usr/libexec/s2i" \
-      name="sclorg/${NAME}-${PERL_SHORT_VER}-c9s" \
+      name="sclorg/${NAME}-${PERL_SHORT_VER}-c10s" \
       com.redhat.component="${NAME}-${PERL_SHORT_VER}-container" \
       version="1" \
       com.redhat.license_terms="https://www.redhat.com/en/about/red-hat-end-user-license-agreements#UBI" \
       maintainer="SoftwareCollections.org <sclorg@redhat.com>" \
       help="For more information visit https://github.com/sclorg/s2i-${NAME}-container" \
-      usage="s2i build <SOURCE-REPOSITORY> quay.io/sclorg/${NAME}-${PERL_SHORT_VER}-c9s:latest <APP-NAME>"
+      usage="s2i build <SOURCE-REPOSITORY> quay.io/sclorg/${NAME}-${PERL_SHORT_VER}-c10s:latest <APP-NAME>"

 # Deselect a default stream
 RUN INSTALL_PKGS="perl perl-devel mod_fcgid perl-App-cpanminus perl-FCGI patch" && \

@phracek

This comment was marked as outdated.

1 similar comment
@phracek

This comment was marked as outdated.

We should use 'run'

5.40/.exclude-fedora is present. We do not have s2i-base for F41 yet.

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

phracek commented Aug 19, 2024

[test]

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

Let's retest it

[test]

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

phracek commented Aug 21, 2024

Switch back to distrosync:

[test]

Copy link
Member

@jplesnik jplesnik left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The changes looks good for me.

@phracek phracek merged commit eb669dc into master Aug 21, 2024
7 checks passed
@phracek phracek deleted the support_c10s_perl_540 branch August 21, 2024 12:10
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