Git Product home page Git Product logo

sclorg / s2i-perl-container Goto Github PK

View Code? Open in Web Editor NEW
16.0 15.0 56.0 553 KB

Perl container images based on Red Hat Software Collections and intended for OpenShift and general usage, that provide a platform for building and running Perl applications. Users can choose between Red Hat Enterprise Linux, Fedora, and CentOS based images.

Home Page: http://softwarecollections.org

License: Apache License 2.0

Shell 70.75% Perl 2.56% Makefile 0.39% sed 5.15% Dockerfile 7.42% Python 13.73%
perl rhel centos dockerfile openshift s2i source-to-image container fedora

s2i-perl-container's Introduction

Perl container images

Build and push images to Quay.io registry

Images available on Quay are:

This repository contains the source for building various versions of the Perl application as a reproducible container image using source-to-image. Users can choose between RHEL and CentOS based builder images. The resulting image can be run using podman.

For more information about using these images with OpenShift, please see the official OpenShift Origin documentation.

For more information about contributing, see the Contribution Guidelines. For more information about concepts used in these container images, see the Landing page.

Versions

Perl versions currently provided:

RHEL versions currently supported:

  • RHEL8
  • RHEL9

CentOS versions currently supported:

  • CentOS Stream 9
  • CentOS Stream 10

Installation

To build a Perl image, choose either the CentOS Stream or RHEL based image:

  • RHEL based image

    These images are available in the Red Hat Container Catalog. To download it run:

    $ podman pull registry.access.redhat.com/rhel8/perl-532
    

    To build a RHEL based Perl image, you need to run the build on a properly subscribed RHEL machine.

    $ git clone --recursive https://github.com/sclorg/s2i-perl-container.git
    $ cd s2i-perl-container
    $ make build TARGET=rhel8 VERSIONS=5.32
    
  • CentOS Stream based image

    This image is available on DockerHub. To download the perl-5.32 image, run:

    $ podman pull quay.io/sclorg/perl-532
    

    To build the perl-5.32 image from scratch run:

    $ git clone --recursive https://github.com/sclorg/s2i-perl-container.git
    $ cd s2i-perl-container
    $ make build TARGET=c9s VERSIONS=5.32
    

Note: while the installation steps are calling podman, you can replace any such calls by docker with the same arguments.

Notice: By omitting the VERSIONS parameter, the build/test action will be performed on all provided versions of Perl.

Usage

For information about usage of the Dockerfile for Perl 5.30, see usage documentation.

For information about usage of the Dockerfile for Perl 5.32 - mod_fcgid version, see usage documentation.

For information about usage of the Dockerfile for Perl 5.34 - mod_fcgid version, see usage documentation.

For information about usage of the Dockerfile for Perl 5.36 - mod_fcgid version, see usage documentation.

For information about usage of the Dockerfile for Perl 5.38 - mod_fcgid version, see usage documentation.

For information about usage of the Dockerfile for Perl 5.40 - mod_fcgid version, see usage documentation.

Test

This repository also provides a S2I test framework, which launches tests to check functionality of a simple Perl application built on top of the s2i-perl image.

Users can choose between testing a Perl test application based on a RHEL or CentOS image.

  • RHEL based image

    To test a RHEL8-based image, you need to run the test on a properly subscribed RHEL machine.

    $ cd s2i-perl-container
    $ make test TARGET=rhel8 VERSIONS=5.32
    
  • CentOS Stream based image

    $ cd s2i-perl-container
    $ make test TARGET=c9s VERSIONS=5.32
    

Notice: By omitting the VERSIONS parameter, the build/test action will be performed on all of the provided versions of Perl.

Repository organization

  • <perl-version>

    • Dockerfile.c9s

      CentOS Stream based Dockerfile.

    • Dockerfile.c10s

      CentOS Stream based Dockerfile.

    • Dockerfile.rhel8

      RHEL based Dockerfile. In order to perform build or test actions on this Dockerfile you need to run the action on a properly subscribed RHEL machine.

    • s2i/bin/

      This folder contains scripts that are run by S2I:

      • assemble

        Used to install the sources into a location where the application will be run and prepare the application for deployment (eg. installing modules, etc.). In order to install application dependencies, the application must contain a cpanfile file, in which the user specifies the modules and their versions. An example of a cpanfile is available within our test application.

        All files with .cgi and .pl extension are handled by mod_perl. If exactly one file with .psgi extension exists in the top-level directory, the mod_perl will be autoconfigured to execute the PSGI application for any request URI path with Plack's mod_perl adaptor.

      • run

        This script is responsible for running the application, using the Apache web server.

      • usage*

        This script prints the usage of this image.

    • contrib/

      This folder contains a file with commonly used modules.

    • test/

      This folder contains the S2I test framework.

      • sample-test-app/

        A simple Perl application used for testing purposes by the S2I test framework.

      • run

        This script runs the S2I test framework.

s2i-perl-container's People

Contributors

