FastCGI for gst

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
16 messages Options
Reply | Threaded
Open this post in threaded view
|

FastCGI for gst

Nicolas Petton
Hi,

I've been working with Sébastien Audier on a port of the squeak
implementation of the fcgi protocol.

For some reasons, porting it wasn't as easy as expected, but we finally
got it working :)

http://github.com/NicolasPetton/fcgi

There is still some work to do. Especially there is no put request or
multipart support, and adaptors still have to be written (WAFCGI is a
subclass of WAKom...).


Cheers!

Nico
--
Nicolas Petton

Iliad Smalltalk web framework
http://iliad.bioskop.fr

_______________________________________________
help-smalltalk mailing list
[hidden email]
http://lists.gnu.org/mailman/listinfo/help-smalltalk

signature.asc (204 bytes) Download Attachment
Reply | Threaded
Open this post in threaded view
|

Re: FastCGI for gst

Andrey Larionov
Yesterday i almost finish porting GemStone version of FastCGI, which
based on work of Steve Waring for Dolphin. I made good progress. I
found this implementation is more complete according to Specification
and it's proven. I think, what in next two days i made a load testing
and publish result.

2009/10/7 Nicolas Petton <[hidden email]>:
> been working with Sébastien Audier on a port of the squeak
> implementation of the fcgi protocol.
>
> For some reasons, porting it wasn't as easy as expected, but we finally
> got it working :)


_______________________________________________
help-smalltalk mailing list
[hidden email]
http://lists.gnu.org/mailman/listinfo/help-smalltalk
Reply | Threaded
Open this post in threaded view
|

Re: FastCGI for gst

Nicolas Petton
Le mercredi 07 octobre 2009 à 15:19 +0400, Andrey Larionov a écrit :
> Yesterday i almost finish porting GemStone version of FastCGI, which
> based on work of Steve Waring for Dolphin.

Is it this implementation? http://seaside.gemstone.com/ss/fastcgi.html


>  I made good progress. I
> found this implementation is more complete according to Specification
> and it's proven. I think, what in next two days i made a load testing
> and publish result.

Hmm, I think it's stupid to work separately here, we obviously want the
same thing :D

Could you share your repository with us?

Cheers!

Nico

_______________________________________________
help-smalltalk mailing list
[hidden email]
http://lists.gnu.org/mailman/listinfo/help-smalltalk

signature.asc (204 bytes) Download Attachment
Reply | Threaded
Open this post in threaded view
|

Re: FastCGI for gst

Paolo Bonzini-2
In reply to this post by Nicolas Petton
On 10/07/2009 01:05 PM, Nicolas Petton wrote:

> Hi,
>
> I've been working with Sébastien Audier on a port of the squeak
> implementation of the fcgi protocol.
>
> For some reasons, porting it wasn't as easy as expected, but we finally
> got it working:)
>
> http://github.com/NicolasPetton/fcgi
>
> There is still some work to do. Especially there is no put request or
> multipart support, and adaptors still have to be written (WAFCGI is a
> subclass of WAKom...).

It would be interesting to reuse the existing Swazoo interface, so that
you can run Swazoo indifferently over HTTP or FastCGI.  Then you'd get
multipart support for free, I think.  My repository's swazoo-pool branch
refactors Swazoo so that you can accept connections, retrieve requests
and print responses on something other than a plain socket, so this may
be an idea for Swazoo 2.3/3.0...  If you want I have the same changes in
Monticello format too.

Does FCGI support streaming (i.e. Comet)?  Kom does, so maybe it's a
good sign that WAFCGI subclasses WAKom.

Paolo


_______________________________________________
help-smalltalk mailing list
[hidden email]
http://lists.gnu.org/mailman/listinfo/help-smalltalk
Reply | Threaded
Open this post in threaded view
|

Re: FastCGI for gst

Nicolas Petton
Le mercredi 07 octobre 2009 à 13:25 +0200, Paolo Bonzini a écrit :

