Hi,
I'm relatively new to the whole paradigm of having a constantly running core image so this question may come of as a little dumb. So please forgive me if I do.
I was wondering what is the generally accepted best method of deployment for hunchentoot websites? (ie. how would one go about moving it from staging/testing server to the live/primary server?)
I'm used to working in the LAMP environment where it's just copying the needed files -- and I've been doing the same thing in the same fashion - except instead of files it's functions being transfered via swank...
But there's got to be a better way! I'm running into problems where I'm forgetting to update a function. (I'm also a tad bit of a neat freak and don't like having abandoned/orphaned functions lying around that do nothing).
Any suggestions? How are you guys managing deployment of your software? I look forward to what you guys have to say.
Thanks, - Micheal Frai
_________________________________________________________________ See what youre getting into before you go there http://newlivehotmail.com/?ocid=TXT_TAGHM_migration_HM_viral_preview_0507
I'm used to working in the LAMP environment where it's just copying the needed files
You can still copy the files over. However, I prefer to use source control to sync up the files instead of using scp/ftp, etc.
and I've been doing the same thing in the same fashion - except instead of files it's functions being transfered via swank...
Assuming that you are using asdf for your project, you can just type ,load-system in slime REPL to reload your modified files.
I usually have gnu screen running and dedicate one terminal for my lisp's REPL (not slime).
When I need slime (for debugging), I just type (swank:CREATE-SERVER) and then I can connect from emacs.
HTH, -- Mac
I've been using darcs to "push" the new files to the server. Then I ssh to the server and make a new core image, with a script like this (sbcl):
(asdf:oos 'asdf:load-op 'swank) (asdf:oos 'asdf:load-op :pettomato)
(defun my-toplevel() ;; start swank (setf swank:*use-dedicated-output-stream* nil) (setf swank:*communication-style* :fd-handler) (swank:create-server :dont-close t)
;; start hunchentoot (pettomato:start)
;; start a repl (sb-impl::toplevel-repl nil))
(sb-ext:save-lisp-and-die "pettomato.core" :toplevel #'my-toplevel)
"pettomato" is the name of my website package.
Then I kill the previously running image, and start a new one running in a screen session with this script:
#!/bin/sh screen -dmS pettomato-site sbcl --core /home/astro/bin/pettomato.core --noinform
The main reason that I do it this way is because I have init scripts that launch the above script at boot time. This way it will be up-to-date and load quickly if the server reboots.
I don't update the production server very often, so this works well for me. If anyone sees any flaws with this logic, please let me know.
-austin
Scribit Micheal Fria dies 08/05/2007 hora 21:12:
I'm relatively new to the whole paradigm of having a constantly running core image
You'll find that paradigm definitely interesting. As I'm fairly new to it myself, I couldn't conclude that it's better in any way, except that I like it more than the other ones, and that it seems to me it opens the door to much more scenarios (notably in terms of security and access control, as you have total control on the environment and permissions of the Lisp image).
so this question may come of as a little dumb. So please forgive me if I do.
A new paradigm opens up new questions...
I was wondering what is the generally accepted best method of deployment for hunchentoot websites? (ie. how would one go about moving it from staging/testing server to the live/primary server?)
I didn't see any best practice published by anyone, but I suspect that many of us manage the code under a revision control and use that to move the source code of a stable revision to the production system.
As far as running the image is concerned, I also suspect many of us run it in some detachable tty. I use screen because I also use it locally to keep a dozen of terminals open, some prefer more lightweight solutions like detachtty.
But there's got to be a better way! I'm running into problems where I'm forgetting to update a function.
I usually have a startup Lisp file or/along with a shell script that loads the ASDF system and starts the server. To be sure my hot updates of code didn't introduce any bootstrap issues, I can just restart the server with that (or do it in parallel, to keep the image running).
Personaly, Pierre