exploring appengine cron

352 views
Skip to first unread message

Ross Karchner

unread,
Jan 19, 2009, 10:51:10 AM1/19/09
to google-a...@googlegroups.com
I've been looking at the latest checkout (35) of the AppEngine SDK (which might be the same as 1.1.8), trying to at least figure out how cron *will* work. Here's what I've found so far.

Interestingly, the SDK's antlr definitions are incompatible with the version of antlr invluded in the sdk, so I had to rename lib/antlr3 and install 3.1.1 from http://www.antlr.org/download/Python

There's a new yaml file at the root of your application, "cron.yaml". Here's a simple one that validates:
-------------------
cron:
- url: /cron
  schedule: every 2 hours
 
-------------------

You can also optionally include a timezone and description. Here's what groctimespecification.py says about the schedule format:

"A Groc schedule looks like '1st,2nd monday 9:00', or 'every 20 mins'. This
module takes a parsed schedule (produced by Antlr) and creates objects that
can produce times that match this schedule."

If cron.yaml is present but empty or invalid, appcfg.py update fails with "google.appengine.api.croninfo.MalformedCronfigurationFile", if the schedule line is invalid, it fails with "Error parsing yaml file:". Otherwise, cron definitions are uploaded distinctly from all the other files.


theross@localhost:~/projects/appname$ appcfg.py update .
Scanning files on local disk.
Scanned 500 files.
Initiating update.
Cloning 155 static files.
Cloned 100 files.
Cloning 57 application files.
Closing update.
Uploading index definitions.
Uploading cron entries.


So, all the SDK pieces appear to work, but my testing indicates this isn't running on the production servers yet-- I set up an "every 1 minutes" cron that logs when it runs, and it hasn't been called yet

They DO show up in the dashboard though, under admin logs:

01/19/09 07:32:28
rosska...@gmail.com  Added cron job 'None' schedule=every 2 hours, url=/cron
01/19/09 07:32:28
rosska...@gmail.com  Removed cron job 'None ' schedule=every 1 minutes, url=/cron

auzhuang

unread,
Jan 20, 2009, 12:31:01 AM1/20/09
to Google App Engine
I saw this:


Uploading cron entries.
Error 500: --- begin server output ---

Server Error (500)
A server error has occurred.
--- end server output ---



On 1月19日, 下午11时51分, "Ross M Karchner" <rosskarch...@gmail.com> wrote:
> I've been looking at the latest checkout (35) of the AppEngine SDK (which
> might be the same as 1.1.8), trying to at least figure out how cron *will*
> work. Here's what I've found so far.
>
> Interestingly, the SDK's antlr definitions are incompatible with the version
> of antlr invluded in the sdk, so I had to rename lib/antlr3 and install
> 3.1.1 fromhttp://www.antlr.org/download/Python
> *Uploading cron entries.*
>
> So, all the SDK pieces appear to work, but my testing indicates this isn't
> running on the production servers yet-- I set up an "every 1 minutes" cron
> that logs when it runs, and it hasn't been called yet
>
> They DO show up in the dashboard though, under admin logs:
>
> 01/19/09 07:32:28
> rosskarch...@gmail.com Added cron job 'None' schedule=every 2 hours,
> url=/cron 01/19/09 07:32:28
> rosskarch...@gmail.com Removed cron job 'None ' schedule=every 1 minutes,
> url=/cron

Jason C

unread,
Jan 20, 2009, 12:37:08 PM1/20/09
to Google App Engine
> Interestingly, the SDK's antlr definitions are incompatible with the version
> of antlr invluded in the sdk, so I had to rename lib/antlr3 and install
> 3.1.1 from http://www.antlr.org/download/Python

In my case, this statement is misleading. lib/antlr3 is included in
the .google_appengine/lib folder, but the Django AppEngine Helper
project wasn't referencing it. That project released a super-minor
update (r68) that includes antlr3 in the python path.

Moving to this most recent version corrected the antlr3 issue without
having to install it separately.
Reply all
Reply to author
Forward
0 new messages