Experimenting more with Ruby based Sensu assets that make use of bundler/inline


I’m starting to look more closely at using bundler/inline for Ruby assets and I’m looking for feedback from users concerning whether its useful or not.

The Problem

So here’s the problem I’m trying to solve. I want to give users who want to use the ruby bases Sensu assets more flexibility to be able to run them in environments where we don’t provide a ruby runtime support asset. It’s difficult to keep up with every possible variation of linux in the wild and provide a matching ruby environment. And bundler/inline might be able to provide a way forward for users with workloads where we can’t provide a Ruby runtime.

Possible solution: bundler/inline

Basically, bundler/inline installs the required gems dependencies in a just in time fashion on first run of the ruby script. It’s a like doing gem install automatically right when you want to run the ruby script so you don’t have the prep your environment. Downside to that is first run of the command is gonna take a little longer while the gems are installing. Trade-offs.

Impact on users making use of the Sensu ruby runtime

For users who are able to make use of the Sensu provided ruby runtime, this shouldn’t change much of anything. For assets with bundler/inline enabled, the wrapper scripts will use environment variables to determine if and when the just in time dependency installation will be enabled. Users who need to use a custom ruby environment can set some envvars in their Sensu checks or handlers and enable just in time ruby gem installation on first run of the command.

Impact for users who need custom ruby env

These are the users who would really benefit! If you’d like to use assets, but you can’t currently use the ruby runtime we provide, then you definitely want to hear from you. Is there anybody out there already doing this? Is there anybody out there who needs to do this? Having someone already in a position to do some real world testing would be a great contribution to ensure the basic workflow is right.

Users with custom ruby environments will most likely need to provide some supplemental build environment packages for native C library requirements buried in the gem dependencies, but if you are prepping a custom ruby environment, you probably already have to deal with that.

Stay tuned for more

I’m putting together some experimental check plugin assets now. I’ll report back with I have the first testable releases up.