[chef-dev] Re: Re: Re: 4/30 Opscode Code Review


Chronological Thread 
  • From: Daniel DeLeo < >
  • To: Bryan Berry < >
  • Cc: Ketan Padegaonkar < >, Bryan McLellan < >,
  • Subject: [chef-dev] Re: Re: Re: 4/30 Opscode Code Review
  • Date: Tue, 1 May 2012 09:00:19 -0700



On Monday, April 30, 2012 at 10:38 PM, Bryan Berry wrote:

> big, big +1 for better support on jruby, though I have no idea of the 
> technical challenges
> 
> On Tue, May 1, 2012 at 6:13 AM, Ketan Padegaonkar 
> <
>  
> (mailto: )>
>  wrote:
> > 
> > 
> > On Tue, May 1, 2012 at 4:49 AM, Bryan McLellan 
> > <
> >  
> > (mailto: )>
> >  wrote:
> > > OHAI-274 - Support Ohai on JRuby
> > > Reopened - The JRuby road is arduous, how do we feel about this?
> > 
> > 
> > Sorry, I'm new to this list. I'm curious what's the hiccups with Ohai on 
> > JRuby (apart from fork). I'd be very interested in making chef(client and 
> > server) run on top of JRuby since it makes for easy deployment.

We're unlikely to support older JRuby (before C ext support); since we don't 
support JRuby at all now, it's easier for us to assume newer JRuby as support 
gets added. This comes up with ohai because we switched ohai to use the 
yajl-ruby gem, which uses the yajl C library. We'd also like to switch Chef 
to using yajl, but we need to refactor our HTTP API code to make this work, 
which is why we haven't done it yet.

The only obvious remaining challenge is for Chef and ohai to shell out in a 
way compatible with JRuby. We're in the midst of moving all shell usage in 
ohai and Chef to use mixlib-shellout, so your best bet would be to add JRuby 
support there:

* Ruby 1.9 has Process.spawn, which on MRI provides all of the features that 
mixlib-shellout requires. Unfortunately, most of these options, such as 
setting the working directory of the spawned process, are ignored in JRuby's 
implementation. If you have the Java chops to fix this, that would be a huge 
benefit for all JRuby users.

* You could add a Java backend for mixlib-shellout; your best bet is probably 
to use the Java ProcessBuilder API via JRuby's Java bridge.

* The posix-spawn gem supports all of the features we need and works on 
JRuby, so you could write a posix-spawn backend for mixlib-shellout. The 
downside here is that we'd have an "optional" gem which would actually be 
required for JRuby, but we could create jruby platform gems to work around 
this.
 

> > 
> > 
> > - Ketan 

--
Dan DeLeo





  • [chef-dev] Re: Re: Re: 4/30 Opscode Code Review, Daniel DeLeo, 05/01/2012

Archive powered by MHonArc 2.6.16.

§