Bug 1866597 - Example repo in oc should be updated since https://github.com/sclorg/ruby-ex cannot work with ruby:2.7
Summary: Example repo in oc should be updated since https://github.com/sclorg/ruby-ex ...
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: OpenShift Container Platform
Classification: Red Hat
Component: Samples
Version: 4.6
Hardware: Unspecified
OS: Unspecified
medium
medium
Target Milestone: ---
: 4.6.0
Assignee: Gabe Montero
QA Contact: XiuJuan Wang
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2020-08-06 02:39 UTC by Wenjing Zheng
Modified: 2020-10-27 16:25 UTC (History)
6 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Cause: the 'oc new-app' example included in the message produced by 'oc new-project' used upstream ruby templates instead of officially supported ruby templates Consequence: intermittent instability due to upstream development would result in the 'oc new-app' example failing if the user tried to use it. Fix: the 'oc new-app' example included in the message produced by 'oc new-project' now uses and officially supported ruby template Result: the 'oc new-app' example included in the message produced by 'oc new-project' should work and be immune to intermittent upstream development.
Clone Of:
Environment:
Last Closed: 2020-10-27 16:25:22 UTC
Target Upstream Version:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Github openshift oc pull 511 0 None closed Bug 1866597: use a fips compliant, but officially supported OCP template, with new-project message 2020-09-29 09:41:03 UTC
Red Hat Product Errata RHBA-2020:4196 0 None None None 2020-10-27 16:25:45 UTC

Description Wenjing Zheng 2020-08-06 02:39:50 UTC
Description of problem:
ruby:latest imagestream under openshift namespace is pointing to 2.7 since OCP 4.6, but it is not compatible with bundle 1.16.4 defined here: https://github.com/sclorg/ruby-ex/blob/master/Gemfile.lock#L15

