Open sciabarracom opened 2 months ago
To add a bit more of context the idea it is to create a runtime with proxy capabilities which will assume that
--main main@<hostname>:<port>
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).
The current implementation has been packaged within the common1.18.0 version. The proxy can now support these two environment variables
to be used to set the proxy in proxy client
mode or proxy server
mode.
In client mode, the proxy simply forward the request to the URL specified via the --main attribute. In server mode, the proxy accept multiple init requests and therefore it is capable to run multiple actions
For an initial complete implementation we need to add these capabilities to the proxy client/server mode
The runtime proxy (repo: apache/openserverless-runtime) will support proxy with a main in this format:
so you provide for example
--main=main@vastai.nuvolaris.io
the runtime will behave as follow:vastai.nuvolaris.io
and execute the init posting the payloadSome notes on the sintax:
@<proxy>
allows for the default main, so if you provide--main=@<proxy>
it shold forward the request as no main was provide using the defailt for the runtimes<proxy>
is in the format of an internet domainxxx.yyy.zzz
the forwarding should happen with https: protocol, howerver if you usehttp://xxx.yyy.zzz
the forwarding should happen using the http protocolTo 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)