The functionality should still be available IMO... allowing for expanded use cases (and reuse) other than fixed, env.-only params. plus possibility of re-init.
Kind regards, Matt From: "Michele Sciabarra" <mich...@sciabarra.com> To: "Matt Rutkowski" <mrutk...@us.ibm.com>, dev@openwhisk.apache.org Date: 10/10/2019 12:19 PM Subject: [EXTERNAL] Re: Porting Knative on Openwhisk Question: but does the "/init" and "/run" entry point should be still available? Also, why do you need to accept this init? Should not be an action built with tekton already ready to run, or you still have an initialization step? -- Michele Sciabarra mich...@sciabarra.com ----- Original message ----- From: Matt Rutkowski <mrutk...@us.ibm.com> To: dev@openwhisk.apache.org Subject: RE: Porting Knative on Openwhisk Date: Thursday, October 10, 2019 6:45 PM Hi Alessio, It should be noted that the JavaScript proxy (httpserver) under knative allows the single root "/" entry point to handle a JSON paylaod that includs "init", "run" or "init/run" together (along with parameter data) to separate logical data and avoid keyname collisins. In order to do this, we simply intrduced new top-level keys in the JSON payload to separate the "init" data from "run" (activation) data, as we already had a collision on the key "name". An example can be fund here: https://urldefense.proofpoint.com/v2/url?u=https-3A__github.com_apache_openwhisk-2Ddevtools_blob_master_knative-2Dbuild_runtimes_javascript_tests_helloworldwithparamsfromenv_payload-2Dknative-2Dinit-2Drun.http&d=DwIFaQ&c=jf_iaSHvJObTbx-siA1ZOg&r=6zQLM7Gc0Sv1iwayKOKa4_SFxRIxS478q2gZlAJj4Zw&m=J6qH6e_AHnGEmmrl77l_s6oi2p36x-FPnfDI6fzrZZM&s=uPcpeCuVI8-XjcsyL0WgVwOKigds8gS2P5XN-_9mebA&e= It should be noted that the changes needed to support these combinations was not easy in NodeJS as route handlers with Promises do not behave in a last-in first out manner and behave asynchronously (in case you were loooking at the code wondering why there was lots of duplication...). Much of the "experimental" work we did under https://urldefense.proofpoint.com/v2/url?u=https-3A__github.com_apache_openwhisk-2Ddevtools_tree_master_knative-2Dbuild&d=DwIFaQ&c=jf_iaSHvJObTbx-siA1ZOg&r=6zQLM7Gc0Sv1iwayKOKa4_SFxRIxS478q2gZlAJj4Zw&m=J6qH6e_AHnGEmmrl77l_s6oi2p36x-FPnfDI6fzrZZM&s=N0FX5uZxp85fUFr9BKwmHlSzXclsjpT2UvBC1JLJVlI&e= (and where we are working on Java optimizations as well) From: Alessio Marinelli <marinelli_ales...@yahoo.it.INVALID> To: <dev@openwhisk.apache.org> Date: 10/10/2019 10:19 AM Subject: [EXTERNAL] Re: Porting Knative on Openwhisk ok, thanks, Alessio Il giovedì 10 ottobre 2019, 16:14:54 CEST, Michele Sciabarra <mich...@sciabarra.com> ha scritto: Hi Alessio, thanks for your help. Basically, the task is to write implement in the runtime an adapter that will allow Knative images, that are basically simply http servers, to satisfy the contract of the OpenWhisk actions. There is already an implementation in Javascript here: https://urldefense.proofpoint.com/v2/url?u=https-3A__github.com_apache_openwhisk-2Druntime-2Dnodejs_blob_master_core_nodejsActionBase_platform_knative.js&d=DwIFaQ&c=jf_iaSHvJObTbx-siA1ZOg&r=6zQLM7Gc0Sv1iwayKOKa4_SFxRIxS478q2gZlAJj4Zw&m=tDM06Fqzo2uglMSzP9HARX04zWh6JG3-eJriGk8kSHw&s=eUkvQmN-dzBR0pzI5JspdtO1yO5bfqFHSV33m2yvPo8&e= The contract is split in /init and /run behaviour I already did the work for the init part although I have to change it to work in the same way the Javascript implementation works. I will take care of it. I would ask you to implement support of the /run part. Basically it means: - accepting an http request in the root path - create a single line json that encodes the values that an action expects, as described here: https://urldefense.proofpoint.com/v2/url?u=https-3A__github.com_apache_openwhisk_blob_master_docs_actions-2Dnew.md&d=DwIFaQ&c=jf_iaSHvJObTbx-siA1ZOg&r=6zQLM7Gc0Sv1iwayKOKa4_SFxRIxS478q2gZlAJj4Zw&m=tDM06Fqzo2uglMSzP9HARX04zWh6JG3-eJriGk8kSHw&s=EiAAbhiVnCJZborUMymzxF2W1lYGYzn7SqTDIB5oXfA&e= (look for activation) - feed the json to the underlying action executor that is already running after the initalization - collect the answer and decode it in order to provide the expected http answer. For a web action it must implement the web action contract as described here: https://urldefense.proofpoint.com/v2/url?u=https-3A__github.com_apache_openwhisk_blob_master_docs_webactions.md&d=DwIFaQ&c=jf_iaSHvJObTbx-siA1ZOg&r=6zQLM7Gc0Sv1iwayKOKa4_SFxRIxS478q2gZlAJj4Zw&m=tDM06Fqzo2uglMSzP9HARX04zWh6JG3-eJriGk8kSHw&s=JAkwVA0EusYnt8G53y4TXZrzYx2TddIUxFYC0oqAS0c&e= otherwise just return an action. The javascript knative.js code should provide a good guidance on the details. For anything else just ask, either here or on slack. Go the same implementation here: -- Michele Sciabarra mich...@sciabarra.com ----- Original message ----- From: Alessio Marinelli <marinelli_ales...@yahoo.it.INVALID> To: "dev@openwhisk.apache.org" <dev@openwhisk.apache.org> Subject: Porting Knative on Openwhisk Date: Thursday, October 10, 2019 4:02 PM Hi I am a colleague of Michele and I would like to help you complete the Knative support for actionloop, any indication will be appreciated, thanks, Alessio.