Giter Site home page Giter Site logo

rails-ex's Introduction

Rails Sample App on OpenShift

This is a quickstart Rails application for OpenShift v3 that you can use as a starting point to develop your own application and deploy it on an OpenShift cluster.

If you'd like to install it, follow these directions.

The steps in this document assume that you have access to an OpenShift deployment that you can deploy applications on.

OpenShift Considerations

These are some special considerations you may need to keep in mind when running your application on OpenShift.

Assets

Your application is set to precompile the assets every time you push to OpenShift. Any assets you commit to your repo will be preserved alongside those which are generated during the build.

By adding the DISABLE_ASSET_COMPILATION=true environment variable value to your BuildConfig, you will disable asset compilation upon application deployment. See the Basic Build Operations documentation on setting environment variables for builds in OpenShift V3.

Security

Since these quickstarts are shared code, we had to take special consideration to ensure that security related configuration variables are unique across applications. To accomplish this, we modified some of the configuration files. Now instead of using the same default values, OpenShift can generate these values using the generate from logic defined within the template.

OpenShift stores these generated values in configuration files that only exist for your deployed application and not in your code anywhere. Each of them will be unique so initialize_secret(:a) will differ from initialize_secret(:b) but they will also be consistent, so any time your application uses them (even across reboots), you know they will be the same.

TLDR: OpenShift can generate and expose environment variables to your application automatically. Look at this quickstart for an example.

Development mode

When you develop your Rails application in OpenShift, you can also enable the 'development' environment by setting the RAILS_ENV environment variable for your deploymentConfiguration, using the oc client, like:

	$ oc set env dc/rails-postgresql-example RAILS_ENV=development

If you do so, OpenShift will run your application under 'development' mode. In development mode, your application will:

  • Show more detailed errors in the browser
  • Skip static assets (re)compilation

Development environment can help you debug problems in your application in the same way as you do when developing on your local machine. However, we strongly advise you to not run your application in this mode in production.

Installation

These steps assume your OpenShift deployment has the default set of ImageStreams defined. Instructions for installing the default ImageStreams are available here. If you are defining the set of ImageStreams now, remember to pass in the proper cluster-admin credentials and to create the ImageStreams in the 'openshift' namespace.

  1. Fork a copy of rails-ex

  2. Clone your repository to your development machine and cd to the repository directory

  3. Add a Ruby application from the rails template:

     $ oc new-app openshift/templates/rails-postgresql.json -p SOURCE_REPOSITORY_URL=https://github.com/< yourusername >/rails-ex 
    
  4. Depending on the state of your system, and whether additional items need to be downloaded, it may take around a minute for your build to be started automatically. If you do not want to wait, run

     $ oc start-build rails-postgresql-example
    
  5. Once the build is running, watch your build progress

     $ oc logs build/rails-postgresql-example-1
    
  6. Wait for rails-postgresql-example pods to start up (this can take a few minutes):

     $ oc get pods -w
    

    Sample output:

     NAME                    READY     REASON         RESTARTS   AGE
     postgresql-1-vk6ny                   1/1       Running        0          4m
     rails-postgresql-example-1-build     0/1       ExitCode:0     0          3m
     rails-postgresql-example-1-deploy    1/1       Running        0          34s
     rails-postgresql-example-1-prehook   0/1       ExitCode:0     0          32s
    
  7. Check the IP and port the rails-postgresql-example service is running on:

     $ oc get svc
    

    Sample output:

     NAME             LABELS                              SELECTOR              IP(S)           PORT(S)
     postgresql                 template=rails-postgresql-example   name=postgresql                 172.30.197.40    5432/TCP
     rails-postgresql-example   template=rails-postgresql-example   name=rails-postgresql-example   172.30.205.117   8080/TCP
    

In this case, the IP for rails-postgresql-example rails-postgresql-example is 172.30.205.117 and it is on port 8080.
Note: you can also get this information from the web console.

Debugging Unexpected Failures

Review some of the common tips and suggestions here.

Adding Webhooks and Making Code Changes

Since OpenShift V3 does not provide a git repository out of the box, you can configure your github repository to make a webhook call whenever you push your code.

  1. From the Web Console homepage, navigate to your project
  2. Click on Browse > Builds
  3. Click the link with your BuildConfig name
  4. Click the Configuration tab
  5. Click the "Copy to clipboard" icon to the right of the "GitHub webhook URL" field
  6. Navigate to your repository on GitHub and click on repository settings > webhooks > Add webhook
  7. Paste your webhook URL provided by OpenShift
  8. Leave the defaults for the remaining fields - That's it!
  9. After you save your webhook, if you refresh your settings page you can see the status of the ping that Github sent to OpenShift to verify it can reach the server.

Enabling the Blog example

In order to access the example blog application, you have to remove the public/index.html which serves as the welcome page and rebuild the application. Another option is to make a request directly to /articles which will give you access to the blog.

The username/pw used for authentication in this application are openshift/secret.

Hot Deploy

In order to dynamically pick up changes made in your application source code, you need to set the RAILS_ENV=development parameter to the oc new-app command, while performing the installation steps described in this README.

$ oc new-app openshift/templates/rails-postgresql.json -p RAILS_ENV=development

To change your source code in the running container you need to oc rsh into it.

$ oc rsh <POD_ID>

After you oc rsh into the running container, your current directory is set to /opt/app-root/src, where the source code is located.

To set your application back to the production environment you need to remove RAILS_ENV environment variable:

$ oc set env dc/rails-postgresql-example RAILS_ENV-

A redeploy will happen automatically due to the ConfigChange trigger.

NOTICE: If the ConfigChange trigger is not set, you need to run the redeploy manually:

$ oc deploy rails-postgresql-example --latest

Compatibility

This repository is compatible with Ruby 2.3 and higher, excluding any alpha or beta versions.

License

This code is dedicated to the public domain to the maximum extent permitted by applicable law, pursuant to CC0.

rails-ex's People

Contributors

adambkaplan avatar bparees avatar coreydaley avatar dinhxuanvu avatar evgeni avatar ewolinetz avatar gabemontero avatar hhorak avatar jackorp avatar jhadvig avatar jupierce avatar kargakis avatar liangxia avatar luciddreamz avatar mfojtik avatar mosleymos avatar phracek avatar pkubatrh avatar pvalena avatar rhcarvalho avatar sallyom avatar snumano avatar spyrbri avatar sspeiche avatar yselkowitz avatar

Stargazers

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

Watchers

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

rails-ex's Issues

Can't send emails from my openshift v3 app

I dont know where ask it.
When my app in openshift v3 send one email (using server: smtp.gmail.com, port: 587... etc), it respond with 500 and: SocketError (getaddrinfo: Servname not supported for ai_socktype)
Whats appening? what can i do to solve this problem?

s2i with ruby 2.6 does not create secret_key_base

Basically, from what I've gathered:

s2i build https://github.com/sclorg/rails-ex registry.access.redhat.com/ubi8/ruby-26 rails-ex:2.6
/tmp/src ~
---> Building your Ruby application from source ...
You are replacing the current global value of set, which is currently "--local deployment true"
---> Running 'bundle install --retry 2' ...
You are replacing the current global value of set, which is currently "--local without development:test"
The dependency tzinfo-data (>= 0) will be unused by any of the platforms Bundler is installing for. Bundler is installing for ruby but the dependency is only for x86-mingw32, x86-mswin32, x64-mingw32, java. To add those platforms to the bundle, run `bundle lock --add-platform x86-mingw32 x86-mswin32 x64-mingw32 java`.
Fetching gem metadata from https://rubygems.org/..........
Fetching rake 13.0.3
Errno::EACCES: Permission denied @ rb_file_s_rename -

