apache / openserverless

Apache OpenServerless
https://openserverless.apache.org
Apache License 2.0
18 stars 11 forks source link

Implement the proxy in main in the runtimes #53

Open sciabarracom opened 1 week ago

sciabarracom commented 1 week ago

The runtime proxy (repo: apache/openserverless-runtime) will support proxy with a main in this format:

<main>@<proxy>

so you provide for example --main=main@vastai.nuvolaris.io the runtime will behave as follow:

Some notes on the sintax:

To awoid security issues, enable the beaviour only if the the variable OW_USE_PROXY_MAIN is provided, so we will build a proxy image (that will be just the proxy without anything else)

francescotimperi commented 1 hour ago

To add a bit more of context the idea it is to create a runtime with proxy capabilities which will assume that

Under this circumstances, the proxy will have to forward the request to a runtime running at the https://<hostname>:<port>, but the request has to be rewritten in a way that the --main params is transformed into something like --main main. The format main@<hostname>:<port> it not understood by any of the OpenWhisk action loop based runtimes, as they are only able to parse something like --main main or --main class#method (for Java).