Beefy Boxes and Bandwidth Generously Provided by pair Networks
The stupid question is the question not asked
 
PerlMonks  

Re: speeding up web development

by dragonchild (Archbishop)
on Jun 24, 2008 at 13:57 UTC ( #693740=note: print w/replies, xml ) Need Help??


in reply to speeding up web development

With regards to deployment, this is what I have done in the past. Everything here is scripted and it's expected that the script will run from the box being deployed TO.
  1. There is a directory that everything is deployed to. Call it /prod. Everything happens here.
  2. There are two subdirectories - /environment and /application.
  3. /environment is the environment in which /application runs. Within it are subdirectories that have a unique name. I use the timestamp of creation in YYYYMMDDHHMISS form. You can do whatever.
  4. Within each subdirectory is a complete environment. A copy of Perl, all modules, and everything else you'd depend on /usr/bin/perl to provide. If you're paranoid enough, it should also contain its own copies of the various libraries, like libz, libjpeg, libpng, etc. You build one of these every time the environment changes.
  5. /application is the actual application deployment. Within it are subdirectories that have a unique name. I'd the same scheme as for /environment. There is also a current softlink that points to the current deployment.
  6. When you deploy the application, you hardcode the environment that this specific deployment uses. Once it's deployed AND TESTED, you flip the current softlink over to it and restart the application (bounce Apache, etc).

This system, as complicated as it sounds, was designed with the following in mind:

  • You never touch the system perl. Ever.
  • If something goes wrong with anything, you can rollback to last known good. This includes bad CPAN modules.
  • You know exactly when things were deployed and how.
  • You know every single dependency.
  • You can build on one machine and, if your machines are homogenous, rsync the others.
  • You can even deploy this over NFS.

My criteria for good software:
  1. Does it work?
  2. Can someone else come in, make a change, and be reasonably certain no bugs were introduced?

Replies are listed 'Best First'.
Re^2: speeding up web development
by zby (Vicar) on Jun 24, 2008 at 18:30 UTC
    This is a great plan! If you ever decided to publish the scripts supporting it - then please pass me a note :)

      Better yet, why not collaborate on getting it published? Maybe refine it for public use on the way if necessary?

      meh.
      Perl::Install is 2/3 of the heavy lifting.

      My criteria for good software:
      1. Does it work?
      2. Can someone else come in, make a change, and be reasonably certain no bugs were introduced?
Re^2: speeding up web development
by stonecolddevin (Parson) on Jun 25, 2008 at 03:50 UTC

    That's certainly thorough.

    May i ask what the point of rebuilding everything in the environment directory? Unless I'm being naive I see another layer of possible error there. Please, enlighten me if I'm mistaken though, this looks like a promising method!

    meh.
      First off, you only update the environment when there's an change to the environment. For example, if a module's required version goes up. Or, if you now need a new module. Or, and this is kinda weird until you think about it, you no longer need a module. As for why, there are several reasons.
      • To make sure that each environment version is completely self-contained.
      • To make sure that each environment version is correctly built against itself.

      But, the most important reason is that you have a "last known good" to fall back to when something breaks. This means that you don't alter an environment after it's been deployed against. Otherwise, you don't have anything stable.


      My criteria for good software:
      1. Does it work?
      2. Can someone else come in, make a change, and be reasonably certain no bugs were introduced?

        Aha.

        That makes a good deal more sense to me now :-)

        Update one thing, update them all for consistency. Makes things simple!

        meh.

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://693740]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others chanting in the Monastery: (4)
As of 2019-12-13 20:34 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found

    Notices?