> On 10/07/2009 01:05 PM, Nicolas Petton wrote:
> > Hi,
> >
> > I've been working with Sébastien Audier on a port of the squeak
> > implementation of the fcgi protocol.
> >
> > For some reasons, porting it wasn't as easy as expected, but we finally
> > got it working:)
> >
> > http://github.com/NicolasPetton/fcgi
> >
> > There is still some work to do. Especially there is no put request or
> > multipart support, and adaptors still have to be written (WAFCGI is a
> > subclass of WAKom...).
>
> It would be interesting to reuse the existing Swazoo interface, so that
> you can run Swazoo indifferently over HTTP or FastCGI.  Then you'd get
> multipart support for free, I think.  My repository's swazoo-pool branch
> refactors Swazoo so that you can accept connections, retrieve requests
> and print responses on something other than a plain socket, so this may
> be an idea for Swazoo 2.3/3.0...  If you want I have the same changes in
> Monticello format too.
>
Yes, that would be the idea in the future. For now, I will get multipart
support for free from somewhere anyway ;)

Cheers!

Nico

_______________________________________________
help-smalltalk mailing list
[hidden email]
http://lists.gnu.org/mailman/listinfo/help-smalltalk

signature.asc (204 bytes) Download Attachment
Reply | Threaded
Open this post in threaded view
|

Re: FastCGI for gst

Andrey Larionov
In reply to this post by Nicolas Petton
I'm Started porting about two days ago after found what Implementation
from SqueakSource is lack of standart conformance, and even it in some
place rely on Komanche (using it addaptor for seaside) it dosn't use
KomServices architecture.
I share my work after testing.

2009/10/7 Nicolas Petton <[hidden email]>:

> Le mercredi 07 octobre 2009 à 15:19 +0400, Andrey Larionov a écrit :
>> Yesterday i almost finish porting GemStone version of FastCGI, which
>> based on work of Steve Waring for Dolphin.
>
> Is it this implementation? http://seaside.gemstone.com/ss/fastcgi.html
>
>
>>  I made good progress. I
>> found this implementation is more complete according to Specification
>> and it's proven. I think, what in next two days i made a load testing
>> and publish result.
>
> Hmm, I think it's stupid to work separately here, we obviously want the
> same thing :D
>
> Could you share your repository with us?
>
> Cheers!
>
> Nico
>


_______________________________________________
help-smalltalk mailing list
[hidden email]
http://lists.gnu.org/mailman/listinfo/help-smalltalk
Reply | Threaded
Open this post in threaded view
|

Re: FastCGI for gst

Nicolas Petton
Le mercredi 07 octobre 2009 à 15:35 +0400, Andrey Larionov a écrit :
> I'm Started porting about two days ago after found what Implementation
> from SqueakSource is lack of standart conformance,

I followed the spec from this page:
http://www.fastcgi.com/devkit/doc/fcgi-spec.html

And the implementation seems fine for me. Which part of this
implementation doesn't follow standards?

>  and even it in some
> place rely on Komanche (using it addaptor for seaside) it dosn't use
> KomServices architecture.

Yes, the adaptor is wrong, but it's just a few lines of code.

> I share my work after testing.

Ok, I'm going to wait until you share it then.

Cheers!

Nico

--
Nicolas Petton

Iliad Smalltalk web framework
http://iliad.bioskop.fr

_______________________________________________
help-smalltalk mailing list
[hidden email]
http://lists.gnu.org/mailman/listinfo/help-smalltalk

signature.asc (204 bytes) Download Attachment
Reply | Threaded
Open this post in threaded view
|

Re: FastCGI for gst

Nicolas Petton
In reply to this post by Paolo Bonzini-2
Le mercredi 07 octobre 2009 à 13:25 +0200, Paolo Bonzini a écrit :