Here, rename fails ^^^ ; do I understand correctly that there's installation destination missing? (and the $HOME one is wrong)

(/opt/app-root/src/.gem/ruby/cache/rake-13.0.3.gem,
/usr/share/gems/cache/rake-13.0.3.gem)
An error occurred while installing rake (13.0.3), and Bundler cannot continue.
Make sure that `gem install rake -v '13.0.3' --source 'https://rubygems.org/'`
succeeds before bundling.

In Gemfile:
coffee-rails was resolved to 5.0.0, which depends on
railties was resolved to 6.1.3.1, which depends on
rake
---> Cleaning up unused ruby gems ...
Running `bundle clean --verbose` with bundler 1.17.2
Cleaning all the gems on your system is dangerous! If you're sure you want to
remove every system gem not in this bundle, run `bundle clean --force`.
---> No master key present in environment, generating ...
/usr/share/gems/gems/bundler-1.17.2/lib/bundler/spec_set.rb:91:in `block in materialize': Could not find rake-13.0.3 in any of the sources (Bundler::GemNotFound)
        from /usr/share/gems/gems/bundler-1.17.2/lib/bundler/spec_set.rb:85:in `map!'
        from /usr/share/gems/gems/bundler-1.17.2/lib/bundler/spec_set.rb:85:in `materialize'
        from /usr/share/gems/gems/bundler-1.17.2/lib/bundler/definition.rb:170:in `specs'
        from /usr/share/gems/gems/bundler-1.17.2/lib/bundler/definition.rb:237:in `specs_for'
        from /usr/share/gems/gems/bundler-1.17.2/lib/bundler/definition.rb:226:in `requested_specs'
        from /usr/share/gems/gems/bundler-1.17.2/lib/bundler/runtime.rb:108:in `block in definition_method'
        from /usr/share/gems/gems/bundler-1.17.2/lib/bundler/runtime.rb:20:in `setup'
        from /usr/share/gems/gems/bundler-1.17.2/lib/bundler.rb:107:in `setup'
        from /usr/share/gems/gems/bundler-1.17.2/lib/bundler/setup.rb:20:in `<top (required)>'
        from /usr/share/rubygems/rubygems/core_ext/kernel_require.rb:54:in `require'
        from /usr/share/rubygems/rubygems/core_ext/kernel_require.rb:54:in `require'
        from /tmp/src/config/boot.rb:3:in `<top (required)>'
        from bin/rails:4:in `require_relative'
        from bin/rails:4:in `<main>'
~

This should have probably failed earlier, with the bundle install; which failed because it tried to install to some invalid destination, probably.

@jackorp PTAL.

Full log: https://gist.github.com/b61bcc35accdcb1807c10d3fe9c323e9


@yselkowitz FYI: It's probably just environment issue.

Consistent example applications

  • document that imagestreams must have been created in the README
  • make applications have similar welcome page look and functionality
  • make READMEs have the same structure
  • useful and similar project descriptions on GitHub
  • BuildConfig.Output.To should reference a ImageStreamTag [https://github.com/sclorg/django-ex/pull/14, https://github.com/sclorg/nodejs-ex/pull/9, https://github.com//pull/10]
  • each template should have one and only one ImageStream object definition, the output of the build
  • default route name: FRAMEWORK-example.openshiftapps.com
  • parameter to specify git ref [https://github.com/sclorg/dancer-ex/pull/5, https://github.com/sclorg/django-ex/pull/15, https://github.com/sclorg/nodejs-ex/pull/10, https://github.com//pull/11]
  • change the parameter FRONTEND_ROUTE to APPLICATION_DOMAIN

@bparees @mfojtik @ewolinetz @jhadvig @sspeiche PTAL


Post 3.0

  • add liveness and readiness probes

Rails container does not restart properly on OpenShift 4.x

Expected Behaviour (verified with Minishift 1.34.0 + OpenShift 3.11.0):

Doing an oc rollout will cleanly restart the Rails container:

$ git clone https://github.com/sclorg/rails-ex                                                                                                                                 
$ oc new-app rails-ex/openshift/templates/rails-postgresql.json -p SOURCE_REPOSITORY_URL=https://github.com/sclorg/rails-ex
$ oc get pods
NAME                               READY     STATUS      RESTARTS   AGE
postgresql-1-n8b94                 1/1       Running     0          20m
rails-postgresql-example-1-build   0/1       Completed   0          20m
rails-postgresql-example-1-tdl2n   1/1       Running     0          17m
$ oc rollout --latest rails-postgresql-example
$ oc get pods
NAME                               READY     STATUS      RESTARTS   AGE
postgresql-1-n8b94                 1/1       Running     0          21m
rails-postgresql-example-1-build   0/1       Completed   0          21m
rails-postgresql-example-2-xrk95   1/1       Running     0          31s

Actual Behaviour (verified with CodeReady Containers 1.2.0 + OpenShift 4.2.8)

On attempting oc rollout, the -hook-pre container hangs in 'Pending' state for over 30min:

$ git clone https://github.com/sclorg/rails-ex
$ oc new-app rails-ex/openshift/templates/rails-postgresql.json -p SOURCE_REPOSITORY_URL=https://github.com/sclorg/rails-ex
$ oc get pods
NAME                               READY   STATUS      RESTARTS   AGE
postgresql-1-46mtk                    1/1     Running     0          4m29s
postgresql-1-deploy                   0/1     Completed   0          4m46s
rails-postgresql-example-1-build      0/1     Completed   0          4m47s
rails-postgresql-example-1-deploy     1/1     Running     0          48s
rails-postgresql-example-1-hook-pre   0/1     Completed   0          39s
rails-postgresql-example-1-vzmtw      0/1     Running     0          15s
$ oc rollout latest rails-postgresql-example
$ oc get pods
NAME                                  READY   STATUS      RESTARTS   AGE
postgresql-1-46mtk                    1/1     Running     0          38m
postgresql-1-deploy                   0/1     Completed   0          38m
rails-postgresql-example-1-build      0/1     Completed   0          38m
rails-postgresql-example-1-deploy     0/1     Completed   0          34m
rails-postgresql-example-1-hook-pre   0/1     Completed   0          34m
rails-postgresql-example-1-vzmtw      1/1     Running     0          34m
rails-postgresql-example-2-deploy     1/1     Running     0          33m
rails-postgresql-example-2-hook-pre   0/1     Pending     0          33m

OpenShift logging is disabled in production

Logging to STDOUT is disabled in production configuration as of the 5.1 upgrade unless RAILS_LOG_TO_STDOUT environment variable is set. OpenShift no longer captures log output:

screen shot 2017-11-14 at 12 27 26 pm

build failed with ruby-20-rhel7 s2i builder image

ruby-20-rhel7 also failed with rails-ex now:
oc logs rails-ex-1-build rbenv:2.2.3
Cloning "https://github.com/openshift/rails-ex" ...
Commit: 26b5a51 (Merge pull request #68 from coreydaley/master)
Author: Ben Parees [email protected]
Date: Wed Nov 9 12:23:27 2016 -0500

---> Installing application source ...
---> Building your Ruby application from source ...
---> Running 'bundle install --deployment' ...
x64_mingw is not a valid platform. The available options are: [:ruby,
:ruby_18, :ruby_19, :ruby_20, :mri, :mri_18, :mri_19, :mri_20, :rbx, :jruby,
:mswin, :mingw, :mingw_18, :mingw_19, :mingw_20]
error: build error: non-zero (13) exit code from registry.ops.openshift.com/openshift3/ruby-20-rhel7@sha256:080d6a3b7cc7d221b2d5cd1fa25c48c844a51fae7474884a20c5627c3b8d7f13

PG::ConnectionBad with Openshift Deployment

I just tried to deploy a rails app in Openshift Online using this repo as reference for my Image, but the deployment has failed

$ oc logs -f myapp-1-deploy
--> pre: Running hook pod ...
Executing bundle exec 'rake db:migrate' ...
rake aborted!
PG::ConnectionBad: could not connect to server: No such file or directory
	Is the server running locally and accepting
	connections on Unix domain socket "/var/run/postgresql/.s.PGSQL.5432"?
/opt/app-root/src/bundle/ruby/2.3.0/gems/pg-0.21.0/lib/pg.rb:56:in `initialize'
/opt/app-root/src/bundle/ruby/2.3.0/gems/pg-0.21.0/lib/pg.rb:56:in `new'
/opt/app-root/src/bundle/ruby/2.3.0/gems/pg-0.21.0/lib/pg.rb:56:in `connect'
/opt/app-root/src/bundle/ruby/2.3.0/gems/activerecord-5.1.2/lib/active_record/connection_adapters/postgresql_adapter.rb:701:in `connect'
/opt/app-root/src/bundle/ruby/2.3.0/gems/activerecord-5.1.2/lib/active_record/connection_adapters/postgresql_adapter.rb:220:in `initialize'
/opt/app-root/src/bundle/ruby/2.3.0/gems/activerecord-5.1.2/lib/active_record/connection_adapters/postgresql_adapter.rb:38:in `new'
/opt/app-root/src/bundle/ruby/2.3.0/gems/activerecord-5.1.2/lib/active_record/connection_adapters/postgresql_adapter.rb:38:in `postgresql_connection'
/opt/app-root/src/bundle/ruby/2.3.0/gems/activerecord-5.1.2/lib/active_record/connection_adapters/abstract/connection_pool.rb:759:in `new_connection'
/opt/app-root/src/bundle/ruby/2.3.0/gems/activerecord-5.1.2/lib/active_record/connection_adapters/abstract/connection_pool.rb:803:in `checkout_new_connection'
/opt/app-root/src/bundle/ruby/2.3.0/gems/activerecord-5.1.2/lib/active_record/connection_adapters/abstract/connection_pool.rb:782:in `try_to_checkout_new_connection'
/opt/app-root/src/bundle/ruby/2.3.0/gems/activerecord-5.1.2/lib/active_record/connection_adapters/abstract/connection_pool.rb:743:in `acquire_connection'
/opt/app-root/src/bundle/ruby/2.3.0/gems/activerecord-5.1.2/lib/active_record/connection_adapters/abstract/connection_pool.rb:500:in `checkout'
/opt/app-root/src/bundle/ruby/2.3.0/gems/activerecord-5.1.2/lib/active_record/connection_adapters/abstract/connection_pool.rb:374:in `connection'
/opt/app-root/src/bundle/ruby/2.3.0/gems/activerecord-5.1.2/lib/active_record/connection_adapters/abstract/connection_pool.rb:931:in `retrieve_connection'
/opt/app-root/src/bundle/ruby/2.3.0/gems/activerecord-5.1.2/lib/active_record/connection_handling.rb:116:in `retrieve_connection'
/opt/app-root/src/bundle/ruby/2.3.0/gems/activerecord-5.1.2/lib/active_record/connection_handling.rb:88:in `connection'
/opt/app-root/src/bundle/ruby/2.3.0/gems/activerecord-5.1.2/lib/active_record/schema_migration.rb:20:in `table_exists?'
/opt/app-root/src/bundle/ruby/2.3.0/gems/activerecord-5.1.2/lib/active_record/schema_migration.rb:24:in `create_table'
/opt/app-root/src/bundle/ruby/2.3.0/gems/activerecord-5.1.2/lib/active_record/migration.rb:1125:in `initialize'
/opt/app-root/src/bundle/ruby/2.3.0/gems/activerecord-5.1.2/lib/active_record/migration.rb:1007:in `new'
/opt/app-root/src/bundle/ruby/2.3.0/gems/activerecord-5.1.2/lib/active_record/migration.rb:1007:in `up'
/opt/app-root/src/bundle/ruby/2.3.0/gems/activerecord-5.1.2/lib/active_record/migration.rb:985:in `migrate'
/opt/app-root/src/bundle/ruby/2.3.0/gems/activerecord-5.1.2/lib/active_record/tasks/database_tasks.rb:171:in `migrate'
/opt/app-root/src/bundle/ruby/2.3.0/gems/activerecord-5.1.2/lib/active_record/railties/databases.rake:58:in `block (2 levels) in <top (required)>'
/opt/app-root/src/bundle/ruby/2.3.0/gems/rake-12.0.0/exe/rake:27:in `<top (required)>'
Tasks: TOP => db:migrate
(See full trace by running task with --trace)
--> pre: Failed
error: pre hook failed: the pre hook failed: , aborting rollout of mynamespace/myapp-1

