From 697a0deb40002997691e34bf42e287e13a5ca44a Mon Sep 17 00:00:00 2001 From: Zuzana Miklankova Date: Mon, 27 Feb 2023 13:13:47 +0100 Subject: [PATCH] remove EOL files --- 2.0/Dockerfile | 33 ----- 2.0/Dockerfile.rhel7 | 43 ------ 2.0/README.md | 4 - 2.0/cccp.yml | 3 - 2.0/root/opt/app-root/.gemrc | 9 -- 2.0/root/opt/app-root/etc/puma.cfg | 50 ------- 2.0/root/opt/app-root/etc/scl_enable | 6 - 2.0/s2i/bin/assemble | 63 -------- 2.0/s2i/bin/run | 39 ----- 2.0/s2i/bin/usage | 16 --- 2.0/test/puma-test-app/Gemfile | 4 - 2.0/test/puma-test-app/Gemfile.lock | 20 --- 2.0/test/puma-test-app/app.rb | 5 - 2.0/test/puma-test-app/config.ru | 2 - 2.0/test/rack-test-app/Gemfile | 3 - 2.0/test/rack-test-app/Gemfile.lock | 17 --- 2.0/test/rack-test-app/app.rb | 5 - 2.0/test/rack-test-app/config.ru | 2 - 2.0/test/run | 191 ------------------------- 2.2/Dockerfile | 47 ------ 2.2/Dockerfile.rhel7 | 48 ------- 2.2/README.md | 4 - 2.2/cccp.yml | 3 - 2.2/content_sets.yml | 10 -- 2.2/root/opt/app-root/.gemrc | 9 -- 2.2/root/opt/app-root/etc/puma.cfg | 50 ------- 2.2/root/opt/app-root/etc/scl_enable | 6 - 2.2/s2i/bin/assemble | 71 ---------- 2.2/s2i/bin/run | 39 ----- 2.2/s2i/bin/usage | 18 --- 2.2/test/puma-test-app/Gemfile | 4 - 2.2/test/puma-test-app/Gemfile.lock | 21 --- 2.2/test/puma-test-app/app.rb | 5 - 2.2/test/puma-test-app/config.ru | 2 - 2.2/test/rack-test-app/Gemfile | 3 - 2.2/test/rack-test-app/Gemfile.lock | 19 --- 2.2/test/rack-test-app/app.rb | 5 - 2.2/test/rack-test-app/config.ru | 2 - 2.2/test/run | 191 ------------------------- 2.3/Dockerfile | 47 ------ 2.3/Dockerfile.rhel7 | 48 ------- 2.3/README.md | 4 - 2.3/cccp.yml | 3 - 2.3/content_sets.yml | 10 -- 2.3/root/opt/app-root/.gemrc | 9 -- 2.3/root/opt/app-root/etc/puma.cfg | 50 ------- 2.3/root/opt/app-root/etc/scl_enable | 6 - 2.3/s2i/bin/assemble | 71 ---------- 2.3/s2i/bin/run | 39 ----- 2.3/s2i/bin/usage | 18 --- 2.3/test/puma-test-app/Gemfile | 4 - 2.3/test/puma-test-app/Gemfile.lock | 24 ---- 2.3/test/puma-test-app/app.rb | 5 - 2.3/test/puma-test-app/config.ru | 2 - 2.3/test/rack-test-app/Gemfile | 3 - 2.3/test/rack-test-app/Gemfile.lock | 22 --- 2.3/test/rack-test-app/app.rb | 5 - 2.3/test/rack-test-app/config.ru | 2 - 2.3/test/run | 197 -------------------------- 2.3/test/run-conu | 1 - 2.3/test/run-openshift | 1 - 2.3/test/run-openshift-remote-cluster | 1 - 2.3/test/test-lib-openshift.sh | 1 - 2.3/test/test-lib-ruby.sh | 1 - 2.3/test/test-lib.sh | 1 - 2.3/test/test_s2i.py | 1 - 2.4/.exclude-fedora | 0 2.4/Dockerfile | 49 ------- 2.4/Dockerfile.fedora | 51 ------- 2.4/Dockerfile.rhel7 | 49 ------- 2.4/README.md | 4 - 2.4/cccp.yml | 3 - 2.4/content_sets.yml | 10 -- 2.4/root/opt/app-root/.gemrc | 9 -- 2.4/root/opt/app-root/etc/puma.cfg | 50 ------- 2.4/root/opt/app-root/etc/scl_enable | 6 - 2.4/s2i/bin/assemble | 67 --------- 2.4/s2i/bin/run | 39 ----- 2.4/s2i/bin/usage | 16 --- 2.4/test/imagestreams | 1 - 2.4/test/puma-test-app/Gemfile | 4 - 2.4/test/puma-test-app/Gemfile.lock | 24 ---- 2.4/test/puma-test-app/app.rb | 5 - 2.4/test/puma-test-app/config.ru | 2 - 2.4/test/rack-test-app/Gemfile | 3 - 2.4/test/rack-test-app/Gemfile.lock | 22 --- 2.4/test/rack-test-app/app.rb | 5 - 2.4/test/rack-test-app/config.ru | 2 - 2.4/test/run | 183 ------------------------ 2.4/test/run-conu | 1 - 2.4/test/run-openshift | 1 - 2.4/test/run-openshift-remote-cluster | 1 - 2.4/test/test-lib-openshift.sh | 1 - 2.4/test/test-lib-ruby.sh | 1 - 2.4/test/test-lib.sh | 1 - 2.4/test/test_s2i.py | 1 - 2.5/Dockerfile.fedora | 2 +- 2.6/Dockerfile | 68 --------- 2.6/Dockerfile.fedora | 51 ------- 2.6/Dockerfile.rhel7 | 70 --------- 2.6/Dockerfile.rhel8 | 63 -------- 2.6/README.md | 3 - 2.6/cccp.yml | 3 - 2.6/root/opt/app-root/.gemrc | 9 -- 2.6/root/opt/app-root/etc/puma.cfg | 50 ------- 2.6/root/opt/app-root/etc/scl_enable | 6 - 2.6/s2i/bin/assemble | 67 --------- 2.6/s2i/bin/run | 39 ----- 2.6/s2i/bin/usage | 18 --- 2.6/test/examples | 1 - 2.6/test/imagestreams | 1 - 2.6/test/puma-test-app/Gemfile | 4 - 2.6/test/puma-test-app/Gemfile.lock | 21 --- 2.6/test/puma-test-app/app.rb | 5 - 2.6/test/puma-test-app/config.ru | 2 - 2.6/test/rack-test-app/Gemfile | 3 - 2.6/test/rack-test-app/Gemfile.lock | 19 --- 2.6/test/rack-test-app/app.rb | 5 - 2.6/test/rack-test-app/config.ru | 2 - 2.6/test/run | 1 - 2.6/test/run-conu | 1 - 2.6/test/run-openshift | 1 - 2.6/test/run-openshift-remote-cluster | 1 - 2.6/test/test-lib-openshift.sh | 1 - 2.6/test/test-lib-remote-openshift.sh | 1 - 2.6/test/test-lib-ruby.sh | 1 - 2.6/test/test-lib.sh | 1 - 2.6/test/test_s2i.py | 1 - 128 files changed, 1 insertion(+), 2779 deletions(-) delete mode 100644 2.0/Dockerfile delete mode 100644 2.0/Dockerfile.rhel7 delete mode 100644 2.0/README.md delete mode 100644 2.0/cccp.yml delete mode 100644 2.0/root/opt/app-root/.gemrc delete mode 100644 2.0/root/opt/app-root/etc/puma.cfg delete mode 100644 2.0/root/opt/app-root/etc/scl_enable delete mode 100755 2.0/s2i/bin/assemble delete mode 100755 2.0/s2i/bin/run delete mode 100755 2.0/s2i/bin/usage delete mode 100755 2.0/test/puma-test-app/Gemfile delete mode 100755 2.0/test/puma-test-app/Gemfile.lock delete mode 100755 2.0/test/puma-test-app/app.rb delete mode 100755 2.0/test/puma-test-app/config.ru delete mode 100755 2.0/test/rack-test-app/Gemfile delete mode 100755 2.0/test/rack-test-app/Gemfile.lock delete mode 100755 2.0/test/rack-test-app/app.rb delete mode 100755 2.0/test/rack-test-app/config.ru delete mode 100755 2.0/test/run delete mode 100644 2.2/Dockerfile delete mode 100644 2.2/Dockerfile.rhel7 delete mode 100644 2.2/README.md delete mode 100644 2.2/cccp.yml delete mode 100644 2.2/content_sets.yml delete mode 100644 2.2/root/opt/app-root/.gemrc delete mode 100644 2.2/root/opt/app-root/etc/puma.cfg delete mode 100644 2.2/root/opt/app-root/etc/scl_enable delete mode 100755 2.2/s2i/bin/assemble delete mode 100755 2.2/s2i/bin/run delete mode 100755 2.2/s2i/bin/usage delete mode 100755 2.2/test/puma-test-app/Gemfile delete mode 100644 2.2/test/puma-test-app/Gemfile.lock delete mode 100755 2.2/test/puma-test-app/app.rb delete mode 100755 2.2/test/puma-test-app/config.ru delete mode 100755 2.2/test/rack-test-app/Gemfile delete mode 100644 2.2/test/rack-test-app/Gemfile.lock delete mode 100755 2.2/test/rack-test-app/app.rb delete mode 100755 2.2/test/rack-test-app/config.ru delete mode 100755 2.2/test/run delete mode 100644 2.3/Dockerfile delete mode 100644 2.3/Dockerfile.rhel7 delete mode 100644 2.3/README.md delete mode 100644 2.3/cccp.yml delete mode 100644 2.3/content_sets.yml delete mode 100644 2.3/root/opt/app-root/.gemrc delete mode 100644 2.3/root/opt/app-root/etc/puma.cfg delete mode 100644 2.3/root/opt/app-root/etc/scl_enable delete mode 100755 2.3/s2i/bin/assemble delete mode 100755 2.3/s2i/bin/run delete mode 100755 2.3/s2i/bin/usage delete mode 100755 2.3/test/puma-test-app/Gemfile delete mode 100644 2.3/test/puma-test-app/Gemfile.lock delete mode 100755 2.3/test/puma-test-app/app.rb delete mode 100755 2.3/test/puma-test-app/config.ru delete mode 100755 2.3/test/rack-test-app/Gemfile delete mode 100644 2.3/test/rack-test-app/Gemfile.lock delete mode 100755 2.3/test/rack-test-app/app.rb delete mode 100755 2.3/test/rack-test-app/config.ru delete mode 100755 2.3/test/run delete mode 120000 2.3/test/run-conu delete mode 120000 2.3/test/run-openshift delete mode 120000 2.3/test/run-openshift-remote-cluster delete mode 120000 2.3/test/test-lib-openshift.sh delete mode 120000 2.3/test/test-lib-ruby.sh delete mode 120000 2.3/test/test-lib.sh delete mode 120000 2.3/test/test_s2i.py delete mode 100644 2.4/.exclude-fedora delete mode 100644 2.4/Dockerfile delete mode 100644 2.4/Dockerfile.fedora delete mode 100644 2.4/Dockerfile.rhel7 delete mode 100644 2.4/README.md delete mode 100644 2.4/cccp.yml delete mode 100644 2.4/content_sets.yml delete mode 100644 2.4/root/opt/app-root/.gemrc delete mode 100644 2.4/root/opt/app-root/etc/puma.cfg delete mode 100644 2.4/root/opt/app-root/etc/scl_enable delete mode 100755 2.4/s2i/bin/assemble delete mode 100755 2.4/s2i/bin/run delete mode 100755 2.4/s2i/bin/usage delete mode 120000 2.4/test/imagestreams delete mode 100755 2.4/test/puma-test-app/Gemfile delete mode 100644 2.4/test/puma-test-app/Gemfile.lock delete mode 100755 2.4/test/puma-test-app/app.rb delete mode 100755 2.4/test/puma-test-app/config.ru delete mode 100755 2.4/test/rack-test-app/Gemfile delete mode 100644 2.4/test/rack-test-app/Gemfile.lock delete mode 100755 2.4/test/rack-test-app/app.rb delete mode 100755 2.4/test/rack-test-app/config.ru delete mode 100755 2.4/test/run delete mode 120000 2.4/test/run-conu delete mode 120000 2.4/test/run-openshift delete mode 120000 2.4/test/run-openshift-remote-cluster delete mode 120000 2.4/test/test-lib-openshift.sh delete mode 120000 2.4/test/test-lib-ruby.sh delete mode 120000 2.4/test/test-lib.sh delete mode 120000 2.4/test/test_s2i.py delete mode 100644 2.6/Dockerfile delete mode 100644 2.6/Dockerfile.fedora delete mode 100644 2.6/Dockerfile.rhel7 delete mode 100644 2.6/Dockerfile.rhel8 delete mode 100644 2.6/README.md delete mode 100644 2.6/cccp.yml delete mode 100644 2.6/root/opt/app-root/.gemrc delete mode 100644 2.6/root/opt/app-root/etc/puma.cfg delete mode 100644 2.6/root/opt/app-root/etc/scl_enable delete mode 100755 2.6/s2i/bin/assemble delete mode 100755 2.6/s2i/bin/run delete mode 100755 2.6/s2i/bin/usage delete mode 120000 2.6/test/examples delete mode 120000 2.6/test/imagestreams delete mode 100755 2.6/test/puma-test-app/Gemfile delete mode 100644 2.6/test/puma-test-app/Gemfile.lock delete mode 100755 2.6/test/puma-test-app/app.rb delete mode 100755 2.6/test/puma-test-app/config.ru delete mode 100755 2.6/test/rack-test-app/Gemfile delete mode 100644 2.6/test/rack-test-app/Gemfile.lock delete mode 100755 2.6/test/rack-test-app/app.rb delete mode 100755 2.6/test/rack-test-app/config.ru delete mode 120000 2.6/test/run delete mode 120000 2.6/test/run-conu delete mode 120000 2.6/test/run-openshift delete mode 120000 2.6/test/run-openshift-remote-cluster delete mode 120000 2.6/test/test-lib-openshift.sh delete mode 120000 2.6/test/test-lib-remote-openshift.sh delete mode 120000 2.6/test/test-lib-ruby.sh delete mode 120000 2.6/test/test-lib.sh delete mode 120000 2.6/test/test_s2i.py diff --git a/2.0/Dockerfile b/2.0/Dockerfile deleted file mode 100644 index 795812a8..00000000 --- a/2.0/Dockerfile +++ /dev/null @@ -1,33 +0,0 @@ -FROM openshift/base-centos7 - -# This image provides a Ruby 2.0 environment you can use to run your Ruby -# applications. - -MAINTAINER SoftwareCollections.org - -EXPOSE 8080 - -ENV RUBY_VERSION 2.0 - -LABEL io.k8s.description="Platform for building and running Ruby 2.0 applications" \ - io.k8s.display-name="Ruby 2.0" \ - io.openshift.expose-services="8080:http" \ - io.openshift.tags="builder,ruby,ruby20" - -RUN INSTALL_PKGS="ruby200 ruby200-ruby-devel ruby200-rubygem-rake v8314 ror40-rubygem-bundler nodejs010" && \ - yum install -y centos-release-scl && \ - yum install -y --setopt=tsflags=nodocs $INSTALL_PKGS && rpm -V $INSTALL_PKGS && \ - yum -y clean all --enablerepo='*' - -# Copy the S2I scripts from the specific language image to $STI_SCRIPTS_PATH -COPY ./s2i/bin/ $STI_SCRIPTS_PATH - -# Copy extra files to the image. -COPY ./root/ / - -RUN chown -R 1001:0 /opt/app-root && chmod -R ug+rwx /opt/app-root - -USER 1001 - -# Set the default CMD to print the usage of the language image -CMD $STI_SCRIPTS_PATH/usage diff --git a/2.0/Dockerfile.rhel7 b/2.0/Dockerfile.rhel7 deleted file mode 100644 index 25e8bfb4..00000000 --- a/2.0/Dockerfile.rhel7 +++ /dev/null @@ -1,43 +0,0 @@ -FROM openshift/base-rhel7 - -# This image provides a Ruby 2.0 environment you can use to run your Ruby -# applications. - -EXPOSE 8080 - -ENV RUBY_VERSION 2.0 - -LABEL summary="Platform for building and running Ruby 2.0 applications" \ - io.k8s.description="Platform for building and running Ruby 2.0 applications" \ - io.k8s.display-name="Ruby 2.0" \ - io.openshift.expose-services="8080:http" \ - io.openshift.tags="builder,ruby,ruby20" - -# Labels consumed by Red Hat build service -LABEL com.redhat.component="openshift-sti-ruby-docker" \ - name="openshift3/ruby-20-rhel7" \ - version="2.0" \ - release="2" \ - architecture="x86_64" - -# To use subscription inside container yum command has to be run first (before yum-config-manager) -# https://access.redhat.com/solutions/1443553 -RUN yum repolist > /dev/null && \ - yum-config-manager --enable rhel-server-rhscl-7-rpms && \ - yum-config-manager --enable rhel-7-server-optional-rpms && \ - INSTALL_PKGS="ruby200 ruby200-ruby-devel ruby200-rubygem-rake v8314 ror40-rubygem-bundler nodejs010" && \ - yum install -y --setopt=tsflags=nodocs $INSTALL_PKGS && rpm -V $INSTALL_PKGS && \ - yum -y clean all --enablerepo='*' - -# Copy the S2I scripts from the specific language image to $STI_SCRIPTS_PATH -COPY ./s2i/bin/ $STI_SCRIPTS_PATH - -# Copy extra files to the image. -COPY ./root/ / - -RUN chown -R 1001:0 /opt/app-root && chmod -R ug+rwx /opt/app-root - -USER 1001 - -# Set the default CMD to print the usage of the language image -CMD $STI_SCRIPTS_PATH/usage diff --git a/2.0/README.md b/2.0/README.md deleted file mode 100644 index 6bd2c7da..00000000 --- a/2.0/README.md +++ /dev/null @@ -1,4 +0,0 @@ -Ruby 2.0 platform for building and running applications -======================================================= - -**The Ruby 2.0 image is deprecated.** diff --git a/2.0/cccp.yml b/2.0/cccp.yml deleted file mode 100644 index 3890e6c7..00000000 --- a/2.0/cccp.yml +++ /dev/null @@ -1,3 +0,0 @@ -# This is for the purpose of building this container -# on the centos container pipeline. -job-id: ruby-20-centos7 diff --git a/2.0/root/opt/app-root/.gemrc b/2.0/root/opt/app-root/.gemrc deleted file mode 100644 index 2422bea3..00000000 --- a/2.0/root/opt/app-root/.gemrc +++ /dev/null @@ -1,9 +0,0 @@ ---- -install: --no-document -update: --no-document -:benchmark: false -:update_sources: true -:bulk_threshold: 1000 -:backtrace: true -:sources: -- https://rubygems.org/ diff --git a/2.0/root/opt/app-root/etc/puma.cfg b/2.0/root/opt/app-root/etc/puma.cfg deleted file mode 100644 index a52d26dc..00000000 --- a/2.0/root/opt/app-root/etc/puma.cfg +++ /dev/null @@ -1,50 +0,0 @@ -def get_max_memory() - return ENV['MEMORY_LIMIT_IN_BYTES'].to_i if ENV.has_key? 'MEMORY_LIMIT_IN_BYTES' - - # Assume unlimited memory. 0.size is the number of bytes a Ruby - # Fixnum class can hold. One bit is used for sign and one is used - # by Ruby to determine whether it's a number or pointer to an object. - # That's why we subtract two bits. This expresion should therefore be - # the largest signed Fixnum possible. - (2 ** (8*0.size - 2) - 1) -end - -def get_memory_per_worker() - bytes = ENV.fetch('MEMORY_BYTES_PER_WORKER', '0').to_i - if bytes == 0 - # Comment describing rationale for choosing default of 256MiB/worker is below. - bytes = 256 * (2**20) - end - bytes -end - -def get_min_threads() - ENV.fetch('PUMA_MIN_THREADS', '0').to_i -end - -def get_max_threads() - ENV.fetch('PUMA_MAX_THREADS', '16').to_i -end - -# Determine the maximum number of workers that are allowed by the available -# memory. Puma documentation recommends the maximum number of workers to be -# set to the number of cores. -# Unless we're specifically tuned otherwise, allow one worker process per 256MiB -# memory, to a maximum of 1 worker / core. Hopefully that'll be a reasonable -# starting point for average apps; if not, it's all tunable. The simple -# OpenShift ruby/rails sample app currently requires approx. 60MiB + -# 70MiB/worker before taking its first request, so hopefully a default of -# 256MiB/worker will give other simple apps reasonable default headroom. -def get_workers() - return ENV['PUMA_WORKERS'].to_i if ENV.has_key? 'PUMA_WORKERS' - - cores = ENV.fetch('NUMBER_OF_CORES', '1').to_i - max_workers = get_max_memory() / get_memory_per_worker() - - [cores, max_workers].min -end - -environment ENV['RACK_ENV'] || ENV['RAILS_ENV'] || 'production' -threads get_min_threads(), get_max_threads() -workers get_workers() -bind 'tcp://0.0.0.0:8080' diff --git a/2.0/root/opt/app-root/etc/scl_enable b/2.0/root/opt/app-root/etc/scl_enable deleted file mode 100644 index 457db1b8..00000000 --- a/2.0/root/opt/app-root/etc/scl_enable +++ /dev/null @@ -1,6 +0,0 @@ -# IMPORTANT: Do not add more content to this file unless you know what you are -# doing. This file is sourced everytime the shell session is opened. -# -# This will make scl collection binaries work out of box. -unset BASH_ENV PROMPT_COMMAND ENV -source scl_source enable ruby200 ror40 nodejs010 diff --git a/2.0/s2i/bin/assemble b/2.0/s2i/bin/assemble deleted file mode 100755 index 0f4af1dd..00000000 --- a/2.0/s2i/bin/assemble +++ /dev/null @@ -1,63 +0,0 @@ -#!/bin/bash - -function rake_assets_precompile() { - [[ "$DISABLE_ASSET_COMPILATION" == "true" ]] && return - [ ! -f Gemfile ] && return - [ ! -f Rakefile ] && return - ! grep " rake " Gemfile.lock >/dev/null && return - ! bundle exec 'rake -T' | grep "assets:precompile" >/dev/null && return - - echo "---> Starting asset compilation ..." - bundle exec rake assets:precompile -} - -set -e - -export RACK_ENV=${RACK_ENV:-"production"} - -shopt -s dotglob -echo "---> Installing application source ..." -mv /tmp/src/* ./ - -echo "---> Building your Ruby application from source ..." -if [ -f Gemfile ]; then - ADDTL_BUNDLE_ARGS="" - if [ -f Gemfile.lock ]; then - ADDTL_BUNDLE_ARGS="--deployment" - fi - - if [[ "$RAILS_ENV" == "development" || "$RACK_ENV" == "development" ]]; then - BUNDLE_WITHOUT=${BUNDLE_WITHOUT:-"test"} - elif [[ "$RAILS_ENV" == "test" || "$RACK_ENV" == "test" ]]; then - BUNDLE_WITHOUT=${BUNDLE_WITHOUT:-"development"} - else - BUNDLE_WITHOUT=${BUNDLE_WITHOUT:-"development:test"} - fi - - echo "---> Running 'bundle install ${ADDTL_BUNDLE_ARGS}' ..." - bundle install --path ./bundle ${ADDTL_BUNDLE_ARGS} - - echo "---> Cleaning up unused ruby gems ..." - bundle clean -V -fi - -if ! bundle exec rackup -h &>/dev/null; then - echo "WARNING: Rubygem Rack is not installed in the present image." - echo " Add rack to your Gemfile in order to start the web server." -fi - -if [[ "$RAILS_ENV" == "production" || "$RACK_ENV" == "production" ]]; then - rake_assets_precompile -fi - -# Fix source directory permissions -fix-permissions ./ - -# Make the ./tmp folder world writeable as Rails or other frameworks might use -# it to store temporary data (uploads/cache/sessions/etcd). -# The ./db folder has to be writeable as well because when Rails complete the -# migration it writes the schema version into ./db/schema.db -set +e -[[ -d ./tmp ]] && chgrp -R 0 ./tmp && chmod -R g+rw ./tmp -[[ -d ./db ]] && chgrp -R 0 ./db && chmod -R g+rw ./db -set -e diff --git a/2.0/s2i/bin/run b/2.0/s2i/bin/run deleted file mode 100755 index 1614ec3b..00000000 --- a/2.0/s2i/bin/run +++ /dev/null @@ -1,39 +0,0 @@ -#!/bin/bash - -function is_puma_installed() { - [ ! -f Gemfile.lock ] && return 1 - grep ' puma ' Gemfile.lock >/dev/null -} - -set -e - -function check_number() { - if [[ ! "$2" =~ ^[0-9]+$ ]]; then - echo "$1 needs to be a non-negative number" - exit 1 - fi -} -check_number PUMA_WORKERS "${PUMA_WORKERS:-0}" -check_number PUMA_MIN_THREADS "${PUMA_MIN_THREADS:-0}" -check_number PUMA_MAX_THREADS "${PUMA_MAX_THREADS:-0}" - -export RACK_ENV=${RACK_ENV:-"production"} - -if is_puma_installed; then - export_vars=$(cgroup-limits) ; export $export_vars - - exec bundle exec "puma --config ../etc/puma.cfg" -else - echo "You might consider adding 'puma' into your Gemfile." - - if bundle exec rackup -h &>/dev/null; then - if [ -f Gemfile ]; then - exec bundle exec "rackup -E ${RAILS_ENV:-$RACK_ENV} -P /tmp/rack.pid --host 0.0.0.0 --port 8080" - else - exec rackup -E "${RAILS_ENV:-$RACK_ENV}" -P /tmp/rack.pid --host 0.0.0.0 --port 8080 - fi - else - echo "ERROR: Rubygem Rack is not installed in the present image." - echo " Add rack to your Gemfile in order to start the web server." - fi -fi diff --git a/2.0/s2i/bin/usage b/2.0/s2i/bin/usage deleted file mode 100755 index 7e5fbadd..00000000 --- a/2.0/s2i/bin/usage +++ /dev/null @@ -1,16 +0,0 @@ -#!/bin/sh - -DISTRO=`cat /etc/*-release | grep ^ID= | grep -Po '".*?"' | tr -d '"'` - -cat <= 1.1, < 2.0) - rack (1.5.2) - rack-protection (1.5.3) - rack - sinatra (1.4.5) - rack (~> 1.4) - rack-protection (~> 1.4) - tilt (~> 1.3, >= 1.3.4) - tilt (1.4.1) - -PLATFORMS - ruby - -DEPENDENCIES - puma - sinatra diff --git a/2.0/test/puma-test-app/app.rb b/2.0/test/puma-test-app/app.rb deleted file mode 100755 index cd7e87d7..00000000 --- a/2.0/test/puma-test-app/app.rb +++ /dev/null @@ -1,5 +0,0 @@ -require 'sinatra' - -get '/' do - 'Hello world!' -end diff --git a/2.0/test/puma-test-app/config.ru b/2.0/test/puma-test-app/config.ru deleted file mode 100755 index 76a6edff..00000000 --- a/2.0/test/puma-test-app/config.ru +++ /dev/null @@ -1,2 +0,0 @@ -require './app' -run Sinatra::Application diff --git a/2.0/test/rack-test-app/Gemfile b/2.0/test/rack-test-app/Gemfile deleted file mode 100755 index c10abd72..00000000 --- a/2.0/test/rack-test-app/Gemfile +++ /dev/null @@ -1,3 +0,0 @@ -source 'https://rubygems.org' - -gem 'sinatra' diff --git a/2.0/test/rack-test-app/Gemfile.lock b/2.0/test/rack-test-app/Gemfile.lock deleted file mode 100755 index 6f67fa8a..00000000 --- a/2.0/test/rack-test-app/Gemfile.lock +++ /dev/null @@ -1,17 +0,0 @@ -GEM - remote: https://rubygems.org/ - specs: - rack (1.6.0) - rack-protection (1.5.3) - rack - sinatra (1.4.5) - rack (~> 1.4) - rack-protection (~> 1.4) - tilt (~> 1.3, >= 1.3.4) - tilt (1.4.1) - -PLATFORMS - ruby - -DEPENDENCIES - sinatra diff --git a/2.0/test/rack-test-app/app.rb b/2.0/test/rack-test-app/app.rb deleted file mode 100755 index cd7e87d7..00000000 --- a/2.0/test/rack-test-app/app.rb +++ /dev/null @@ -1,5 +0,0 @@ -require 'sinatra' - -get '/' do - 'Hello world!' -end diff --git a/2.0/test/rack-test-app/config.ru b/2.0/test/rack-test-app/config.ru deleted file mode 100755 index 76a6edff..00000000 --- a/2.0/test/rack-test-app/config.ru +++ /dev/null @@ -1,2 +0,0 @@ -require './app' -run Sinatra::Application diff --git a/2.0/test/run b/2.0/test/run deleted file mode 100755 index d18bcd67..00000000 --- a/2.0/test/run +++ /dev/null @@ -1,191 +0,0 @@ -#!/bin/bash -x -# -# The 'run' performs a simple test that verifies that S2I image. -# The main focus here is to excersise the S2I scripts. -# -# IMAGE_NAME specifies a name of the candidate image used for testing. -# The image has to be available before this script is executed. -# -IMAGE_NAME=${IMAGE_NAME-openshift/ruby-20-centos7-candidate} - -declare -a WEB_SERVERS=(db puma rack) -#declare -a WEB_SERVERS=(db) - -# TODO: Make command compatible for Mac users -test_dir="$(readlink -zf $(dirname "${BASH_SOURCE[0]}"))" -image_dir=$(readlink -zf ${test_dir}/..) - -# Read exposed port from image meta data -test_port="$(docker inspect --format='{{range $key, $value := .Config.ExposedPorts }}{{$key}}{{end}}' ${IMAGE_NAME} | sed 's/\/.*//')" - -info() { - echo -e "\n\e[1m[INFO] $@...\e[0m\n" -} - -image_exists() { - docker inspect $1 &>/dev/null -} - -container_exists() { - image_exists $(cat $cid_file) -} - -container_ip() { - docker inspect --format="{{ .NetworkSettings.IPAddress }}" $(cat $cid_file) -} - -run_s2i_build() { - s2i build ${s2i_args} file://${test_dir}/${1}-test-app ${IMAGE_NAME} ${IMAGE_NAME}-testapp -} - -prepare() { - if ! image_exists ${IMAGE_NAME}; then - echo "ERROR: The image ${IMAGE_NAME} must exist before this script is executed." - exit 1 - fi - # TODO: S2I build require the application is a valid 'GIT' repository, we - # should remove this restriction in the future when a file:// is used. - info "Build the test application image" - pushd ${test_dir}/${1}-test-app >/dev/null - git init - git config user.email "build@localhost" && git config user.name "builder" - git add -A && git commit -m "Sample commit" - popd >/dev/null -} - -run_test_application() { - docker run --user=100001 --rm --cidfile=${cid_file} ${IMAGE_NAME}-testapp -} - -cleanup() { - info "Cleaning up the test application image $1" - if [ -f $cid_file ]; then - if container_exists; then - docker stop $(cat $cid_file) - fi - fi - if image_exists ${IMAGE_NAME}-testapp; then - docker rmi -f ${IMAGE_NAME}-testapp - fi - rm -rf ${test_dir}/${1}-test-app/.git - if [[ $1 == "db" ]]; then - rm -rf ${test_dir}/db-test-app - fi -} - -check_result() { - local result="$1" - if [[ "$result" != "0" ]]; then - info "TEST FAILED (${result})" - cleanup - exit $result - fi -} - -wait_for_cid() { - local max_attempts=10 - local sleep_time=1 - local attempt=1 - local result=1 - info "Waiting for application container to start" - while [ $attempt -le $max_attempts ]; do - [ -f $cid_file ] && [ -s $cid_file ] && break - attempt=$(( $attempt + 1 )) - sleep $sleep_time - done -} - -test_s2i_usage() { - info "Testing 's2i usage'" - s2i usage ${s2i_args} ${IMAGE_NAME} &>/dev/null -} - -test_docker_run_usage() { - info "Testing 'docker run' usage" - docker run ${IMAGE_NAME} &>/dev/null -} - -test_connection() { - info "Testing the HTTP connection (http://$(container_ip):${test_port})" - local max_attempts=10 - local sleep_time=1 - local attempt=1 - local result=1 - while [ $attempt -le $max_attempts ]; do - response_code=$(curl -s -w %{http_code} -o /dev/null http://$(container_ip):${test_port}/) - status=$? - if [ $status -eq 0 ]; then - if [ $response_code -eq 200 ]; then - result=0 - fi - break - fi - attempt=$(( $attempt + 1 )) - sleep $sleep_time - done - return $result -} - -test_scl_usage() { - local run_cmd="$1" - local expected="$2" - - info "Testing the image SCL enable" - out=$(docker run --rm ${IMAGE_NAME} /bin/bash -c "${run_cmd}") - if ! echo "${out}" | grep -q "${expected}"; then - echo "ERROR[/bin/bash -c "${run_cmd}"] Expected '${expected}', got '${out}'" - return 1 - fi - out=$(docker exec $(cat ${cid_file}) /bin/bash -c "${run_cmd}" 2>&1) - if ! echo "${out}" | grep -q "${expected}"; then - echo "ERROR[exec /bin/bash -c "${run_cmd}"] Expected '${expected}', got '${out}'" - return 1 - fi - out=$(docker exec $(cat ${cid_file}) /bin/sh -ic "${run_cmd}" 2>&1) - if ! echo "${out}" | grep -q "${expected}"; then - echo "ERROR[exec /bin/sh -ic "${run_cmd}"] Expected '${expected}', got '${out}'" - return 1 - fi -} - -pushd ${test_dir} -git clone git://github.com/openshift/ruby-hello-world -mv ruby-hello-world db-test-app -popd - -for server in ${WEB_SERVERS[@]}; do - cid_file=$(mktemp -u --suffix=.cid) - - # Since we built the candidate image locally, we don't want S2I attempt to pull - # it from Docker hub - s2i_args="--pull-policy=never" - - prepare ${server} - run_s2i_build ${server} - check_result $? - - # Verify the 'usage' script is working properly when running the base image with 's2i usage ...' - test_s2i_usage - check_result $? - - # Verify the 'usage' script is working properly when running the base image with 'docker run ...' - test_docker_run_usage - check_result $? - - # Verify that the HTTP connection can be established to test application container - run_test_application & - - # Wait for the container to write it's CID file - wait_for_cid - - test_connection - check_result $? - - test_scl_usage "ruby --version" "ruby 2.0.0" - check_result $? - - info "All tests for the ${server}-test-app finished successfully." - cleanup ${server} -done - -info "All tests finished successfully." diff --git a/2.2/Dockerfile b/2.2/Dockerfile deleted file mode 100644 index 23bcc550..00000000 --- a/2.2/Dockerfile +++ /dev/null @@ -1,47 +0,0 @@ -FROM centos/s2i-base-centos7 - -# This image provides a Ruby 2.2 environment you can use to run your Ruby -# applications. - -EXPOSE 8080 - -ENV RUBY_VERSION 2.2 - -ENV SUMMARY="Platform for building and running Ruby $RUBY_VERSION applications" \ - DESCRIPTION="Ruby $RUBY_VERSION available as container is a base platform for \ -building and running various Ruby $RUBY_VERSION applications and frameworks. \ -Ruby is the interpreted scripting language for quick and easy object-oriented programming. \ -It has many features to process text files and to do system management tasks (as in Perl). \ -It is simple, straight-forward, and extensible." - -LABEL summary="$SUMMARY" \ - description="$DESCRIPTION" \ - io.k8s.description="$DESCRIPTION" \ - io.k8s.display-name="Ruby 2.2" \ - io.openshift.expose-services="8080:http" \ - io.openshift.tags="builder,ruby,ruby22" \ - com.redhat.component="rh-ruby22-docker" \ - name="centos/ruby-22-centos7" \ - version="2.2" \ - usage="s2i build https://github.com/sclorg/s2i-ruby-container.git --context-dir=2.4/test/puma-test-app/ centos/ruby-22-centos7 ruby-sample-app" \ - maintainer="SoftwareCollections.org " - -RUN INSTALL_PKGS="rh-ruby22 rh-ruby22-ruby-devel rh-ruby22-rubygem-rake v8314 rh-ruby22-rubygem-bundler" && \ - yum install -y centos-release-scl && \ - yum install -y --setopt=tsflags=nodocs $INSTALL_PKGS && rpm -V $INSTALL_PKGS && \ - yum -y clean all --enablerepo='*' - -# Copy the S2I scripts from the specific language image to $STI_SCRIPTS_PATH -COPY ./s2i/bin/ $STI_SCRIPTS_PATH - -# Copy extra files to the image. -COPY ./root/ / - -# Drop the root user and make the content of /opt/app-root owned by user 1001 -RUN chown -R 1001:0 ${APP_ROOT} && chmod -R ug+rwx ${APP_ROOT} && \ - rpm-file-permissions - -USER 1001 - -# Set the default CMD to print the usage of the language image -CMD $STI_SCRIPTS_PATH/usage diff --git a/2.2/Dockerfile.rhel7 b/2.2/Dockerfile.rhel7 deleted file mode 100644 index d7d74bad..00000000 --- a/2.2/Dockerfile.rhel7 +++ /dev/null @@ -1,48 +0,0 @@ -FROM rhscl/s2i-base-rhel7 - -# This image provides a Ruby 2.2 environment you can use to run your Ruby -# applications. - -EXPOSE 8080 - -ENV RUBY_VERSION 2.2 - -ENV SUMMARY="Platform for building and running Ruby $RUBY_VERSION applications" \ - DESCRIPTION="Ruby $RUBY_VERSION available as container is a base platform for \ -building and running various Ruby $RUBY_VERSION applications and frameworks. \ -Ruby is the interpreted scripting language for quick and easy object-oriented programming. \ -It has many features to process text files and to do system management tasks (as in Perl). \ -It is simple, straight-forward, and extensible." - -LABEL summary="$SUMMARY" \ - description="$DESCRIPTION" \ - io.k8s.description="$DESCRIPTION" \ - io.k8s.display-name="Ruby 2.2" \ - io.openshift.expose-services="8080:http" \ - io.openshift.tags="builder,ruby,ruby22" \ - com.redhat.component="rh-ruby22-docker" \ - name="rhscl/ruby-22-rhel7" \ - version="2.2" \ - usage="s2i build https://github.com/sclorg/s2i-ruby-container.git --context-dir=2.4/test/puma-test-app/ rhscl/ruby-22-rhel7 ruby-sample-app" \ - maintainer="SoftwareCollections.org " - -RUN yum install -y yum-utils && \ - prepare-yum-repositories rhel-server-rhscl-7-rpms && \ - INSTALL_PKGS="rh-ruby22 rh-ruby22-ruby-devel rh-ruby22-rubygem-rake v8314 rh-ruby22-rubygem-bundler" && \ - yum install -y --setopt=tsflags=nodocs $INSTALL_PKGS && rpm -V $INSTALL_PKGS && \ - yum -y clean all --enablerepo='*' - -# Copy the S2I scripts from the specific language image to $STI_SCRIPTS_PATH -COPY ./s2i/bin/ $STI_SCRIPTS_PATH - -# Copy extra files to the image. -COPY ./root/ / - -# Drop the root user and make the content of /opt/app-root owned by user 1001 -RUN chown -R 1001:0 ${APP_ROOT} && chmod -R ug+rwx ${APP_ROOT} && \ - rpm-file-permissions - -USER 1001 - -# Set the default CMD to print the usage of the language image -CMD $STI_SCRIPTS_PATH/usage diff --git a/2.2/README.md b/2.2/README.md deleted file mode 100644 index 2f1aecee..00000000 --- a/2.2/README.md +++ /dev/null @@ -1,4 +0,0 @@ -Ruby 2.2 platform for building and running applications -======================================================= - -**The Ruby 2.2 image is deprecated.** diff --git a/2.2/cccp.yml b/2.2/cccp.yml deleted file mode 100644 index b0f06ad9..00000000 --- a/2.2/cccp.yml +++ /dev/null @@ -1,3 +0,0 @@ -# This is for the purpose of building this container -# on the centos container pipeline. -job-id: ruby-22-centos7 diff --git a/2.2/content_sets.yml b/2.2/content_sets.yml deleted file mode 100644 index 432c0914..00000000 --- a/2.2/content_sets.yml +++ /dev/null @@ -1,10 +0,0 @@ -# This is a file defining which content sets are needed to update content in -# this image. Data provided here helps determine which images are vulnerable to -# specific CVEs. Generally you should only need to update this file when: -# 1. You start depending on new product -# 2. You are preparing new product release and your content sets will change ---- -x86_64: -- rhel-7-server-rpms -- rhel-7-server-optional-rpms -- rhel-server-rhscl-7-rpms diff --git a/2.2/root/opt/app-root/.gemrc b/2.2/root/opt/app-root/.gemrc deleted file mode 100644 index 2422bea3..00000000 --- a/2.2/root/opt/app-root/.gemrc +++ /dev/null @@ -1,9 +0,0 @@ ---- -install: --no-document -update: --no-document -:benchmark: false -:update_sources: true -:bulk_threshold: 1000 -:backtrace: true -:sources: -- https://rubygems.org/ diff --git a/2.2/root/opt/app-root/etc/puma.cfg b/2.2/root/opt/app-root/etc/puma.cfg deleted file mode 100644 index a52d26dc..00000000 --- a/2.2/root/opt/app-root/etc/puma.cfg +++ /dev/null @@ -1,50 +0,0 @@ -def get_max_memory() - return ENV['MEMORY_LIMIT_IN_BYTES'].to_i if ENV.has_key? 'MEMORY_LIMIT_IN_BYTES' - - # Assume unlimited memory. 0.size is the number of bytes a Ruby - # Fixnum class can hold. One bit is used for sign and one is used - # by Ruby to determine whether it's a number or pointer to an object. - # That's why we subtract two bits. This expresion should therefore be - # the largest signed Fixnum possible. - (2 ** (8*0.size - 2) - 1) -end - -def get_memory_per_worker() - bytes = ENV.fetch('MEMORY_BYTES_PER_WORKER', '0').to_i - if bytes == 0 - # Comment describing rationale for choosing default of 256MiB/worker is below. - bytes = 256 * (2**20) - end - bytes -end - -def get_min_threads() - ENV.fetch('PUMA_MIN_THREADS', '0').to_i -end - -def get_max_threads() - ENV.fetch('PUMA_MAX_THREADS', '16').to_i -end - -# Determine the maximum number of workers that are allowed by the available -# memory. Puma documentation recommends the maximum number of workers to be -# set to the number of cores. -# Unless we're specifically tuned otherwise, allow one worker process per 256MiB -# memory, to a maximum of 1 worker / core. Hopefully that'll be a reasonable -# starting point for average apps; if not, it's all tunable. The simple -# OpenShift ruby/rails sample app currently requires approx. 60MiB + -# 70MiB/worker before taking its first request, so hopefully a default of -# 256MiB/worker will give other simple apps reasonable default headroom. -def get_workers() - return ENV['PUMA_WORKERS'].to_i if ENV.has_key? 'PUMA_WORKERS' - - cores = ENV.fetch('NUMBER_OF_CORES', '1').to_i - max_workers = get_max_memory() / get_memory_per_worker() - - [cores, max_workers].min -end - -environment ENV['RACK_ENV'] || ENV['RAILS_ENV'] || 'production' -threads get_min_threads(), get_max_threads() -workers get_workers() -bind 'tcp://0.0.0.0:8080' diff --git a/2.2/root/opt/app-root/etc/scl_enable b/2.2/root/opt/app-root/etc/scl_enable deleted file mode 100644 index 62b0a6af..00000000 --- a/2.2/root/opt/app-root/etc/scl_enable +++ /dev/null @@ -1,6 +0,0 @@ -# IMPORTANT: Do not add more content to this file unless you know what you are -# doing. This file is sourced everytime the shell session is opened. -# -# This will make scl collection binaries work out of box. -unset BASH_ENV PROMPT_COMMAND ENV -source scl_source enable rh-ruby22 $NODEJS_SCL diff --git a/2.2/s2i/bin/assemble b/2.2/s2i/bin/assemble deleted file mode 100755 index 76f92f06..00000000 --- a/2.2/s2i/bin/assemble +++ /dev/null @@ -1,71 +0,0 @@ -#!/bin/bash - -function rake_assets_precompile() { - [[ "$DISABLE_ASSET_COMPILATION" == "true" ]] && return - [ ! -f Gemfile ] && return - [ ! -f Rakefile ] && return - ! grep " rake " Gemfile.lock >/dev/null && return - ! bundle exec 'rake -T' | grep "assets:precompile" >/dev/null && return - - echo "---> Starting asset compilation ..." - bundle exec rake assets:precompile -} - -set -e - -export RACK_ENV=${RACK_ENV:-"production"} - -if [ -n "$RUBYGEM_MIRROR" ]; then - bundle config mirror.https://rubygems.org $RUBYGEM_MIRROR -fi - -shopt -s dotglob -echo "---> Installing application source ..." -mv /tmp/src/* ./ - -echo "---> Building your Ruby application from source ..." -if [ -f Gemfile ]; then - ADDTL_BUNDLE_ARGS="--retry 2" - if [ -f Gemfile.lock ]; then - ADDTL_BUNDLE_ARGS+=" --deployment" - fi - - if [[ "$RAILS_ENV" == "development" || "$RACK_ENV" == "development" ]]; then - BUNDLE_WITHOUT=${BUNDLE_WITHOUT:-"test"} - elif [[ "$RAILS_ENV" == "test" || "$RACK_ENV" == "test" ]]; then - BUNDLE_WITHOUT=${BUNDLE_WITHOUT:-"development"} - else - BUNDLE_WITHOUT=${BUNDLE_WITHOUT:-"development:test"} - fi - - if [ -n "$BUNDLE_WITHOUT" ]; then - ADDTL_BUNDLE_ARGS+=" --without $BUNDLE_WITHOUT" - fi - - echo "---> Running 'bundle install ${ADDTL_BUNDLE_ARGS}' ..." - bundle install --path ./bundle ${ADDTL_BUNDLE_ARGS} - - echo "---> Cleaning up unused ruby gems ..." - bundle clean -V -fi - -if ! bundle exec rackup -h &>/dev/null; then - echo "WARNING: Rubygem Rack is not installed in the present image." - echo " Add rack to your Gemfile in order to start the web server." -fi - -if [[ "$RAILS_ENV" == "production" || "$RACK_ENV" == "production" ]]; then - rake_assets_precompile -fi - -# Fix source directory permissions -fix-permissions ./ - -# Make the ./tmp folder world writeable as Rails or other frameworks might use -# it to store temporary data (uploads/cache/sessions/etcd). -# The ./db folder has to be writeable as well because when Rails complete the -# migration it writes the schema version into ./db/schema.db -set +e -[[ -d ./tmp ]] && chgrp -R 0 ./tmp && chmod -R g+rw ./tmp -[[ -d ./db ]] && chgrp -R 0 ./db && chmod -R g+rw ./db -set -e diff --git a/2.2/s2i/bin/run b/2.2/s2i/bin/run deleted file mode 100755 index 1614ec3b..00000000 --- a/2.2/s2i/bin/run +++ /dev/null @@ -1,39 +0,0 @@ -#!/bin/bash - -function is_puma_installed() { - [ ! -f Gemfile.lock ] && return 1 - grep ' puma ' Gemfile.lock >/dev/null -} - -set -e - -function check_number() { - if [[ ! "$2" =~ ^[0-9]+$ ]]; then - echo "$1 needs to be a non-negative number" - exit 1 - fi -} -check_number PUMA_WORKERS "${PUMA_WORKERS:-0}" -check_number PUMA_MIN_THREADS "${PUMA_MIN_THREADS:-0}" -check_number PUMA_MAX_THREADS "${PUMA_MAX_THREADS:-0}" - -export RACK_ENV=${RACK_ENV:-"production"} - -if is_puma_installed; then - export_vars=$(cgroup-limits) ; export $export_vars - - exec bundle exec "puma --config ../etc/puma.cfg" -else - echo "You might consider adding 'puma' into your Gemfile." - - if bundle exec rackup -h &>/dev/null; then - if [ -f Gemfile ]; then - exec bundle exec "rackup -E ${RAILS_ENV:-$RACK_ENV} -P /tmp/rack.pid --host 0.0.0.0 --port 8080" - else - exec rackup -E "${RAILS_ENV:-$RACK_ENV}" -P /tmp/rack.pid --host 0.0.0.0 --port 8080 - fi - else - echo "ERROR: Rubygem Rack is not installed in the present image." - echo " Add rack to your Gemfile in order to start the web server." - fi -fi diff --git a/2.2/s2i/bin/usage b/2.2/s2i/bin/usage deleted file mode 100755 index 576561fe..00000000 --- a/2.2/s2i/bin/usage +++ /dev/null @@ -1,18 +0,0 @@ -#!/bin/sh - -DISTRO=`cat /etc/*-release | grep ^ID= | grep -Po '".*?"' | tr -d '"'` -NAMESPACE=centos -[[ $DISTRO =~ rhel* ]] && NAMESPACE=rhscl - -cat < 1.0) - rack (~> 2.0) - rack-protection (= 2.0.5) - tilt (~> 2.0) - tilt (2.0.9) - -PLATFORMS - ruby - -DEPENDENCIES - puma - sinatra diff --git a/2.2/test/puma-test-app/app.rb b/2.2/test/puma-test-app/app.rb deleted file mode 100755 index cd7e87d7..00000000 --- a/2.2/test/puma-test-app/app.rb +++ /dev/null @@ -1,5 +0,0 @@ -require 'sinatra' - -get '/' do - 'Hello world!' -end diff --git a/2.2/test/puma-test-app/config.ru b/2.2/test/puma-test-app/config.ru deleted file mode 100755 index 76a6edff..00000000 --- a/2.2/test/puma-test-app/config.ru +++ /dev/null @@ -1,2 +0,0 @@ -require './app' -run Sinatra::Application diff --git a/2.2/test/rack-test-app/Gemfile b/2.2/test/rack-test-app/Gemfile deleted file mode 100755 index c10abd72..00000000 --- a/2.2/test/rack-test-app/Gemfile +++ /dev/null @@ -1,3 +0,0 @@ -source 'https://rubygems.org' - -gem 'sinatra' diff --git a/2.2/test/rack-test-app/Gemfile.lock b/2.2/test/rack-test-app/Gemfile.lock deleted file mode 100644 index bbe912b5..00000000 --- a/2.2/test/rack-test-app/Gemfile.lock +++ /dev/null @@ -1,19 +0,0 @@ -GEM - remote: https://rubygems.org/ - specs: - mustermann (1.0.3) - rack (2.0.6) - rack-protection (2.0.5) - rack - sinatra (2.0.5) - mustermann (~> 1.0) - rack (~> 2.0) - rack-protection (= 2.0.5) - tilt (~> 2.0) - tilt (2.0.9) - -PLATFORMS - ruby - -DEPENDENCIES - sinatra diff --git a/2.2/test/rack-test-app/app.rb b/2.2/test/rack-test-app/app.rb deleted file mode 100755 index cd7e87d7..00000000 --- a/2.2/test/rack-test-app/app.rb +++ /dev/null @@ -1,5 +0,0 @@ -require 'sinatra' - -get '/' do - 'Hello world!' -end diff --git a/2.2/test/rack-test-app/config.ru b/2.2/test/rack-test-app/config.ru deleted file mode 100755 index 76a6edff..00000000 --- a/2.2/test/rack-test-app/config.ru +++ /dev/null @@ -1,2 +0,0 @@ -require './app' -run Sinatra::Application diff --git a/2.2/test/run b/2.2/test/run deleted file mode 100755 index 27c4abb6..00000000 --- a/2.2/test/run +++ /dev/null @@ -1,191 +0,0 @@ -#!/bin/bash -x -# -# The 'run' performs a simple test that verifies that S2I image. -# The main focus here is to excersise the S2I scripts. -# -# IMAGE_NAME specifies a name of the candidate image used for testing. -# The image has to be available before this script is executed. -# -IMAGE_NAME=${IMAGE_NAME-openshift/ruby-22-centos7-candidate} - -declare -a WEB_SERVERS=(db puma rack) -#declare -a WEB_SERVERS=(db) - -# TODO: Make command compatible for Mac users -test_dir="$(readlink -zf $(dirname "${BASH_SOURCE[0]}"))" -image_dir=$(readlink -zf ${test_dir}/..) - -# Read exposed port from image meta data -test_port="$(docker inspect --format='{{range $key, $value := .Config.ExposedPorts }}{{$key}}{{end}}' ${IMAGE_NAME} | sed 's/\/.*//')" - -info() { - echo -e "\n\e[1m[INFO] $@...\e[0m\n" -} - -image_exists() { - docker inspect $1 &>/dev/null -} - -container_exists() { - image_exists $(cat $cid_file) -} - -container_ip() { - docker inspect --format="{{ .NetworkSettings.IPAddress }}" $(cat $cid_file) -} - -run_s2i_build() { - s2i build ${s2i_args} file://${test_dir}/${1}-test-app ${IMAGE_NAME} ${IMAGE_NAME}-testapp -} - -prepare() { - if ! image_exists ${IMAGE_NAME}; then - echo "ERROR: The image ${IMAGE_NAME} must exist before this script is executed." - exit 1 - fi - # TODO: S2I build require the application is a valid 'GIT' repository, we - # should remove this restriction in the future when a file:// is used. - info "Build the test application image" - pushd ${test_dir}/${1}-test-app >/dev/null - git init - git config user.email "build@localhost" && git config user.name "builder" - git add -A && git commit -m "Sample commit" - popd >/dev/null -} - -run_test_application() { - docker run --user=100001 --rm --cidfile=${cid_file} ${IMAGE_NAME}-testapp -} - -cleanup() { - info "Cleaning up the test application image $1" - if [ -f $cid_file ]; then - if container_exists; then - docker stop $(cat $cid_file) - fi - fi - if image_exists ${IMAGE_NAME}-testapp; then - docker rmi -f ${IMAGE_NAME}-testapp - fi - rm -rf ${test_dir}/${1}-test-app/.git - if [[ $1 == "db" ]]; then - rm -rf ${test_dir}/db-test-app - fi -} - -check_result() { - local result="$1" - if [[ "$result" != "0" ]]; then - info "TEST FAILED (${result})" - cleanup - exit $result - fi -} - -wait_for_cid() { - local max_attempts=10 - local sleep_time=1 - local attempt=1 - local result=1 - info "Waiting for application container to start" - while [ $attempt -le $max_attempts ]; do - [ -f $cid_file ] && [ -s $cid_file ] && break - attempt=$(( $attempt + 1 )) - sleep $sleep_time - done -} - -test_s2i_usage() { - info "Testing 's2i usage'" - s2i usage ${s2i_args} ${IMAGE_NAME} &>/dev/null -} - -test_docker_run_usage() { - info "Testing 'docker run' usage" - docker run ${IMAGE_NAME} &>/dev/null -} - -test_connection() { - info "Testing the HTTP connection (http://$(container_ip):${test_port})" - local max_attempts=10 - local sleep_time=1 - local attempt=1 - local result=1 - while [ $attempt -le $max_attempts ]; do - response_code=$(curl -s -w %{http_code} -o /dev/null http://$(container_ip):${test_port}/) - status=$? - if [ $status -eq 0 ]; then - if [ $response_code -eq 200 ]; then - result=0 - fi - break - fi - attempt=$(( $attempt + 1 )) - sleep $sleep_time - done - return $result -} - -test_scl_usage() { - local run_cmd="$1" - local expected="$2" - - info "Testing the image SCL enable" - out=$(docker run --rm ${IMAGE_NAME} /bin/bash -c "${run_cmd}") - if ! echo "${out}" | grep -q "${expected}"; then - echo "ERROR[/bin/bash -c "${run_cmd}"] Expected '${expected}', got '${out}'" - return 1 - fi - out=$(docker exec $(cat ${cid_file}) /bin/bash -c "${run_cmd}" 2>&1) - if ! echo "${out}" | grep -q "${expected}"; then - echo "ERROR[exec /bin/bash -c "${run_cmd}"] Expected '${expected}', got '${out}'" - return 1 - fi - out=$(docker exec $(cat ${cid_file}) /bin/sh -ic "${run_cmd}" 2>&1) - if ! echo "${out}" | grep -q "${expected}"; then - echo "ERROR[exec /bin/sh -ic "${run_cmd}"] Expected '${expected}', got '${out}'" - return 1 - fi -} - -pushd ${test_dir} -git clone git://github.com/openshift/ruby-hello-world -mv ruby-hello-world db-test-app -popd - -for server in ${WEB_SERVERS[@]}; do - cid_file=$(mktemp -u --suffix=.cid) - - # Since we built the candidate image locally, we don't want S2I attempt to pull - # it from Docker hub - s2i_args="--pull-policy=never" - - prepare ${server} - run_s2i_build ${server} - check_result $? - - # Verify the 'usage' script is working properly when running the base image with 's2i usage ...' - test_s2i_usage - check_result $? - - # Verify the 'usage' script is working properly when running the base image with 'docker run ...' - test_docker_run_usage - check_result $? - - # Verify that the HTTP connection can be established to test application container - run_test_application & - - # Wait for the container to write it's CID file - wait_for_cid - - test_connection - check_result $? - - test_scl_usage "ruby --version" "ruby 2.2." - check_result $? - - info "All tests for the ${server}-test-app finished successfully." - cleanup ${server} -done - -info "All tests finished successfully." diff --git a/2.3/Dockerfile b/2.3/Dockerfile deleted file mode 100644 index fced5bfc..00000000 --- a/2.3/Dockerfile +++ /dev/null @@ -1,47 +0,0 @@ -FROM centos/s2i-base-centos7 - -# This image provides a Ruby 2.3 environment you can use to run your Ruby -# applications. - -EXPOSE 8080 - -ENV RUBY_VERSION 2.3 - -ENV SUMMARY="Platform for building and running Ruby $RUBY_VERSION applications" \ - DESCRIPTION="Ruby $RUBY_VERSION available as container is a base platform for \ -building and running various Ruby $RUBY_VERSION applications and frameworks. \ -Ruby is the interpreted scripting language for quick and easy object-oriented programming. \ -It has many features to process text files and to do system management tasks (as in Perl). \ -It is simple, straight-forward, and extensible." - -LABEL summary="$SUMMARY" \ - description="$DESCRIPTION" \ - io.k8s.description="$DESCRIPTION" \ - io.k8s.display-name="Ruby 2.3" \ - io.openshift.expose-services="8080:http" \ - io.openshift.tags="builder,ruby,ruby23,rh-ruby23" \ - com.redhat.component="rh-ruby23-container" \ - name="centos/ruby-23-centos7" \ - version="2.3" \ - usage="s2i build https://github.com/sclorg/s2i-ruby-container.git --context-dir=2.4/test/puma-test-app/ centos/ruby-23-centos7 ruby-sample-app" \ - maintainer="SoftwareCollections.org " - -RUN yum install -y centos-release-scl && \ - INSTALL_PKGS="rh-ruby23 rh-ruby23-ruby-devel rh-ruby23-rubygem-rake rh-ruby23-rubygem-bundler" && \ - yum install -y --setopt=tsflags=nodocs $INSTALL_PKGS && rpm -V $INSTALL_PKGS && \ - yum -y clean all --enablerepo='*' - -# Copy the S2I scripts from the specific language image to $STI_SCRIPTS_PATH -COPY ./s2i/bin/ $STI_SCRIPTS_PATH - -# Copy extra files to the image. -COPY ./root/ / - -# Drop the root user and make the content of /opt/app-root owned by user 1001 -RUN chown -R 1001:0 ${APP_ROOT} && chmod -R ug+rwx ${APP_ROOT} && \ - rpm-file-permissions - -USER 1001 - -# Set the default CMD to print the usage of the language image -CMD $STI_SCRIPTS_PATH/usage diff --git a/2.3/Dockerfile.rhel7 b/2.3/Dockerfile.rhel7 deleted file mode 100644 index 56242f60..00000000 --- a/2.3/Dockerfile.rhel7 +++ /dev/null @@ -1,48 +0,0 @@ -FROM rhscl/s2i-base-rhel7 - -# This image provides a Ruby 2.3 environment you can use to run your Ruby -# applications. - -EXPOSE 8080 - -ENV RUBY_VERSION 2.3 - -ENV SUMMARY="Platform for building and running Ruby $RUBY_VERSION applications" \ - DESCRIPTION="Ruby $RUBY_VERSION available as container is a base platform for \ -building and running various Ruby $RUBY_VERSION applications and frameworks. \ -Ruby is the interpreted scripting language for quick and easy object-oriented programming. \ -It has many features to process text files and to do system management tasks (as in Perl). \ -It is simple, straight-forward, and extensible." - -LABEL summary="$SUMMARY" \ - description="$DESCRIPTION" \ - io.k8s.description="$DESCRIPTION" \ - io.k8s.display-name="Ruby 2.3" \ - io.openshift.expose-services="8080:http" \ - io.openshift.tags="builder,ruby,ruby23,rh-ruby23" \ - com.redhat.component="rh-ruby23-container" \ - name="rhscl/ruby-23-rhel7" \ - version="2.3" \ - usage="s2i build https://github.com/sclorg/s2i-ruby-container.git --context-dir=2.4/test/puma-test-app/ rhscl/ruby-23-rhel7 ruby-sample-app" \ - maintainer="SoftwareCollections.org " - -RUN yum install -y yum-utils && \ - prepare-yum-repositories rhel-server-rhscl-7-rpms && \ - INSTALL_PKGS="rh-ruby23 rh-ruby23-ruby-devel rh-ruby23-rubygem-rake rh-ruby23-rubygem-bundler" && \ - yum install -y --setopt=tsflags=nodocs $INSTALL_PKGS && rpm -V $INSTALL_PKGS && \ - yum -y clean all --enablerepo='*' - -# Copy the S2I scripts from the specific language image to $STI_SCRIPTS_PATH -COPY ./s2i/bin/ $STI_SCRIPTS_PATH - -# Copy extra files to the image. -COPY ./root/ / - -# Drop the root user and make the content of /opt/app-root owned by user 1001 -RUN chown -R 1001:0 ${APP_ROOT} && chmod -R ug+rwx ${APP_ROOT} && \ - rpm-file-permissions - -USER 1001 - -# Set the default CMD to print the usage of the language image -CMD $STI_SCRIPTS_PATH/usage diff --git a/2.3/README.md b/2.3/README.md deleted file mode 100644 index 3c8414ec..00000000 --- a/2.3/README.md +++ /dev/null @@ -1,4 +0,0 @@ -Ruby 2.3 container image -================= - -**The Ruby 2.3 image is deprecated.** diff --git a/2.3/cccp.yml b/2.3/cccp.yml deleted file mode 100644 index d909f4e2..00000000 --- a/2.3/cccp.yml +++ /dev/null @@ -1,3 +0,0 @@ -# This is for the purpose of building this container -# on the centos container pipeline. -job-id: ruby-23-centos7 diff --git a/2.3/content_sets.yml b/2.3/content_sets.yml deleted file mode 100644 index 432c0914..00000000 --- a/2.3/content_sets.yml +++ /dev/null @@ -1,10 +0,0 @@ -# This is a file defining which content sets are needed to update content in -# this image. Data provided here helps determine which images are vulnerable to -# specific CVEs. Generally you should only need to update this file when: -# 1. You start depending on new product -# 2. You are preparing new product release and your content sets will change ---- -x86_64: -- rhel-7-server-rpms -- rhel-7-server-optional-rpms -- rhel-server-rhscl-7-rpms diff --git a/2.3/root/opt/app-root/.gemrc b/2.3/root/opt/app-root/.gemrc deleted file mode 100644 index 2422bea3..00000000 --- a/2.3/root/opt/app-root/.gemrc +++ /dev/null @@ -1,9 +0,0 @@ ---- -install: --no-document -update: --no-document -:benchmark: false -:update_sources: true -:bulk_threshold: 1000 -:backtrace: true -:sources: -- https://rubygems.org/ diff --git a/2.3/root/opt/app-root/etc/puma.cfg b/2.3/root/opt/app-root/etc/puma.cfg deleted file mode 100644 index a52d26dc..00000000 --- a/2.3/root/opt/app-root/etc/puma.cfg +++ /dev/null @@ -1,50 +0,0 @@ -def get_max_memory() - return ENV['MEMORY_LIMIT_IN_BYTES'].to_i if ENV.has_key? 'MEMORY_LIMIT_IN_BYTES' - - # Assume unlimited memory. 0.size is the number of bytes a Ruby - # Fixnum class can hold. One bit is used for sign and one is used - # by Ruby to determine whether it's a number or pointer to an object. - # That's why we subtract two bits. This expresion should therefore be - # the largest signed Fixnum possible. - (2 ** (8*0.size - 2) - 1) -end - -def get_memory_per_worker() - bytes = ENV.fetch('MEMORY_BYTES_PER_WORKER', '0').to_i - if bytes == 0 - # Comment describing rationale for choosing default of 256MiB/worker is below. - bytes = 256 * (2**20) - end - bytes -end - -def get_min_threads() - ENV.fetch('PUMA_MIN_THREADS', '0').to_i -end - -def get_max_threads() - ENV.fetch('PUMA_MAX_THREADS', '16').to_i -end - -# Determine the maximum number of workers that are allowed by the available -# memory. Puma documentation recommends the maximum number of workers to be -# set to the number of cores. -# Unless we're specifically tuned otherwise, allow one worker process per 256MiB -# memory, to a maximum of 1 worker / core. Hopefully that'll be a reasonable -# starting point for average apps; if not, it's all tunable. The simple -# OpenShift ruby/rails sample app currently requires approx. 60MiB + -# 70MiB/worker before taking its first request, so hopefully a default of -# 256MiB/worker will give other simple apps reasonable default headroom. -def get_workers() - return ENV['PUMA_WORKERS'].to_i if ENV.has_key? 'PUMA_WORKERS' - - cores = ENV.fetch('NUMBER_OF_CORES', '1').to_i - max_workers = get_max_memory() / get_memory_per_worker() - - [cores, max_workers].min -end - -environment ENV['RACK_ENV'] || ENV['RAILS_ENV'] || 'production' -threads get_min_threads(), get_max_threads() -workers get_workers() -bind 'tcp://0.0.0.0:8080' diff --git a/2.3/root/opt/app-root/etc/scl_enable b/2.3/root/opt/app-root/etc/scl_enable deleted file mode 100644 index 66366b60..00000000 --- a/2.3/root/opt/app-root/etc/scl_enable +++ /dev/null @@ -1,6 +0,0 @@ -# IMPORTANT: Do not add more content to this file unless you know what you are -# doing. This file is sourced everytime the shell session is opened. -# -# This will make scl collection binaries work out of box. -unset BASH_ENV PROMPT_COMMAND ENV -source scl_source enable rh-ruby23 $NODEJS_SCL diff --git a/2.3/s2i/bin/assemble b/2.3/s2i/bin/assemble deleted file mode 100755 index f3a4b8d2..00000000 --- a/2.3/s2i/bin/assemble +++ /dev/null @@ -1,71 +0,0 @@ -#!/bin/bash - -function rake_assets_precompile() { - [[ "$DISABLE_ASSET_COMPILATION" == "true" ]] && return - [ ! -f Gemfile ] && return - [ ! -f Rakefile ] && return - ! grep " rake " Gemfile.lock >/dev/null && return - ! bundle exec 'rake -T' | grep "assets:precompile" >/dev/null && return - - echo "---> Starting asset compilation ..." - bundle exec rake assets:precompile -} - -set -e - -export RACK_ENV=${RACK_ENV:-"production"} - -if [ -n "$RUBYGEM_MIRROR" ]; then - bundle config mirror.https://rubygems.org $RUBYGEM_MIRROR -fi - -shopt -s dotglob -echo "---> Installing application source ..." -mv /tmp/src/* ./ - -echo "---> Building your Ruby application from source ..." -if [ -f Gemfile ]; then - ADDTL_BUNDLE_ARGS="--retry 2" - if [ -f Gemfile.lock ]; then - ADDTL_BUNDLE_ARGS+=" --deployment" - fi - - if [[ "$RAILS_ENV" == "development" || "$RACK_ENV" == "development" ]]; then - BUNDLE_WITHOUT=${BUNDLE_WITHOUT:-"test"} - elif [[ "$RAILS_ENV" == "test" || "$RACK_ENV" == "test" ]]; then - BUNDLE_WITHOUT=${BUNDLE_WITHOUT:-"development"} - else - BUNDLE_WITHOUT=${BUNDLE_WITHOUT:-"development:test"} - fi - - if [ -n "$BUNDLE_WITHOUT" ]; then - ADDTL_BUNDLE_ARGS+=" --without $BUNDLE_WITHOUT" - fi - - echo "---> Running 'bundle install ${ADDTL_BUNDLE_ARGS}' ..." - bundle install --path ./bundle ${ADDTL_BUNDLE_ARGS} - - echo "---> Cleaning up unused ruby gems ..." - bundle clean -V -fi - -if ! bundle exec rackup -h &>/dev/null; then - echo "WARNING: Rubygem Rack is not installed in the present image." - echo " Add rack to your Gemfile in order to start the web server." -fi - -if [[ "$RAILS_ENV" == "production" || "$RACK_ENV" == "production" ]]; then - rake_assets_precompile -fi - -# Fix source directory permissions -fix-permissions ./ - -# Make the ./tmp folder world writeable as Rails or other frameworks might use -# it to store temporary data (uploads/cache/sessions/etcd). -# The ./db folder has to be writeable as well because when Rails complete the -# migration it writes the schema version into ./db/schema.db -set +e -[[ -d ./tmp ]] && chgrp -R 0 ./tmp && chmod -R g+rw ./tmp -[[ -d ./db ]] && chgrp -R 0 ./db && chmod -R g+rw ./db -set -e diff --git a/2.3/s2i/bin/run b/2.3/s2i/bin/run deleted file mode 100755 index 1614ec3b..00000000 --- a/2.3/s2i/bin/run +++ /dev/null @@ -1,39 +0,0 @@ -#!/bin/bash - -function is_puma_installed() { - [ ! -f Gemfile.lock ] && return 1 - grep ' puma ' Gemfile.lock >/dev/null -} - -set -e - -function check_number() { - if [[ ! "$2" =~ ^[0-9]+$ ]]; then - echo "$1 needs to be a non-negative number" - exit 1 - fi -} -check_number PUMA_WORKERS "${PUMA_WORKERS:-0}" -check_number PUMA_MIN_THREADS "${PUMA_MIN_THREADS:-0}" -check_number PUMA_MAX_THREADS "${PUMA_MAX_THREADS:-0}" - -export RACK_ENV=${RACK_ENV:-"production"} - -if is_puma_installed; then - export_vars=$(cgroup-limits) ; export $export_vars - - exec bundle exec "puma --config ../etc/puma.cfg" -else - echo "You might consider adding 'puma' into your Gemfile." - - if bundle exec rackup -h &>/dev/null; then - if [ -f Gemfile ]; then - exec bundle exec "rackup -E ${RAILS_ENV:-$RACK_ENV} -P /tmp/rack.pid --host 0.0.0.0 --port 8080" - else - exec rackup -E "${RAILS_ENV:-$RACK_ENV}" -P /tmp/rack.pid --host 0.0.0.0 --port 8080 - fi - else - echo "ERROR: Rubygem Rack is not installed in the present image." - echo " Add rack to your Gemfile in order to start the web server." - fi -fi diff --git a/2.3/s2i/bin/usage b/2.3/s2i/bin/usage deleted file mode 100755 index dbf64a65..00000000 --- a/2.3/s2i/bin/usage +++ /dev/null @@ -1,18 +0,0 @@ -#!/bin/sh - -DISTRO=`cat /etc/*-release | grep ^ID= | grep -Po '".*?"' | tr -d '"'` -NAMESPACE=centos -[[ $DISTRO =~ rhel* ]] && NAMESPACE=rhscl - -cat < 1.0) - rack (~> 2.0) - rack-protection (= 2.0.5) - tilt (~> 2.0) - tilt (2.0.9) - -PLATFORMS - ruby - -DEPENDENCIES - puma - sinatra - -BUNDLED WITH - 1.10.6 diff --git a/2.3/test/puma-test-app/app.rb b/2.3/test/puma-test-app/app.rb deleted file mode 100755 index cd7e87d7..00000000 --- a/2.3/test/puma-test-app/app.rb +++ /dev/null @@ -1,5 +0,0 @@ -require 'sinatra' - -get '/' do - 'Hello world!' -end diff --git a/2.3/test/puma-test-app/config.ru b/2.3/test/puma-test-app/config.ru deleted file mode 100755 index 76a6edff..00000000 --- a/2.3/test/puma-test-app/config.ru +++ /dev/null @@ -1,2 +0,0 @@ -require './app' -run Sinatra::Application diff --git a/2.3/test/rack-test-app/Gemfile b/2.3/test/rack-test-app/Gemfile deleted file mode 100755 index c10abd72..00000000 --- a/2.3/test/rack-test-app/Gemfile +++ /dev/null @@ -1,3 +0,0 @@ -source 'https://rubygems.org' - -gem 'sinatra' diff --git a/2.3/test/rack-test-app/Gemfile.lock b/2.3/test/rack-test-app/Gemfile.lock deleted file mode 100644 index 2049e6e9..00000000 --- a/2.3/test/rack-test-app/Gemfile.lock +++ /dev/null @@ -1,22 +0,0 @@ -GEM - remote: https://rubygems.org/ - specs: - mustermann (1.0.3) - rack (2.0.6) - rack-protection (2.0.5) - rack - sinatra (2.0.5) - mustermann (~> 1.0) - rack (~> 2.0) - rack-protection (= 2.0.5) - tilt (~> 2.0) - tilt (2.0.9) - -PLATFORMS - ruby - -DEPENDENCIES - sinatra - -BUNDLED WITH - 1.10.6 diff --git a/2.3/test/rack-test-app/app.rb b/2.3/test/rack-test-app/app.rb deleted file mode 100755 index cd7e87d7..00000000 --- a/2.3/test/rack-test-app/app.rb +++ /dev/null @@ -1,5 +0,0 @@ -require 'sinatra' - -get '/' do - 'Hello world!' -end diff --git a/2.3/test/rack-test-app/config.ru b/2.3/test/rack-test-app/config.ru deleted file mode 100755 index 76a6edff..00000000 --- a/2.3/test/rack-test-app/config.ru +++ /dev/null @@ -1,2 +0,0 @@ -require './app' -run Sinatra::Application diff --git a/2.3/test/run b/2.3/test/run deleted file mode 100755 index a5a106d4..00000000 --- a/2.3/test/run +++ /dev/null @@ -1,197 +0,0 @@ -#!/bin/bash -x -# -# The 'run' performs a simple test that verifies that S2I image. -# The main focus here is to excersise the S2I scripts. -# -# IMAGE_NAME specifies a name of the candidate image used for testing. -# The image has to be available before this script is executed. -# -IMAGE_NAME=${IMAGE_NAME-centos/ruby-23-centos7-candidate} - -declare -a WEB_SERVERS=(db puma rack) -#declare -a WEB_SERVERS=(db) - -# TODO: Make command compatible for Mac users -test_dir="$(readlink -zf $(dirname "${BASH_SOURCE[0]}"))" -image_dir=$(readlink -zf ${test_dir}/..) - -source "${test_dir}/test-lib.sh" - -# Read exposed port from image meta data -test_port="$(docker inspect --format='{{range $key, $value := .Config.ExposedPorts }}{{$key}}{{end}}' ${IMAGE_NAME} | sed 's/\/.*//')" - -info() { - echo -e "\n\e[1m[INFO] $@...\e[0m\n" -} - -image_exists() { - docker inspect $1 &>/dev/null -} - -container_exists() { - image_exists $(cat $cid_file) -} - -container_ip() { - docker inspect --format="{{ .NetworkSettings.IPAddress }}" $(cat $cid_file) -} - -run_s2i_build() { - ct_s2i_build_as_df file://${test_dir}/${1}-test-app ${IMAGE_NAME} ${IMAGE_NAME}-testapp ${s2i_args} -} - -prepare() { - if ! image_exists ${IMAGE_NAME}; then - echo "ERROR: The image ${IMAGE_NAME} must exist before this script is executed." - exit 1 - fi - # TODO: S2I build require the application is a valid 'GIT' repository, we - # should remove this restriction in the future when a file:// is used. - info "Build the test application image" - pushd ${test_dir}/${1}-test-app >/dev/null - git init - git config user.email "build@localhost" && git config user.name "builder" - git add -A && git commit -m "Sample commit" - popd >/dev/null -} - -run_test_application() { - docker run --user=100001 --rm --cidfile=${cid_file} ${IMAGE_NAME}-testapp -} - -cleanup() { - info "Cleaning up the test application image $1" - if [ -f $cid_file ]; then - if container_exists; then - docker stop $(cat $cid_file) - fi - fi - if image_exists ${IMAGE_NAME}-testapp; then - docker rmi -f ${IMAGE_NAME}-testapp - fi - rm -rf ${test_dir}/${1}-test-app/.git - if [[ $1 == "db" ]]; then - rm -rf ${test_dir}/db-test-app - fi -} - -check_result() { - local result="$1" - if [[ "$result" != "0" ]]; then - info "TEST FAILED (${result})" - cleanup - exit $result - fi -} - -wait_for_cid() { - local max_attempts=10 - local sleep_time=1 - local attempt=1 - local result=1 - info "Waiting for application container to start" - while [ $attempt -le $max_attempts ]; do - [ -f $cid_file ] && [ -s $cid_file ] && break - attempt=$(( $attempt + 1 )) - sleep $sleep_time - done -} - -test_s2i_usage() { - info "Testing 's2i usage'" - ct_s2i_usage ${IMAGE_NAME} ${s2i_args} &>/dev/null -} - -test_docker_run_usage() { - info "Testing 'docker run' usage" - docker run ${IMAGE_NAME} &>/dev/null -} - -test_connection() { - info "Testing the HTTP connection (http://$(container_ip):${test_port})" - local max_attempts=10 - local sleep_time=1 - local attempt=1 - local result=1 - while [ $attempt -le $max_attempts ]; do - response_code=$(curl -s -w %{http_code} -o /dev/null http://$(container_ip):${test_port}/) - status=$? - if [ $status -eq 0 ]; then - if [ $response_code -eq 200 ]; then - result=0 - fi - break - fi - attempt=$(( $attempt + 1 )) - sleep $sleep_time - done - return $result -} - -test_scl_usage() { - local run_cmd="$1" - local expected="$2" - - info "Testing the image SCL enable" - out=$(docker run --rm ${IMAGE_NAME} /bin/bash -c "${run_cmd}") - if ! echo "${out}" | grep -q "${expected}"; then - echo "ERROR[/bin/bash -c "${run_cmd}"] Expected '${expected}', got '${out}'" - return 1 - fi - out=$(docker exec $(cat ${cid_file}) /bin/bash -c "${run_cmd}" 2>&1) - if ! echo "${out}" | grep -q "${expected}"; then - echo "ERROR[exec /bin/bash -c "${run_cmd}"] Expected '${expected}', got '${out}'" - return 1 - fi - out=$(docker exec $(cat ${cid_file}) /bin/sh -ic "${run_cmd}" 2>&1) - if ! echo "${out}" | grep -q "${expected}"; then - echo "ERROR[exec /bin/sh -ic "${run_cmd}"] Expected '${expected}', got '${out}'" - return 1 - fi -} - -pushd ${test_dir} -git clone git://github.com/openshift/ruby-hello-world -mv ruby-hello-world db-test-app -popd - -for server in ${WEB_SERVERS[@]}; do - cid_file=$(mktemp -u --suffix=.cid) - - # Since we built the candidate image locally, we don't want S2I attempt to pull - # it from Docker hub - s2i_args="--pull-policy=never" - - prepare ${server} - run_s2i_build ${server} - check_result $? - - # Verify the 'usage' script is working properly when running the base image with 's2i usage ...' - test_s2i_usage - check_result $? - - # Verify the 'usage' script is working properly when running the base image with 'docker run ...' - test_docker_run_usage - check_result $? - - # Verify that the HTTP connection can be established to test application container - run_test_application & - - # Wait for the container to write it's CID file - wait_for_cid - - test_connection - check_result $? - - test_scl_usage "ruby --version" "ruby 2.3." - check_result $? - - info "All tests for the ${server}-test-app finished successfully." - cleanup ${server} -done - -info "Testing npm availibility" -ct_npm_works -check_result $? - -info "All tests finished successfully." diff --git a/2.3/test/run-conu b/2.3/test/run-conu deleted file mode 120000 index deed6574..00000000 --- a/2.3/test/run-conu +++ /dev/null @@ -1 +0,0 @@ -../../test/run-conu \ No newline at end of file diff --git a/2.3/test/run-openshift b/2.3/test/run-openshift deleted file mode 120000 index ec13e4a1..00000000 --- a/2.3/test/run-openshift +++ /dev/null @@ -1 +0,0 @@ -../../test/run-openshift \ No newline at end of file diff --git a/2.3/test/run-openshift-remote-cluster b/2.3/test/run-openshift-remote-cluster deleted file mode 120000 index 1bffcba8..00000000 --- a/2.3/test/run-openshift-remote-cluster +++ /dev/null @@ -1 +0,0 @@ -../../test/run-openshift-remote-cluster \ No newline at end of file diff --git a/2.3/test/test-lib-openshift.sh b/2.3/test/test-lib-openshift.sh deleted file mode 120000 index 68794d67..00000000 --- a/2.3/test/test-lib-openshift.sh +++ /dev/null @@ -1 +0,0 @@ -../../test/test-lib-openshift.sh \ No newline at end of file diff --git a/2.3/test/test-lib-ruby.sh b/2.3/test/test-lib-ruby.sh deleted file mode 120000 index ea235094..00000000 --- a/2.3/test/test-lib-ruby.sh +++ /dev/null @@ -1 +0,0 @@ -../../test/test-lib-ruby.sh \ No newline at end of file diff --git a/2.3/test/test-lib.sh b/2.3/test/test-lib.sh deleted file mode 120000 index 1ac99b93..00000000 --- a/2.3/test/test-lib.sh +++ /dev/null @@ -1 +0,0 @@ -../../common/test-lib.sh \ No newline at end of file diff --git a/2.3/test/test_s2i.py b/2.3/test/test_s2i.py deleted file mode 120000 index 54807341..00000000 --- a/2.3/test/test_s2i.py +++ /dev/null @@ -1 +0,0 @@ -../../test/test_s2i.py \ No newline at end of file diff --git a/2.4/.exclude-fedora b/2.4/.exclude-fedora deleted file mode 100644 index e69de29b..00000000 diff --git a/2.4/Dockerfile b/2.4/Dockerfile deleted file mode 100644 index d626d180..00000000 --- a/2.4/Dockerfile +++ /dev/null @@ -1,49 +0,0 @@ -FROM centos/s2i-base-centos7 - -# This image provides a Ruby 2.4 environment you can use to run your Ruby -# applications. - -EXPOSE 8080 - -ENV RUBY_VERSION 2.4 - -ENV SUMMARY="Platform for building and running Ruby $RUBY_VERSION applications" \ - DESCRIPTION="Ruby $RUBY_VERSION available as container is a base platform for \ -building and running various Ruby $RUBY_VERSION applications and frameworks. \ -Ruby is the interpreted scripting language for quick and easy object-oriented programming. \ -It has many features to process text files and to do system management tasks (as in Perl). \ -It is simple, straight-forward, and extensible." - -LABEL summary="$SUMMARY" \ - description="$DESCRIPTION" \ - io.k8s.description="$DESCRIPTION" \ - io.k8s.display-name="Ruby 2.4" \ - io.openshift.expose-services="8080:http" \ - io.openshift.tags="builder,ruby,ruby24,rh-ruby24" \ - com.redhat.component="rh-ruby24-container" \ - name="centos/ruby-24-centos7" \ - version="2.4" \ - usage="s2i build https://github.com/sclorg/s2i-ruby-container.git --context-dir=2.4/test/puma-test-app/ centos/ruby-24-centos7 ruby-sample-app" \ - maintainer="SoftwareCollections.org " - -# To use subscription inside container yum command has to be run first (before yum-config-manager) -# https://access.redhat.com/solutions/1443553 -RUN yum install -y centos-release-scl && \ - INSTALL_PKGS="rh-ruby24 rh-ruby24-ruby-devel rh-ruby24-rubygem-rake rh-ruby24-rubygem-bundler" && \ - yum install -y --setopt=tsflags=nodocs $INSTALL_PKGS && rpm -V $INSTALL_PKGS && \ - yum -y clean all --enablerepo='*' - -# Copy the S2I scripts from the specific language image to $STI_SCRIPTS_PATH -COPY ./s2i/bin/ $STI_SCRIPTS_PATH - -# Copy extra files to the image. -COPY ./root/ / - -# Drop the root user and make the content of /opt/app-root owned by user 1001 -RUN chown -R 1001:0 ${APP_ROOT} && chmod -R ug+rwx ${APP_ROOT} && \ - rpm-file-permissions - -USER 1001 - -# Set the default CMD to print the usage of the language image -CMD $STI_SCRIPTS_PATH/usage diff --git a/2.4/Dockerfile.fedora b/2.4/Dockerfile.fedora deleted file mode 100644 index 6f7600b2..00000000 --- a/2.4/Dockerfile.fedora +++ /dev/null @@ -1,51 +0,0 @@ -FROM registry.fedoraproject.org/f29/s2i-base:latest - -# This image provides a Ruby environment you can use to run your Ruby -# applications. - -EXPOSE 8080 - -ENV NAME=ruby \ - RUBY_VERSION=2.4 \ - RUBY_SHORT_VER=24 \ - VERSION=0 - -ENV SUMMARY="Platform for building and running Ruby $RUBY_VERSION applications" \ - DESCRIPTION="Ruby $RUBY_VERSION available as container is a base platform for \ -building and running various Ruby $RUBY_VERSION applications and frameworks. \ -Ruby is the interpreted scripting language for quick and easy object-oriented programming. \ -It has many features to process text files and to do system management tasks (as in Perl). \ -It is simple, straight-forward, and extensible." - -LABEL summary="$SUMMARY" \ - description="$DESCRIPTION" \ - io.k8s.description="$DESCRIPTION" \ - io.k8s.display-name="Ruby ${RUBY_VERSION}" \ - io.openshift.expose-services="8080:http" \ - io.openshift.tags="builder,ruby,ruby${RUBY_SHORT_VER}" \ - com.redhat.component="$NAME" \ - name="$FGC/$NAME" \ - version="$VERSION" \ - usage="s2i build https://github.com/sclorg/s2i-ruby-container.git --context-dir=2.4/test/puma-test-app/ registry.fedoraproject.org/$FGC/ruby ruby-sample-app" \ - maintainer="SoftwareCollections.org " - -# Install required packages -RUN INSTALL_PKGS="python2 ruby ruby-devel rubygem-bundler rubygem-rake rubygems-devel redhat-rpm-config" && \ - dnf install -y --setopt=tsflags=nodocs $INSTALL_PKGS && \ - rpm -V $INSTALL_PKGS && \ - dnf clean all - -# Copy the S2I scripts from the specific language image to $STI_SCRIPTS_PATH -COPY ./s2i/bin/ $STI_SCRIPTS_PATH - -# Copy extra files to the image. -COPY ./root/ / - -# Drop the root user and make the content of /opt/app-root owned by user 1001 -RUN chown -R 1001:0 ${APP_ROOT} && chmod -R ug+rwx ${APP_ROOT} && \ - rpm-file-permissions - -USER 1001 - -# Set the default CMD to print the usage of the language image -CMD $STI_SCRIPTS_PATH/usage diff --git a/2.4/Dockerfile.rhel7 b/2.4/Dockerfile.rhel7 deleted file mode 100644 index b86c806e..00000000 --- a/2.4/Dockerfile.rhel7 +++ /dev/null @@ -1,49 +0,0 @@ -FROM rhscl/s2i-base-rhel7:1 - -# This image provides a Ruby 2.4 environment you can use to run your Ruby -# applications. - -EXPOSE 8080 - -ENV RUBY_VERSION 2.4 - -ENV SUMMARY="Platform for building and running Ruby $RUBY_VERSION applications" \ - DESCRIPTION="Ruby $RUBY_VERSION available as container is a base platform for \ -building and running various Ruby $RUBY_VERSION applications and frameworks. \ -Ruby is the interpreted scripting language for quick and easy object-oriented programming. \ -It has many features to process text files and to do system management tasks (as in Perl). \ -It is simple, straight-forward, and extensible." - -LABEL summary="$SUMMARY" \ - description="$DESCRIPTION" \ - io.k8s.description="$DESCRIPTION" \ - io.k8s.display-name="Ruby 2.4" \ - io.openshift.expose-services="8080:http" \ - io.openshift.tags="builder,ruby,ruby24,rh-ruby24" \ - com.redhat.component="rh-ruby24-container" \ - name="rhscl/ruby-24-rhel7" \ - version="2.4" \ - com.redhat.license_terms="https://www.redhat.com/en/about/red-hat-end-user-license-agreements#rhel" \ - usage="s2i build https://github.com/sclorg/s2i-ruby-container.git --context-dir=2.4/test/puma-test-app/ rhscl/ruby-24-rhel7 ruby-sample-app" \ - maintainer="SoftwareCollections.org " - -RUN yum install -y yum-utils && \ - prepare-yum-repositories rhel-server-rhscl-7-rpms && \ - INSTALL_PKGS="rh-ruby24 rh-ruby24-ruby-devel rh-ruby24-rubygem-rake rh-ruby24-rubygem-bundler" && \ - yum install -y --setopt=tsflags=nodocs $INSTALL_PKGS && rpm -V $INSTALL_PKGS && \ - yum -y clean all --enablerepo='*' - -# Copy the S2I scripts from the specific language image to $STI_SCRIPTS_PATH -COPY ./s2i/bin/ $STI_SCRIPTS_PATH - -# Copy extra files to the image. -COPY ./root/ / - -# Drop the root user and make the content of /opt/app-root owned by user 1001 -RUN chown -R 1001:0 ${APP_ROOT} && chmod -R ug+rwx ${APP_ROOT} && \ - rpm-file-permissions - -USER 1001 - -# Set the default CMD to print the usage of the language image -CMD $STI_SCRIPTS_PATH/usage diff --git a/2.4/README.md b/2.4/README.md deleted file mode 100644 index c400de11..00000000 --- a/2.4/README.md +++ /dev/null @@ -1,4 +0,0 @@ -Ruby 2.4 container image -================= - -**The Ruby 2.4 image is deprecated.** diff --git a/2.4/cccp.yml b/2.4/cccp.yml deleted file mode 100644 index c0cc2d37..00000000 --- a/2.4/cccp.yml +++ /dev/null @@ -1,3 +0,0 @@ -# This is for the purpose of building this container -# on the centos container pipeline. -job-id: ruby-24-centos7 diff --git a/2.4/content_sets.yml b/2.4/content_sets.yml deleted file mode 100644 index 432c0914..00000000 --- a/2.4/content_sets.yml +++ /dev/null @@ -1,10 +0,0 @@ -# This is a file defining which content sets are needed to update content in -# this image. Data provided here helps determine which images are vulnerable to -# specific CVEs. Generally you should only need to update this file when: -# 1. You start depending on new product -# 2. You are preparing new product release and your content sets will change ---- -x86_64: -- rhel-7-server-rpms -- rhel-7-server-optional-rpms -- rhel-server-rhscl-7-rpms diff --git a/2.4/root/opt/app-root/.gemrc b/2.4/root/opt/app-root/.gemrc deleted file mode 100644 index 2422bea3..00000000 --- a/2.4/root/opt/app-root/.gemrc +++ /dev/null @@ -1,9 +0,0 @@ ---- -install: --no-document -update: --no-document -:benchmark: false -:update_sources: true -:bulk_threshold: 1000 -:backtrace: true -:sources: -- https://rubygems.org/ diff --git a/2.4/root/opt/app-root/etc/puma.cfg b/2.4/root/opt/app-root/etc/puma.cfg deleted file mode 100644 index a52d26dc..00000000 --- a/2.4/root/opt/app-root/etc/puma.cfg +++ /dev/null @@ -1,50 +0,0 @@ -def get_max_memory() - return ENV['MEMORY_LIMIT_IN_BYTES'].to_i if ENV.has_key? 'MEMORY_LIMIT_IN_BYTES' - - # Assume unlimited memory. 0.size is the number of bytes a Ruby - # Fixnum class can hold. One bit is used for sign and one is used - # by Ruby to determine whether it's a number or pointer to an object. - # That's why we subtract two bits. This expresion should therefore be - # the largest signed Fixnum possible. - (2 ** (8*0.size - 2) - 1) -end - -def get_memory_per_worker() - bytes = ENV.fetch('MEMORY_BYTES_PER_WORKER', '0').to_i - if bytes == 0 - # Comment describing rationale for choosing default of 256MiB/worker is below. - bytes = 256 * (2**20) - end - bytes -end - -def get_min_threads() - ENV.fetch('PUMA_MIN_THREADS', '0').to_i -end - -def get_max_threads() - ENV.fetch('PUMA_MAX_THREADS', '16').to_i -end - -# Determine the maximum number of workers that are allowed by the available -# memory. Puma documentation recommends the maximum number of workers to be -# set to the number of cores. -# Unless we're specifically tuned otherwise, allow one worker process per 256MiB -# memory, to a maximum of 1 worker / core. Hopefully that'll be a reasonable -# starting point for average apps; if not, it's all tunable. The simple -# OpenShift ruby/rails sample app currently requires approx. 60MiB + -# 70MiB/worker before taking its first request, so hopefully a default of -# 256MiB/worker will give other simple apps reasonable default headroom. -def get_workers() - return ENV['PUMA_WORKERS'].to_i if ENV.has_key? 'PUMA_WORKERS' - - cores = ENV.fetch('NUMBER_OF_CORES', '1').to_i - max_workers = get_max_memory() / get_memory_per_worker() - - [cores, max_workers].min -end - -environment ENV['RACK_ENV'] || ENV['RAILS_ENV'] || 'production' -threads get_min_threads(), get_max_threads() -workers get_workers() -bind 'tcp://0.0.0.0:8080' diff --git a/2.4/root/opt/app-root/etc/scl_enable b/2.4/root/opt/app-root/etc/scl_enable deleted file mode 100644 index 6c513932..00000000 --- a/2.4/root/opt/app-root/etc/scl_enable +++ /dev/null @@ -1,6 +0,0 @@ -# IMPORTANT: Do not add more content to this file unless you know what you are -# doing. This file is sourced everytime the shell session is opened. -# -# This will make scl collection binaries work out of box. -unset BASH_ENV PROMPT_COMMAND ENV -source scl_source enable rh-ruby24 $NODEJS_SCL diff --git a/2.4/s2i/bin/assemble b/2.4/s2i/bin/assemble deleted file mode 100755 index b98b5af8..00000000 --- a/2.4/s2i/bin/assemble +++ /dev/null @@ -1,67 +0,0 @@ -#!/bin/bash - -function rake_assets_precompile() { - [[ "$DISABLE_ASSET_COMPILATION" == "true" ]] && return - [ ! -f Gemfile ] && return - [ ! -f Rakefile ] && return - ! grep " rake " Gemfile.lock >/dev/null && return - ! bundle exec 'rake -T' | grep "assets:precompile" >/dev/null && return - - echo "---> Starting asset compilation ..." - bundle exec rake assets:precompile -} - -set -e - -export RACK_ENV=${RACK_ENV:-"production"} - -if [ -n "$RUBYGEM_MIRROR" ]; then - bundle config mirror.https://rubygems.org $RUBYGEM_MIRROR -fi - -shopt -s dotglob -echo "---> Installing application source ..." -mv /tmp/src/* ./ - -# Change the npm registry mirror if provided -if [ -n "$NPM_MIRROR" ]; then - npm config set registry $NPM_MIRROR -fi - -echo "---> Building your Ruby application from source ..." -if [ -f Gemfile ]; then - ADDTL_BUNDLE_ARGS="--retry 2" - if [ -f Gemfile.lock ]; then - ADDTL_BUNDLE_ARGS+=" --deployment" - fi - - if [[ "$RAILS_ENV" == "development" || "$RACK_ENV" == "development" ]]; then - BUNDLE_WITHOUT=${BUNDLE_WITHOUT:-"test"} - elif [[ "$RAILS_ENV" == "test" || "$RACK_ENV" == "test" ]]; then - BUNDLE_WITHOUT=${BUNDLE_WITHOUT:-"development"} - else - BUNDLE_WITHOUT=${BUNDLE_WITHOUT:-"development:test"} - fi - - if [ -n "$BUNDLE_WITHOUT" ]; then - ADDTL_BUNDLE_ARGS+=" --without $BUNDLE_WITHOUT" - fi - - echo "---> Running 'bundle install ${ADDTL_BUNDLE_ARGS}' ..." - bundle install --path ./bundle ${ADDTL_BUNDLE_ARGS} - - echo "---> Cleaning up unused ruby gems ..." - bundle clean -V -fi - -if ! bundle exec rackup -h &>/dev/null; then - echo "WARNING: Rubygem Rack is not installed in the present image." - echo " Add rack to your Gemfile in order to start the web server." -fi - -if [[ "$RAILS_ENV" == "production" || "$RACK_ENV" == "production" ]]; then - rake_assets_precompile -fi - -# Fix source directory permissions -fix-permissions ./ diff --git a/2.4/s2i/bin/run b/2.4/s2i/bin/run deleted file mode 100755 index 1614ec3b..00000000 --- a/2.4/s2i/bin/run +++ /dev/null @@ -1,39 +0,0 @@ -#!/bin/bash - -function is_puma_installed() { - [ ! -f Gemfile.lock ] && return 1 - grep ' puma ' Gemfile.lock >/dev/null -} - -set -e - -function check_number() { - if [[ ! "$2" =~ ^[0-9]+$ ]]; then - echo "$1 needs to be a non-negative number" - exit 1 - fi -} -check_number PUMA_WORKERS "${PUMA_WORKERS:-0}" -check_number PUMA_MIN_THREADS "${PUMA_MIN_THREADS:-0}" -check_number PUMA_MAX_THREADS "${PUMA_MAX_THREADS:-0}" - -export RACK_ENV=${RACK_ENV:-"production"} - -if is_puma_installed; then - export_vars=$(cgroup-limits) ; export $export_vars - - exec bundle exec "puma --config ../etc/puma.cfg" -else - echo "You might consider adding 'puma' into your Gemfile." - - if bundle exec rackup -h &>/dev/null; then - if [ -f Gemfile ]; then - exec bundle exec "rackup -E ${RAILS_ENV:-$RACK_ENV} -P /tmp/rack.pid --host 0.0.0.0 --port 8080" - else - exec rackup -E "${RAILS_ENV:-$RACK_ENV}" -P /tmp/rack.pid --host 0.0.0.0 --port 8080 - fi - else - echo "ERROR: Rubygem Rack is not installed in the present image." - echo " Add rack to your Gemfile in order to start the web server." - fi -fi diff --git a/2.4/s2i/bin/usage b/2.4/s2i/bin/usage deleted file mode 100755 index 203f8452..00000000 --- a/2.4/s2i/bin/usage +++ /dev/null @@ -1,16 +0,0 @@ -#!/bin/sh - -DISTRO="`grep ^ID= /etc/*-release | cut -d'"' -f2`" - -cat < 1.0) - rack (~> 2.0) - rack-protection (= 2.0.5) - tilt (~> 2.0) - tilt (2.0.9) - -PLATFORMS - ruby - -DEPENDENCIES - puma - sinatra - -BUNDLED WITH - 1.13.7 diff --git a/2.4/test/puma-test-app/app.rb b/2.4/test/puma-test-app/app.rb deleted file mode 100755 index cd7e87d7..00000000 --- a/2.4/test/puma-test-app/app.rb +++ /dev/null @@ -1,5 +0,0 @@ -require 'sinatra' - -get '/' do - 'Hello world!' -end diff --git a/2.4/test/puma-test-app/config.ru b/2.4/test/puma-test-app/config.ru deleted file mode 100755 index 76a6edff..00000000 --- a/2.4/test/puma-test-app/config.ru +++ /dev/null @@ -1,2 +0,0 @@ -require './app' -run Sinatra::Application diff --git a/2.4/test/rack-test-app/Gemfile b/2.4/test/rack-test-app/Gemfile deleted file mode 100755 index c10abd72..00000000 --- a/2.4/test/rack-test-app/Gemfile +++ /dev/null @@ -1,3 +0,0 @@ -source 'https://rubygems.org' - -gem 'sinatra' diff --git a/2.4/test/rack-test-app/Gemfile.lock b/2.4/test/rack-test-app/Gemfile.lock deleted file mode 100644 index 91d8f111..00000000 --- a/2.4/test/rack-test-app/Gemfile.lock +++ /dev/null @@ -1,22 +0,0 @@ -GEM - remote: https://rubygems.org/ - specs: - mustermann (1.0.3) - rack (2.0.6) - rack-protection (2.0.5) - rack - sinatra (2.0.5) - mustermann (~> 1.0) - rack (~> 2.0) - rack-protection (= 2.0.5) - tilt (~> 2.0) - tilt (2.0.9) - -PLATFORMS - ruby - -DEPENDENCIES - sinatra - -BUNDLED WITH - 1.13.7 diff --git a/2.4/test/rack-test-app/app.rb b/2.4/test/rack-test-app/app.rb deleted file mode 100755 index cd7e87d7..00000000 --- a/2.4/test/rack-test-app/app.rb +++ /dev/null @@ -1,5 +0,0 @@ -require 'sinatra' - -get '/' do - 'Hello world!' -end diff --git a/2.4/test/rack-test-app/config.ru b/2.4/test/rack-test-app/config.ru deleted file mode 100755 index 76a6edff..00000000 --- a/2.4/test/rack-test-app/config.ru +++ /dev/null @@ -1,2 +0,0 @@ -require './app' -run Sinatra::Application diff --git a/2.4/test/run b/2.4/test/run deleted file mode 100755 index 5c0d0969..00000000 --- a/2.4/test/run +++ /dev/null @@ -1,183 +0,0 @@ -#!/bin/bash -x -# -# The 'run' performs a simple test that verifies that S2I image. -# The main focus here is to excersise the S2I scripts. -# -# IMAGE_NAME specifies a name of the candidate image used for testing. -# The image has to be available before this script is executed. -# -IMAGE_NAME=${IMAGE_NAME-centos/ruby-24-centos7-candidate} - -declare -a WEB_SERVERS=(db puma rack) -#declare -a WEB_SERVERS=(db) - -# TODO: Make command compatible for Mac users -test_dir="$(readlink -zf $(dirname "${BASH_SOURCE[0]}"))" -image_dir=$(readlink -zf ${test_dir}/..) - -source "${test_dir}/test-lib.sh" - -# Read exposed port from image meta data -test_port="$(docker inspect --format='{{range $key, $value := .Config.ExposedPorts }}{{$key}}{{end}}' ${IMAGE_NAME} | sed 's/\/.*//')" - -info() { - echo -e "\n\e[1m[INFO] $@...\e[0m\n" -} - -image_exists() { - docker inspect $1 &>/dev/null -} - -container_exists() { - image_exists $(cat $cid_file) -} - -container_ip() { - docker inspect --format="{{ .NetworkSettings.IPAddress }}" $(cat $cid_file) -} - -run_s2i_build() { - ct_s2i_build_as_df file://${test_dir}/${1}-test-app ${IMAGE_NAME} ${IMAGE_NAME}-testapp ${s2i_args} $(ct_build_s2i_npm_variables) -} - -run_test_application() { - docker run --user=100001 --rm --cidfile=${cid_file} ${IMAGE_NAME}-testapp -} - -cleanup() { - info "Cleaning up the test application image $1" - if [ -f $cid_file ]; then - if container_exists; then - docker stop $(cat $cid_file) - fi - fi - if image_exists ${IMAGE_NAME}-testapp; then - docker rmi -f ${IMAGE_NAME}-testapp - fi - rm -rf ${test_dir}/${1}-test-app/.git - if [[ $1 == "db" ]]; then - rm -rf ${test_dir}/db-test-app - fi -} - -check_result() { - local result="$1" - if [[ "$result" != "0" ]]; then - info "TEST FAILED (${result})" - cleanup - exit $result - fi -} - -wait_for_cid() { - local max_attempts=10 - local sleep_time=1 - local attempt=1 - local result=1 - info "Waiting for application container to start" - while [ $attempt -le $max_attempts ]; do - [ -f $cid_file ] && [ -s $cid_file ] && break - attempt=$(( $attempt + 1 )) - sleep $sleep_time - done -} - -test_s2i_usage() { - info "Testing 's2i usage'" - ct_s2i_usage ${IMAGE_NAME} ${s2i_args} &>/dev/null -} - -test_docker_run_usage() { - info "Testing 'docker run' usage" - docker run ${IMAGE_NAME} &>/dev/null -} - -test_connection() { - info "Testing the HTTP connection (http://$(container_ip):${test_port})" - local max_attempts=10 - local sleep_time=1 - local attempt=1 - local result=1 - while [ $attempt -le $max_attempts ]; do - response_code=$(curl -s -w %{http_code} -o /dev/null http://$(container_ip):${test_port}/) - status=$? - if [ $status -eq 0 ]; then - if [ $response_code -eq 200 ]; then - result=0 - fi - break - fi - attempt=$(( $attempt + 1 )) - sleep $sleep_time - done - return $result -} - -test_scl_usage() { - local run_cmd="$1" - local expected="$2" - - info "Testing the image SCL enable" - out=$(docker run --rm ${IMAGE_NAME} /bin/bash -c "${run_cmd}") - if ! echo "${out}" | grep -q "${expected}"; then - echo "ERROR[/bin/bash -c "${run_cmd}"] Expected '${expected}', got '${out}'" - return 1 - fi - out=$(docker exec $(cat ${cid_file}) /bin/bash -c "${run_cmd}" 2>&1) - if ! echo "${out}" | grep -q "${expected}"; then - echo "ERROR[exec /bin/bash -c "${run_cmd}"] Expected '${expected}', got '${out}'" - return 1 - fi - out=$(docker exec $(cat ${cid_file}) /bin/sh -ic "${run_cmd}" 2>&1) - if ! echo "${out}" | grep -q "${expected}"; then - echo "ERROR[exec /bin/sh -ic "${run_cmd}"] Expected '${expected}', got '${out}'" - return 1 - fi -} - -mkdir -p ${test_dir}/db-test-app -pushd ${test_dir}/db-test-app -git clone git://github.com/openshift/ruby-hello-world . -# Switch to commit which works with ruby-2.4 -git reset --hard d6857ea547c9f7d19d31cfc0355303b059412359 -popd - -for server in ${WEB_SERVERS[@]}; do - cid_file=$(mktemp -u --suffix=.cid) - - # Since we built the candidate image locally, we don't want S2I attempt to pull - # it from Docker hub - s2i_args="--pull-policy=never" - - run_s2i_build ${server} - check_result $? - - # Verify the 'usage' script is working properly when running the base image with 's2i usage ...' - test_s2i_usage - check_result $? - - # Verify the 'usage' script is working properly when running the base image with 'docker run ...' - test_docker_run_usage - check_result $? - - # Verify that the HTTP connection can be established to test application container - run_test_application & - - # Wait for the container to write it's CID file - wait_for_cid - - test_connection - check_result $? - - test_scl_usage "ruby --version" "ruby 2.4." - check_result $? - - info "Testing npm availibility" - ct_npm_works - check_result $? - - info "All tests for the ${server}-test-app finished successfully." - cleanup ${server} -done - -info "All tests finished successfully." diff --git a/2.4/test/run-conu b/2.4/test/run-conu deleted file mode 120000 index deed6574..00000000 --- a/2.4/test/run-conu +++ /dev/null @@ -1 +0,0 @@ -../../test/run-conu \ No newline at end of file diff --git a/2.4/test/run-openshift b/2.4/test/run-openshift deleted file mode 120000 index ec13e4a1..00000000 --- a/2.4/test/run-openshift +++ /dev/null @@ -1 +0,0 @@ -../../test/run-openshift \ No newline at end of file diff --git a/2.4/test/run-openshift-remote-cluster b/2.4/test/run-openshift-remote-cluster deleted file mode 120000 index 1bffcba8..00000000 --- a/2.4/test/run-openshift-remote-cluster +++ /dev/null @@ -1 +0,0 @@ -../../test/run-openshift-remote-cluster \ No newline at end of file diff --git a/2.4/test/test-lib-openshift.sh b/2.4/test/test-lib-openshift.sh deleted file mode 120000 index 68794d67..00000000 --- a/2.4/test/test-lib-openshift.sh +++ /dev/null @@ -1 +0,0 @@ -../../test/test-lib-openshift.sh \ No newline at end of file diff --git a/2.4/test/test-lib-ruby.sh b/2.4/test/test-lib-ruby.sh deleted file mode 120000 index ea235094..00000000 --- a/2.4/test/test-lib-ruby.sh +++ /dev/null @@ -1 +0,0 @@ -../../test/test-lib-ruby.sh \ No newline at end of file diff --git a/2.4/test/test-lib.sh b/2.4/test/test-lib.sh deleted file mode 120000 index 1ac99b93..00000000 --- a/2.4/test/test-lib.sh +++ /dev/null @@ -1 +0,0 @@ -../../common/test-lib.sh \ No newline at end of file diff --git a/2.4/test/test_s2i.py b/2.4/test/test_s2i.py deleted file mode 120000 index 54807341..00000000 --- a/2.4/test/test_s2i.py +++ /dev/null @@ -1 +0,0 @@ -../../test/test_s2i.py \ No newline at end of file diff --git a/2.5/Dockerfile.fedora b/2.5/Dockerfile.fedora index 73d9f45d..628bd962 100644 --- a/2.5/Dockerfile.fedora +++ b/2.5/Dockerfile.fedora @@ -26,7 +26,7 @@ LABEL summary="$SUMMARY" \ com.redhat.component="$NAME" \ name="$FGC/$NAME" \ version="$VERSION" \ - usage="s2i build https://github.com/sclorg/s2i-ruby-container.git --context-dir=2.4/test/puma-test-app/ registry.fedoraproject.org/$FGC/ruby ruby-sample-app" \ + usage="s2i build https://github.com/sclorg/s2i-ruby-container.git --context-dir=2.5/test/puma-test-app/ registry.fedoraproject.org/$FGC/ruby ruby-sample-app" \ maintainer="SoftwareCollections.org " # Install required packages diff --git a/2.6/Dockerfile b/2.6/Dockerfile deleted file mode 100644 index a3853dd7..00000000 --- a/2.6/Dockerfile +++ /dev/null @@ -1,68 +0,0 @@ -FROM quay.io/centos7/s2i-base-centos7 - -# This image provides a Ruby environment you can use to run your Ruby -# applications. - -EXPOSE 8080 - -ENV RUBY_MAJOR_VERSION=2 \ - RUBY_MINOR_VERSION=6 - -ENV RUBY_VERSION="${RUBY_MAJOR_VERSION}.${RUBY_MINOR_VERSION}" \ - RUBY_SCL_NAME_VERSION="${RUBY_MAJOR_VERSION}${RUBY_MINOR_VERSION}" - -# Set SCL related variables in Dockerfile so that the collection is enabled by default -ENV RUBY_SCL="rh-ruby${RUBY_SCL_NAME_VERSION}" \ - IMAGE_NAME="centos7/ruby-${RUBY_SCL_NAME_VERSION}-centos7" \ - SUMMARY="Platform for building and running Ruby $RUBY_VERSION applications" \ - DESCRIPTION="Ruby $RUBY_VERSION available as container is a base platform for \ -building and running various Ruby $RUBY_VERSION applications and frameworks. \ -Ruby is the interpreted scripting language for quick and easy object-oriented programming. \ -It has many features to process text files and to do system management tasks (as in Perl). \ -It is simple, straight-forward, and extensible." \ - PATH="/opt/rh/rh-ruby${RUBY_SCL_NAME_VERSION}/root/usr/local/bin:/opt/rh/rh-ruby${RUBY_SCL_NAME_VERSION}/root/usr/bin:/opt/rh/${NODEJS_SCL}/root/usr/bin:${PATH}" \ - LD_LIBRARY_PATH="/opt/rh/rh-ruby${RUBY_SCL_NAME_VERSION}/root/usr/local/lib64:/opt/rh/rh-ruby${RUBY_SCL_NAME_VERSION}/root/usr/lib64:/opt/rh/${NODEJS_SCL}/root/usr/lib64" \ - X_SCLS="${NODEJS_SCL} rh-ruby${RUBY_SCL_NAME_VERSION}" \ - MANPATH="/opt/rh/rh-ruby${RUBY_SCL_NAME_VERSION}/root/usr/local/share/man:/opt/rh/rh-ruby${RUBY_SCL_NAME_VERSION}/root/usr/share/man:/opt/rh/${NODEJS_SCL}/root/usr/share/man:" \ - XDG_DATA_DIRS="/opt/rh/rh-ruby${RUBY_SCL_NAME_VERSION}/root/usr/local/share:/opt/rh/rh-ruby${RUBY_SCL_NAME_VERSION}/root/usr/share:/usr/local/share:/usr/share" \ - PKG_CONFIG_PATH="/opt/rh/rh-ruby${RUBY_SCL_NAME_VERSION}/root/usr/local/lib64/pkgconfig:/opt/rh/rh-ruby${RUBY_SCL_NAME_VERSION}/root/usr/lib64/pkgconfig" - -LABEL summary="$SUMMARY" \ - description="$DESCRIPTION" \ - io.k8s.description="$DESCRIPTION" \ - io.k8s.display-name="Ruby ${RUBY_VERSION}" \ - io.openshift.expose-services="8080:http" \ - io.openshift.tags="builder,ruby,ruby${RUBY_SCL_NAME_VERSION},${RUBY_SCL}" \ - com.redhat.component="${RUBY_SCL}-container" \ - name="${IMAGE_NAME}" \ - version="${RUBY_VERSION}" \ - usage="s2i build https://github.com/sclorg/s2i-ruby-container.git \ ---context-dir=${RUBY_VERSION}/test/puma-test-app/ ${IMAGE_NAME} ruby-sample-app" \ - maintainer="SoftwareCollections.org " - -RUN yum install -y centos-release-scl-rh && \ - INSTALL_PKGS=" \ -libffi-devel \ -${RUBY_SCL} \ -${RUBY_SCL}-ruby-devel \ -${RUBY_SCL}-rubygem-rake \ -${RUBY_SCL}-rubygem-bundler \ -" && \ - yum install -y --setopt=tsflags=nodocs ${INSTALL_PKGS} && \ - yum -y clean all --enablerepo='*' && \ - rpm -V ${INSTALL_PKGS} - -# Copy the S2I scripts from the specific language image to $STI_SCRIPTS_PATH -COPY ./s2i/bin/ $STI_SCRIPTS_PATH - -# Copy extra files to the image. -COPY ./root/ / - -# Drop the root user and make the content of /opt/app-root owned by user 1001 -RUN chown -R 1001:0 ${APP_ROOT} && chmod -R ug+rwx ${APP_ROOT} && \ - rpm-file-permissions - -USER 1001 - -# Set the default CMD to print the usage of the language image -CMD $STI_SCRIPTS_PATH/usage diff --git a/2.6/Dockerfile.fedora b/2.6/Dockerfile.fedora deleted file mode 100644 index 9dad82ee..00000000 --- a/2.6/Dockerfile.fedora +++ /dev/null @@ -1,51 +0,0 @@ -FROM registry.fedoraproject.org/f31/s2i-base - -# This image provides a Ruby environment you can use to run your Ruby -# applications. - -EXPOSE 8080 - -ENV NAME=ruby \ - RUBY_VERSION=2.6 \ - RUBY_SHORT_VER=26 \ - VERSION=0 - -ENV SUMMARY="Platform for building and running Ruby $RUBY_VERSION applications" \ - DESCRIPTION="Ruby $RUBY_VERSION available as container is a base platform for \ -building and running various Ruby $RUBY_VERSION applications and frameworks. \ -Ruby is the interpreted scripting language for quick and easy object-oriented programming. \ -It has many features to process text files and to do system management tasks (as in Perl). \ -It is simple, straight-forward, and extensible." - -LABEL summary="$SUMMARY" \ - description="$DESCRIPTION" \ - io.k8s.description="$DESCRIPTION" \ - io.k8s.display-name="Ruby ${RUBY_VERSION}" \ - io.openshift.expose-services="8080:http" \ - io.openshift.tags="builder,ruby,ruby${RUBY_SHORT_VER}" \ - com.redhat.component="$NAME" \ - name="$FGC/$NAME" \ - version="$VERSION" \ - usage="s2i build https://github.com/sclorg/s2i-ruby-container.git --context-dir=2.4/test/puma-test-app/ registry.fedoraproject.org/$FGC/ruby ruby-sample-app" \ - maintainer="SoftwareCollections.org " - -# Install required packages -RUN INSTALL_PKGS="python2 ruby ruby-devel rubygem-bundler rubygem-rake rubygems-devel redhat-rpm-config libffi-devel" && \ - dnf install -y --setopt=tsflags=nodocs $INSTALL_PKGS && \ - rpm -V $INSTALL_PKGS && \ - dnf clean all - -# Copy the S2I scripts from the specific language image to $STI_SCRIPTS_PATH -COPY ./s2i/bin/ $STI_SCRIPTS_PATH - -# Copy extra files to the image. -COPY ./root/ / - -# Drop the root user and make the content of /opt/app-root owned by user 1001 -RUN chown -R 1001:0 ${APP_ROOT} && chmod -R ug+rwx ${APP_ROOT} && \ - rpm-file-permissions - -USER 1001 - -# Set the default CMD to print the usage of the language image -CMD $STI_SCRIPTS_PATH/usage diff --git a/2.6/Dockerfile.rhel7 b/2.6/Dockerfile.rhel7 deleted file mode 100644 index 53e95f3f..00000000 --- a/2.6/Dockerfile.rhel7 +++ /dev/null @@ -1,70 +0,0 @@ -FROM rhscl/s2i-base-rhel7 - -# This image provides a Ruby environment you can use to run your Ruby -# applications. - -EXPOSE 8080 - -ENV RUBY_MAJOR_VERSION=2 \ - RUBY_MINOR_VERSION=6 - -ENV RUBY_VERSION="${RUBY_MAJOR_VERSION}.${RUBY_MINOR_VERSION}" \ - RUBY_SCL_NAME_VERSION="${RUBY_MAJOR_VERSION}${RUBY_MINOR_VERSION}" - -# Set SCL related variables in Dockerfile so that the collection is enabled by default -ENV RUBY_SCL="rh-ruby${RUBY_SCL_NAME_VERSION}" \ - IMAGE_NAME="rhscl/ruby-${RUBY_SCL_NAME_VERSION}-rhel7" \ - SUMMARY="Platform for building and running Ruby $RUBY_VERSION applications" \ - DESCRIPTION="Ruby $RUBY_VERSION available as container is a base platform for \ -building and running various Ruby $RUBY_VERSION applications and frameworks. \ -Ruby is the interpreted scripting language for quick and easy object-oriented programming. \ -It has many features to process text files and to do system management tasks (as in Perl). \ -It is simple, straight-forward, and extensible." \ - PATH="/opt/rh/rh-ruby${RUBY_SCL_NAME_VERSION}/root/usr/local/bin:/opt/rh/rh-ruby${RUBY_SCL_NAME_VERSION}/root/usr/bin:/opt/rh/${NODEJS_SCL}/root/usr/bin:${PATH}" \ - LD_LIBRARY_PATH="/opt/rh/rh-ruby${RUBY_SCL_NAME_VERSION}/root/usr/local/lib64:/opt/rh/rh-ruby${RUBY_SCL_NAME_VERSION}/root/usr/lib64:/opt/rh/${NODEJS_SCL}/root/usr/lib64" \ - X_SCLS="${NODEJS_SCL} rh-ruby${RUBY_SCL_NAME_VERSION}" \ - MANPATH="/opt/rh/rh-ruby${RUBY_SCL_NAME_VERSION}/root/usr/local/share/man:/opt/rh/rh-ruby${RUBY_SCL_NAME_VERSION}/root/usr/share/man:/opt/rh/${NODEJS_SCL}/root/usr/share/man:" \ - XDG_DATA_DIRS="/opt/rh/rh-ruby${RUBY_SCL_NAME_VERSION}/root/usr/local/share:/opt/rh/rh-ruby${RUBY_SCL_NAME_VERSION}/root/usr/share:/usr/local/share:/usr/share" \ - PKG_CONFIG_PATH="/opt/rh/rh-ruby${RUBY_SCL_NAME_VERSION}/root/usr/local/lib64/pkgconfig:/opt/rh/rh-ruby${RUBY_SCL_NAME_VERSION}/root/usr/lib64/pkgconfig" - -LABEL summary="$SUMMARY" \ - description="$DESCRIPTION" \ - io.k8s.description="$DESCRIPTION" \ - io.k8s.display-name="Ruby ${RUBY_VERSION}" \ - io.openshift.expose-services="8080:http" \ - io.openshift.tags="builder,ruby,ruby${RUBY_SCL_NAME_VERSION},${RUBY_SCL}" \ - com.redhat.component="${RUBY_SCL}-container" \ - name="${IMAGE_NAME}" \ - version="${RUBY_VERSION}" \ - com.redhat.license_terms="https://www.redhat.com/en/about/red-hat-end-user-license-agreements#UBI" \ - usage="s2i build https://github.com/sclorg/s2i-ruby-container.git \ ---context-dir=${RUBY_VERSION}/test/puma-test-app/ ${IMAGE_NAME} ruby-sample-app" \ - maintainer="SoftwareCollections.org " - -RUN yum install -y yum-utils && \ - prepare-yum-repositories rhel-server-rhscl-7-rpms && \ - INSTALL_PKGS=" \ -libffi-devel \ -${RUBY_SCL} \ -${RUBY_SCL}-ruby-devel \ -${RUBY_SCL}-rubygem-rake \ -${RUBY_SCL}-rubygem-bundler \ -" && \ - yum install -y --setopt=tsflags=nodocs ${INSTALL_PKGS} && \ - yum -y clean all --enablerepo='*' && \ - rpm -V ${INSTALL_PKGS} - -# Copy the S2I scripts from the specific language image to $STI_SCRIPTS_PATH -COPY ./s2i/bin/ $STI_SCRIPTS_PATH - -# Copy extra files to the image. -COPY ./root/ / - -# Drop the root user and make the content of /opt/app-root owned by user 1001 -RUN chown -R 1001:0 ${APP_ROOT} && chmod -R ug+rwx ${APP_ROOT} && \ - rpm-file-permissions - -USER 1001 - -# Set the default CMD to print the usage of the language image -CMD $STI_SCRIPTS_PATH/usage diff --git a/2.6/Dockerfile.rhel8 b/2.6/Dockerfile.rhel8 deleted file mode 100644 index 3a99f3fe..00000000 --- a/2.6/Dockerfile.rhel8 +++ /dev/null @@ -1,63 +0,0 @@ -FROM ubi8/s2i-base - -# This image provides a Ruby environment you can use to run your Ruby -# applications. - -EXPOSE 8080 - -ENV RUBY_MAJOR_VERSION=2 \ - RUBY_MINOR_VERSION=6 - -ENV RUBY_VERSION="${RUBY_MAJOR_VERSION}.${RUBY_MINOR_VERSION}" \ - RUBY_SCL_NAME_VERSION="${RUBY_MAJOR_VERSION}${RUBY_MINOR_VERSION}" - -ENV RUBY_SCL="ruby-${RUBY_SCL_NAME_VERSION}" \ - IMAGE_NAME="ubi8/ruby-${RUBY_SCL_NAME_VERSION}" \ - SUMMARY="Platform for building and running Ruby $RUBY_VERSION applications" \ - DESCRIPTION="Ruby $RUBY_VERSION available as container is a base platform for \ -building and running various Ruby $RUBY_VERSION applications and frameworks. \ -Ruby is the interpreted scripting language for quick and easy object-oriented programming. \ -It has many features to process text files and to do system management tasks (as in Perl). \ -It is simple, straight-forward, and extensible." - -LABEL summary="$SUMMARY" \ - description="$DESCRIPTION" \ - io.k8s.description="$DESCRIPTION" \ - io.k8s.display-name="Ruby ${RUBY_VERSION}" \ - io.openshift.expose-services="8080:http" \ - io.openshift.tags="builder,ruby,ruby${RUBY_SCL_NAME_VERSION},${RUBY_SCL}" \ - com.redhat.component="${RUBY_SCL}-container" \ - name="${IMAGE_NAME}" \ - version="1" \ - com.redhat.license_terms="https://www.redhat.com/en/about/red-hat-end-user-license-agreements#UBI" \ - usage="s2i build https://github.com/sclorg/s2i-ruby-container.git \ ---context-dir=${RUBY_VERSION}/test/puma-test-app/ ${IMAGE_NAME} ruby-sample-app" \ - maintainer="SoftwareCollections.org " - -RUN yum -y module enable ruby:$RUBY_VERSION && \ - INSTALL_PKGS=" \ - libffi-devel \ - ruby \ - ruby-devel \ - rubygem-rake \ - rubygem-bundler \ - redhat-rpm-config \ - " && \ - yum install -y --setopt=tsflags=nodocs ${INSTALL_PKGS} && \ - yum -y clean all --enablerepo='*' && \ - rpm -V ${INSTALL_PKGS} - -# Copy the S2I scripts from the specific language image to $STI_SCRIPTS_PATH -COPY ./s2i/bin/ $STI_SCRIPTS_PATH - -# Copy extra files to the image. -COPY ./root/ / - -# Drop the root user and make the content of /opt/app-root owned by user 1001 -RUN chown -R 1001:0 ${APP_ROOT} && chmod -R ug+rwx ${APP_ROOT} && \ - rpm-file-permissions - -USER 1001 - -# Set the default CMD to print the usage of the language image -CMD $STI_SCRIPTS_PATH/usage diff --git a/2.6/README.md b/2.6/README.md deleted file mode 100644 index 0d210cda..00000000 --- a/2.6/README.md +++ /dev/null @@ -1,3 +0,0 @@ -Ruby 2.6 container image -======================== -**The Ruby 2.6 image is deprecated.** \ No newline at end of file diff --git a/2.6/cccp.yml b/2.6/cccp.yml deleted file mode 100644 index f50df6ee..00000000 --- a/2.6/cccp.yml +++ /dev/null @@ -1,3 +0,0 @@ -# This is for the purpose of building this container -# on the centos container pipeline. -job-id: ruby-26-centos7 diff --git a/2.6/root/opt/app-root/.gemrc b/2.6/root/opt/app-root/.gemrc deleted file mode 100644 index 2422bea3..00000000 --- a/2.6/root/opt/app-root/.gemrc +++ /dev/null @@ -1,9 +0,0 @@ ---- -install: --no-document -update: --no-document -:benchmark: false -:update_sources: true -:bulk_threshold: 1000 -:backtrace: true -:sources: -- https://rubygems.org/ diff --git a/2.6/root/opt/app-root/etc/puma.cfg b/2.6/root/opt/app-root/etc/puma.cfg deleted file mode 100644 index a52d26dc..00000000 --- a/2.6/root/opt/app-root/etc/puma.cfg +++ /dev/null @@ -1,50 +0,0 @@ -def get_max_memory() - return ENV['MEMORY_LIMIT_IN_BYTES'].to_i if ENV.has_key? 'MEMORY_LIMIT_IN_BYTES' - - # Assume unlimited memory. 0.size is the number of bytes a Ruby - # Fixnum class can hold. One bit is used for sign and one is used - # by Ruby to determine whether it's a number or pointer to an object. - # That's why we subtract two bits. This expresion should therefore be - # the largest signed Fixnum possible. - (2 ** (8*0.size - 2) - 1) -end - -def get_memory_per_worker() - bytes = ENV.fetch('MEMORY_BYTES_PER_WORKER', '0').to_i - if bytes == 0 - # Comment describing rationale for choosing default of 256MiB/worker is below. - bytes = 256 * (2**20) - end - bytes -end - -def get_min_threads() - ENV.fetch('PUMA_MIN_THREADS', '0').to_i -end - -def get_max_threads() - ENV.fetch('PUMA_MAX_THREADS', '16').to_i -end - -# Determine the maximum number of workers that are allowed by the available -# memory. Puma documentation recommends the maximum number of workers to be -# set to the number of cores. -# Unless we're specifically tuned otherwise, allow one worker process per 256MiB -# memory, to a maximum of 1 worker / core. Hopefully that'll be a reasonable -# starting point for average apps; if not, it's all tunable. The simple -# OpenShift ruby/rails sample app currently requires approx. 60MiB + -# 70MiB/worker before taking its first request, so hopefully a default of -# 256MiB/worker will give other simple apps reasonable default headroom. -def get_workers() - return ENV['PUMA_WORKERS'].to_i if ENV.has_key? 'PUMA_WORKERS' - - cores = ENV.fetch('NUMBER_OF_CORES', '1').to_i - max_workers = get_max_memory() / get_memory_per_worker() - - [cores, max_workers].min -end - -environment ENV['RACK_ENV'] || ENV['RAILS_ENV'] || 'production' -threads get_min_threads(), get_max_threads() -workers get_workers() -bind 'tcp://0.0.0.0:8080' diff --git a/2.6/root/opt/app-root/etc/scl_enable b/2.6/root/opt/app-root/etc/scl_enable deleted file mode 100644 index 83db2be7..00000000 --- a/2.6/root/opt/app-root/etc/scl_enable +++ /dev/null @@ -1,6 +0,0 @@ -# IMPORTANT: Do not add more content to this file unless you know what you are -# doing. This file is sourced everytime the shell session is opened. -# -# This will make scl collection binaries work out of box. -unset BASH_ENV PROMPT_COMMAND ENV -source scl_source enable $NODEJS_SCL rh-ruby26 diff --git a/2.6/s2i/bin/assemble b/2.6/s2i/bin/assemble deleted file mode 100755 index c2d292ce..00000000 --- a/2.6/s2i/bin/assemble +++ /dev/null @@ -1,67 +0,0 @@ -#!/bin/bash - -function rake_assets_precompile() { - [[ "$DISABLE_ASSET_COMPILATION" == "true" ]] && return - [ ! -f Gemfile ] && return - [ ! -f Rakefile ] && return - ! grep " rake " Gemfile.lock >/dev/null && return - ! bundle exec 'rake -T' | grep "assets:precompile" >/dev/null && return - - echo "---> Starting asset compilation ..." - bundle exec "rake assets:precompile" -} - -set -e - -export RACK_ENV=${RACK_ENV:-"production"} - -if [ -n "$RUBYGEM_MIRROR" ]; then - bundle config mirror.https://rubygems.org $RUBYGEM_MIRROR -fi - -shopt -s dotglob -echo "---> Installing application source ..." -mv /tmp/src/* ./ - -# Change the npm registry mirror if provided -if [ -n "$NPM_MIRROR" ]; then - npm config set registry $NPM_MIRROR -fi - -echo "---> Building your Ruby application from source ..." -if [ -f Gemfile ]; then - ADDTL_BUNDLE_ARGS="--retry 2" - if [ -f Gemfile.lock ]; then - ADDTL_BUNDLE_ARGS+=" --deployment" - fi - - if [[ "$RAILS_ENV" == "development" || "$RACK_ENV" == "development" ]]; then - BUNDLE_WITHOUT=${BUNDLE_WITHOUT:-"test"} - elif [[ "$RAILS_ENV" == "test" || "$RACK_ENV" == "test" ]]; then - BUNDLE_WITHOUT=${BUNDLE_WITHOUT:-"development"} - else - BUNDLE_WITHOUT=${BUNDLE_WITHOUT:-"development:test"} - fi - - if [ -n "$BUNDLE_WITHOUT" ]; then - ADDTL_BUNDLE_ARGS+=" --without $BUNDLE_WITHOUT" - fi - - echo "---> Running 'bundle install ${ADDTL_BUNDLE_ARGS}' ..." - bundle install --path ./bundle ${ADDTL_BUNDLE_ARGS} - - echo "---> Cleaning up unused ruby gems ..." - bundle clean -V -fi - -if ! bundle exec rackup -h &>/dev/null; then - echo "WARNING: Rubygem Rack is not installed in the present image." - echo " Add rack to your Gemfile in order to start the web server." -fi - -if [[ "$RAILS_ENV" == "production" || "$RACK_ENV" == "production" ]]; then - rake_assets_precompile -fi - -# Fix source directory permissions -fix-permissions ./ diff --git a/2.6/s2i/bin/run b/2.6/s2i/bin/run deleted file mode 100755 index 1614ec3b..00000000 --- a/2.6/s2i/bin/run +++ /dev/null @@ -1,39 +0,0 @@ -#!/bin/bash - -function is_puma_installed() { - [ ! -f Gemfile.lock ] && return 1 - grep ' puma ' Gemfile.lock >/dev/null -} - -set -e - -function check_number() { - if [[ ! "$2" =~ ^[0-9]+$ ]]; then - echo "$1 needs to be a non-negative number" - exit 1 - fi -} -check_number PUMA_WORKERS "${PUMA_WORKERS:-0}" -check_number PUMA_MIN_THREADS "${PUMA_MIN_THREADS:-0}" -check_number PUMA_MAX_THREADS "${PUMA_MAX_THREADS:-0}" - -export RACK_ENV=${RACK_ENV:-"production"} - -if is_puma_installed; then - export_vars=$(cgroup-limits) ; export $export_vars - - exec bundle exec "puma --config ../etc/puma.cfg" -else - echo "You might consider adding 'puma' into your Gemfile." - - if bundle exec rackup -h &>/dev/null; then - if [ -f Gemfile ]; then - exec bundle exec "rackup -E ${RAILS_ENV:-$RACK_ENV} -P /tmp/rack.pid --host 0.0.0.0 --port 8080" - else - exec rackup -E "${RAILS_ENV:-$RACK_ENV}" -P /tmp/rack.pid --host 0.0.0.0 --port 8080 - fi - else - echo "ERROR: Rubygem Rack is not installed in the present image." - echo " Add rack to your Gemfile in order to start the web server." - fi -fi diff --git a/2.6/s2i/bin/usage b/2.6/s2i/bin/usage deleted file mode 100755 index 76b9beb1..00000000 --- a/2.6/s2i/bin/usage +++ /dev/null @@ -1,18 +0,0 @@ -#!/bin/sh - -DISTRO="`grep ^ID= /etc/*-release | cut -d'"' -f2`" - -cat < -- curl 127.0.0.1:8080 - -Alternatively, to run the image directly using podman or docker, or how to use it as a parent image in a Dockerfile, see documentation at - -https://github.com/sclorg/s2i-ruby-container/blob/master/${RUBY_VERSION}/README.md -EOF diff --git a/2.6/test/examples b/2.6/test/examples deleted file mode 120000 index d15735c1..00000000 --- a/2.6/test/examples +++ /dev/null @@ -1 +0,0 @@ -../../examples \ No newline at end of file diff --git a/2.6/test/imagestreams b/2.6/test/imagestreams deleted file mode 120000 index 7a0aee9c..00000000 --- a/2.6/test/imagestreams +++ /dev/null @@ -1 +0,0 @@ -../../imagestreams \ No newline at end of file diff --git a/2.6/test/puma-test-app/Gemfile b/2.6/test/puma-test-app/Gemfile deleted file mode 100755 index a98e5e1c..00000000 --- a/2.6/test/puma-test-app/Gemfile +++ /dev/null @@ -1,4 +0,0 @@ -source 'https://rubygems.org' - -gem 'sinatra' -gem 'puma' diff --git a/2.6/test/puma-test-app/Gemfile.lock b/2.6/test/puma-test-app/Gemfile.lock deleted file mode 100644 index 2b2190d1..00000000 --- a/2.6/test/puma-test-app/Gemfile.lock +++ /dev/null @@ -1,21 +0,0 @@ -GEM - remote: https://rubygems.org/ - specs: - mustermann (1.0.1) - puma (3.11.2) - rack (2.0.4) - rack-protection (2.0.0) - rack - sinatra (2.0.0) - mustermann (~> 1.0) - rack (~> 2.0) - rack-protection (= 2.0.0) - tilt (~> 2.0) - tilt (2.0.8) - -PLATFORMS - ruby - -DEPENDENCIES - puma - sinatra diff --git a/2.6/test/puma-test-app/app.rb b/2.6/test/puma-test-app/app.rb deleted file mode 100755 index cd7e87d7..00000000 --- a/2.6/test/puma-test-app/app.rb +++ /dev/null @@ -1,5 +0,0 @@ -require 'sinatra' - -get '/' do - 'Hello world!' -end diff --git a/2.6/test/puma-test-app/config.ru b/2.6/test/puma-test-app/config.ru deleted file mode 100755 index 76a6edff..00000000 --- a/2.6/test/puma-test-app/config.ru +++ /dev/null @@ -1,2 +0,0 @@ -require './app' -run Sinatra::Application diff --git a/2.6/test/rack-test-app/Gemfile b/2.6/test/rack-test-app/Gemfile deleted file mode 100755 index c10abd72..00000000 --- a/2.6/test/rack-test-app/Gemfile +++ /dev/null @@ -1,3 +0,0 @@ -source 'https://rubygems.org' - -gem 'sinatra' diff --git a/2.6/test/rack-test-app/Gemfile.lock b/2.6/test/rack-test-app/Gemfile.lock deleted file mode 100644 index 15694067..00000000 --- a/2.6/test/rack-test-app/Gemfile.lock +++ /dev/null @@ -1,19 +0,0 @@ -GEM - remote: https://rubygems.org/ - specs: - mustermann (1.0.1) - rack (2.0.4) - rack-protection (2.0.0) - rack - sinatra (2.0.0) - mustermann (~> 1.0) - rack (~> 2.0) - rack-protection (= 2.0.0) - tilt (~> 2.0) - tilt (2.0.8) - -PLATFORMS - ruby - -DEPENDENCIES - sinatra diff --git a/2.6/test/rack-test-app/app.rb b/2.6/test/rack-test-app/app.rb deleted file mode 100755 index cd7e87d7..00000000 --- a/2.6/test/rack-test-app/app.rb +++ /dev/null @@ -1,5 +0,0 @@ -require 'sinatra' - -get '/' do - 'Hello world!' -end diff --git a/2.6/test/rack-test-app/config.ru b/2.6/test/rack-test-app/config.ru deleted file mode 100755 index 76a6edff..00000000 --- a/2.6/test/rack-test-app/config.ru +++ /dev/null @@ -1,2 +0,0 @@ -require './app' -run Sinatra::Application diff --git a/2.6/test/run b/2.6/test/run deleted file mode 120000 index 44977d63..00000000 --- a/2.6/test/run +++ /dev/null @@ -1 +0,0 @@ -../../test/run \ No newline at end of file diff --git a/2.6/test/run-conu b/2.6/test/run-conu deleted file mode 120000 index deed6574..00000000 --- a/2.6/test/run-conu +++ /dev/null @@ -1 +0,0 @@ -../../test/run-conu \ No newline at end of file diff --git a/2.6/test/run-openshift b/2.6/test/run-openshift deleted file mode 120000 index ec13e4a1..00000000 --- a/2.6/test/run-openshift +++ /dev/null @@ -1 +0,0 @@ -../../test/run-openshift \ No newline at end of file diff --git a/2.6/test/run-openshift-remote-cluster b/2.6/test/run-openshift-remote-cluster deleted file mode 120000 index 1bffcba8..00000000 --- a/2.6/test/run-openshift-remote-cluster +++ /dev/null @@ -1 +0,0 @@ -../../test/run-openshift-remote-cluster \ No newline at end of file diff --git a/2.6/test/test-lib-openshift.sh b/2.6/test/test-lib-openshift.sh deleted file mode 120000 index 68794d67..00000000 --- a/2.6/test/test-lib-openshift.sh +++ /dev/null @@ -1 +0,0 @@ -../../test/test-lib-openshift.sh \ No newline at end of file diff --git a/2.6/test/test-lib-remote-openshift.sh b/2.6/test/test-lib-remote-openshift.sh deleted file mode 120000 index 92ad2f4d..00000000 --- a/2.6/test/test-lib-remote-openshift.sh +++ /dev/null @@ -1 +0,0 @@ -../../common/test-lib-remote-openshift.sh \ No newline at end of file diff --git a/2.6/test/test-lib-ruby.sh b/2.6/test/test-lib-ruby.sh deleted file mode 120000 index ea235094..00000000 --- a/2.6/test/test-lib-ruby.sh +++ /dev/null @@ -1 +0,0 @@ -../../test/test-lib-ruby.sh \ No newline at end of file diff --git a/2.6/test/test-lib.sh b/2.6/test/test-lib.sh deleted file mode 120000 index 1ac99b93..00000000 --- a/2.6/test/test-lib.sh +++ /dev/null @@ -1 +0,0 @@ -../../common/test-lib.sh \ No newline at end of file diff --git a/2.6/test/test_s2i.py b/2.6/test/test_s2i.py deleted file mode 120000 index 54807341..00000000 --- a/2.6/test/test_s2i.py +++ /dev/null @@ -1 +0,0 @@ -../../test/test_s2i.py \ No newline at end of file