January 6, 2009

Project Darkstar 0.9.8

Project Darkstar is, in the simplest description, an application server for games. What J2EE has done for business applications, we want Project Darkstar to do for MMOPGs, virtual worlds, and the like. If you've used a J2EE server such as Glassfish or JBoss, then you know that deployment and maintenance of applications into these containers is simple, and more importantly consistent. However, until just recently, this simplicity and consistency has been sorely lacking with Project Darkstar deployments.

Just before the holidays, we managed to roll a new release, version 0.9.8, of Project Darkstar. Officially announced today, this release features a major packaging improvement that greatly simplifies deployment, startup, and shutdown of Darkstar applications. Let's take a look at how this works.

At the heart of a deployment, is the Project Darkstar container itself. Unlike past releases, installing the server package is as simple as unzipping the distribution zip file. No additional steps are required. The extracted archive will leave a directory structure as follows:

- sgs-server-dist-0.9.8
  - API-CHANGES
  - CHANGELOG
  - NOTICE.txt
  - README
  - bin
  - conf
  - deploy
  - doc
  - lib
  - license
  - src
  - tutorial

The README file has a decent introductory explanation of this structure, but the main directories that you want to concentrate on are bin, conf, deploy, and lib:
  • bin - The bin directory contains two executable JAR files, sgs-boot.jar and sgs-stop.jar which are respectively used to startup and shutdown the container. Executing the command "java -jar /path/to/sgs-server-dist-0.9.8/bin/sgs-boot.jar" will startup the container and initialize the deployed application according to the configuration in the directories below.
  • conf - The conf directory contains three configuration files used for the runtime configuration of the system. The sgs-boot.properties file is used to configure the system environment and JVM configuration, the sgs-server.properties file represents the application configuration file which is fed to the Darkstar Kernel, and the sgs-logging.properties file is used as the java.util.logging.config.file during runtime.
  • deploy - The deploy directory contains all application-specific JAR files. When the container is booted up, these JAR files are automatically included in the JVM's classpath. Additionally, a single one of these JAR files can optionally include an embedded META-INF/app.properties file which is combined with the sgs-server.properties file from the conf directory to make up the set of properties used by the Darkstar Kernel. Out of the box, the deploy directory is empty and so booting up the container will immediately fail since there is no application to run.
  • lib - The lib directory suitably contains all of the JAR files required for any Project Darkstar application. These are automatically included in the JVM's classpath upon bootup of the container.
So we see above that the Project Darkstar container offers a rigid, well-defined structure, while at the same time being customizable and highly flexible. This brings us to the second component of a deployment, the Project Darkstar application. As stated previously, we want simplicity and consistency when developing and deploying an application into a container:
  • An additional feature of the 0.9.8 release of Project Darkstar is the explicit decoupling of the API interfaces from the implementation classes. The only compile-time dependency required when developing an app now is the sgs-server-api JAR file (found in the lib directory as well as the Maven repository). Simple.
  • Application specific Darkstar properties (e.g. com.sun.sgs.app.listener, etc.) can be bundled directly with the application by embedding a META-INF/app.properties Darkstar configuration file directly into your application JAR file. Simple. Consistent.
  • A Project Darkstar application is a JAR file or set of JAR files, one of which optionally contains a META-INF/app.properties Darkstar configuration file. Consistent.
  • A Project Darkstar application can be deployed into any Project Darkstar container by simply dropping the application JAR files into the deploy directory of the container and suitably tweaking the configuration files in the conf directory for your needs. Simple. Consistent.
There are other, subtle details about the flexibility and configuration of the container (including, among many things, how to use native libraries, how to use custom BDB libraries, how to use a different deploy directory, etc.) but I'll leave those for a separate discussion. In a future post, I'm hoping to case-study a real deployment using this new distribution.

Ultimate Status

Monday January 5, 2009
12PM Pick-up game
Mitre Fields, Burlington, MA
Weather: 34 F, Cloudy
Field: thin snow cover
Perfect conditions for Ultimate.

Back to work and back to regular numbers with the holidays over on Monday.

Ultimate Statistics (since January 2008):
Total Games Played: 140
Total Hours Played: 165

January 1, 2009

Ultimate Windchill

Thursday January 1, 2009
11AM Pick-up game
Danehy Park, Cambridge, MA
Weather: 13 F, Windy
Field: several inches of powder snow
Perfect conditions for Ultimate.

I don't usually attend the regular pickup game held in Arlington and/or Cambridge, but I'm on the mailing list and couldn't resist going to the annual New Year's day game. With a snow covered field, and wind chills below 0F, the game drew 17 people at its peak. Once again, a snow field game made for lots of fun, lots of layouts, and a great way to ring in the new year.

Ultimate Statistics (since January 2008):
Total Games Played: 139
Total Hours Played: 164

December 31, 2008

Ultimate Snowstorm

Wednesday December 31, 2008
12PM Pick-up game
Mitre Fields, Burlington, MA
Weather: 22 F, Heavy Snow, Wind
Field: several inches of powder snow
Perfect conditions for Ultimate.

I actually can't believe I drove all the way from Arlington to Burlington right in the middle of a significant snow event here in the Northeast to get to pickup Ultimate. It was worth it, though, as we had a snowy, windy, layout-filled game.

Ultimate Statistics (since January 2008):
Total Games Played: 138
Total Hours Played: 162

Ultimate Warmup

Monday December 29, 2008
12PM Pick-up game
Mitre Fields, Burlington, MA
Weather: 45 F, Cloudy, Windy
Field: wet grass
Perfect conditions for Ultimate.

Sun is shutdown for this week but I couldn't stop myself from going out for the lunchtime pickup game on Monday. Nice warm weather and the snow had all melted away with the after Christmas warmup.

Ultimate Statistics (since January 2008):
Total Games Played: 137
Total Hours Played: 161

December 23, 2008

Ultimate Snow

Monday December 22, 2008
12PM Pick-up game
Mitre Fields, Burlington, MA
Weather: 20 F, Sunny, Windy
Field: about 2 feet of snow
Perfect conditions for Ultimate.

After the barrage of snowstorms over the weekend, yesterday's field was covered in deep, fresh powder. As it turns out, running in two feet of snow is just as difficult as it sounds.

Ultimate Statistics (since January 2008):
Total Games Played: 136
Total Hours Played: 160

Ultimate Calm

Friday December 19, 2008
12PM Pick-up game
TRW Field, Burlington, MA
Weather: 28 F, Cloudy, Flurries
Field: cruncy snow and ice
Perfect conditions for Ultimate.

On Friday we managed to get the game in before the snowstorm hit. Too bad!

Ultimate Statistics (since January 2008):
Total Games Played: 135
Total Hours Played: 159