> On 10/07/2009 01:05 PM, Nicolas Petton wrote:
> > Hi,
> >
> > I've been working with Sébastien Audier on a port of the squeak
> > implementation of the fcgi protocol.
> >
> > For some reasons, porting it wasn't as easy as expected, but we finally
> > got it working:)
> >
> > http://github.com/NicolasPetton/fcgi
> >
> > There is still some work to do. Especially there is no put request or
> > multipart support, and adaptors still have to be written (WAFCGI is a
> > subclass of WAKom...).
>
> It would be interesting to reuse the existing Swazoo interface, so that
> you can run Swazoo indifferently over HTTP or FastCGI.  Then you'd get
> multipart support for free, I think.  My repository's swazoo-pool branch
> refactors Swazoo so that you can accept connections, retrieve requests
> and print responses on something other than a plain socket, so this may
> be an idea for Swazoo 2.3/3.0...  If you want I have the same changes in
> Monticello format too.
yes, Could you send me both mcz and git diff?
If integrating it into Swazoo is not too hard, I'll do it as soon as
I'll have some time.

Thanks,

Nico
--
Nicolas Petton

Iliad Smalltalk web framework
http://iliad.bioskop.fr

_______________________________________________
help-smalltalk mailing list
[hidden email]
http://lists.gnu.org/mailman/listinfo/help-smalltalk

signature.asc (204 bytes) Download Attachment
Reply | Threaded
Open this post in threaded view
|

Re: FastCGI for gst

Paolo Bonzini-2

>> It would be interesting to reuse the existing Swazoo interface, so that
>> you can run Swazoo indifferently over HTTP or FastCGI.  Then you'd get
>> multipart support for free, I think.  My repository's swazoo-pool branch
>> refactors Swazoo so that you can accept connections, retrieve requests
>> and print responses on something other than a plain socket, so this may
>> be an idea for Swazoo 2.3/3.0...  If you want I have the same changes in
>> Monticello format too.
>
> yes, Could you send me both mcz and git diff?

You can get diffs from my repository, see

     http://smalltalk.gnu.org/wiki/other-git-repositories

and I'm attaching the .mcd file too.

That would really be quite a rewrite compared to your current code,
however!  There are quite a few design-patternish things involved, and
without docs they are ehm a bit hard to follow so here are the steps:

1) derive a new class (or maybe two, one for passive and one for active
sockets) from AbstractSwazooSocket.  These classes would implement the
FCGI protocol with a socket-like interface: you have a request-fetching
Process, and accepting a connection blocks on a Semaphore until a new
request arrives, etc.  You can add additional methods on top of the
abstract interface of AbstractSwazooSocket, which would provide access
to the key-value part of the request.

2) derive a new class from SwazooRequestReader.  The class would convert
environment variables back to HTTP headers,  The class knows that the
underlying "socket" is actually a FastCGI connection.

I think the standard HTTPPrinter will work, otherwise you can derive
from it or from SwazooResponsePrinter.

3) derive a new class from AbstractHTTPServer.  This is a factory that
would point to the classes of steps (1) and (2).

4) derive a new class from URIIdentifier.  This is also a factory, that
would point to the class of step (3).  You would have to override
#newServer and #valueMatch:.  There would be probably some commonality
between SiteIdentifier and this new class, so it would probably be a
good idea to make a new class AbstractSiteIdentifier and derive both
SiteIdentifier and the new class from there.

Paolo

_______________________________________________
help-smalltalk mailing list
[hidden email]
http://lists.gnu.org/mailman/listinfo/help-smalltalk

Swazoo-PaoloBonzini.13(2.2).mcd (86K) Download Attachment
Reply | Threaded
Open this post in threaded view
|

Re: FastCGI for gst

Andrey Larionov
In reply to this post by Nicolas Petton
Hello, Nicolas. I'm sorry what i dindnt say in the begining (now
reread thread and saw it), i'm porting this to Squeak.
I made a some progress. Basic test is passed. But there are some
troubles in error handling.
I decide to share my current progress, cause i think what two heads
better then one. It's my first work with smalltalk, so if you do any
suggestions on improving architecture, it will be good.

Hope on backporting bugfixes or improvments.

