punkish has asked for the wisdom of the Perl Monks concerning the following question:

Monks,

A few years ago the bloke from Morgan Stanley gave a presentation at OSCON titled, IIRC, "One Perl to Rule Them All." The idea was that he had (he was the Perl/IT manager for the company) one canonical version of Perl that his company's developer's world wide used as *the* version for their development. That way, everyone was working off of the same basic code base quality checked at one point of inspection.

Well, I want to find out how to implement something like that on a drastically smaller scale. I have a small network of 7-9 machines on a very fast local network. I would like *all* production level stuff to be served from one app per machine (MySQL on computer, PostgreSql on another, ArcGIS on yet another... similarly, production level Perl/PHP/Pyhon/Ruby/Java on one including all the CPAN packages, etc.). Similarly, only one production web server that can serve both cgi scripts as well as mod_perl.

Of course, any remaining machines would be available for tinkering, so I can install the latest, bleading edge Perl module or Perl 5.1.11, and not bring the house down.

How do I go about implementing something like this? Esp., how do I create one Perl snapshot that all other applications on all other machines including the web server can take advantage of? I would like even PostgreSql's PL/Perl to be built off of this production quality Perl.

Guide me monks. Lead me to the light. I am assuming once I know the Perl way, I can probably apply it to Python/PHP etc. as well.

--

when small people start casting long shadows, it is time to go to bed

Replies are listed 'Best First'.
Re: One Perl to Rule Them All
by NetWallah (Canon) on Mar 14, 2008 at 15:35 UTC
    You will probably get several implementation ideas - here is one:

    Base this on a change-management system (or version control system), such as CVS, git, Clearcase, or subversion.

    Check-in the "canonical" version of perl, then LABEL that version as "canonical".

    From that point, each machine checks-out a daily snapshot of the "canonical" branch.

    This allows you to change what you think of as "canonical" - after testing the new version, of course. It also lets you revert, in the event that waste matter impacts the rotating ventilator.

         "As you get older three things happen. The first is your memory goes, and I can't remember the other two... " - Sir Norman Wisdom

Re: One Perl to Rule Them All
by moritz (Cardinal) on Mar 14, 2008 at 15:25 UTC

    Install the same Unix or Linux distribution (let's say Debian) on all production, and use their binary packages.

    You can assume that they are tested, and if you find bugs you can still maintain your local patches and build binary packages with them.

    On one of the machines you can keep a mirror with Debian packages, and update all production machines from that server.

    That way you can ensure that they all share the same version of each package, with minimal effort.

    You can install CPAN packages to a separate directory that you export via NFS (or another network filesystem).

    The only thing that won't work well is to use a very different version of perl (say 5.10.0) than your OS uses (5.8.8 on Debian Etch).

      For "very different" versions of Perl, it's easily possible to install these completely separate from the system Perl by manually compiling them and making them use /opt/perl instead of /usr/bin/perl. Invocation of the correct Perl for a script is then done either through a symlink or through the hashbang line.

Re: One Perl to Rule Them All
by Akoya (Scribe) on Mar 14, 2008 at 15:44 UTC

    Two options ...

    • Install perl and all approved modules on one of the servers, then build a bundle of all installed modules. Install the same version of perl, along with the bundle on all the other servers.
    • Install perl and all approved modules on a filesystem shared by all of the servers. This is not a good idea, because it is a single point of failure, but it would work.

      ... and a third:

      • Install perl and all approved modules on one of the servers, then rdist and/or rsync to the others.

      -derby
      Your second suggestion, correctly pointing out a single point of failure, is the only suggestion here that actually answers the question, since the OP specified he doesn't just want one version installed on each host, he wants every host to point to one particular installation on one of the hosts; i.e. all but one use a non-local perl.

      Which will definitely rule out disparate versions.

Re: One Perl to Rule Them All
by punkish (Priest) on Mar 17, 2008 at 13:54 UTC
    Thanks everyone who responded. I still don't have a firm idea of how I want to accomplish this, but now I do have a pool of choices in front of me based on your suggestions.

    Here is an image to better illustrate what I was looking for
    http://punkish.eidesis.org/images/docs/plan.gif
    Sorry, I don't think I can embed an image in either a post or even in my scratchpad... Perlmonks should really consider joining the modern web by allowing links to external images.

    Ideally, the network mount of /usr/local/ from one master machine to other machines seems like the best way. There is one possibly hitch in this -- while most machines are Intel, there is at least one that is an AMD Opteron 64 bit, so XS modules might have to be compiled for it specifically. In fact, even Perl may have to be compiled for it specifically. I could be totally wrong in this, because I don't know XS from my ass, but then, something to worry about.

    Other than the possible recompile hitch based on different chip types, the other way is to make one master repo, and then rsync to other machines. That way, one doesn't have to depend upon the network mount during production, although, this is one reliable and ultra-fast network. All fiber on the LAN.

    Basically, the idea is to not only save on the extra work required to recompile and install everything on every machine, but also to ensure that every machine has exactly the same base config at all times.

    Thanks monks.

    --

    when small people start casting long shadows, it is time to go to bed
Re: One Perl to Rule Them All
by jdoege (Acolyte) on Mar 15, 2008 at 20:18 UTC
    I suppose you could simply make a /usr/dist/bin or some such on a file server and make that a remote mount that every machine mounts, thereby causing them all to use the same binaries.