google

Exploring Google AppEngine, Part 2

In my first experiment with Google's AppEngine, I dove straight in and started using CherryPy for development. This worked pretty well at first, but I eventually hit some issues due to lack of threading within AppEngine.

At that point, I decided to step back a bit and take a fresh look with a pure-WSGI approach. I had never used WSGI directly, so this was an interesting experiment. I definitely like the simplicity of pure-WSGI, but the question will be how much custom code I have to write versus using a prebuilt framework. (Don't get me wrong, I expect to return to CherryPy later, but I want to experiment at the lower level for now.)

You can follow the work in progress at boodebr.appspot.com
Written in WikklyText.

Running CherryPy based apps under Google's App Engine

Google's App Engine is a new application platform from Google that allows you to run custom Python code on Google's infrastructure. From their website:
Google App Engine lets you run your web applications on Google's infrastructure. App Engine applications are easy to build, easy to maintain, and easy to scale as your traffic and data storage needs grow. With App Engine, there are no servers to maintain: You just upload your application, and it's ready to serve your users.
Several websites (including Google) make the claim that App Engine is compatible with any WSGI framework, even mentioning CherryPy by name. Unfortunately, they don't give any examples using CherryPy, and it turns out that it doesn't quite work "out of the box". Fortunately it wasn't too tricky to get it working, so I documented the steps here.

Click through to read more ...
Written in WikklyText.

Getting started with Google Code and svk

I've decided to play with Google Code a bit, to host some miscellaneous code from boodebr.org.

Up to this point in my programming life, the only version control systems I've used have been darcs and mercurial, which are both distributed systems. The concept of having to use svn to access Google Code really made me cringe.

Fortunately, there is nice tool called svk which makes a standard svn server look very much like a distributed system. I wrote a little walk-through to demonstrate the basics of using svk with Google Code.

Read it here: Google Code: Getting started with svk

Written in WikklyText.

Google Code: Getting started with svk

This is a quick walk-through of working with a Google Code project, using svk instead of svn on the client-side.

Why svk?
  • svn requires you to have a network connection to Google Code in order to commit any changes.
  • svk allows you work fully disconnected, only reconnecting to push back your changesets, or to pull updates from others.
  • svk features a much nicer merge algorithm that eliminates the need to manually track revisions that have been merged (as svn requires you to do).
  • On a personal note, the only version control systems I've used up to this point have been darcs and mercurial, which are both distributed systems. The "svk" way of working seems much more natural to me than svn does.

Getting started

  1. The first thing I did was to create a new project. I named the project boodebr.
  2. Once this was done, my new project was immediately available at http://boodebr.googlecode.com

Lets look at how to do "guest" (read-only) access as well as author/contributor (read-write) access below.

Guests access (read-only) via svk


First, create a mirror of the svn repository:
svk mirror //mirror/boodebr http://boodebr.googlecode.com/svn/trunk/


Lets create a working copy:
svk sync -a
svk co //mirror/boodebr
Since we're only doing read-only access, I'm checking out directly from the mirror instead of creating a local copy of the repository like I would for read-write access. See the notes on disconnected operation in next section.


You'll want to grab the latest updates periodically:
svk sync -a
svk update boodebr


To completely wipe out our mirror and working copy:
svk co -d boodebr
svk mirror -d //mirror/boodebr


Author/contributor access (read-write) via svk


Make sure you know your googlecode login and password (you can find them here).

The first step is to create a mirror of the svn repository:
svk mirror //mirror/boodebr https://boodebr.googlecode.com/svn/trunk/
This uses https instead of http since we're logging in!
This will prompt you for a few things:
  1. When it shows you the certificate information, select (p)ermanently so it won't ask you every time.
    At this point I received the following error:
    RA layer request failed: PROPFIND request failed on '/svn/trunk': PROPFIND of '/svn/trunk': Could not read status line: Secure connection truncated (https://boodebr.googlecode.com)
    Simply re-running the command fixed it.
  2. It will then say Password for 'YourLogin'. If 'YourLogin' is not the same as your google-code login, simply press ENTER and it will let you enter your correct username and password.

Its probably a good idea to go ahead and sync first:
svk sync //mirror/boodebr


To use svk for "disconnected" operation, you need to create a local copy of the repository:
svk cp -p -m "Make local repo" //mirror/boodebr //local/boodebr


Now checkout your working copy from //local/boodebr, not //mirror/boodebr:
svk co //local/boodebr


Go about your work, editing files, commiting changes (svk ci), etc.

To pull updates from google-code, merging with your working copy (if needed):
svk sync -a
svk smerge -lt .


When you are ready to push back to google-code:
svk smerge -Ilf .
You might want to add -C to preview what will happen before you do it.
When smerge -Ilf fails ...
svk has what appears to me to be a bug in that it will try to make you merge conflicts twice - once when pulling from svn and once when pushing back. Whenever you do a merge with conflicts, I recommend doing:
svk smerge -Ilf . -C
If this tells you there are conflicts, then you cannot use smerge -Ilf (unless you really want to redo the merge, that is!). Instead, use smerge -lf .. This is not great, since it pushes your changes in one large chunk instead of incrementally, but this is the only solution I've found so far!
push & pull
The above bug (or feature?) is why I recommend against using svk push and svk pull. Using smerge gives you access to more features and makes it easier to control what is happening. push and pull are fairly 'opaque' and if they fail you don't have much recourse.
This has just been a quick introduction to Google-Code-via-svk. If you have any suggestions or corrections, please let me know below!
Written in WikklyText.
Syndicate content