bparees avatar coreydaley avatar csrwng avatar danielhelfand avatar dependabot[bot] avatar dinhxuanvu avatar eliskasl avatar ewolinetz avatar fila43 avatar hhorak avatar jhadvig avatar jplesnik avatar mfojtik avatar michal-josef-spacek avatar mnagy avatar omron93 avatar php-coder avatar phracek avatar pkubatrh avatar ppisar avatar praiskup avatar pvalena avatar rhcarvalho avatar sdodson avatar soltysh avatar spinolacastro avatar stevekuznetsov avatar torsava avatar yselkowitz avatar zmiklank avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

s2i-perl-container's Issues

s21-perl-container is failing with DBD::mysql 5.x

Container platform

No response

Version

All versions

OS version of the container image

No response

Bugzilla, Jira

No response

Description

On all version, test_from_dockerfile is failing.
It uses dancer-ex which install DBD::mysql directly from CPAN.
DBD::mysql requires MySQL 8.x for build since version 5.x, but the container contains mariadb.

The recommendation is replace using DBD::MariaDB instead of DBD::mysql.

Reproducer

No response

Test cases described as [PASSED] even though they failed

The code in master is now failing tests because of missing fix from common scripts. However, the failing test is still described as [PASSED]:

Version to check is 5.30.
Checking file imagestreams/perl-rhel.json.
Checking file imagestreams/perl-rhel-aarch64.json.
The latest version is not present in imagestreams/perl-rhel-aarch64.json or in latest tag.
Checking file imagestreams/perl-centos.json.
[PASSED] test_latest_imagestreams

Tests for centos/perl-526-centos7:5.26 failed.
make: *** [common/common.mk:94: test] Error 1

@phracek Can you take a look?

Installed perl modules are not accessible in script

I have script begins with:
`#!/usr/bin/perl

use strict;
use warnings;

use Math::Round;
use utf8;
use XML::LibXML::Reader;
`

cpanfile file:
requires 'Math::Round', '== 0.06'; requires 'XML::LibXML::Reader', '== 2.0132';

Both located in tests2i folder, inside this folder I run command:
s2i build . centos/perl-526-centos7 test-cos

Build log here:

---> Installing application source ... ---> Installing modules from cpanfile ... --> Working on Module::CoreList Fetching http://www.cpan.org/authors/id/B/BI/BINGOS/Module-CoreList-5.20181020.tar.gz ... OK Configuring Module-CoreList-5.20181020 ... OK Building Module-CoreList-5.20181020 ... OK Successfully installed Module-CoreList-5.20181020 (upgraded from 5.20171120) 1 distribution installed --> Working on . Configuring /opt/app-root/src ... OK ==> Found dependencies: XML::LibXML::Reader, Math::Round --> Working on XML::LibXML::Reader Fetching http://www.cpan.org/authors/id/S/SH/SHLOMIF/XML-LibXML-2.0132.tar.gz ... OK Configuring XML-LibXML-2.0132 ... OK ==> Found dependencies: XML::SAX, XML::SAX::Exception, XML::SAX::Base, XML::NamespaceSupport --> Working on XML::SAX Fetching http://www.cpan.org/authors/id/G/GR/GRANTM/XML-SAX-1.00.tar.gz ... OK Configuring XML-SAX-1.00 ... OK ==> Found dependencies: XML::NamespaceSupport, XML::SAX::Base --> Working on XML::NamespaceSupport Fetching http://www.cpan.org/authors/id/P/PE/PERIGRIN/XML-NamespaceSupport-1.12.tar.gz ... OK Configuring XML-NamespaceSupport-1.12 ... OK Building XML-NamespaceSupport-1.12 ... OK Successfully installed XML-NamespaceSupport-1.12 --> Working on XML::SAX::Base Fetching http://www.cpan.org/authors/id/G/GR/GRANTM/XML-SAX-Base-1.09.tar.gz ... OK Configuring XML-SAX-Base-1.09 ... OK Building XML-SAX-Base-1.09 ... OK Successfully installed XML-SAX-Base-1.09 Building XML-SAX-1.00 ... OK Successfully installed XML-SAX-1.00 Building XML-LibXML-2.0132 ... OK Successfully installed XML-LibXML-2.0132 --> Working on Math::Round Fetching http://backpan.perl.org/authors/id/G/GR/GROMMEL/Math-Round-0.06.tar.gz ... OK Configuring Math-Round-0.06 ... OK Building Math-Round-0.06 ... OK Successfully installed Math-Round-0.06 <== Installed dependencies for .. Finishing. 5 distributions installed Build completed successfully

It seems ok, dependencies found and installed. I run container:
docker run -d -p 8080:8080 test-cos

and exec bash. Inside I try:
perl zapret.pl

thats give error:

