The language-puppet website.

Work with your manifests!

Hruby Package Released

I finally released the hruby package, along with an updated version of the language-puppet package. It is very unfortunate this package will never get proper haddocks on Hackage, as the documentation is quite useful. If someone has a suggestion for getting haddocks without having the ruby1.8 library installed, I am interested. Also the path to the Ruby include files is hardcoded, meaning it might require manual tweaking to get it right.

Both libraries now have build flags :

  • Hruby has a flag for ruby1.9. This flag is mostly cosmetic as I didn’t even test it, and just copied the files for ruby1.8.
  • Language-puppet now has a -fhruby option, to build with this library.

The immediate result is a two-fold speed increase for single runs of puppetresource, and a six-time speed-up for scripts computing several catalogs. The reason is that the parser is not too fast, but its results get cached. Also, the language-puppet daemon infrastructure still let you define the number of threads that should be spawned to compute templates. This should be set to 1. The ruby interpreter cannot be used in a thread-safe way.

There are still several issues to address. The first is related to the multiple variable assignment problem. In Puppet all variables are immutable, and can’t be reassigned. Well, except when overwriting variables belonging to an inherited class. I wish they never introduced inheritance, as it introduces all kind of special rules, and seems generally fragile. Moreover, given how I (have not) implemented scopes, it is not trivial to have a robust way to check if the overwrite is valid or not.

The second most important issue is the fact that the dependency system isn’t working as it should be. I still get dependency loops in Puppet that are not catched by language-puppet. This is a show-stopper, and must be fixed soon. It is however a big challenge.

Finally, as language-puppet is Linux only for now, I would like to start using the inotify feature. The current caching mechanism works by issuing stat system calls on all files that might have changed. Inotify would greatly reduce the number of system calls, which is always a good thing. I am not sure this would lead to a big speed increase however.

Comments