Re: [web2py] GAE & Python 2.7 update

2011-11-07 Thread Jonathan Lundell
On Nov 5, 2011, at 5:24 PM, Massimo Di Pierro wrote:

> I know I said otherwise before but perhaps we should continue to
> default to 2.5 until App Launcher supports 2.7

I just got Launcher 1.6.0, and it appears to support 2.7.

> 
> On Nov 5, 1:28 pm, Jonathan Lundell  wrote:
>> I thought I'd pass on my recent experience deploying an app to GAE with 
>> Python 2.7. My motivation was the new features available, in particular 
>> concurrent requests and WSGI operation, and secondarily some other 
>> performance improvements (like the native JSON library). 
>> Seehttp://code.google.com/appengine/docs/python/python27/newin27.htmlfor 
>> more info.
>> 
>> There are a couple of downsides.
>> 
>> 1. The App Launcher doesn't support 2.7 yet, so you need to deploy from the 
>> command line. I'm not entirely clear on whether there's any way at all to 
>> run a 2.7 app locally.
>> 
>> 2. You must use the High Replication datastore. That's not necessarily a bad 
>> thing, but a) it's more expensive (if you have enough traffic to be paying), 
>> and b) run_in_transaction only works with ancestor queries, which the DAL 
>> does not support.
>> 
>> Fortunately, my db requirements aren't too complicated, and I was able to 
>> put all my db accesses behind a class that allowed me to talk to the 
>> datastore through its native API while preserving compatibility with DAL on 
>> other servers. (There were some other advantages to doing this, and it was 
>> an interesting learning experience.)
>> 
>> The trunk's app.example.yaml defaults to 2.7; that part was fairly simple 
>> (it supports 2.5 as well; just change some commenting-out stuff).
>> 
>> I like the way GAE is going, and I really like being able to deploy an app 
>> in the cloud without having to become a sysadmin.




Re: [web2py] GAE & Python 2.7 update

2011-11-06 Thread Jonathan Lundell
On Nov 5, 2011, at 5:24 PM, Massimo Di Pierro wrote:

> I know I said otherwise before but perhaps we should continue to
> default to 2.5 until App Launcher supports 2.7

I have, btw, some changes to gaehandler.py. For example, GAE+2.7 now has 
cPickle, and GAE+2.5 already aliases it, so that logic needs to come out. And 
I've got code to support cProfile, so maybe the timing logic can go away.

There are also a couple of workarounds that might no longer be necessary (not 
sure), and I don't think the background task logic is up to date, but I don't 
use it, so I haven't tried.

> 
> On Nov 5, 1:28 pm, Jonathan Lundell  wrote:
>> I thought I'd pass on my recent experience deploying an app to GAE with 
>> Python 2.7. My motivation was the new features available, in particular 
>> concurrent requests and WSGI operation, and secondarily some other 
>> performance improvements (like the native JSON 
>> library).Seehttp://code.google.com/appengine/docs/python/python27/newin27.htmlfor
>>  more info.
>> 
>> There are a couple of downsides.
>> 
>> 1. The App Launcher doesn't support 2.7 yet, so you need to deploy from the 
>> command line. I'm not entirely clear on whether there's any way at all to 
>> run a 2.7 app locally.
>> 
>> 2. You must use the High Replication datastore. That's not necessarily a bad 
>> thing, but a) it's more expensive (if you have enough traffic to be paying), 
>> and b) run_in_transaction only works with ancestor queries, which the DAL 
>> does not support.
>> 
>> Fortunately, my db requirements aren't too complicated, and I was able to 
>> put all my db accesses behind a class that allowed me to talk to the 
>> datastore through its native API while preserving compatibility with DAL on 
>> other servers. (There were some other advantages to doing this, and it was 
>> an interesting learning experience.)
>> 
>> The trunk's app.example.yaml defaults to 2.7; that part was fairly simple 
>> (it supports 2.5 as well; just change some commenting-out stuff).
>> 
>> I like the way GAE is going, and I really like being able to deploy an app 
>> in the cloud without having to become a sysadmin.




[web2py] GAE & Python 2.7 update

2011-11-05 Thread Jonathan Lundell
I thought I'd pass on my recent experience deploying an app to GAE with Python 
2.7. My motivation was the new features available, in particular concurrent 
requests and WSGI operation, and secondarily some other performance 
improvements (like the native JSON library). See 
http://code.google.com/appengine/docs/python/python27/newin27.html for more 
info.