2009/10/7 Nicolas Petton <[hidden email]>:

> Le mercredi 07 octobre 2009 à 15:35 +0400, Andrey Larionov a écrit :
>> I'm Started porting about two days ago after found what Implementation
>> from SqueakSource is lack of standart conformance,
>
> I followed the spec from this page:
> http://www.fastcgi.com/devkit/doc/fcgi-spec.html
>
> And the implementation seems fine for me. Which part of this
> implementation doesn't follow standards?
>
>>  and even it in some
>> place rely on Komanche (using it addaptor for seaside) it dosn't use
>> KomServices architecture.
>
> Yes, the adaptor is wrong, but it's just a few lines of code.
>
>> I share my work after testing.
>
> Ok, I'm going to wait until you share it then.
>
> Cheers!
>
> Nico
>
> --
> Nicolas Petton
>
> Iliad Smalltalk web framework
> http://iliad.bioskop.fr
>

_______________________________________________
help-smalltalk mailing list
[hidden email]
http://lists.gnu.org/mailman/listinfo/help-smalltalk

FastCGI-AndreyLarionov.3.mcz (59K) Download Attachment
Reply | Threaded
Open this post in threaded view
|

Re: FastCGI for gst

Nicolas Petton
Le jeudi 08 octobre 2009 à 04:59 +0400, Andrey Larionov a écrit :
> Hello, Nicolas. I'm sorry what i dindnt say in the begining (now
> reread thread and saw it), i'm porting this to Squeak.


Ahhh. It changes everything.

> I made a some progress. Basic test is passed. But there are some
> troubles in error handling.
> I decide to share my current progress, cause i think what two heads
> better then one.

You should probably share it on squeak-dev mailing list instead then.

>  It's my first work with smalltalk, so if you do any
> suggestions on improving architecture, it will be good.
>
> Hope on backporting bugfixes or improvments.

Sorry, but my current work on fcgi is for gst only, and I don't think
I'll have time to help you with your code... But again, I'm sure people
on squeak-dev (you can ask on seaside list or even pharo one maybe) will
be happy to help.

Thanks anyway :)

Cheers!

Nico

>
> 2009/10/7 Nicolas Petton <[hidden email]>:
> > Le mercredi 07 octobre 2009 à 15:35 +0400, Andrey Larionov a écrit :
> >> I'm Started porting about two days ago after found what Implementation
> >> from SqueakSource is lack of standart conformance,
> >
> > I followed the spec from this page:
> > http://www.fastcgi.com/devkit/doc/fcgi-spec.html
> >
> > And the implementation seems fine for me. Which part of this
> > implementation doesn't follow standards?
> >
> >>  and even it in some
> >> place rely on Komanche (using it addaptor for seaside) it dosn't use
> >> KomServices architecture.
> >
> > Yes, the adaptor is wrong, but it's just a few lines of code.
> >
> >> I share my work after testing.
> >
> > Ok, I'm going to wait until you share it then.
> >
> > Cheers!
> >
> > Nico
> >
> > --
> > Nicolas Petton
> >
> > Iliad Smalltalk web framework
> > http://iliad.bioskop.fr
> >
--
Nicolas Petton

Iliad Smalltalk web framework
http://iliad.bioskop.fr

_______________________________________________
help-smalltalk mailing list
[hidden email]
http://lists.gnu.org/mailman/listinfo/help-smalltalk

signature.asc (204 bytes) Download Attachment
Reply | Threaded
Open this post in threaded view
|

Re: FastCGI for gst

Göran Krampe
For some extra info/inspiration etc, see Blackfoot which is a SimpleCGI
implementation:

http://map.squeak.org/packagebyname/blackfoot

Slides:

http://goran.krampe.se/Blackfoot.pdf

regards, Göran



_______________________________________________
help-smalltalk mailing list
[hidden email]
http://lists.gnu.org/mailman/listinfo/help-smalltalk
Reply | Threaded
Open this post in threaded view
|