It seems it can`t connect to the Postgresql database (which is well deployed and running).

So i don't think if the cluster is able to define these variables :

  host: <%= ENV["#{db_service}_SERVICE_HOST"] %>
  port: <%= ENV["#{db_service}_SERVICE_PORT"] %>

In the Openshift default DeploymentConfig, there's no host or port environment variables defined. Not sure if I need to explicitly define them during app creation since it's not written in the documentation here.

So what kind of changes do I need to make ? Thank you.

rails-ex repo does not support ruby version below 2.3

@bparees When I do s2i using ruby-2.2-rhel7 with rails-ex repo, I got this error.

Cloning "https://github.com/openshift/rails-ex" ... Commit: 099b107f67f7df550b16863272708a7f7d59ba9 (Merge pull request #91 from snumano/master) Author: Ben Parees [email protected] Date: Tue Jul 25 11:28:44 2017 -0400 ---> Installing application source ... ---> Building your Ruby application from source ... ---> Running 'bundle install --deployment --without development:test' ...
Fetching gem metadata from https://rubygems.org/..........
Fetching additional metadata from https://rubygems.org/..
Installing rake 12.0.0
Installing concurrent-ruby 1.0.5
Installing i18n 0.8.4
Installing minitest 5.10.2
Installing thread_safe 0.3.6
Installing tzinfo 1.2.3
Installing activesupport 5.1.2
Installing builder 3.2.3
Installing erubi 1.6.0
Installing mini_portile2 2.2.0
Installing nokogiri 1.8.0
Installing rails-dom-testing 2.0.3
Installing loofah 2.0.3
Installing rails-html-sanitizer 1.0.3
Installing actionview 5.1.2
Installing rack 2.0.3
Installing rack-test 0.6.3
Installing actionpack 5.1.2
Installing nio4r 2.1.0
Installing websocket-extensions 0.1.2
Installing websocket-driver 0.6.5
Installing actioncable 5.1.2
Installing globalid 0.4.0
Installing activejob 5.1.2
Installing mime-types-data 3.2016.0521
Installing mime-types 3.1
Installing mail 2.6.6
Installing actionmailer 5.1.2
Installing activemodel 5.1.2
Installing arel 8.0.0
Installing activerecord 5.1.2
Installing coffee-script-source 1.12.2
Installing execjs 2.7.0
Installing coffee-script 2.4.1
Installing method_source 0.8.2
Installing thor 0.19.4
Installing railties 5.1.2
Installing coffee-rails 4.2.2
Installing ffi 1.9.18
Installing multi_json 1.12.1
Installing jbuilder 2.7.0
Installing rb-fsevent 0.9.8
Installing rb-inotify 0.9.10
Gem::InstallError: ruby_dep requires Ruby version >= 2.2.5, ~> 2.2. An error occurred while installing ruby_dep (1.5.0), and Bundler cannot continue.
Make sure that gem install ruby_dep -v '1.5.0' succeeds before bundling. error: build error: non-zero (13) exit code from brew-***/rhscl/ruby-22-rhel7@sha256:01d956b46d17bd60650dabc0cfb925a4d1c688bb3473357f30cfa8bda3f676ae

Standard welcome page contents

I want to determine what will be the content of our welcome pages. Layout stays as v2, rails-ex and dancer-ex.
The current page for rails-ex:
image

Issues:

  1. Web Console section: I'm unsure the copy "add collaborator access authorizations, designate custom domain aliases, and manage domain memberships" relates to the web console in v3
  2. Command Line Tools section: documentation is for v2
  3. Development Resources section: except for StackOverflow and Git docs, all links point to v2 resources.
  4. In Deploying code changes, the first thing we do is list the steps to use GitHub webhook, but that won't work if you are trying OpenShift on a non-GitHub accessible network, and it not totally required.
  5. Working in your local Git repository links to v2 documentation
  6. Working in your local Git repository steps won't work unless you change the template parameter to point to your fork of the github repo.

Content present in django-ex and not in rails-ex:

  • Steps how the example project was created
  • Dynamic request info: hostname of the pod serving the request, database connection info, page view counter
    image

@bparees @mfojtik @jhadvig @ewolinetz could you please comment on the points above?
Once I have a clearer picture of the contents we want in the welcome pages I can make PRs to update what's needed.

Rails example issues

Few more issues I found:

  1. The http_basic_authenticate_with name: "openshift", password: "secret", except: [:index, :show] in the "articles" controller must use ENV["ADMIN_USER"]/ENV["ADMIN_PASSWORD"]. Also these are not set as env vars, but they just exists as parameters now

  2. Navigate to /articles/new and get this error (the database exists at this point):

I, [2015-06-16T16:38:50.524034 #1]  INFO -- : Started GET "/articles/new" for 172.17.0.4 at 2015-06-16 16:38:50 +0000
I, [2015-06-16T16:38:50.526076 #1]  INFO -- : Processing by ArticlesController#new as HTML
E, [2015-06-16T16:38:50.529902 #1] ERROR -- : PG::UndefinedTable: ERROR:  relation "articles" does not exist
LINE 5:                WHERE a.attrelid = '"articles"'::regclass
                                          ^
:               SELECT a.attname, format_type(a.atttypid, a.atttypmod),
                     pg_get_expr(d.adbin, d.adrelid), a.attnotnull, a.atttypid, a.atttypmod
                FROM pg_attribute a LEFT JOIN pg_attrdef d
                  ON a.attrelid = d.adrelid AND a.attnum = d.adnum
               WHERE a.attrelid = '"articles"'::regclass
                 AND a.attnum > 0 AND NOT a.attisdropped
               ORDER BY a.attnum

I, [2015-06-16T16:38:50.530846 #1]  INFO -- : Completed 500 Internal Server Error in 5ms (ActiveRecord: 2.1ms)
F, [2015-06-16T16:38:50.534080 #1] FATAL -- : 
ActiveRecord::StatementInvalid (PG::UndefinedTable: ERROR:  relation "articles" does not exist
LINE 5:                WHERE a.attrelid = '"articles"'::regclass
                                          ^
:               SELECT a.attname, format_type(a.atttypid, a.atttypmod),
                     pg_get_expr(d.adbin, d.adrelid), a.attnotnull, a.atttypid, a.atttypmod
                FROM pg_attribute a LEFT JOIN pg_attrdef d
                  ON a.attrelid = d.adrelid AND a.attnum = d.adnum
               WHERE a.attrelid = '"articles"'::regclass
                 AND a.attnum > 0 AND NOT a.attisdropped
               ORDER BY a.attnum
):
  app/controllers/articles_controller.rb:20:in `new'
  1. We have to store sessions into database (there is a configuration settings to do that)

