Beefy Boxes and Bandwidth Generously Provided by pair Networks
No such thing as a small change
 
PerlMonks  

Seek ideas for hosting a sandbox on production server . . .

by hesco (Deacon)
on Jun 02, 2009 at 17:08 UTC ( [id://767682]=perlquestion: print w/replies, xml ) Need Help??

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

Hey folks:

I'm in the midst of a new product launch 'on the cheap'. I just turned beta over to the stress-testers. Next I need to set up a sandbox where development on the next version can continue.

Problem is, beta is kept up to speed with a make; sudo make install and my sandbox will, for economic reasons, have to live on the same server as the production version, currently beta.

Obviously, I ought to set up a parrallel set of configuration files, templates and logs for the sandbox.

But if in my sandbox, I use a use lib qw( path/to/sandbox/lib ); in my sandbox scripts, what else might I need to do to ensure that my sandbox reads ONLY my sandbox code and doesn't go poking around the site libraries for the modules under development? I only want to separate out the code I'm writing and would prefer that the dependencies be accessible in the site libraries without having to reproduce all of those in a parrallel installation.

All ideas are appreciated.

-- Hugh

UPDATE:

Thanks, perrin, but that actually was not my concern. I was more interested in preventing dev.myapp.com loading the code available in the site libraries on the server instead of the dev/lib branch where the unstable stuff is being tested.

If I did a sudo make install, won't @INC give preference to the site libraries over anything I might offer in my development tree? How do I let it find DBI, etc. in the site libraries and My::App at sandbox/My-App/lib ???

perldoc says: "It is typically used to add extra directories to perl's search path so that later use or require statements will find modules which are not located on perl's default search path."

My question is this: what if those modules ARE available on perl's default search path? If so, how do I control the precedence in which the options are considered?

I assume that the @INC array is walked until the requested module is found. If that is correct, does use lib '/path/to/my/sandbox/lib'; append or prepend the new path to the array?

if( $lal && $lol ) { $life++; }

Replies are listed 'Best First'.
Re: Seek ideas for hosting a sandbox on production server . . .
by almut (Canon) on Jun 02, 2009 at 22:42 UTC
    does use lib '/path/to/my/sandbox/lib'; append or prepend

    It always prepends. So any stuff found in those extra directories won't be loaded from the default library directories.

    It's in the docs, btw — one paragraph further down to the one you quoted :)

    Adding directories to @INC The parameters to "use lib" are added to the start of the perl +search path. Saying use lib LIST; is almost the same as saying BEGIN { unshift(@INC, LIST) }
Re: Seek ideas for hosting a sandbox on production server . . .
by perrin (Chancellor) on Jun 02, 2009 at 17:56 UTC
    You really should do the parallel installation to be safe, since you're likely to need different versions of the same CPAN module someday. However, in the meantime, if your code lives on a path that can only be found by adding it to @INC with a use lib then you shouldn't need to worry about the dev version accidentally loading that code.
Re: Seek ideas for hosting a sandbox on production server . . .
by John M. Dlugosz (Monsignor) on Jun 04, 2009 at 20:34 UTC
    Use a virtual machine. I've done this: start with a clone of the server, and run it locally on my lan (changing the IP address). Make changes and test. Then use unison to synchronize the changes with the real server.

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: perlquestion [id://767682]
Front-paged by Arunbear
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others sharing their wisdom with the Monastery: (5)
As of 2024-03-28 13:17 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found