command: "oc new-app ruby~https://github.com/sclorg/ruby-ex" has below error:
STEP 8: RUN /usr/libexec/s2i/assemble
---> Installing application source ...
---> Building your Ruby application from source ...
---> Running 'bundle install --retry 2 --deployment --without development:test' ...
/opt/rh/rh-ruby27/root/usr/share/rubygems/rubygems.rb:275:in find_spec_for_exe': Could not find 'bundler' (1.16.4) required by your /opt/app-root/src/Gemfile.lock. (Gem::GemNotFoundException) To update to the latest version installed on your system, run bundle update --bundler. To install the missing version, run gem install bundler:1.16.4from /opt/rh/rh-ruby27/root/usr/share/rubygems/rubygems.rb:294:inactivate_bin_path'
from /opt/rh/rh-ruby27/root/usr/bin/bundle:23:in `
'
subprocess exited with status 1
subprocess exited with status 1
error: build error: error building at STEP "RUN /usr/libexec/s2i/assemble": exit status 1



Version-Release number of selected component (if applicable):
$ oc version
Client Version: 4.6.0-0.nightly-2020-08-03-143208
Server Version: 4.6.0-0.nightly-2020-08-05-183436
Kubernetes Version: v4.6.0-202008031851.p0-dirty

How reproducible:
Always

Steps to Reproduce:
1. $ oc new-project wzheng1
Now using project "wzheng1" on server "https://api.qe-groupd-0806.qe.devcluster.openshift.com:6443".

You can add applications to this project with the 'new-app' command. For example, try:

    oc new-app ruby~https://github.com/sclorg/ruby-ex.git

to build a new example application in Ruby. Or use kubectl to deploy a simple Kubernetes application:

    kubectl create deployment hello-node --image=gcr.io/hello-minikube-zero-install/hello-node

2. $ oc describe is ruby -n openshift
Name:			ruby
Namespace:		openshift
Created:		3 hours ago
Labels:			samples.operator.openshift.io/managed=true
Annotations:		openshift.io/display-name=Ruby
			openshift.io/image.dockerRepositoryCheck=2020-08-05T23:32:35Z
			samples.operator.openshift.io/version=4.6.0-0.nightly-2020-08-05-183436
Image Repository:	image-registry.openshift-image-registry.svc:5000/openshift/ruby
Image Lookup:		local=false
Unique Images:		3
Tags:			4

2.7 (latest)
  tagged from registry.redhat.io/rhscl/ruby-27-rhel7:latest
    prefer registry pullthrough when referencing this tag

  Build and run Ruby 2.7 applications on RHEL 7. For more information about using this builder image, including OpenShift considerations, see https://github.com/sclorg/s2i-ruby-container/blob/master/2.7/README.md.
  Tags: builder, ruby
  Supports: ruby:2.7, ruby
  Example Repo: https://github.com/sclorg/ruby-ex.git

  * registry.redhat.io/rhscl/ruby-27-rhel7@sha256:0e6e657cc73103bdbc9a2aa0eaa590e61cf51ea78df162a36fecbf6103d11be8
      3 hours ago

Actual results:
Ruby:2.7(latest) is using https://github.com/sclorg/ruby-ex.git as example repo.

Expected results:
It should not , since ruby:2.7 cannot work with bundle 1.16.4

Additional info:

Comment 1 Pavel Valena 2020-08-06 09:01:03 UTC
Note that this is actually workaroundable using custom `assemble` script [1] for either the app, or including the required 'capabilitiy' in s2i-ruby-container.

[1] https://github.com/sclorg/rails-ex/issues/129

Comment 2 Gabe Montero 2020-08-06 13:58:02 UTC
Technically speaking, direct use of https://github.com/sclorg/ruby-ex.git is not an officially supported sample of OCP.  It is the upstream representation 
of samples shipped by samples operator in OCP.

In fact, we've gone through some amount of effort in our e2e's to stop validation of new-app against upstream repo's, as they invariable can be "under development"
at various times, and have intermittent inconsistencies as noted by this latest bug, and instead our e2e's now new-app against the 
templates we officially ship.

The closest alternative to that new-app is most likely the template at https://github.com/openshift/cluster-samples-operator/blob/master/assets/operator/ocp-x86_64/rails/templates/rails-postgresql-example.json
And it you look there, the BuildConfig uses ruby:2.5 - https://github.com/openshift/cluster-samples-operator/blob/master/assets/operator/ocp-x86_64/rails/templates/rails-postgresql-example.json#L120

So the new-app call instead would be:

oc new-app rails-postgresql-example

My plan is to keep this bz under samples, but change the new-project message in `oc` to move off of direct upstream repo usage.

The SCL folks can sort out their ruby versioning issues independently / in parallel as part of their dev cycle.

Comment 3 Gabe Montero 2020-08-06 15:41:48 UTC
As I research history and refresh my old memory, some of this came up in https://bugzilla.redhat.com/show_bug.cgi?id=1774318 ... FIPS was the fly in the ointment back then.

Never did get an answer to my question in https://bugzilla.redhat.com/show_bug.cgi?id=1774318#c2

So I'm going to fix my error back then and use `rails-postgresql-example` re: https://github.com/openshift/oc/pull/170/files#r348680799

Comment 6 XiuJuan Wang 2020-08-18 07:54:31 UTC
$oc new-project xiuwang1 
Now using project "xiuwang1" on server "https://api.juzhao-osp.0817-un8.qe.rhcloud.com:6443".

You can add applications to this project with the 'new-app' command. For example, try:

    oc new-app rails-postgresql-example

to build a new example application in Ruby. Or use kubectl to deploy a simple Kubernetes application:

    kubectl create deployment hello-node --image=gcr.io/hello-minikube-zero-install/hello-node

$oc new-app rails-postgresql-example
$oc get builds
NAME                         TYPE     FROM          STATUS     STARTED         DURATION
rails-postgresql-example-1   Source   Git@df00e00   Complete   2 minutes ago   2m2s

Verified on version 
Client Version: 4.6.0-0.nightly-2020-08-18-030245
Server Version: 4.6.0-0.nightly-2020-08-17-184032

Comment 8 errata-xmlrpc 2020-10-27 16:25:22 UTC
Since the problem described in this bug report should be
resolved in a recent advisory, it has been closed with a
resolution of ERRATA.

For information on the advisory (OpenShift Container Platform 4.6 GA Images), and where to find the updated
files, follow the link below.

If the solution does not work for you, open a new bug report.

https://access.redhat.com/errata/RHBA-2020:4196


Note You need to log in before you can comment on or make changes to this bug.