Overview of OpenWhisk Actions
masterwsk) or the REST API.repository·master·Indexed 27 days ago
https://github.com/apache/openwhiskA serverless functions platform for building cloud applications. OpenWhisk enables developers to create serverless APIs from functions, compose them into workflows, and connect events via rules and triggers. Documentation covers standalone and Kubernetes deployment, the wsk CLI, the Scala core API (including FullyQualifiedEntityName and ByteSize), Etcd integration for leader election and key-value operations, and HTTP error response formats.
wsk) or the REST API.Apache OpenWhisk is composed of several specialized modules categorized by their role in the ecosystem, including core platform components, client libraries, runtimes, deployment tools, and integration packages.
OpenWhisk supports various execution environments via specific runtime modules:
When a user uploads an action via the wsk CLI, the ActionLoop proxy prepares a work folder containing src and bin directories. The proxy handles different file types as follows:
bin/exec and executed directly.src/exec, then the compilation script is invoked.src folder.src/exec exists and is an executable, src is renamed to bin and bin/exec is executed.src/exec is missing or not an executable, the compilation script is invoked.An executable for ActionLoop must be either a Linux binary (ELF) or a script starting with a shebang (e.g., #!/bin/bash).
OpenWhisk follows a RESTful design where commands (like those from the wsk CLI) are translated into HTTP requests. The flow of an action invocation is as follows:
POST to an action into an 'invocation') and manages the Load Balancer.subjects database.whisks database.activations database under a unique ActivationId.OpenWhisk allows users to expose event producer services as feeds within a package. There are three primary architectural patterns for implementing a feed:
To function as an OpenWhisk action, a function must meet these criteria:
main or be explicitly exported. If using the wsk CLI, you can specify a different entry point using the --main flag.OpenWhisk provides two distinct categories of metrics:
Note: User metrics are not directly exposed via an API; consuming them requires a separate micro-service based on a Kafka Consumer to process the data.
The FPCScheduler is a proposed high-performance scheduler for OpenWhisk designed to address performance bottlenecks in the default ShardingPoolBalancer.
Key improvements include:
MemoryQueue to prevent interference between different actions.For more advanced examples, complete applications, tutorials, and hands-on learning, use the following resources:
OpenWhisk is an event-driven compute platform (Serverless/FaaS) that executes code in response to events or direct invocations.
Key concepts include:
OpenWhisk uses a hierarchical structure for its entities (actions, triggers, rules, packages, and namespaces).
/whisk.system namespace is reserved for system-distributed entities.The format for a fully qualified name is /namespaceName[/packageName]/entityName.
| Fully qualified name | Alias | Namespace | Package | Name |
|---|---|---|---|---|
/whisk.system/cloudant/read | /whisk.system | cloudant | read | |
/myOrg/video/transcode | video/transcode | /myOrg | video | transcode |
/myOrg/filter | filter | /myOrg | filter |
If you are in your default namespace, you can omit the namespace prefix in your commands.
/whisk.system namespace. These packages allow you to easily integrate external services and capabilities into your applications without writing custom integration code. You can browse these packages using the command line tool to find specific integrations like Slack, GitHub, or Watson services.