Chef workstation on Windows

I know it isn’t the optimal setup, but in our organization we’re going to
have to have Windows as a good solution for a chef workstation (the nodes
themselves are going to be mostly linux).

I’ve followed the wiki page about setting up a windows workstation with
omnibus, etc, and I’ve got things to a place where I can run them, but it
is SO SLOW.

We’re talking 10-15 seconds just to run ‘knife help.’

Has anyone made any headway on getting things to run faster on Windows?

I understand that Ruby 2.0 has some huge fixes that make the gem loading
faster, but it looks like chef + ruby2 on Windows isn’t working yet
(win32-api gem isn’t working). Is there a roadmap anywhere to get to Ruby 2
support (especially on Windows)?

Thanks in advance,

Ben Bytheway

I don’t know much about running Chef on Windows, but I do know that there updates in recent releases to address slow behavior. What version of Chef are you using?

Thanks,
Matt Ray
Senior Technical Evangelist :: Opscodehttp://opscode.com
512.731.2218 :: matt@opscode.com
mattray :: GitHubhttp://github.com/mattray/ :: IRC :: Twitterhttp://twitter.com/mattray


From: Benjamin Bytheway
Sent: Wednesday, May 15, 2013 10:56 AM
To: chef@lists.opscode.com
Subject: [chef] Chef workstation on Windows

I know it isn’t the optimal setup, but in our organization we’re going to have to have Windows as a good solution for a chef workstation (the nodes themselves are going to be mostly linux).

I’ve followed the wiki page about setting up a windows workstation with omnibus, etc, and I’ve got things to a place where I can run them, but it is SO SLOW.

We’re talking 10-15 seconds just to run ‘knife help.’

Has anyone made any headway on getting things to run faster on Windows?

I understand that Ruby 2.0 has some huge fixes that make the gem loading faster, but it looks like chef + ruby2 on Windows isn’t working yet (win32-api gem isn’t working). Is there a roadmap anywhere to get to Ruby 2 support (especially on Windows)?

Thanks in advance,

Ben Bytheway

I understand that Ruby 2.0 has some huge fixes that make the gem loading faster, but it looks like chef + ruby2 on Windows isn't working yet (win32-api gem isn't working). Is there a roadmap anywhere to get to Ruby 2 support (especially on Windows)?
Many gems with C extensions pre-compile them on windows. Newish versions of ruby gems will show you this by default:

$ gem list win32-api -r
win32-api (1.4.8 ruby x86-mingw32, 1.4.6 x86-mswin32-60, 1.4.0 x86-mswin32-80, 1.0.4 mswin32)

If you gem fetch win32-api --platform x86-mingw32 and then gem unpack it, you can see that there's ruby ABI (binary interface) specific paths:

$ ls -1 lib/win32
api.rb
ruby18
ruby19

So, basically you need to track down the gem owners (see win32-api | RubyGems.org | your community gem host ) and convince them to make a new release with ruby 2.0 ABI extensions.

In the meantime, if you have compilers on your system, you can install these gems manually with gem install GEMNAME --platform ruby which will pull the gem that just has the C source and build the extensions on your box. If you go this route, I'd appreciate if you can let us know how it all works.

Thanks in advance,

Ben Bytheway
Thanks,

--
Daniel DeLeo

We're trying to get chef client omnibus 11.4.4 currently.

I've tried using the windows ruby installer + devkit and install chef from
gems. Installing win32-api from gems (--platform ruby to force a complie)
appears to work, but when you try to require it, ruby can't find it.

I did a manual install of the win32-api lib to site_ruby (not a gem) and it
looks like ruby can find it that way, and knife runs (and MUCH faster).

I'll have to keep digging and see why win32-api gem doesn't install
properly under 2.0.

On Wed, May 15, 2013 at 10:27 AM, Daniel DeLeo dan@kallistec.com wrote:

