[Koha-devel] Time to think Plack?

Tomas Cohen Arazi tomascohen at gmail.com
Wed May 4 15:23:14 CEST 2016


2016-05-04 10:07 GMT-03:00 Julian Maurice <julian.maurice at biblibre.com>:

> Hi Tomas,
>
> As I haven't worked much with Plack, I am not sure to understand what
> you mean by "thinking of Koha as a Plack app". Do you mean rewrite Koha
> so that Plack::App::CGIBin is not needed to make it work under Plack ?
>

I'm not sure. A while back I recall devs started to do their daily dev
tasks with plack enabled to we could find all bugs, so we reached a good
level of compatibility for running inside plack. I think we moved forward,
a lot. At a point where users can just enable Plack and enjoy it with a
single CLI command. But if you look closer, we are still putting several
pieces together, that could, at some point be avoided to simplify our stack
and workflows. Not sure how to do it, just rising the question.

How is it related to the API implementation with Mojolicious ?
> I believe Mojolicious apps can be turned into Plack apps quite easily.
>

The point of the REST api using Mojolicious was that it is a separate set
of tools, that doesn't interfere with the old-loved Koha. If it gains
momentum and evolves, we could make several UI pieces rely on it. And of
course, we shouldn't run it on a CGI emulator if it can run natively as a
Plack app. The main problem with it is that it is not integrated into the
packages, so users cannot take advantage of it right now. I forgot to fill
a bug about it.

Are you suggesting we should extend the use of Mojolicious to all parts
> of Koha ?
>

There's no consensus about Mojolicious actually. I'd say leave it for the
REST api, and extend it so it can make sense to use it for the UI,
eventually deprecating some .pl scripts. In a baby steps approach, as we
like.

My post was about to start talking about what we expect in a mid term about
the plack integration and the rocks that block that road.

To start with, the current packages integration relies on the new apache's
mod_proxy's UDS support, which seems really buggy regarding the way it
handles SCRIPT_NAME and PATH_INFO, thus making our Plack use problematic at
some point. If you point NGINX into our starman socket, you will see how it
has to be done, working properly. This specific issue might led to a new
thread about supporting different HTTP servers on our packages, but lets
start with 'what we want about the plack integration for the short term,
and what is holding devs from using plack, daily'.

Regards

On 04/05/2016 14:39, Tomas Cohen Arazi wrote:
> > Hi everyone, I just wanted to raise some questions, that might be worth
> > thinking about at the KohaCon16 hackfest, or just here.
> >
> > Koha has been a CGI app for ages. And we slowly made it work under Plack
> > to gain performance. We did so, by running it inside a CGI emulation
> > context (i.e. CGI::Emulate::PSGI [1]). We even wired all stuff so
> > packages can take advantage of Plack out of the box (just not enabled by
> > default, that'd be a next future step).
> >
> > We then introduced a Mojolicious implementation of (a beggining of) a
> > REST API.
> >
> > Is it time to start thinking of Koha as a Plack app and focus on that?
> >
> >
> > [1] Through Plack::App::CGIBin actually.
> >
> > --
> > Tomás Cohen Arazi
> > Theke Solutions (http://theke.io <http://theke.io/>)
> > ✆ +54 9351 3513384
> > GPG: B2F3C15F
> >
> >
> > _______________________________________________
> > Koha-devel mailing list
> > Koha-devel at lists.koha-community.org
> > http://lists.koha-community.org/cgi-bin/mailman/listinfo/koha-devel
> > website : http://www.koha-community.org/
> > git : http://git.koha-community.org/
> > bugs : http://bugs.koha-community.org/
> >
>
>
> --
> Julian Maurice <julian.maurice at biblibre.com>
> BibLibre
> _______________________________________________
> Koha-devel mailing list
> Koha-devel at lists.koha-community.org
> http://lists.koha-community.org/cgi-bin/mailman/listinfo/koha-devel
> website : http://www.koha-community.org/
> git : http://git.koha-community.org/
> bugs : http://bugs.koha-community.org/




-- 
Tomás Cohen Arazi
Theke Solutions (http://theke.io)
✆ +54 9351 3513384
GPG: B2F3C15F
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.koha-community.org/pipermail/koha-devel/attachments/20160504/b27e815a/attachment-0001.html>


More information about the Koha-devel mailing list