There are a couple of downsides.

1. The App Launcher doesn't support 2.7 yet, so you need to deploy from the 
command line. I'm not entirely clear on whether there's any way at all to run a 
2.7 app locally.

2. You must use the High Replication datastore. That's not necessarily a bad 
thing, but a) it's more expensive (if you have enough traffic to be paying), 
and b) run_in_transaction only works with ancestor queries, which the DAL does 
not support.

Fortunately, my db requirements aren't too complicated, and I was able to put 
all my db accesses behind a class that allowed me to talk to the datastore 
through its native API while preserving compatibility with DAL on other 
servers. (There were some other advantages to doing this, and it was an 
interesting learning experience.)

The trunk's app.example.yaml defaults to 2.7; that part was fairly simple (it 
supports 2.5 as well; just change some commenting-out stuff). 

I like the way GAE is going, and I really like being able to deploy an app in 
the cloud without having to become a sysadmin.

Re: [web2py] GAE & Python 2.7

2011-11-03 Thread Jonathan Lundell
On Nov 3, 2011, at 11:21 AM, howesc wrote:

> i'm not smart enough to know the difference between CGI and WSGI, but i have 
> inserted custom WSGI middleware on GAE before web2py successfully.  (perhaps 
> because web2py is using CGI it was harder than i expected)
> 
> i am interested in 2.7 and concurrent requests, though i don't know how to 
> audit my code to know that it is safe for concurrent requests and i have not 
> signed up for the 2.7 preview (and am still waiting for a SQL invite for GAE)
> 
> all on my TODO list...

app.example.yaml now has 2.7 support.

The main problem with concurrent requests is serialization. web2py session 
serialization doesn't operate under GAE, so it'll be necessary to do any 
necessary serialization through GAE database transactions. I think.

[web2py] GAE & Python 2.7

2011-11-03 Thread Jonathan Lundell
There's now a new version of app.example.yaml in the trunk. If you're working 
with the Google App Engine, read on.

GAE has been evolving a bit, and now supports Python 2.7 (vs 2.5). The new 
app.example.yaml is configured to use Python 2.7 and support concurrent 
requests. It can be modified in (I think) an obvious way to do 2.5, but the 2.7 
version should be considerable faster, since it uses WSGI instead of CGI.

Two drawbacks. 2.7 support is still in beta, and the GAE Launcher doesn't 
support it, so you'll need to deploy your app through the command line. 



Re: [web2py] GAE & Python 2.7

2011-11-03 Thread howesc
i'm not smart enough to know the difference between CGI and WSGI, but i 
have inserted custom WSGI middleware on GAE before web2py successfully.  
(perhaps because web2py is using CGI it was harder than i expected)

i am interested in 2.7 and concurrent requests, though i don't know how to 
audit my code to know that it is safe for concurrent requests and i have 
not signed up for the 2.7 preview (and am still waiting for a SQL invite 
for GAE)

all on my TODO list...


Re: [web2py] GAE & Python 2.7

2011-11-02 Thread Jonathan Lundell
On Nov 2, 2011, at 12:16 PM, Jonathan Lundell wrote:

> On Nov 2, 2011, at 12:11 PM, Jonathan Lundell wrote:
> 
>> 1. Does anyone have a Python 2.7 web2py app running on GAE?
>> 
>> 2. Ditto, with WSGI rather than CGI?
>> 
>> I'm thinking that we need a new handler that's a blend of gaehandler.py and 
>> wsgihandler.py.
> 
> On second thought, would it work to app.yaml to specify a script of 
> gaehandler.wsgiapp?

Yes! Along with a few other minor changes.

Re: [web2py] GAE & Python 2.7

2011-11-02 Thread Jonathan Lundell
On Nov 2, 2011, at 12:11 PM, Jonathan Lundell wrote:

> 1. Does anyone have a Python 2.7 web2py app running on GAE?
> 
> 2. Ditto, with WSGI rather than CGI?
> 
> I'm thinking that we need a new handler that's a blend of gaehandler.py and 
> wsgihandler.py.

On second thought, would it work to app.yaml to specify a script of 
gaehandler.wsgiapp?

[web2py] GAE & Python 2.7

2011-11-02 Thread Jonathan Lundell

1. Does anyone have a Python 2.7 web2py app running on GAE?

2. Ditto, with WSGI rather than CGI?

I'm thinking that we need a new handler that's a blend of gaehandler.py and 
wsgihandler.py.