Apache OpenServerless (incubating)

Clone this repo:
  1. 65a1451 Merge branch 'main' into 0.9.0 by Michele Sciabarra · 4 days ago main 0.9.0-incubating.26i07m11-snapshot 0.9.0-incubating.26i07m26-snapshot 0.9.0-incubating.26i09l58-snapshot
  2. 10277bc chore(deps): bump golang.org/x/net from 0.38.0 to 0.55.0 in /src by Michele Sciabarra · 4 days ago
  3. dce4ada Merge branch '0.9.0' by Michele Sciabarra · 4 days ago
  4. c044fcd using approved actions by Michele Sciabarra · 4 days ago
  5. 88c2836 aligned to 0.9.0 (#20) by Michele Sciabarra · 4 days ago

Apache OpenServerless Streamer (incubating)

The OpenServerless streamer is a tool to relay a stream from OpenWhisk actions to an outside HTTP client.

The streamer is a simple HTTP server that exposes an endpoint /stream/{namespace}/{action} to invoke the relative OpenWhisk action, open a socket for the action to write to, and relay the output to the client.

It expects 2 environment variables to be set:

  • OW_APIHOST: the OpenWhisk API host
  • STREAMER_ADDR: the address of the streamer server for the OpenWhisk actions to connect to

Other environment variables can be set to configure the streamer:

  • HTTP_SERVER_PORT: the port the streamer server listens on (default: 80)

Cors handling is handled through these variables:

  • CORS_ENABLED: set to 1 or true to enable the CORS handler
  • CORS_ALLOW_ORIGIN: this defaults to *
  • CORS_ALLOW_METHODS: this defaults to GET,POST,OPTIONS
  • CORS_ALLOW_HEADERS: this defaults to Authorization,Content-Type

Endpoints

The streamer exposes the following endpoints (use POST in case you need to send arguments to the action):

  • GET/POST /action/{namespace}/{action}: to invoke the OpenWhisk action on the given namespace, default package, and action name. It requires an Authorization header with Bearer token with the OpenWhisk AUTH token.

  • GET/POST /action/{namespace}/{package}/{action}: to invoke the OpenWhisk action on the given namespace, custom package, and action name. It requires an Authorization header with Bearer token with the OpenWhisk AUTH token

  • GET/POST /web/{namespace}/{action}: to invoke an OpenWhisk web action on the given namespace, default package, and action name.

  • GET/POST /web/{namespace}/{package}/{action}: to invoke an OpenWhisk web action on the given namespace, custom package, and action name.

Building

Check the BUILD.md in the apache/openserverless repository.