Hi Milan,
I'm developing a small website in Seaside and using Magma for persistence. Now it's time to deploy the project to a server where development would continue in a more real environment. I'm not sure how to do it, since I've never deployed a smalltalk image.
Congratulations. Deploying is fun because you get to see your hard-work put to action. Some suggestions:
- Write deployment "make" scripts. I like to write mine in Smalltalk and put it right in the same MC package as the app. It assembles all the files, etc. into a zip. It's a nice way to document how to deploy the system since it also provides the convenience of producing it in one-click. One nice feature is to have a single-file deployment (i.e., zip, tgz, etc.), if possible, since that makes it easy to scp to remote servers.
- I also recommend, for the above, to include the Squeak VM you want to use to run it. Include it in the app deployment directory and then all of your OS utility scripts point, relative-path, to that executable. That way it's self-contained and can run anywhere since no specific permissions are required.
- A set of OS utility scripts - "start", "stop" of course, but I also have, "upgrade" since I seem to be upgrading my magma server code every few months (to, ahem, eat my own dog food). Also, perhaps, "backup", although I also perform backups remotely on-demand.
- I don't know what OS you're using but.. since you are using Magma, you already have MaCommandLineProcessor in your image. It is +very convenient+ for interfacing with Squeak from the Linux command-line.
I was going to run the Magma server in a separate VM, containing not a lot more than needed by Magma.
I like to run my own Magma servers in their own image too. I use a pre-built image and it's not saved by my shutdown script. That way, I always know what I'm running.
Let's say a plain Pharo image with Magma installed. Seems reasonable to me, but is it a good idea to have it separated from the WEB server and the only client?
Yes, this approach provides upward scalability.
The other thing I'm concerned about is stopping the server. How do I shut it down gracefully when running in headless mode?
I've attached working start and stop scripts (one line each!). See stops.st, which opens a "admin MagmaSession" and instructs the server to shut down gracefully.
- Chris
-- Milan Mimica http://sparklet.sf.net
Magma mailing list Magma@lists.squeakfoundation.org http://lists.squeakfoundation.org/mailman/listinfo/magma