Can't locate Math/Round.pm in @INC (you may need to install the Math::Round module) (@INC contains: /opt/rh/rh-perl526/root/usr/local/lib64/perl5 /opt/rh/rh-perl526/root/usr/local/share/perl5 /opt/rh/rh-perl526/root/usr/lib64/perl5/vendor_perl /opt/rh/rh-perl526/root/usr/share/perl5/vendor_perl /opt/rh/rh-perl526/root/usr/lib64/perl5 /opt/rh/rh-perl526/root/usr/share/perl5) at zapret.pl line 6. BEGIN failed--compilation aborted at zapret.pl line 6.

What do I do wrong ?

Fix testing imagestreams on OpenShift 4 for mod_fcid versions

See error log:

 Checking APP using ct_os_test_response_internal 'http://172.30.46.117:8080' '200' 'Everything is OK' ...
command POD not running yet, will start one called command-app registry.access.redhat.com/ubi7/ubi
pod/command-app created
Waiting for command POD .NAME                    READY   STATUS              RESTARTS   AGE
command-app             0/1     ContainerCreating   0          64s
perl-testing-1-build    0/1     Completed           0          5m56s
perl-testing-1-deploy   0/1     Error               0          5m7s
.NAME                    READY   STATUS              RESTARTS   AGE
command-app             0/1     ContainerCreating   0          <invalid>
perl-testing-1-build    0/1     Completed           0          57s
perl-testing-1-deploy   0/1     Error               0          8s
.NAME                    READY   STATUS      RESTARTS   AGE
command-app             1/1     Running     0          <invalid>
perl-testing-1-build    0/1     Completed   0          61s
perl-testing-1-deploy   0/1     Error       0          12s
DONE
command terminated with exit code 28
command terminated with exit code 28
command terminated with exit code 28
command terminated with exit code 28
command terminated with exit code 28
command terminated with exit code 28
command terminated with exit code 28
command terminated with exit code 28
command terminated with exit code 28
command terminated with exit code 28
command terminated with exit code 28
command terminated with exit code 28
command terminated with exit code 28
command terminated with exit code 28
command terminated with exit code 28
command terminated with exit code 28
command terminated with exit code 28
command terminated with exit code 28
command terminated with exit code 28
command terminated with exit code 28
  Information about the image we work with:
      lastTriggeredImage: image-registry.openshift-image-registry.svc:5000/sclorg-test-15015/perl-testing@sha256:3642a430e34ca0877dd9331589d68db61990c03c04f5d5b8f20d2be7f93c6fdd
apiVersion: image.openshift.io/v1

[SNIP]

NAME           TYPE     FROM          LATEST
perl-testing   Source   Git@staging   1
buildconfig.build.openshift.io "perl-testing" deleted
No resources found in sclorg-test-15015 namespace.
No resources found
NAME           REVISION   DESIRED   CURRENT   TRIGGERED BY
perl-testing   1          1         0         config,image(perl-testing:latest)
deploymentconfig.apps.openshift.io "perl-testing" deleted
NAME           IMAGE REPOSITORY                                                                                                      TAGS                                                 UPDATED
perl           default-route-openshift-image-registry.apps.core-serv-ocp.hosted.psi.rdu2.redhat.com/sclorg-test-15015/perl           5.26-ubi8,5.30-el7,5.30-ubi8,5.32-ubi8 + 3 more...   6 minutes ago
perl-testing   default-route-openshift-image-registry.apps.core-serv-ocp.hosted.psi.rdu2.redhat.com/sclorg-test-15015/perl-testing   latest                                               5 minutes ago
imagestream.image.openshift.io "perl" deleted
imagestream.image.openshift.io "perl-testing" deleted
Error from server (NotFound): Unable to list "image.openshift.io/v1, Resource=imagestreamimages": the server could not find the requested resource
No resources found

[SNIP]

Test for image 'ubi8/perl-530:1' FAILED (exit code: 1)
 [PASSED] for 'openshift-remote-cluster' test_perl_s2i_sample_app (00:01:41)
 [PASSED] for 'openshift-remote-cluster' test_perl_s2i_dancer_app (00:02:34)
 [PASSED] for 'openshift-remote-cluster' test_perl_s2i_templates (00:01:20)
 [FAILED] for 'openshift-remote-cluster' test_perl_imagestream (00:11:40)

OpenShift tests for ubi8/perl-530:1 failed.

CPAN modules that require non-base system libs are not supported

I attempted to create a Perl-based image from an application that requires the GD module, which depends upon libgd. I tried using the perl-516-centos7 s2i image for this purpose.

The cpanm approach to adding and building modules failed due to the absence of the gd-devel RPM in the builder, but this problem also exists in the resulting image. In the output below, you can see that even if I use cpanm on a CentOS 7 host to build and vendor-ize the GD module into my source repo, it still fails for lack of the needed libraries:

bash-4.2$ ldd /opt/app-root/src/Vendor/lib/perl5/x86_64-linux-thread-multi/auto/GD/GD.so
    linux-vdso.so.1 =>  (0x00007ffdfcc48000)
    libXpm.so.4 => not found
    libX11.so.6 => not found
    libjpeg.so.62 => not found
    libfontconfig.so.1 => not found
    libfreetype.so.6 => not found
    libpng15.so.15 => not found
    libz.so.1 => /lib64/libz.so.1 (0x00007fbfb6b2b000)
    libm.so.6 => /lib64/libm.so.6 (0x00007fbfb6828000)
    libgd.so.2 => not found
    libc.so.6 => /lib64/libc.so.6 (0x00007fbfb6467000)
    /lib64/ld-linux-x86-64.so.2 (0x0000560035716000)

