You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@openwhisk.apache.org by Rob Allen <ro...@akrabat.com> on 2017/07/02 14:12:08 UTC

PHP 7.1 support for OpenWhisk

Hi all,

I have raised a PR to implement native PHP 7.1 support in OpenWhisk. I’ve called this kind `php:7.1`, as I expect we’ll want a 7.2, 7.3 etc.

This allows us to write PHP actions like this:

<?php
function main(array $args) : array
{
    $name = $args["name"] ?? "stranger";
    $greeting = "Hello $name!";
    return ["greeting" => $greeting];
}


I’ve tried to match the functionality of the other languages with support for --main to change the action's entry function along with support for zip files of multiple PHP files, along with providing tests and documentation that match that provided with the other languages.

The PR is at https://github.com/apache/incubator-openwhisk/pull/2415 <https://github.com/apache/incubator-openwhisk/pull/2415> and I would appreciate all reviews and feedback.

Regards,

Rob...

-- 
Development thoughts at http://akrabat.com
Daily Jotter for macOS at http://dailyjotter.com


Re: PHP 7.1 support for OpenWhisk

Posted by Carlos Santana <cs...@gmail.com>.
Oh forgot to mentioned I want to help with such docs since I have being
messing with Swift kinds specific to adding swift:3.1.1 and dealing with
defaults for kinds all driven from runtime manifest file/data
On Sun, Jul 2, 2017 at 1:15 PM Carlos Santana <cs...@gmail.com> wrote:

> This is great addition by community in addition someone recognize by the
> PHP community
>
> Rodric I  mentioned the same thing to Rob, to capture while is fresh and
> the PR is open to at the minimum document how to introduce a new "kind
> doc"(i.e. "kind.md" ) including notes on pain points that could be
> streamlined, but first I would ask for the minimum to doc what's the
> current state and as we improved the doc gets updated to reflect
> improvements. It's OK if this doc targets committers/contributors to core
>
> - Carlos Santana
> @csantanapr
>
> > On Jul 2, 2017, at 12:21 PM, Rodric Rabbah <ro...@gmail.com> wrote:
> >
> > This is the first action runtime contributed by the community! Kudos.
> >
> > I'm wondering if you have thoughts, while it's still fresh, on the
> effort for adding new runtimes. Was this too much work? What could be made
> easier?
> >
> > -r
>

Re: PHP 7.1 support for OpenWhisk

Posted by James Thomas <jt...@gmail.com>.
Great work Rob 💪.

On 2 July 2017 at 21:12, Rob Allen <ro...@akrabat.com> wrote:

> Hi,
>
> Yes, I intend to write up the process of adding a new kind. It wasn't too
> much work as there's relatively few points to integrate now which is nice.
> The key thing is having a reasonably efficient way to develop the action
> container and ensure it works. I used the advanced debugging article on
> Medium, which allowed for running an action quickly without the rest of
> OpenWhisk and seeing the stdout and stderr output.
>
> As Carlos says, this is a contributor level type document so the docs/dev
> directory would be the obvious place to put it.
>
> Regards,
>
> Rob...
>
>
> > On 2 Jul 2017, at 18:15, Carlos Santana <cs...@gmail.com> wrote:
> >
> > This is great addition by community in addition someone recognize by the
> PHP community
> >
> > Rodric I  mentioned the same thing to Rob, to capture while is fresh and
> the PR is open to at the minimum document how to introduce a new "kind
> doc"(i.e. "kind.md" ) including notes on pain points that could be
> streamlined, but first I would ask for the minimum to doc what's the
> current state and as we improved the doc gets updated to reflect
> improvements. It's OK if this doc targets committers/contributors to core
> >
> > - Carlos Santana
> > @csantanapr
> >
> >> On Jul 2, 2017, at 12:21 PM, Rodric Rabbah <ro...@gmail.com> wrote:
> >>
> >> This is the first action runtime contributed by the community! Kudos.
> >>
> >> I'm wondering if you have thoughts, while it's still fresh, on the
> effort for adding new runtimes. Was this too much work? What could be made
> easier?
> >>
> >> -r
>
> --
> Development thoughts at http://akrabat.com
> Daily Jotter for macOS at http://dailyjotter.com
>
>


