January 20, 2010

Updating Vosao on Google App Engine

This site has been a project to see how well Google App Engine (GAE) can be used for a personal website. I'm happy to say that with the help of the Vosao framework, it is working out rather well. First you can't beat the cost which other than my time is effectively zero. I'm currently nowhere near the GAE free quota limits yet and have a lot of room to grow. The only hitch so far has been persistent DataStore based 500 system errors which are sadly par for the course with GAE. In December 2009 Vosao version 0.1 was released, so what follows is my complete process for updating a GAE Vosao site from version 0.0.4 to version 0.1.

 

Updating Vosao from 0.0.4 to 0.1:

You have Maven, Eclipse, and the Google App Engine Java SDK or the Eclipse GAE plugin installed right? While Eclipse is not really necessicary to install or update Vosao, I find it handy for going through the source-code and making velocity templates, so I am including Eclipse specific settings information. If you don't use Eclipse, most of the setting changes will be similar enough that you can probably find your way.

Go to the subversion repository, open the tags directory, and checkout 0.1 from repository as a project into Eclipse.

Next we must add the Java nature to the .project file. Quit Eclipse and in your favorite editor, make the following changes:

Before:

	<natures>
	       <nature>org.eclipse.wst.common.project.facet.core.nature</nature>
	</natures>

After:

	<natures>
	       <nature>org.eclipse.wst.common.project.facet.core.nature</nature>
	       <nature>org.eclipse.jdt.core.javanature</nature>
	</natures>

 

Restart Eclipse

Change /web/ant.properties appengine.sdk.home property to match the path to your App Engine SDK home, or create a link from /opt/gae to the App Engine SDK home directory.

	# Provide App Engine SDK location here
	appengine.sdk.home=/opt/gae

If your GAE application name is not vosaocms, change the appname property in /build.sh and /make.sh to match your GAE application name.

build.sh:

	mvn -Dappname=vosaocms clean install

make.sh:

	mvn -Dappname=vosaocms install

Changing the following Eclipse settings are not strictly necessary, but if you hate seeing errors in your project like I do, then you may want to change them.

First, if you are not using Java 5.0, you must change the Project Facets version to match JDK version. In my case, I'm using Java 6.0. First, open the project properties and go to Project Facets. Change the Java version.

Change Project Facets

Second, set Source and output folders.

Change Source Folders

And finally, click on the Libraries tab and add the Maven libraries.

 

Next open a terminal and run build.sh

Depending on your development environment, the unit tests that are run upon building may cause memory errors. If this occurs increase the memory allotted to the surefire plugin by adding the following to /kernel/pom.xml.

	<plugin>
	<groupId>org.apache.maven.plugins</groupId>
	<artifactId>maven-surefire-plugin</artifactId>
	<configuration>
	<systemProperties>
	<property>
	<name>net.sourceforge.cobertura.datafile</name>
	<value>target/cobertura/cobertura.ser</value>
	</property>
	</systemProperties>
	<argLine>-Xmx256m</argLine>
	</configuration>
	</plugin>

Change directory to /web. If your GAE application name is not vosaocms, change the appname property in ./build.sh and ./make.sh to match your GAE application name.

build.sh:

	mvn -Dappname=vosaocms clean install

make.sh:

	mvn -Dappname=vosaocms install

After running build.sh and test.sh, execute run.sh to start the server and test locally. On the local server configuration area, you can import data from the production site, but note that as resource files are not included in the export data, any resource files on the original site will not be shown on the local test environment. There's no need to worry however, because when the real App Engine site is updated, the resource files and data from the previous version will automatically be imported into the new version.

Now begins the actual update of the GAE site. First, login to your App Engine Dashboard, open the Datastore Viewer, and click on Create an Entity.

GAE Admin Datastore Viewer

If it is not already set, select ConfigEntity from the pulldown menu and click on the id link.

Scroll down to version, enter "0.0.4", change the type pulldown to string, and click on Save Entity.

GAE Change version setting

The GAE update

Back on your local development machine, If you haven't linked /opt/gae to your GAE Google App Engine SDK home directory, go to the /web project directory and change update.sh to match your local environment. Adding your login email will help streamline the update process.

	 --email=update@gmail.com

Run /web/update.sh and enter your password when prompted.

Back on the App Engine dashboard and open the Administration Versions page. Click on the live URI of the new version and check to make sure that all is well.

After testing, set the radio button to the new version and click Make Default.

Finally, accessing the update URL (http://domain.com/update) will complete the upgrade to 0.1

 

Vosao Release Notes