You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@openwhisk.apache.org by Michele Sciabarra <mi...@sciabarra.com> on 2018/12/18 20:42:26 UTC

Are changes to the ActionLoop required to implement the Pyhton runtime?

Hello all,

I am implementing an action loop based runtime for Python. So far I managed to have everything working and I have a runtime that passes all the mandatory tests. However, I am trying to run it against the existing tests for the Python runtime and I am hitting the head against the expected behavior for reporting compilation errors.

Looks like the current runtime tests expects (and checks) that certain errors are reported in stdout/stderr and produces output guards also for the init action, something novel for me.

Currently, ActionLoop expects a compiler either is silent if there are no errors OR reports errors in stdout/stderr. However, the output of the compiler is captured and returned as  part of the answer to the init (either {"ok":true} or {"error":"output-of-the-compiler"}. In particular, ActionLoop at  init time does not produce any guard nor any output in the log.

What I should do? To pass those tests I should change the current ActionLoop behavior, but I do not know if is it important. I am trying to make it compatible a pass all the tests for expected output but I think I can instead change the test at least for those behaviors related to error reporting at init time.

Please advise.

-- 
  Michele Sciabarra
  michele@sciabarra.com

Re: Are changes to the ActionLoop required to implement the Pyhton runtime?

Posted by Michele Sciabarra <mi...@sciabarra.com>.
The proxy is able to report those errors but it reports then in the answer to the init NOT in the log.

For example, this:

 it should "report error if zip-encoded action does not include required file" 

I changed the test adding a flag errorsAreLogged that defaults to true.
With my changes the test now looks like:

---
 val (out, err) = withActionContainer() { c =>
      val (initCode, initRes) = c.init(initPayload(code, main = "echo"))
      initCode should be(502)
      if(!errorsAreLogged)
        initRes.get.fields.get("error").get.toString() should include("Zip file does not include")
    }

    if(errorsAreLogged)
      checkStreams(out, err, {
        case (o, e) =>
          o shouldBe empty
          e should include("Zip file does not include")
      })
---

Let me know if it is acceptable. If it is, I will fix tests to support the different error reporting semantics. 
I am not going to change any runtime semantic though.

-- 
  Michele Sciabarra
  michele@sciabarra.com

----- Original message -----
From: Rodric Rabbah <ro...@gmail.com>
To: dev@openwhisk.apache.org
Subject: Re: Are changes to the ActionLoop required to implement the Pyhton runtime?
Date: Wed, 19 Dec 2018 15:35:26 +0000

Can you give some examples Michele?

The errors checked in the test are to give the user some indication of what
failed (parse error, missing variable definition, ...) - is the proxy
you're working on able to report these errors? i dont think the exact
wording matters but the nature of the content is what's important and how
it can help the end user figure out what went wrong.

-r


On Tue, Dec 18, 2018 at 8:49 PM Michele Sciabarra <mi...@sciabarra.com>
wrote:

> Hello all,
>
> I am implementing an action loop based runtime for Python. So far I
> managed to have everything working and I have a runtime that passes all the
> mandatory tests. However, I am trying to run it against the existing tests
> for the Python runtime and I am hitting the head against the expected
> behavior for reporting compilation errors.
>
> Looks like the current runtime tests expects (and checks) that certain
> errors are reported in stdout/stderr and produces output guards also for
> the init action, something novel for me.
>
> Currently, ActionLoop expects a compiler either is silent if there are no
> errors OR reports errors in stdout/stderr. However, the output of the
> compiler is captured and returned as  part of the answer to the init
> (either {"ok":true} or {"error":"output-of-the-compiler"}. In particular,
> ActionLoop at  init time does not produce any guard nor any output in the
> log.
>
> What I should do? To pass those tests I should change the current
> ActionLoop behavior, but I do not know if is it important. I am trying to
> make it compatible a pass all the tests for expected output but I think I
> can instead change the test at least for those behaviors related to error
> reporting at init time.
>
> Please advise.
>
> --
>   Michele Sciabarra
>   michele@sciabarra.com
>

Re: Are changes to the ActionLoop required to implement the Pyhton runtime?

Posted by Rodric Rabbah <ro...@gmail.com>.
Can you give some examples Michele?

The errors checked in the test are to give the user some indication of what
failed (parse error, missing variable definition, ...) - is the proxy
you're working on able to report these errors? i dont think the exact
wording matters but the nature of the content is what's important and how
it can help the end user figure out what went wrong.

-r


On Tue, Dec 18, 2018 at 8:49 PM Michele Sciabarra <mi...@sciabarra.com>
wrote:

> Hello all,
>
> I am implementing an action loop based runtime for Python. So far I
> managed to have everything working and I have a runtime that passes all the
> mandatory tests. However, I am trying to run it against the existing tests
> for the Python runtime and I am hitting the head against the expected
> behavior for reporting compilation errors.
>
> Looks like the current runtime tests expects (and checks) that certain
> errors are reported in stdout/stderr and produces output guards also for
> the init action, something novel for me.
>
> Currently, ActionLoop expects a compiler either is silent if there are no
> errors OR reports errors in stdout/stderr. However, the output of the
> compiler is captured and returned as  part of the answer to the init
> (either {"ok":true} or {"error":"output-of-the-compiler"}. In particular,
> ActionLoop at  init time does not produce any guard nor any output in the
> log.
>
> What I should do? To pass those tests I should change the current
> ActionLoop behavior, but I do not know if is it important. I am trying to
> make it compatible a pass all the tests for expected output but I think I
> can instead change the test at least for those behaviors related to error
> reporting at init time.
>
> Please advise.
>
> --
>   Michele Sciabarra
>   michele@sciabarra.com
>