Bug 2058266
| Summary: | [sig-devex][Feature:ImageEcosystem][ruby][Slow] hot deploy for openshift ruby image Rails example should work with hot deploy | ||
|---|---|---|---|
| Product: | OpenShift Container Platform | Reporter: | Surender Yadav <suryadav> |
| Component: | Samples | Assignee: | David Peraza <dperaza> |
| Status: | CLOSED CURRENTRELEASE | QA Contact: | Jitendar Singh <jitsingh> |
| Severity: | medium | Docs Contact: | |
| Priority: | unspecified | ||
| Version: | 4.10 | CC: | aos-bugs, dgoodwin, dmistry, dperaza, jar.prokop, jprokop, pvalena, yselkowi |
| Target Milestone: | --- | ||
| Target Release: | --- | ||
| Hardware: | s390x | ||
| OS: | Linux | ||
| Whiteboard: | |||
| Fixed In Version: | Doc Type: | If docs needed, set a value | |
| Doc Text: | Story Points: | --- | |
| Clone Of: | Environment: | ||
| Last Closed: | 2022-03-01 17:09:18 UTC | Type: | Bug |
| Regression: | --- | Mount Type: | --- |
| Documentation: | --- | CRM: | |
| Verified Versions: | Category: | --- | |
| oVirt Team: | --- | RHEL 7.3 requirements from Atomic Host: | |
| Cloudforms Team: | --- | Target Upstream Version: | |
| Embargoed: | |||
|
Description
Surender Yadav
2022-02-24 15:39:18 UTC
This is caused by an apparent incompatibility between https://github.com/sclorg/rails-ex/pull/134 with Ruby <2.7. In order to be compatible with recent Rails versions, the s2i assemble script now generates a master key when none is present. That is done by calling a rake command, but ruby-26's rake is apparently too old: $ s2i build https://github.com/sclorg/rails-ex registry.redhat.io/ubi8/ruby-26 rails-ex:2.6 [snip] ---> 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) [snip] ---> Starting asset compilation ... rake aborted! ArgumentError: Missing `secret_key_base` for 'production' environment, set this string with `bin/rails credentials:edit` One workaround would be to update the rails templates to ruby:2.7-ubi8, but ideally the repo should work with all supported ruby versions. I was going to investigate this but got pulled off to higher priority items. Pavel, Jaroslav, could you PTAL? Firstly, we've run multiple tests, and it also works for openshift tests on s2i-ruby-container. Please verify if the tests on s2i-ruby-container cover your use-case. This is related to regenerating the secret key change. The true error occures before this in the log (please attach full logs; it's impossible to be found in the links you've added). https://github.com/sclorg/rails-ex/issues/146 (In reply to Yaakov Selkowitz from comment #1) > This is caused by an apparent incompatibility between > https://github.com/sclorg/rails-ex/pull/134 with Ruby <2.7. In order to be > compatible with recent Rails versions, the s2i assemble script now generates > a master key when none is present. That is done by calling a rake command, > but ruby-26's rake is apparently too old: > FTR I don't think it's true. The issue is that it fails to install to the requested (default) location. Please note that running rails-ex manually in the container with rails-ex app still works: ### + bundle install --path vendor 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 Installing rake 13.0.3 Fetching concurrent-ruby 1.1.8 Installing concurrent-ruby 1.1.8 Fetching i18n 1.8.10 Installing i18n 1.8.10 Fetching minitest 5.14.4 [ . . . ] ### rake just happens to be first to be installed (whole installation fails). So this is just probably dependent on the environment (or the 'vendor' destination is not writable?). https://gist.github.com/bd150d499d6c5e462e29dec1e1a15233 The issue is in the old bundler, namely the older syntax command of `bundle config` for entering the key-value pairs for configuration. In short, it thought that "set" is a key and not a command as is the case with newer bundler. This PR[0] uses the older syntax instead, which seems backward compatible with the newer bundler that comes with Ruby 2.7 and 3.0. I have included example commands in the PR as well as the logs of s2i build for Ruby 2.6, 2.7, and 3.0. [0] https://github.com/sclorg/rails-ex/pull/147 We're getting successful image-eco runs again, so looks like that fixed it. Thanks for your help with this! |