template is not running properly on OpenShift 4

Container platform

OCP 4

Version

ruby-3.1, ruby3.0

OS version of the container image

RHEL 8, RHEL 9

Bugzilla, Jira

No response

Description

During the testing of rail-ex template I discovered, that it is not working properly. Log from build is here:

Defaulted container "sti-build" out of: sti-build, git-clone (init), manage-dockerfile (init)
time="2024-01-16T13:03:31Z" level=info msg="Not using native diff for overlay, this may cause degraded performance for building images: kernel has CONFIG_OVERLAY_FS_REDIRECT_DIR enabled"
I0116 13:03:31.114103       1 defaults.go:112] Defaulting to storage driver "overlay" with options [mountopt=metacopy=on].
Caching blobs under "/var/cache/blobs".
Trying to pull image-registry.openshift-image-registry.svc:5000/sclorg-test-20714/ruby@sha256:370bcf32ceb5505acf52679882fdba076ce2a5d7bbe4aa77924ea808925a9a77...
Getting image source signatures
Copying blob sha256:2a8df87989f5321716be1b8863523d3ee9d5b5324f33f0163bb054330f5fe758
Copying blob sha256:50ccdb01751aeb08fdb4bb077afe0f302149e1fb82242159e5787372a750d3c1
Copying blob sha256:8ee5f1e863ab9d2a5c9741aa4954fd8be5fa515465efdc38cb4e15808b58010e
Copying blob sha256:2e81a4fbe719bf7452c5a1dfc71d98c0c1d2daa567b7db50466b15f9448d88f9
Copying blob sha256:696f68f50a3c4b73bf17307463f440fa7da4780aca9ab78f4a4ffc6c0c978d74
Copying blob sha256:c2650fe947f606317fadb11c65aae44ee7b8ebd7c245a639d3521ce7a8d4544f
Copying blob sha256:ac0e01248de69227cd4fab0fa3cf5024af18872ca86eac77356d9b93129c0c7a
Copying config sha256:19271c2407eadb0fa558c9322e675626dae59d154ba0a881c266e854a9828d27
Writing manifest to image destination
Generating dockerfile with builder image image-registry.openshift-image-registry.svc:5000/sclorg-test-20714/ruby@sha256:370bcf32ceb5505acf52679882fdba076ce2a5d7bbe4aa77924ea808925a9a77
Replaced Dockerfile FROM image image-registry.openshift-image-registry.svc:5000/sclorg-test-20714/ruby@sha256:370bcf32ceb5505acf52679882fdba076ce2a5d7bbe4aa77924ea808925a9a77
Adding transient rw bind mount for /run/secrets/rhsm
[1/3] STEP 1/10: FROM image-registry.openshift-image-registry.svc:5000/sclorg-test-20714/ruby@sha256:370bcf32ceb5505acf52679882fdba076ce2a5d7bbe4aa77924ea808925a9a77 AS appimagea0b095206ff640fda78eb83b746d9d9b
[1/3] STEP 2/10: LABEL "io.openshift.build.commit.message"="Fix oc env"       "io.openshift.build.source-location"="https://github.com/sclorg/rails-ex.git"       "io.openshift.build.image"="image-registry.openshift-image-registry.svc:5000/sclorg-test-20714/ruby@sha256:370bcf32ceb5505acf52679882fdba076ce2a5d7bbe4aa77924ea808925a9a77"       "io.openshift.build.commit.author"="Pavel Valena <[email protected]>"       "io.openshift.build.commit.date"="Tue Jan 2 15:02:42 2024 +0100"       "io.openshift.build.commit.id"="a5fa1c2383333d663b08fd8ffae3d87663358924"       "io.openshift.build.commit.ref"="master"
[1/3] STEP 3/10: ENV OPENSHIFT_BUILD_NAME="rails-postgresql-example-1"     OPENSHIFT_BUILD_NAMESPACE="sclorg-test-20714"     OPENSHIFT_BUILD_SOURCE="https://github.com/sclorg/rails-ex.git"     OPENSHIFT_BUILD_REFERENCE="master"     OPENSHIFT_BUILD_COMMIT="a5fa1c2383333d663b08fd8ffae3d87663358924"     RUBYGEM_MIRROR=""
[1/3] STEP 4/10: USER root
[1/3] STEP 5/10: COPY upload/scripts /tmp/scripts
[1/3] STEP 6/10: COPY upload/src /tmp/src
[1/3] STEP 7/10: RUN chown -R 1001:0 /tmp/scripts /tmp/src
[1/3] STEP 8/10: USER 1001
[1/3] STEP 9/10: RUN /tmp/scripts/assemble
/tmp/src ~
---> Building your Ruby application from source ...
---> Running 'bundle install --retry 2' ...
Fetching gem metadata from https://rubygems.org/..........
Fetching rake 13.1.0
/usr/share/ruby/net/http.rb:1162: warning: The environment variable HTTP_PROXY is discouraged.  Use http_proxy.
Installing rake 13.1.0
Fetching concurrent-ruby 1.2.2
Fetching minitest 5.15.0
Fetching crass 1.0.6
/usr/share/ruby/net/http.rb:1162: warning: The environment variable HTTP_PROXY is discouraged.  Use http_proxy.
/usr/share/ruby/net/http.rb:1162: warning: The environment variable HTTP_PROXY is discouraged.  Use http_proxy.
/usr/share/ruby/net/http.rb:1162: warning: The environment variable HTTP_PROXY is discouraged.  Use http_proxy.
Fetching zeitwerk 2.6.12
Fetching builder 3.2.4
Fetching erubi 1.12.0
Fetching mini_portile2 2.6.1
Fetching racc 1.7.3
/usr/share/ruby/net/http.rb:1162: warning: The environment variable HTTP_PROXY is discouraged.  Use http_proxy.
/usr/share/ruby/net/http.rb:1162: warning: The environment variable HTTP_PROXY is discouraged.  Use http_proxy.
/usr/share/ruby/net/http.rb:1162: warning: The environment variable HTTP_PROXY is discouraged.  Use http_proxy.
/usr/share/ruby/net/http.rb:1162: warning: The environment variable HTTP_PROXY is discouraged.  Use http_proxy.
/usr/share/ruby/net/http.rb:1162: warning: The environment variable HTTP_PROXY is discouraged.  Use http_proxy.
Installing crass 1.0.6
Installing builder 3.2.4
Installing erubi 1.12.0
Installing mini_portile2 2.6.1
Fetching rack 2.2.8
/usr/share/ruby/net/http.rb:1162: warning: The environment variable HTTP_PROXY is discouraged.  Use http_proxy.
Installing zeitwerk 2.6.12
Installing racc 1.7.3 with native extensions
Fetching nio4r 2.7.0
/usr/share/ruby/net/http.rb:1162: warning: The environment variable HTTP_PROXY is discouraged.  Use http_proxy.
Installing minitest 5.15.0
Installing concurrent-ruby 1.2.2
Fetching websocket-extensions 0.1.5
/usr/share/ruby/net/http.rb:1162: warning: The environment variable HTTP_PROXY is discouraged.  Use http_proxy.
Fetching marcel 1.0.2
/usr/share/ruby/net/http.rb:1162: warning: The environment variable HTTP_PROXY is discouraged.  Use http_proxy.
Installing websocket-extensions 0.1.5
Fetching mini_mime 1.1.2
/usr/share/ruby/net/http.rb:1162: warning: The environment variable HTTP_PROXY is discouraged.  Use http_proxy.
Fetching digest 3.1.1
Installing nio4r 2.7.0 with native extensions
/usr/share/ruby/net/http.rb:1162: warning: The environment variable HTTP_PROXY is discouraged.  Use http_proxy.
Installing rack 2.2.8
Fetching io-wait 0.3.1
/usr/share/ruby/net/http.rb:1162: warning: The environment variable HTTP_PROXY is discouraged.  Use http_proxy.
Installing mini_mime 1.1.2
Installing marcel 1.0.2
Installing digest 3.1.1 with native extensions
Fetching timeout 0.4.0
/usr/share/ruby/net/http.rb:1162: warning: The environment variable HTTP_PROXY is discouraged.  Use http_proxy.
Installing io-wait 0.3.1 with native extensions
Fetching strscan 3.0.7
/usr/share/ruby/net/http.rb:1162: warning: The environment variable HTTP_PROXY is discouraged.  Use http_proxy.
Installing timeout 0.4.0
Using bundler 2.3.7
Fetching coffee-script-source 1.12.2
/usr/share/ruby/net/http.rb:1162: warning: The environment variable HTTP_PROXY is discouraged.  Use http_proxy.
Fetching execjs 2.9.1
/usr/share/ruby/net/http.rb:1162: warning: The environment variable HTTP_PROXY is discouraged.  Use http_proxy.
Installing strscan 3.0.7 with native extensions
Fetching method_source 1.0.0
/usr/share/ruby/net/http.rb:1162: warning: The environment variable HTTP_PROXY is discouraged.  Use http_proxy.
Installing coffee-script-source 1.12.2
Fetching thor 1.2.2
/usr/share/ruby/net/http.rb:1162: warning: The environment variable HTTP_PROXY is discouraged.  Use http_proxy.
Installing execjs 2.9.1
Installing method_source 1.0.0
Fetching connection_pool 2.4.1
/usr/share/ruby/net/http.rb:1162: warning: The environment variable HTTP_PROXY is discouraged.  Use http_proxy.
Fetching ffi 1.16.3
/usr/share/ruby/net/http.rb:1162: warning: The environment variable HTTP_PROXY is discouraged.  Use http_proxy.
Installing thor 1.2.2
Installing connection_pool 2.4.1
Fetching rb-fsevent 0.11.2
/usr/share/ruby/net/http.rb:1162: warning: The environment variable HTTP_PROXY is discouraged.  Use http_proxy.
Fetching matrix 0.4.2
/usr/share/ruby/net/http.rb:1162: warning: The environment variable HTTP_PROXY is discouraged.  Use http_proxy.
Installing matrix 0.4.2
Installing rb-fsevent 0.11.2
Fetching pg 1.2.3
/usr/share/ruby/net/http.rb:1162: warning: The environment variable HTTP_PROXY is discouraged.  Use http_proxy.
Fetching tilt 2.3.0
/usr/share/ruby/net/http.rb:1162: warning: The environment variable HTTP_PROXY is discouraged.  Use http_proxy.
Fetching sqlite3 1.4.4
/usr/share/ruby/net/http.rb:1162: warning: The environment variable HTTP_PROXY is discouraged.  Use http_proxy.
Installing ffi 1.16.3 with native extensions
Installing tilt 2.3.0
Installing pg 1.2.3 with native extensions
Installing sqlite3 1.4.4 with native extensions
Fetching turbolinks-source 5.2.0
/usr/share/ruby/net/http.rb:1162: warning: The environment variable HTTP_PROXY is discouraged.  Use http_proxy.
Installing turbolinks-source 5.2.0
Fetching websocket-driver 0.7.6
/usr/share/ruby/net/http.rb:1162: warning: The environment variable HTTP_PROXY is discouraged.  Use http_proxy.
Installing websocket-driver 0.7.6 with native extensions
Fetching rack-test 2.1.0
/usr/share/ruby/net/http.rb:1162: warning: The environment variable HTTP_PROXY is discouraged.  Use http_proxy.
Installing rack-test 2.1.0
Fetching i18n 1.14.1
/usr/share/ruby/net/http.rb:1162: warning: The environment variable HTTP_PROXY is discouraged.  Use http_proxy.
Installing i18n 1.14.1
Fetching tzinfo 2.0.6
/usr/share/ruby/net/http.rb:1162: warning: The environment variable HTTP_PROXY is discouraged.  Use http_proxy.
Fetching sprockets 4.2.1
/usr/share/ruby/net/http.rb:1162: warning: The environment variable HTTP_PROXY is discouraged.  Use http_proxy.
Installing tzinfo 2.0.6
Installing sprockets 4.2.1
Fetching coffee-script 2.4.1
/usr/share/ruby/net/http.rb:1162: warning: The environment variable HTTP_PROXY is discouraged.  Use http_proxy.
Fetching uglifier 4.2.0
/usr/share/ruby/net/http.rb:1162: warning: The environment variable HTTP_PROXY is discouraged.  Use http_proxy.
Fetching redis-client 0.19.1
/usr/share/ruby/net/http.rb:1162: warning: The environment variable HTTP_PROXY is discouraged.  Use http_proxy.
Installing coffee-script 2.4.1
Fetching nokogiri 1.12.5
/usr/share/ruby/net/http.rb:1162: warning: The environment variable HTTP_PROXY is discouraged.  Use http_proxy.
Installing redis-client 0.19.1
Installing uglifier 4.2.0
Fetching turbolinks 5.2.1
/usr/share/ruby/net/http.rb:1162: warning: The environment variable HTTP_PROXY is discouraged.  Use http_proxy.
Using net-protocol 0.1.2
Fetching activesupport 6.1.7.6
/usr/share/ruby/net/http.rb:1162: warning: The environment variable HTTP_PROXY is discouraged.  Use http_proxy.
Installing turbolinks 5.2.1
Fetching redis 5.0.8
/usr/share/ruby/net/http.rb:1162: warning: The environment variable HTTP_PROXY is discouraged.  Use http_proxy.
Installing redis 5.0.8
Installing activesupport 6.1.7.6
Fetching net-pop 0.1.2
/usr/share/ruby/net/http.rb:1162: warning: The environment variable HTTP_PROXY is discouraged.  Use http_proxy.
Installing net-pop 0.1.2
Fetching globalid 1.2.1
/usr/share/ruby/net/http.rb:1162: warning: The environment variable HTTP_PROXY is discouraged.  Use http_proxy.
Fetching activemodel 6.1.7.6
/usr/share/ruby/net/http.rb:1162: warning: The environment variable HTTP_PROXY is discouraged.  Use http_proxy.
Installing nokogiri 1.12.5 with native extensions
Installing globalid 1.2.1
Fetching activejob 6.1.7.6
/usr/share/ruby/net/http.rb:1162: warning: The environment variable HTTP_PROXY is discouraged.  Use http_proxy.
Installing activemodel 6.1.7.6
Fetching activerecord 6.1.7.6
/usr/share/ruby/net/http.rb:1162: warning: The environment variable HTTP_PROXY is discouraged.  Use http_proxy.
Installing activejob 6.1.7.6
Installing activerecord 6.1.7.6
Fetching puma 6.4.0
/usr/share/ruby/net/http.rb:1162: warning: The environment variable HTTP_PROXY is discouraged.  Use http_proxy.
Installing puma 6.4.0 with native extensions
Fetching net-imap 0.2.2
Fetching net-smtp 0.3.0
/usr/share/ruby/net/http.rb:1162: warning: The environment variable HTTP_PROXY is discouraged.  Use http_proxy.
/usr/share/ruby/net/http.rb:1162: warning: The environment variable HTTP_PROXY is discouraged.  Use http_proxy.
Installing net-smtp 0.3.0
Installing net-imap 0.2.2
Fetching mail 2.8.1
/usr/share/ruby/net/http.rb:1162: warning: The environment variable HTTP_PROXY is discouraged.  Use http_proxy.
Installing mail 2.8.1
Fetching rb-inotify 0.10.1
Fetching sassc 2.4.0
/usr/share/ruby/net/http.rb:1162: warning: The environment variable HTTP_PROXY is discouraged.  Use http_proxy.
/usr/share/ruby/net/http.rb:1162: warning: The environment variable HTTP_PROXY is discouraged.  Use http_proxy.
Installing rb-inotify 0.10.1
Fetching listen 3.8.0
/usr/share/ruby/net/http.rb:1162: warning: The environment variable HTTP_PROXY is discouraged.  Use http_proxy.
Installing sassc 2.4.0 with native extensions
Installing listen 3.8.0
Fetching rails-dom-testing 2.2.0
/usr/share/ruby/net/http.rb:1162: warning: The environment variable HTTP_PROXY is discouraged.  Use http_proxy.
Fetching loofah 2.22.0
/usr/share/ruby/net/http.rb:1162: warning: The environment variable HTTP_PROXY is discouraged.  Use http_proxy.
Installing rails-dom-testing 2.2.0
Installing loofah 2.22.0
Fetching rails-html-sanitizer 1.5.0
/usr/share/ruby/net/http.rb:1162: warning: The environment variable HTTP_PROXY is discouraged.  Use http_proxy.
Installing rails-html-sanitizer 1.5.0
Fetching actionview 6.1.7.6
/usr/share/ruby/net/http.rb:1162: warning: The environment variable HTTP_PROXY is discouraged.  Use http_proxy.
Installing actionview 6.1.7.6
Fetching actionpack 6.1.7.6
Fetching jbuilder 2.11.5
/usr/share/ruby/net/http.rb:1162: warning: The environment variable HTTP_PROXY is discouraged.  Use http_proxy.
/usr/share/ruby/net/http.rb:1162: warning: The environment variable HTTP_PROXY is discouraged.  Use http_proxy.
Installing jbuilder 2.11.5
Installing actionpack 6.1.7.6
Fetching actioncable 6.1.7.6
Fetching actionmailer 6.1.7.6
Fetching sprockets-rails 3.4.2
Fetching activestorage 6.1.7.6
Fetching railties 6.1.7.6
/usr/share/ruby/net/http.rb:1162: warning: The environment variable HTTP_PROXY is discouraged.  Use http_proxy.
/usr/share/ruby/net/http.rb:1162: warning: The environment variable HTTP_PROXY is discouraged.  Use http_proxy.
/usr/share/ruby/net/http.rb:1162: warning: The environment variable HTTP_PROXY is discouraged.  Use http_proxy.
/usr/share/ruby/net/http.rb:1162: warning: The environment variable HTTP_PROXY is discouraged.  Use http_proxy.
/usr/share/ruby/net/http.rb:1162: warning: The environment variable HTTP_PROXY is discouraged.  Use http_proxy.
Installing sprockets-rails 3.4.2
Installing actionmailer 6.1.7.6
Installing activestorage 6.1.7.6
Installing actioncable 6.1.7.6
Fetching actionmailbox 6.1.7.6
Fetching actiontext 6.1.7.6
/usr/share/ruby/net/http.rb:1162: warning: The environment variable HTTP_PROXY is discouraged.  Use http_proxy.
/usr/share/ruby/net/http.rb:1162: warning: The environment variable HTTP_PROXY is discouraged.  Use http_proxy.
Installing railties 6.1.7.6
Installing actionmailbox 6.1.7.6
Installing actiontext 6.1.7.6
Fetching coffee-rails 5.0.0
Fetching rails 6.1.7.6
/usr/share/ruby/net/http.rb:1162: warning: The environment variable HTTP_PROXY is discouraged.  Use http_proxy.
/usr/share/ruby/net/http.rb:1162: warning: The environment variable HTTP_PROXY is discouraged.  Use http_proxy.
Installing coffee-rails 5.0.0
Installing rails 6.1.7.6
Fetching sassc-rails 2.1.2
/usr/share/ruby/net/http.rb:1162: warning: The environment variable HTTP_PROXY is discouraged.  Use http_proxy.
Installing sassc-rails 2.1.2
Fetching sass-rails 6.0.0
/usr/share/ruby/net/http.rb:1162: warning: The environment variable HTTP_PROXY is discouraged.  Use http_proxy.
Installing sass-rails 6.0.0
Bundle complete! 21 Gemfile dependencies, 73 gems now installed.
Gems in the groups 'development' and 'test' were not installed.
Bundled gems are installed into `./bundle`
---> Cleaning up unused ruby gems ...
Running `bundle clean --verbose` with bundler 2.3.7
Frozen, using resolution from the lockfile
---> No master key present in environment, generating ...
Adding config/master.key to store the encryption key: 0b988816d99ec7f3565283423cac5f4e

