RFE: include dalli gem in ondemand bundle

We have some apps that do some very slow lookups to external resources, and we currenlty cache them using memcache, but adding the dalli gem that is required for memcache support is always a pain.
Is it possible that the dalli gem is part of the ondemand gems bundle? (we only need it for the dashboard app)

Many thanks

stijn

What is the process you currently use to add the dalli gem for your particular apps?

hello,

we currently use the rh-ruby25 gem to install the bundle, and then copy the content of the gems lib to a generic ruby search path (but not a default gem install path).

the issue likely is that the bundle (or the way bundler works, not sure and not a ruby expert) restricts all possible gem paths that are searched (i strace’d passenger to find a path that was searched by default to place the rb files in)

we might package it up, but even if there was a rpm from eg. scl with the gem, it wouldn’t be discovered anyway

stijn

Oh I see, you want the dalli gem:

  1. installed to be accessible to rh-ruby25
  2. added as a dependency to the dashboard app

So you can use dalli in a batch connect/interactive app plugin?

The OnDemand SCL has this logic when you do scl enable ondemand:

for dir in /opt/ood/ondemand/root/usr/share/gems/2.5/apps/* ; do
  export GEM_PATH="${dir}:${GEM_PATH}"
done

The OnDemand RPM building environment makes it possible for apps to “know” about this special GEM_PATH at build time. A good example is the OSC systemstatus app spec file: osc-systemstatus/ondemand-systemstatus.spec at master · OSC/osc-systemstatus · GitHub

The app name used in GEM_PATH doesn’t have to match an actual app, it just has to be something our bash logic can see and load into GEM_PATH.

We could probably add this as a gem to be available in future release. Until then, here is an alternative approach. You can modify /var/www/ood/apps/dashboard/Gemfile to include this line:

gem 'dalli'

And then in that directory you can run this command:

scl enable ondemand -- bin/bundle install --path vendor/bundle

This will reinstall a copy of all the gems to the dashboard app’s local vendor/bundle directory and then drop a .bundle/config file that stores the path to where those gems are located.

@efranz my apologies for being so unclear, but yes that is what i want to do.

thanks for the explanation. i tried adding it with bundle, but i failed to come up with the required magic :wink:

but thanks for the explanation

i am only hoping this can become part of the 2.X releases; i don’t need anything for current or older releases.

thanks for the explanation and considering it!

stijn