-- 
Regards,
James Thomas

Re: PHP 7.1 support for OpenWhisk

Posted by Rob Allen <ro...@akrabat.com>.
Hi,

Yes, I intend to write up the process of adding a new kind. It wasn't too much work as there's relatively few points to integrate now which is nice. The key thing is having a reasonably efficient way to develop the action container and ensure it works. I used the advanced debugging article on Medium, which allowed for running an action quickly without the rest of OpenWhisk and seeing the stdout and stderr output.

As Carlos says, this is a contributor level type document so the docs/dev directory would be the obvious place to put it.

Regards,

Rob...


> On 2 Jul 2017, at 18:15, Carlos Santana <cs...@gmail.com> wrote:
> 
> This is great addition by community in addition someone recognize by the PHP community 
> 
> Rodric I  mentioned the same thing to Rob, to capture while is fresh and the PR is open to at the minimum document how to introduce a new "kind doc"(i.e. "kind.md" ) including notes on pain points that could be streamlined, but first I would ask for the minimum to doc what's the current state and as we improved the doc gets updated to reflect improvements. It's OK if this doc targets committers/contributors to core
> 
> - Carlos Santana
> @csantanapr
> 
>> On Jul 2, 2017, at 12:21 PM, Rodric Rabbah <ro...@gmail.com> wrote:
>> 
>> This is the first action runtime contributed by the community! Kudos. 
>> 
>> I'm wondering if you have thoughts, while it's still fresh, on the effort for adding new runtimes. Was this too much work? What could be made easier?
>> 
>> -r

-- 
Development thoughts at http://akrabat.com
Daily Jotter for macOS at http://dailyjotter.com


Re: PHP 7.1 support for OpenWhisk

Posted by Carlos Santana <cs...@gmail.com>.
This is great addition by community in addition someone recognize by the PHP community 

Rodric I  mentioned the same thing to Rob, to capture while is fresh and the PR is open to at the minimum document how to introduce a new "kind doc"(i.e. "kind.md" ) including notes on pain points that could be streamlined, but first I would ask for the minimum to doc what's the current state and as we improved the doc gets updated to reflect improvements. It's OK if this doc targets committers/contributors to core

- Carlos Santana
@csantanapr

> On Jul 2, 2017, at 12:21 PM, Rodric Rabbah <ro...@gmail.com> wrote:
> 
> This is the first action runtime contributed by the community! Kudos. 
> 
> I'm wondering if you have thoughts, while it's still fresh, on the effort for adding new runtimes. Was this too much work? What could be made easier?
> 
> -r

Re: PHP 7.1 support for OpenWhisk

Posted by Rodric Rabbah <ro...@gmail.com>.
This is the first action runtime contributed by the community! Kudos. 

I'm wondering if you have thoughts, while it's still fresh, on the effort for adding new runtimes. Was this too much work? What could be made easier?

-r

Re: PHP 7.1 support for OpenWhisk

Posted by Rob Allen <ro...@akrabat.com>.
Hi all,

I've added a "How to test" section to the description in https://github.com/apache/incubator-openwhisk/pull/2415 <https://github.com/apache/incubator-openwhisk/pull/2415> which may make it easier try it out locally.

Regards,

Rob...


> On 2 Jul 2017, at 15:12, Rob Allen <ro...@akrabat.com> wrote:
> 
> Hi all,
> 
> I have raised a PR to implement native PHP 7.1 support in OpenWhisk. I’ve called this kind `php:7.1`, as I expect we’ll want a 7.2, 7.3 etc.
> 
> This allows us to write PHP actions like this:
> 
> <?php
> function main(array $args) : array
> {
>     $name = $args["name"] ?? "stranger";
>     $greeting = "Hello $name!";
>     return ["greeting" => $greeting];
> }
> 
> 
> I’ve tried to match the functionality of the other languages with support for --main to change the action's entry function along with support for zip files of multiple PHP files, along with providing tests and documentation that match that provided with the other languages.
> 
> The PR is at https://github.com/apache/incubator-openwhisk/pull/2415 <https://github.com/apache/incubator-openwhisk/pull/2415> and I would appreciate all reviews and feedback.
> 
> Regards,
> 
> Rob...