voxpupuli / container-puppetdb

Container image for PuppetDB
Apache License 2.0
9 stars 10 forks source link

Pod fails when deploying on Red Hat Openshift #60

Open bschonec opened 3 months ago

bschonec commented 3 months ago

In Red Hat Openshift 4.1, the puppetdb pod crashes after a successful build.

Steps I used to produce:

  1. Created OpenShift project
  2. As the Developer user, click Add then "Git Repository/Import from Git"
  3. In the "Git Repo Url", enter https://github.com/voxpupuli/container-puppetdb.git (The Ruby 3.1 (UBI 8) Builder image is selected automatically.)
  4. Click Create

After Build completes successfully, but the Pod continuously crashes with the following error:

You might consider adding 'puma' into your Gemfile.
ERROR: Rubygem Rack is not installed in the present image.
       Add rack to your Gemfile in order to start the web server.

I'm a novice at Openshift so I don't have much else to provide. I know next to nothing about Ruby but perhaps the Gemfile or Rakefile need to be updated to include the Rack gem?

rwaffen commented 3 months ago

I'll take a look at this.

rwaffen commented 3 months ago

sry, we have no openshift knwoledge atm. but as far as i understand you try to build the container yourself from this repository?

we kindly recommend using the pre-builded images we provide on ghcr and docker hub.

we have version tags like 8.3.0-v1.3.0 or up2date builds on push with 8.3.0-main. same goes for the 7 release of puppetdb.

bschonec commented 3 months ago

@rwaffen, thank you for your attention to this. The pre-built image doesn't work, either probably because of OpenShift's requirement that pods run as a non-root, random-ish UID. I'm working on a fix for that as well, but my OS knowledge is lacking.

I got past these errors by adding puma and rack to the Gemfile but I don't know how that affects builds on non-OpenShift platforms. Is there a way in the Gemfile to do something like:

if $BUILDENVIRONMENT = 'OPENSHIFT' then
  include gem rack
  include gem puma
end

??

rwaffen commented 1 month ago

sry for late reply:

you could try

# add a gem when env var test is set to true
gem 'rspec', '~> 3.0' if ENV['test'] == 'true'