Many of the CPAN modules depend upon system libraries in order to function properly, and currently there is no way to specify RPMs that must be installed - both in the build environment and the completed image - to enable these modules to function.

One possible solution may be to specify a named file (similar to the cpanfile) where devs can list the RPMs that are required by their CPAN modules.

Fix SELinux context for non-standard httpd conf files

From https://github.com/sclorg/rhscl2dockerfile/issues/19#issuecomment-105499125:

The dockerfile as well as .sti/bin/run script moves httpd files to non-default path (/opt/openshift). Without tuning selinux file labeling, it will cause SELinux denials preventing httpd from accessing the files. Either you should use the default directories, or amend SELinux file contexts (semanage fcontext --add && restorecon -FR), or disable SELinux. (I do not recomend the last option, I prefer the first one).

I think that the best and quickest fix would be to amend the SELinux file contexts in the Dockerfile.

test_psgi_hot_deploy_with_reload is failing on RHEL8 w/o OpenShift

Container platform

Podman/Docker

Version

Perl 5.26

OS version of the container image

RHEL 8

Bugzilla, Jira

No response

Description

See output log from our nightly build script:

Running test test_psgi_hot_deploy_with_reload (starting at 2023-08-29 22:40:40-04:00) ... 
-----------------------------------------------

�[1m[INFO] Starting tests for psgi-hot_deploy....�[0m


�[1m[INFO] Build the test application image...�[0m

hint: Using 'master' as the name for the initial branch. This default branch name
hint: is subject to change. To configure the initial branch name to use in all
hint: of your new repositories, which will suppress this warning, call:
hint: 
hint: 	git config --global init.defaultBranch <name>
hint: 
hint: Names commonly chosen instead of 'master' are 'main', 'trunk' and
hint: 'development'. The just-created branch can be renamed via this command:
hint: 
hint: 	git branch -m <name>
Initialized empty Git repository in /var/tmp/daily_scl_tests/rhel8-test/plans/nightly-container-rhel8/data/s2i-perl-container/test/psgi-hot_deploy/.git/
[master (root-commit) c8a0add] Sample commit
 3 files changed, 38 insertions(+)
 create mode 100644 cpanfile
 create mode 100755 index.psgi
 create mode 100644 lib/My/Test.pm
STEP 1/12: FROM ubi8/perl-526:1
STEP 2/12: LABEL "io.openshift.s2i.build.image"="ubi8/perl-526:1"       "io.openshift.s2i.build.source-location"="file:///var/tmp/daily_scl_tests/rhel8-test/plans/nightly-container-rhel8/data/s2i-perl-container/5.26-mod_fcgid/test/psgi-hot_deploy"
--> dc163130b43
STEP 3/12: USER root
--> 57ca068cb39
STEP 4/12: COPY upload/src/ /tmp/src
--> 5485575375e
STEP 5/12: RUN chown -R 1001:0 /tmp/src
--> 4ae1fb2d547
STEP 6/12: ENV NPM_MIRROR=https://repository.engineering.redhat.com/nexus/repository/registry.npmjs.org
--> 515cb247320
STEP 7/12: ENV PSGI_FILE=./index.psgi
--> 8b6191b438a
STEP 8/12: ENV PSGI_RELOAD=1
--> f6f447bbbc5
STEP 9/12: RUN cd /etc/pki/ca-trust/source/anchors && update-ca-trust extract
--> e0fd8c81a77
STEP 10/12: USER 1001
--> bc25b47748f
STEP 11/12: RUN /usr/libexec/s2i/assemble
---> Installing application source ...
---> PSGI application found in ./index.psgi
---> Installing modules from cpanfile ...
--> Working on .
Configuring /opt/app-root/src ... OK
==> Found dependencies: Plack::Handler::FCGI, FCGI::ProcManager
--> Working on Plack::Handler::FCGI
Fetching http://www.cpan.org/authors/id/M/MI/MIYAGAWA/Plack-1.0050.tar.gz ... OK
==> Found dependencies: File::ShareDir::Install
--> Working on File::ShareDir::Install
Fetching http://www.cpan.org/authors/id/E/ET/ETHER/File-ShareDir-Install-0.14.tar.gz ... OK
Configuring File-ShareDir-Install-0.14 ... OK
Building File-ShareDir-Install-0.14 ... OK
Successfully installed File-ShareDir-Install-0.14
Configuring Plack-1.0050 ... OK
==> Found dependencies: Cookie::Baker, WWW::Form::UrlEncoded, Devel::StackTrace, Devel::StackTrace::AsHTML, Filesys::Notify::Simple, HTTP::Entity::Parser, HTTP::Headers::Fast, Test::TCP, Hash::MultiValue, Apache::LogFormat::Compiler, HTTP::Message, File::ShareDir, Stream::Buffered, Try::Tiny
--> Working on Cookie::Baker
Fetching http://www.cpan.org/authors/id/K/KA/KAZEBURO/Cookie-Baker-0.11.tar.gz ... OK
==> Found dependencies: Module::Build::Tiny
--> Working on Module::Build::Tiny
Fetching http://www.cpan.org/authors/id/L/LE/LEONT/Module-Build-Tiny-0.046.tar.gz ... OK
==> Found dependencies: ExtUtils::Helpers, ExtUtils::InstallPaths, ExtUtils::Config
--> Working on ExtUtils::Helpers
Fetching http://www.cpan.org/authors/id/L/LE/LEONT/ExtUtils-Helpers-0.026.tar.gz ... OK
Configuring ExtUtils-Helpers-0.026 ... OK
Building ExtUtils-Helpers-0.026 ... OK
Successfully installed ExtUtils-Helpers-0.026
--> Working on ExtUtils::InstallPaths
Fetching http://www.cpan.org/authors/id/L/LE/LEONT/ExtUtils-InstallPaths-0.012.tar.gz ... OK
Configuring ExtUtils-InstallPaths-0.012 ... OK
==> Found dependencies: ExtUtils::Config
--> Working on ExtUtils::Config
Fetching http://www.cpan.org/authors/id/L/LE/LEONT/ExtUtils-Config-0.008.tar.gz ... OK
Configuring ExtUtils-Config-0.008 ... OK
Building ExtUtils-Config-0.008 ... OK
Successfully installed ExtUtils-Config-0.008
Building ExtUtils-InstallPaths-0.012 ... OK
Successfully installed ExtUtils-InstallPaths-0.012
Configuring Module-Build-Tiny-0.046 ... OK
Building Module-Build-Tiny-0.046 ... OK
Successfully installed Module-Build-Tiny-0.046
Configuring Cookie-Baker-0.11 ... OK
Building Cookie-Baker-0.11 ... OK
Successfully installed Cookie-Baker-0.11
--> Working on WWW::Form::UrlEncoded
Fetching http://www.cpan.org/authors/id/K/KA/KAZEBURO/WWW-Form-UrlEncoded-0.26.tar.gz ... OK
Configuring WWW-Form-UrlEncoded-0.26 ... OK
Building WWW-Form-UrlEncoded-0.26 ... OK
Successfully installed WWW-Form-UrlEncoded-0.26
--> Working on Devel::StackTrace
Fetching http://www.cpan.org/authors/id/D/DR/DROLSKY/Devel-StackTrace-2.04.tar.gz ... OK
Configuring Devel-StackTrace-2.04 ... OK
Building Devel-StackTrace-2.04 ... OK
Successfully installed Devel-StackTrace-2.04
--> Working on Devel::StackTrace::AsHTML
Fetching http://www.cpan.org/authors/id/M/MI/MIYAGAWA/Devel-StackTrace-AsHTML-0.15.tar.gz ... OK
Configuring Devel-StackTrace-AsHTML-0.15 ... OK
Building Devel-StackTrace-AsHTML-0.15 ... OK
Successfully installed Devel-StackTrace-AsHTML-0.15
--> Working on Filesys::Notify::Simple
Fetching http://www.cpan.org/authors/id/M/MI/MIYAGAWA/Filesys-Notify-Simple-0.14.tar.gz ... OK
Configuring Filesys-Notify-Simple-0.14 ... OK
Building Filesys-Notify-Simple-0.14 ... OK
Successfully installed Filesys-Notify-Simple-0.14
--> Working on HTTP::Entity::Parser
Fetching http://www.cpan.org/authors/id/K/KA/KAZEBURO/HTTP-Entity-Parser-0.25.tar.gz ... OK
Configuring HTTP-Entity-Parser-0.25 ... OK
==> Found dependencies: HTTP::MultiPartParser, Stream::Buffered, Hash::MultiValue, JSON::MaybeXS
--> Working on HTTP::MultiPartParser
Fetching http://www.cpan.org/authors/id/C/CH/CHANSEN/HTTP-MultiPartParser-0.02.tar.gz ... OK
Configuring HTTP-MultiPartParser-0.02 ... OK
==> Found dependencies: Test::Deep
--> Working on Test::Deep
Fetching http://www.cpan.org/authors/id/R/RJ/RJBS/Test-Deep-1.204.tar.gz ... OK
Configuring Test-Deep-1.204 ... OK
Building Test-Deep-1.204 ... OK
Successfully installed Test-Deep-1.204
Building HTTP-MultiPartParser-0.02 ... OK
Successfully installed HTTP-MultiPartParser-0.02
--> Working on Stream::Buffered
Fetching http://www.cpan.org/authors/id/D/DO/DOY/Stream-Buffered-0.03.tar.gz ... OK
Configuring Stream-Buffered-0.03 ... OK
Building Stream-Buffered-0.03 ... OK
Successfully installed Stream-Buffered-0.03
--> Working on Hash::MultiValue
Fetching http://www.cpan.org/authors/id/A/AR/ARISTOTLE/Hash-MultiValue-0.16.tar.gz ... OK
Configuring Hash-MultiValue-0.16 ... OK
Building Hash-MultiValue-0.16 ... OK
Successfully installed Hash-MultiValue-0.16
--> Working on JSON::MaybeXS
Fetching http://www.cpan.org/authors/id/E/ET/ETHER/JSON-MaybeXS-1.004005.tar.gz ... OK
Configuring JSON-MaybeXS-1.004005 ... OK
==> Found dependencies: Cpanel::JSON::XS
--> Working on Cpanel::JSON::XS
Fetching http://www.cpan.org/authors/id/R/RU/RURBAN/Cpanel-JSON-XS-4.37.tar.gz ... OK
Configuring Cpanel-JSON-XS-4.37 ... OK
Building Cpanel-JSON-XS-4.37 ... OK
Successfully installed Cpanel-JSON-XS-4.37
Building JSON-MaybeXS-1.004005 ... OK
Successfully installed JSON-MaybeXS-1.004005
Building HTTP-Entity-Parser-0.25 ... OK
Successfully installed HTTP-Entity-Parser-0.25
--> Working on HTTP::Headers::Fast
Fetching http://www.cpan.org/authors/id/T/TO/TOKUHIROM/HTTP-Headers-Fast-0.22.tar.gz ... OK
Configuring HTTP-Headers-Fast-0.22 ... OK
==> Found dependencies: HTTP::Date
--> Working on HTTP::Date
Fetching http://www.cpan.org/authors/id/O/OA/OALDERS/HTTP-Date-6.06.tar.gz ... OK
Configuring HTTP-Date-6.06 ... OK
==> Found dependencies: Time::Zone
--> Working on Time::Zone
Fetching http://www.cpan.org/authors/id/A/AT/ATOOMIC/TimeDate-2.33.tar.gz ... OK
Configuring TimeDate-2.33 ... OK
Building TimeDate-2.33 ... OK
Successfully installed TimeDate-2.33
Building HTTP-Date-6.06 ... OK
Successfully installed HTTP-Date-6.06
Building HTTP-Headers-Fast-0.22 ... OK
Successfully installed HTTP-Headers-Fast-0.22
--> Working on Test::TCP
Fetching http://www.cpan.org/authors/id/M/MI/MIYAGAWA/Test-TCP-2.22.tar.gz ... OK
Configuring Test-TCP-2.22 ... OK
==> Found dependencies: Test::SharedFork
--> Working on Test::SharedFork
Fetching http://www.cpan.org/authors/id/E/EX/EXODIST/Test-SharedFork-0.35.tar.gz ... OK
Configuring Test-SharedFork-0.35 ... OK
Building Test-SharedFork-0.35 ... OK
Successfully installed Test-SharedFork-0.35
Building Test-TCP-2.22 ... OK
Successfully installed Test-TCP-2.22
--> Working on Apache::LogFormat::Compiler
Fetching http://www.cpan.org/authors/id/K/KA/KAZEBURO/Apache-LogFormat-Compiler-0.36.tar.gz ... OK
Configuring Apache-LogFormat-Compiler-0.36 ... OK
==> Found dependencies: POSIX::strftime::Compiler
--> Working on POSIX::strftime::Compiler
Fetching http://www.cpan.org/authors/id/K/KA/KAZEBURO/POSIX-strftime-Compiler-0.44.tar.gz ... OK
Configuring POSIX-strftime-Compiler-0.44 ... OK
Building POSIX-strftime-Compiler-0.44 ... OK
Successfully installed POSIX-strftime-Compiler-0.44
Building Apache-LogFormat-Compiler-0.36 ... OK
Successfully installed Apache-LogFormat-Compiler-0.36
--> Working on HTTP::Message
Fetching http://www.cpan.org/authors/id/O/OA/OALDERS/HTTP-Message-6.44.tar.gz ... OK
Configuring HTTP-Message-6.44 ... OK
==> Found dependencies: Clone, IO::HTML, Encode, LWP::MediaTypes
--> Working on Clone
Fetching http://www.cpan.org/authors/id/G/GA/GARU/Clone-0.46.tar.gz ... OK
Configuring Clone-0.46 ... OK
Building Clone-0.46 ... OK
Successfully installed Clone-0.46
--> Working on IO::HTML
Fetching http://www.cpan.org/authors/id/C/CJ/CJM/IO-HTML-1.004.tar.gz ... OK
Configuring IO-HTML-1.004 ... OK
==> Found dependencies: Encode
--> Working on Encode
Fetching http://www.cpan.org/authors/id/D/DA/DANKOGAI/Encode-3.19.tar.gz ... OK
Configuring Encode-3.19 ... OK
Building Encode-3.19 ... OK
Successfully installed Encode-3.19 (upgraded from 2.97)
Building IO-HTML-1.004 ... OK
Successfully installed IO-HTML-1.004
--> Working on LWP::MediaTypes
Fetching http://www.cpan.org/authors/id/O/OA/OALDERS/LWP-MediaTypes-6.04.tar.gz ... OK
Configuring LWP-MediaTypes-6.04 ... OK
Building LWP-MediaTypes-6.04 ... OK
Successfully installed LWP-MediaTypes-6.04
Building HTTP-Message-6.44 ... OK
Successfully installed HTTP-Message-6.44
--> Working on File::ShareDir
Fetching http://www.cpan.org/authors/id/R/RE/REHSACK/File-ShareDir-1.118.tar.gz ... OK
Configuring File-ShareDir-1.118 ... OK
==> Found dependencies: Class::Inspector
--> Working on Class::Inspector
Fetching http://www.cpan.org/authors/id/P/PL/PLICEASE/Class-Inspector-1.36.tar.gz ... OK
Configuring Class-Inspector-1.36 ... OK
Building Class-Inspector-1.36 ... OK
Successfully installed Class-Inspector-1.36
Building File-ShareDir-1.118 ... OK
Successfully installed File-ShareDir-1.118
--> Working on Try::Tiny
Fetching http://www.cpan.org/authors/id/E/ET/ETHER/Try-Tiny-0.31.tar.gz ... OK
Configuring Try-Tiny-0.31 ... OK
Building Try-Tiny-0.31 ... OK
Successfully installed Try-Tiny-0.31
Building Plack-1.0050 ... OK
Successfully installed Plack-1.0050
--> Working on FCGI::ProcManager
Fetching http://www.cpan.org/authors/id/A/AR/ARODLAND/FCGI-ProcManager-0.28.tar.gz ... OK
Configuring FCGI-ProcManager-0.28 ... OK
Building FCGI-ProcManager-0.28 ... OK
Successfully installed FCGI-ProcManager-0.28
<== Installed dependencies for .. Finishing.
34 distributions installed
---> Patching Plack::Handler::FCGI to work with mod_fcgi ...
~/extlib/lib/perl5 ~
patching file Plack/Handler/FCGI.pm
~
--> 335b302ff8d
STEP 12/12: CMD /usr/libexec/s2i/run
COMMIT ubi8/perl-526:1-testapp
--> a85a5cefb9c
Successfully tagged localhost/ubi8/perl-526:1-testapp
a85a5cefb9c1ce3c458e9bceaf2710acdf2d76abd20aaa48be84fdc485c4ad8e
Waiting for container start... 1

�[1m[INFO] Testing the HTTP response for <http://10.88.1.124:8080/>...�[0m


�[1m[INFO] Testing the HTTP response for <http://10.88.1.124:8080/>...�[0m


�[1m[INFO] Changing source code of application...�[0m


�[1m[INFO] Testing the HTTP response for <http://10.88.1.124:8080/>...�[0m

Test for image 'ubi8/perl-526:1' FAILED (exit code: 1)
Test for image 'ubi8/perl-526:1' FAILED (exit code: 1)

�[1m[INFO] Cleaning up the test application...�[0m

afaa97737034fa10c156648214c7a03f6f416ff3509d29ec902f5bc8eb727e26
Error: no container with ID or name "afaa97737034fa10c156648214c7a03f6f416ff3509d29ec902f5bc8eb727e26" found: no such container
rm: cannot remove '/tmp/tmp.1XglKr28st/cid': No such file or directory

�[1m[INFO] Cleaning up the test application image...�[0m

Untagged: localhost/ubi8/perl-526:1-testapp
Deleted: a85a5cefb9c1ce3c458e9bceaf2710acdf2d76abd20aaa48be84fdc485c4ad8e
Deleted: 335b302ff8dc816ef2eb1fa7cca6c9ac9a0c04c81ad5ce8524bc42742ebcbc9b
Deleted: bc25b47748faadeebbc38ee259e77f7cce616e98c597a27e88df04c1f06512af
Deleted: e0fd8c81a775aca015b883e310a8e161d162dd7cc36cf5744a24c004b95585a3
Deleted: f6f447bbbc5356e293965453acdffae6d2ae3b03817424633a45dc9f6bf23f16
Deleted: 8b6191b438a11995a066e2c21f4cb3a2808300060863bf044796e67ffaeea4ce
Deleted: 515cb2473205dfb50718cfd764b4de3301974e805d3823a4e552bb31a12bb684
Deleted: 4ae1fb2d547a81d9bef9d4babc22eaba6c1834f0a5d5ca95f8ec20d6171bac19
Deleted: 5485575375e5fa6e79b54652d82673f4030155df26d803f3a11fa4a25b951ac6
Deleted: 57ca068cb3977aeb2a82136d2d527166966ca54df3db6b927913de24ad735459
Deleted: dc163130b432c6e0758ebbffed91d08823848de61e9ea47cb422198a66512b3b

�[1m[INFO] All tests for the psgi-hot_deploy finished successfully....�[0m

Reproducer

No response

5.30-mod_fcgid is absent

Despite the release of RHEL/UBI 8.3 with a perl-530 mod_fcgid image, a corresponding directory is missing from this repository.

httpd: could not open error log file /proc/self/fd/2

When I build the current version of the source here and run the current version of the test, I get this error:
(13)Permission denied: AH00091: httpd: could not open error log file /proc/self/fd/2.

It works fine when trying to go back before this commit:
3c704ab

So, it seems to me like PR #73 is not working in all cases. I don't understand why it works for someone else though.

Add 5.32 version to RHEL8

Container platform

OCP 4, Podman/Docker

Version

5.32 and RHEL8

OS version of the container image

RHEL 8

Bugzilla, Jira

No response

Description

We do not test Perl - 5.32 at all for RHEL8.

Reproducer

No response

Add post build hook

Add an example build hook to run unit tests as part of the build.

💭 I tried doing so myself but couldn't get it working without friction, so deferring it for later or someone else.

The hook shall be added to the BuildConfigs of our templates:

+        "postCommit": {
+          "script": "perl -Iextlib/lib/perl5 t/*"
+        }

I am not sure about the right one-liner to run unit tests.

Container stops when terminal is resized

Built S2I image exits when running from docker (not detached) and the terminal window is resized, apache quits on catching SIGWINCH signal.

$ docker run --rm -ti perl-sample-app
[...]
[ resize window ]
[Fri May 06 09:06:11.625146 2016] [mpm_prefork:notice] [pid 1] AH00170: caught SIGWINCH, shutting down gracefully

How to customize httpd for PSGI application

PSGI applications do not seem to work with ModPerl::PerlRun PerlResponseHandler.

This simple application:

$ cat index.cgi 
#!/usr/bin/env perl
use Plack::Runner;
use Web::Paste::Simple;
Plack::Runner->new->run(Web::Paste::Simple->new->app);
$ cat cpanfile 
requires 'Plack::Runner';
requires 'Web::Paste::Simple';

sends empty response on subsequent requests. (Actually after all preforked httpd workers are exhausted and are recycled by httpd.) I don't know if this is a bug in mod_perl, Plack PSGI server, or the Web::Paste::Simple application.

But any Plack documentation states the right way is to use Plack::Handler::Apache2 PerlResponseHandler instead of the ModPerl::PerlRun one (http://search.cpan.org/dist/Plack/lib/Plack/Handler/Apache2.pm). And that indeed works. (Another option is to use Plack::Handler::Apache2::Registry PerlResponseHandler).

So we need to be able to redefine the PerlResponseHandler in the httpd configuration.

Also users may want have nice short URLs without the visible real application file name (e.g. http://domain/ instead of http://domain/application.psgi). Thus the recommended way is to adjust httpd configuration for every application like:

<Location />
SetHandler perl-script
PerlResponseHandler Plack::Handler::Apache2
PerlSetVar psgi_app /path/to/application.psgi
</Location>

This requires to know that the deployed code is an PSGI application and to know where the file (application.psgi) is installed by absolute path (/path/to/application.psgi).

My question is how to augment the assemble script to support this use case?

We could:

(1) Allow user to supply httpd configuration file in the sources.

(2) Allow user to specify path to the PSGI file in the source tree with an environment variable and generate the httpd configuration based on the varaible.

(3) Scan the sources for PSGI files or expect some hard coded file name and generate a the httpd configuration.

Is there a preferred method? How are similar issues handled by other httpd docker images?

Standard Perl environment variable $PERL5LIB missing from built images

At the end of the assemble process, the builder should set up the PERL5LIB variable so that it is available to built applications. The purpose of this variable is to extent perl's default module lookup paths with ones that were added through other means. In this case it would be used to look up paths introduced by cpanm-driven package installations. This is valuable because it is a pretty standard part of a Perl runtime environment, and also means that devs will not need to adjust their code for the specific module paths that we set up in our containers.

Add support for extending image and enabling SSL connections

The image should be generally flexible, which means it should be easy to extend the functionality of the image by end users. A common thing that the end users need to change is providing own configuration file or setting up secured connection over SSL.

In some cases, users prefer to extend the image by creating a thin layer on top of the provided image and have the own bits available in the image itself. However, it is also common to use kubernetes secrets to extend the image functionality, by providing a configuration file or pair of SSL certificates.

In some cases, making the image flexible required to refactor the image a bit more; there are PRs for other images, that already support these features below, they could serve for inspiration. An important part of the changes is also documentation how the extending works, what paths should be used, etc.

nginx: sclorg/nginx-container#41
httpd: sclorg/httpd-container#28
php: sclorg/s2i-php-container#183 (especially interesting for perl case, since the required changes will probably be very similar)
mariadb: sclorg/mariadb-container#45
postgresql: sclorg/postgresql-container#208
mongodb: sclorg/mongodb-container#239

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.