Re: FastCGI for gst

Nicolas Petton
Thank you very much Goran, I was just going to start working on a scgi
module for Swazoo :)

Nico

Le jeudi 08 octobre 2009 à 10:39 +0200, Göran Krampe a écrit :

> For some extra info/inspiration etc, see Blackfoot which is a SimpleCGI
> implementation:
>
> http://map.squeak.org/packagebyname/blackfoot
>
> Slides:
>
> http://goran.krampe.se/Blackfoot.pdf
>
> regards, Göran
>
--
Nicolas Petton

Iliad Smalltalk web framework
http://iliad.bioskop.fr

_______________________________________________
help-smalltalk mailing list
[hidden email]
http://lists.gnu.org/mailman/listinfo/help-smalltalk

signature.asc (204 bytes) Download Attachment
Reply | Threaded
Open this post in threaded view
|

Re: FastCGI for gst

Göran Krampe
Nicolas Petton wrote:
> Thank you very much Goran, I was just going to start working on a scgi
> module for Swazoo :)

Ah, well, please improve on Blackfoot then! :)

Blackfoot is very small and works with Seaside 2.8 at least. One thing
on the "todo" is multipart-POST-file-upload blabla stuff. But otherwise
it works fine.

I have tested it with Cherokee and also with Nginx but unfortunately the
SCGI module for Nginx is broken (I have a patch making it work but
upstream maintainer has not included it) and pretty unmaintained.

regards, Göran



_______________________________________________
help-smalltalk mailing list
[hidden email]
http://lists.gnu.org/mailman/listinfo/help-smalltalk
Reply | Threaded
Open this post in threaded view
|

Re: FastCGI for gst

Nicolas Petton
Le jeudi 08 octobre 2009 à 11:28 +0200, Göran Krampe a écrit :
> Nicolas Petton wrote:
> > Thank you very much Goran, I was just going to start working on a scgi
> > module for Swazoo :)
>
> Ah, well, please improve on Blackfoot then! :)

The idea was to reuse code from Swazoo, since almost everything is
already there. We don't really want something written from scratch; like
blackfoot. Nevertheless, I'll read the code, and when implementing scgi
for Swazoo, if I find some things to improve in blackfoot, I will submit
patches.

I think I only need 3 classes to make SCGI work with it. Parsing,
headers, multipart, put, etc are already in Swazoo.

Cheers!

Nico

>
> Blackfoot is very small and works with Seaside 2.8 at least. One thing
> on the "todo" is multipart-POST-file-upload blabla stuff. But otherwise
> it works fine.
>
> I have tested it with Cherokee and also with Nginx but unfortunately the
> SCGI module for Nginx is broken (I have a patch making it work but
> upstream maintainer has not included it) and pretty unmaintained.
>
> regards, Göran
>
--
Nicolas Petton

Iliad Smalltalk web framework
http://iliad.bioskop.fr

_______________________________________________
help-smalltalk mailing list
[hidden email]
http://lists.gnu.org/mailman/listinfo/help-smalltalk

signature.asc (204 bytes) Download Attachment
Reply | Threaded
Open this post in threaded view
|

Re: FastCGI for gst

Paolo Bonzini-2
On 10/08/2009 12:14 PM, Nicolas Petton wrote:
> Le jeudi 08 octobre 2009 à 11:28 +0200, Göran Krampe a écrit :
>> Nicolas Petton wrote:
>>> Thank you very much Goran, I was just going to start working on a scgi
>>> module for Swazoo :)
>>
>> Ah, well, please improve on Blackfoot then! :)
>
> The idea was to reuse code from Swazoo, since almost everything is
> already there.

Note that this is using a development branch of Swazoo that is currently
for GST only (I have backports to Squeak but they are not 100% ready
yet).  The branch allows to plug in alternative protocol reader/writers.

Paolo


_______________________________________________
help-smalltalk mailing list
[hidden email]
http://lists.gnu.org/mailman/listinfo/help-smalltalk