Save this in a password manager your team can access.

If you lose the key, no one, including you, can access anything encrypted with it.

      create  config/master.key

File encrypted and saved.
~
---> Installing application source ...
---> Building your Ruby application from source ...
---> Running 'bundle install --retry 2' ...
Using rake 13.1.0
Using concurrent-ruby 1.2.2
Using i18n 1.14.1
Using minitest 5.15.0
Using tzinfo 2.0.6
Using zeitwerk 2.6.12
Using activesupport 6.1.7.6
Using builder 3.2.4
Using erubi 1.12.0
Using mini_portile2 2.6.1
Using racc 1.7.3
Using nokogiri 1.12.5
Using rails-dom-testing 2.2.0
Using crass 1.0.6
Using loofah 2.22.0
Using rails-html-sanitizer 1.5.0
Using actionview 6.1.7.6
Using rack 2.2.8
Using rack-test 2.1.0
Using actionpack 6.1.7.6
Using nio4r 2.7.0
Using websocket-extensions 0.1.5
Using websocket-driver 0.7.6
Using actioncable 6.1.7.6
Using globalid 1.2.1
Using activejob 6.1.7.6
Using activemodel 6.1.7.6
Using activerecord 6.1.7.6
Using marcel 1.0.2
Using mini_mime 1.1.2
Using activestorage 6.1.7.6
Using digest 3.1.1
Using io-wait 0.3.1
Using timeout 0.4.0
Using net-protocol 0.1.2
Using strscan 3.0.7
Using net-imap 0.2.2
Using net-pop 0.1.2
Using net-smtp 0.3.0
Using mail 2.8.1
Using actionmailbox 6.1.7.6
Using actionmailer 6.1.7.6
Using actiontext 6.1.7.6
Using bundler 2.3.7
Using coffee-script-source 1.12.2
Using execjs 2.9.1
Using coffee-script 2.4.1
Using method_source 1.0.0
Using thor 1.2.2
Using railties 6.1.7.6
Using coffee-rails 5.0.0
Using connection_pool 2.4.1
Using ffi 1.16.3
Using jbuilder 2.11.5
Using rb-fsevent 0.11.2
Using rb-inotify 0.10.1
Using listen 3.8.0
Using matrix 0.4.2
Using pg 1.2.3
Using puma 6.4.0
Using sprockets 4.2.1
Using sprockets-rails 3.4.2
Using rails 6.1.7.6
Using redis-client 0.19.1
Using redis 5.0.8
Using sassc 2.4.0
Using tilt 2.3.0
Using sassc-rails 2.1.2
Using sass-rails 6.0.0
Using sqlite3 1.4.4
Using turbolinks-source 5.2.0
Using turbolinks 5.2.1
Using uglifier 4.2.0
Bundle complete! 21 Gemfile dependencies, 73 gems now installed.
Gems in the groups 'development' and 'test' were not installed.
Bundled gems are installed into `./bundle`
---> Cleaning up unused ruby gems ...
Running `bundle clean --verbose` with bundler 2.3.7
Frozen, using resolution from the lockfile
---> Starting asset compilation ...
I, [2024-01-16T13:06:18.906300 #10253]  INFO -- : Writing /opt/app-root/src/public/assets/manifest-dad05bf766af0fe3d79dd746db3c1361c0583026cdf35d6a2921bccaea835331.js
I, [2024-01-16T13:06:18.907151 #10253]  INFO -- : Writing /opt/app-root/src/public/assets/manifest-dad05bf766af0fe3d79dd746db3c1361c0583026cdf35d6a2921bccaea835331.js.gz
I, [2024-01-16T13:06:18.907331 #10253]  INFO -- : Writing /opt/app-root/src/public/assets/application-220737ee0c8b1a6764f5c9e9cedc63bc8269f273b020285effe037827266ff1a.js
I, [2024-01-16T13:06:18.908073 #10253]  INFO -- : Writing /opt/app-root/src/public/assets/application-220737ee0c8b1a6764f5c9e9cedc63bc8269f273b020285effe037827266ff1a.js.gz
I, [2024-01-16T13:06:18.908303 #10253]  INFO -- : Writing /opt/app-root/src/public/assets/articles-27cfb9694c5e92d25d972c2b4a2d2e222ad088aef866823f772241c1db423402.js
I, [2024-01-16T13:06:18.908951 #10253]  INFO -- : Writing /opt/app-root/src/public/assets/articles-27cfb9694c5e92d25d972c2b4a2d2e222ad088aef866823f772241c1db423402.js.gz
I, [2024-01-16T13:06:18.909099 #10253]  INFO -- : Writing /opt/app-root/src/public/assets/cable-405b9eaa96e229928daca399c41ed1672fe9b1eb4aea0bbe27306cf68f4f829e.js
I, [2024-01-16T13:06:18.909985 #10253]  INFO -- : Writing /opt/app-root/src/public/assets/cable-405b9eaa96e229928daca399c41ed1672fe9b1eb4aea0bbe27306cf68f4f829e.js.gz
I, [2024-01-16T13:06:18.910625 #10253]  INFO -- : Writing /opt/app-root/src/public/assets/comments-27cfb9694c5e92d25d972c2b4a2d2e222ad088aef866823f772241c1db423402.js
I, [2024-01-16T13:06:18.910787 #10253]  INFO -- : Writing /opt/app-root/src/public/assets/comments-27cfb9694c5e92d25d972c2b4a2d2e222ad088aef866823f772241c1db423402.js.gz
I, [2024-01-16T13:06:18.912235 #10253]  INFO -- : Writing /opt/app-root/src/public/assets/welcome-27cfb9694c5e92d25d972c2b4a2d2e222ad088aef866823f772241c1db423402.js
I, [2024-01-16T13:06:18.912534 #10253]  INFO -- : Writing /opt/app-root/src/public/assets/welcome-27cfb9694c5e92d25d972c2b4a2d2e222ad088aef866823f772241c1db423402.js.gz
I, [2024-01-16T13:06:18.913153 #10253]  INFO -- : Writing /opt/app-root/src/public/assets/application-30e2c46de053e7de3812037627d684e34d284d750d562538351e4629c5244306.css
I, [2024-01-16T13:06:18.913231 #10253]  INFO -- : Writing /opt/app-root/src/public/assets/application-30e2c46de053e7de3812037627d684e34d284d750d562538351e4629c5244306.css.gz
I, [2024-01-16T13:06:18.913530 #10253]  INFO -- : Writing /opt/app-root/src/public/assets/articles-04024382391bb910584145d8113cf35ef376b55d125bb4516cebeb14ce788597.css
I, [2024-01-16T13:06:18.913802 #10253]  INFO -- : Writing /opt/app-root/src/public/assets/articles-04024382391bb910584145d8113cf35ef376b55d125bb4516cebeb14ce788597.css.gz
I, [2024-01-16T13:06:18.913932 #10253]  INFO -- : Writing /opt/app-root/src/public/assets/comments-04024382391bb910584145d8113cf35ef376b55d125bb4516cebeb14ce788597.css
I, [2024-01-16T13:06:18.914051 #10253]  INFO -- : Writing /opt/app-root/src/public/assets/comments-04024382391bb910584145d8113cf35ef376b55d125bb4516cebeb14ce788597.css.gz
I, [2024-01-16T13:06:18.914132 #10253]  INFO -- : Writing /opt/app-root/src/public/assets/scaffolds-30e2c46de053e7de3812037627d684e34d284d750d562538351e4629c5244306.css
I, [2024-01-16T13:06:18.914188 #10253]  INFO -- : Writing /opt/app-root/src/public/assets/scaffolds-30e2c46de053e7de3812037627d684e34d284d750d562538351e4629c5244306.css.gz
I, [2024-01-16T13:06:18.914261 #10253]  INFO -- : Writing /opt/app-root/src/public/assets/welcome-04024382391bb910584145d8113cf35ef376b55d125bb4516cebeb14ce788597.css
I, [2024-01-16T13:06:18.914567 #10253]  INFO -- : Writing /opt/app-root/src/public/assets/welcome-04024382391bb910584145d8113cf35ef376b55d125bb4516cebeb14ce788597.css.gz
[1/3] STEP 10/10: CMD /usr/libexec/s2i/run
Getting image source signatures
Copying blob sha256:86426b9e591db2cdd8eba8085aa38b705422152b49960696308d988f33f3d741
Copying blob sha256:ed3888a8ac3ef81efe863a57700ec94aef8ea84de1f8bb80b7065f6fe6d33300
Copying blob sha256:d4a64153af37ff791798154a516026125224d6a16a5c27d1c5c6548569026d99
Copying blob sha256:077d233fd2c7a2ee467690f781c36709f763ee77189fa9d1afce53dd528bd29e
Copying blob sha256:952d535c89a228961f23c814064af02f5c1c4b4fa84d4702f3bd8bec44c67d69
Copying blob sha256:753a922c20eedf2959d59644ffd7fe367940caaef8916d9eb15c946e6399a059
Copying blob sha256:9d24b62b7e8377368cce7da225dafb4b8b5042557f13bbf4314c0e536933e197
Copying blob sha256:1bbb79699756d312cb2a70c5f6a2b87eef1a8d0ecbe2958a1c4e2ff1af1aa030
Copying config sha256:e1588bd82c29aefa93fbc62f7ec6fc72700d3825510aaa44110376d365fd5a52
Writing manifest to image destination
--> e1588bd82c29
[2/3] STEP 1/2: FROM e1588bd82c29aefa93fbc62f7ec6fc72700d3825510aaa44110376d365fd5a52
[2/3] STEP 2/2: RUN /bin/sh -ic 'bundle exec rake test'
sh: cannot set terminal process group (-1): Inappropriate ioctl for device
sh: no job control in this shell
Run options: --seed 40294

# Running:

.

Finished in 0.145536s, 6.8712 runs/s, 6.8712 assertions/s.
1 runs, 1 assertions, 0 failures, 0 errors, 0 skips
[3/3] STEP 1/1: FROM e1588bd82c29aefa93fbc62f7ec6fc72700d3825510aaa44110376d365fd5a52
[3/3] COMMIT temp.builder.openshift.io/sclorg-test-20714/rails-postgresql-example-1:2b4e7ddf
--> e1588bd82c29
Successfully tagged temp.builder.openshift.io/sclorg-test-20714/rails-postgresql-example-1:2b4e7ddf
e1588bd82c29aefa93fbc62f7ec6fc72700d3825510aaa44110376d365fd5a52

Pushing image image-registry.openshift-image-registry.svc:5000/sclorg-test-20714/rails-postgresql-example:latest ...
Getting image source signatures
Copying blob sha256:2a8df87989f5321716be1b8863523d3ee9d5b5324f33f0163bb054330f5fe758
Copying blob sha256:50ccdb01751aeb08fdb4bb077afe0f302149e1fb82242159e5787372a750d3c1
Copying blob sha256:c2650fe947f606317fadb11c65aae44ee7b8ebd7c245a639d3521ce7a8d4544f
Copying blob sha256:696f68f50a3c4b73bf17307463f440fa7da4780aca9ab78f4a4ffc6c0c978d74
Copying blob sha256:2e81a4fbe719bf7452c5a1dfc71d98c0c1d2daa567b7db50466b15f9448d88f9
Copying blob sha256:8ee5f1e863ab9d2a5c9741aa4954fd8be5fa515465efdc38cb4e15808b58010e
Copying blob sha256:ac0e01248de69227cd4fab0fa3cf5024af18872ca86eac77356d9b93129c0c7a
Copying blob sha256:1bbb79699756d312cb2a70c5f6a2b87eef1a8d0ecbe2958a1c4e2ff1af1aa030
Copying config sha256:e1588bd82c29aefa93fbc62f7ec6fc72700d3825510aaa44110376d365fd5a52
Writing manifest to image destination
Successfully pushed image-registry.openshift-image-registry.svc:5000/sclorg-test-20714/rails-postgresql-example@sha256:e072ca0d8f59331ab52d6633bbe0386cb5a90d9df94e852eb086094a14d85ee8
Push successful

The next running pod based on this build crashed with logs:

[1] Puma starting in cluster mode...
[1] * Puma version: 6.4.0 (ruby 3.1.2-p20) ("The Eagle of Durango")
[1] *  Min threads: 0
[1] *  Max threads: 16
[1] *  Environment: production
[1] *   Master PID: 1
[1] *      Workers: 2
[1] *     Restarts: (✔) hot (✔) phased
[1] * Listening on http://0.0.0.0:8080
[1] Use Ctrl-C to stop
[1] - Worker 0 (PID: 10) booted in 2.1s, phase: 0
[1] - Worker 1 (PID: 12) booted in 2.19s, phase: 0

Reproducer

No response

List of changes

Can you provide a summary of changes from a standard rails app?

While this example is useful for seeing how a rails app might work in openshift, it doesn't list all the changes that are needed for a standard rails app to work with the openshift template.

For me this has become problematic as converting my existing rails applications has become trial and error as I run into errors, then look to see how it was solved. This would have been easier if I had an initial list of things to change before I tried my app in openshift. Along the same lines, I have no way to know if there are problems I'm experiencing (but not noticing yet) that are already solved in this example.

Update to Rails 5.1

Rails 5.1 is out.

It uses yarn for javascript (optionally) , and also webpacker (optionally)

Current build breaks when using yarn and/or webpacker

Support Ruby 2.7

I get the following with 2.7:

@yselkowitz what command did you run, s2i build? Thanks for checking.

/opt/rh/rh-ruby27/root/usr/share/rubygems/rubygems.rb:275:in `find_spec_for_exe': Could not find 'bundler' (1.16.1) required by your /opt/app-root/src/Gemfile.lock. (Gem::GemNotFoundException)

Yes, this is caused by Ruby 2.7 switching to Bundler 2. Now it requires Gemfile.lock 'conversion'. Bundler 2 didn't bring any backward incompatible changes, but they may diverge further on, so they're not interchangable and thus require conversion.
https://bundler.io/blog/2019/01/03/announcing-bundler-2.html

IOW you can't have same Gemfile.lock for Ruby 2.7 and previous, unless we'll add bundle update --bundler for it's assemble, like it's advised.

Originally posted by @pvalena in #128 (comment)

Recommend Projects

  • React photo React

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

  • Vue.js photo Vue.js

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

  • Typescript photo Typescript

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

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

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

Recommend Topics

  • javascript

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

  • web

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

  • server

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

  • Machine learning

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

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

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

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.