I understand that Ruby 2.0 has some huge fixes that make the gem loading
faster, but it looks like chef + ruby2 on Windows isn't working yet
(win32-api gem isn't working). Is there a roadmap anywhere to get to Ruby 2
support (especially on Windows)?

Many gems with C extensions pre-compile them on windows. Newish versions
of ruby gems will show you this by default:

$ gem list win32-api -r
win32-api (1.4.8 ruby x86-mingw32, 1.4.6 x86-mswin32-60, 1.4.0

x86-mswin32-80, 1.0.4 mswin32)

If you gem fetch win32-api --platform x86-mingw32 and then gem unpack
it, you can see that there's ruby ABI (binary interface) specific paths:

$ ls -1 lib/win32
api.rb
ruby18
ruby19

So, basically you need to track down the gem owners (see
win32-api | RubyGems.org | your community gem host ) and convince them to make a new
release with ruby 2.0 ABI extensions.

In the meantime, if you have compilers on your system, you can install
these gems manually with gem install GEMNAME --platform ruby which will
pull the gem that just has the C source and build the extensions on your
box. If you go this route, I'd appreciate if you can let us know how it all
works.

Thanks in advance,

Ben Bytheway

Thanks,

--
Daniel DeLeo

I'm in the exactly same situation (windows workstation and linux servers),
and bill's kitchen [0] is what works for me :slight_smile:

It gives you all you need for developing with chef on windows (e.g. ruby,
devkit, chef, vagrant, git, editor, etc..) in a portable zip file (no need
to install anything - just unpack and go). It has the additional benefit
that if you are working in a team it's easy to distribute/setup and
everyone uses the same environment (bye bye "it works on my machine").

It currently ships with Ruby 1.9.3.p392 which brings huge performance
improvements compared to previous 1.9.3 versions (probably on par with
2.0).

It's still on chef 10.x, but should be easy to update to chef 11 by editing
this Gemfile [1]. The other gems in there might need an update as well.
(note that this specific Gemfile is only used for installing a consistent
set of useful chef-related gems to the bill's kitchen ruby before it's
packaged into a zip file).

That being said, I'd definitely recommend to use project-specific Gemfiles
declaring only the gems that you really need in this project (or chef repo
or cookbook repo) and then use bundle exec.... This will reduce the load
path to the minimum required for your project and can makes a huge
difference - especially on windows.

HTH,
Torben

[0] GitHub - tknerr/bills-kitchen: All you need for cooking with Chef and Vagrant on Windows you will find in Bill's Kitchen
[1] https://github.com/tknerr/bills-kitchen/blob/master/files/Gemfile

On Wed, May 15, 2013 at 8:18 PM, Benjamin Bytheway bbytheway@gmail.comwrote:

We're trying to get chef client omnibus 11.4.4 currently.

I've tried using the windows ruby installer + devkit and install chef from
gems. Installing win32-api from gems (--platform ruby to force a complie)
appears to work, but when you try to require it, ruby can't find it.

I did a manual install of the win32-api lib to site_ruby (not a gem) and
it looks like ruby can find it that way, and knife runs (and MUCH faster).

I'll have to keep digging and see why win32-api gem doesn't install
properly under 2.0.

On Wed, May 15, 2013 at 10:27 AM, Daniel DeLeo dan@kallistec.com wrote:

I understand that Ruby 2.0 has some huge fixes that make the gem
loading faster, but it looks like chef + ruby2 on Windows isn't working yet
(win32-api gem isn't working). Is there a roadmap anywhere to get to Ruby 2
support (especially on Windows)?

Many gems with C extensions pre-compile them on windows. Newish versions
of ruby gems will show you this by default:

$ gem list win32-api -r
win32-api (1.4.8 ruby x86-mingw32, 1.4.6 x86-mswin32-60, 1.4.0

x86-mswin32-80, 1.0.4 mswin32)

If you gem fetch win32-api --platform x86-mingw32 and then gem unpack
it, you can see that there's ruby ABI (binary interface) specific paths:

$ ls -1 lib/win32
api.rb
ruby18
ruby19

So, basically you need to track down the gem owners (see
win32-api | RubyGems.org | your community gem host ) and convince them to make a new
release with ruby 2.0 ABI extensions.

In the meantime, if you have compilers on your system, you can install
these gems manually with gem install GEMNAME --platform ruby which will
pull the gem that just has the C source and build the extensions on your
box. If you go this route, I'd appreciate if you can let us know how it all
works.

Thanks in advance,

Ben Bytheway

Thanks,

--
Daniel DeLeo

Thanks for the pointer to bill's kitchen. That looks like a great
approach. My place needs something like this if we're going to get some
traction getting more than just my team writing cookbooks.

Thanks again,

Ben

On Wed, May 15, 2013 at 1:27 PM, Torben Knerr ukio@gmx.de wrote:

I'm in the exactly same situation (windows workstation and linux servers),
and bill's kitchen [0] is what works for me :slight_smile:

It gives you all you need for developing with chef on windows (e.g. ruby,
devkit, chef, vagrant, git, editor, etc..) in a portable zip file (no need
to install anything - just unpack and go). It has the additional benefit
that if you are working in a team it's easy to distribute/setup and
everyone uses the same environment (bye bye "it works on my machine").

It currently ships with Ruby 1.9.3.p392 which brings huge performance
improvements compared to previous 1.9.3 versions (probably on par with
2.0).

It's still on chef 10.x, but should be easy to update to chef 11 by
editing this Gemfile [1]. The other gems in there might need an update as
well. (note that this specific Gemfile is only used for installing a
consistent set of useful chef-related gems to the bill's kitchen ruby
before it's packaged into a zip file).

That being said, I'd definitely recommend to use project-specific Gemfiles
declaring only the gems that you really need in this project (or chef repo
or cookbook repo) and then use bundle exec.... This will reduce the load
path to the minimum required for your project and can makes a huge
difference - especially on windows.

HTH,
Torben

[0] GitHub - tknerr/bills-kitchen: All you need for cooking with Chef and Vagrant on Windows you will find in Bill's Kitchen
[1] https://github.com/tknerr/bills-kitchen/blob/master/files/Gemfile

On Wed, May 15, 2013 at 8:18 PM, Benjamin Bytheway bbytheway@gmail.comwrote:

We're trying to get chef client omnibus 11.4.4 currently.

I've tried using the windows ruby installer + devkit and install chef
from gems. Installing win32-api from gems (--platform ruby to force a
complie) appears to work, but when you try to require it, ruby can't find
it.

I did a manual install of the win32-api lib to site_ruby (not a gem) and
it looks like ruby can find it that way, and knife runs (and MUCH faster).

I'll have to keep digging and see why win32-api gem doesn't install
properly under 2.0.

On Wed, May 15, 2013 at 10:27 AM, Daniel DeLeo dan@kallistec.com wrote:

I understand that Ruby 2.0 has some huge fixes that make the gem
loading faster, but it looks like chef + ruby2 on Windows isn't working yet
(win32-api gem isn't working). Is there a roadmap anywhere to get to Ruby 2
support (especially on Windows)?

Many gems with C extensions pre-compile them on windows. Newish versions
of ruby gems will show you this by default:

$ gem list win32-api -r
win32-api (1.4.8 ruby x86-mingw32, 1.4.6 x86-mswin32-60, 1.4.0

x86-mswin32-80, 1.0.4 mswin32)

If you gem fetch win32-api --platform x86-mingw32 and then gem unpack it, you can see that there's ruby ABI (binary interface) specific
paths:

$ ls -1 lib/win32
api.rb
ruby18
ruby19

So, basically you need to track down the gem owners (see
win32-api | RubyGems.org | your community gem host ) and convince them to make a new
release with ruby 2.0 ABI extensions.

In the meantime, if you have compilers on your system, you can install
these gems manually with gem install GEMNAME --platform ruby which will
pull the gem that just has the C source and build the extensions on your
box. If you go this route, I'd appreciate if you can let us know how it all
works.

Thanks in advance,

Ben Bytheway

Thanks,

--
Daniel DeLeo