Skip to content

Commit 77cae7d

Browse files
docs(chore): add script for runtime dependecies generation and guides (#61)
* docs(chore): add script for runtime dependecies generation add guide for nodejs, python and php (#98) * docs(fix): add light mode for table removed typos on php add space Creating and invoking PHP actions add missing php tag
1 parent 730b10d commit 77cae7d

27 files changed

Lines changed: 1734 additions & 10 deletions

File tree

README.md

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,14 +42,17 @@ The documentation for [OpenServerless Tasks](https://github.com/apache/openserve
4242
[OpenServerless Tools](https://github.com/apache/openserverless-cli/) is automatically extracted from the
4343
respective repositories.
4444

45-
Is possible to align task and tools using these commands:
45+
Is possible to align task, tools and runtimes using these commands:
4646

4747
- Tasks
4848
- `task import-task`
4949

5050
- Tools
5151
- `task import-tools`
5252

53+
- Runtimes
54+
- `task import-runtimes`
55+
5356
### Web site build
5457

5558
- Run Hugo Build

Taskfile.yaml

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,17 @@ tasks:
4242
#cat $file >>content/en/docs/reference/tasks/$tgt
4343
done
4444
- rm -rf openserverless-task
45+
46+
import-runtimes:
47+
desc: import runtimes dependecies
48+
silent: true
49+
cmds:
50+
- test -d "openserverless-task" && git pull || git clone https://github.com/apache/openserverless-task
51+
- test -d "openserverless-runtimes" && git pull || git clone https://github.com/apache/openserverless-runtimes
52+
- |
53+
bun tasks/runtimes/src/index.ts
54+
- rm -rf openserverless-runtimes
55+
- rm -rf openserverless-task
4556

4657
preview:
4758
silent: true

assets/scss/_styles_project.scss

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,8 @@
3535
--code-bg-light: #f5f5f5;
3636
--bs-secondary-color: #333333;
3737
--td-pre-bg: #ececec;
38+
--bs-body-bg: #ffffff;
39+
--bs-emphasis-color: #333333;
3840
}
3941

4042
.dark-mode {
@@ -45,6 +47,8 @@
4547
--code-bg-light: #1e1e1e;
4648
--bs-secondary-color: #e0e0e0;
4749
--td-pre-bg: #1e1e1e;
50+
--bs-body-bg: #333333;
51+
--bs-emphasis-color: #ffffff;
4852
}
4953

5054
body {

content/en/docs/reference/runtimes/_index.md

Lines changed: 57 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,69 @@
11
---
22
title: Runtimes
3-
description: List of OpenServerless' supported runtimes
3+
description:
44
#weight: 60
55
draft: false
66
---
77

8-
## Supported Runtimes
9-
This document is still 🚧 **work in progress** 🚧
8+
# Apache OpenServerless (OPS) Runtimes Explained
109

11-
The programming languages currently directly supported by OpenServerless are:
10+
Apache OpenServerless (OPS) is a serverless platform built on Apache OpenWhisk, designed to execute functions in a scalable, event-driven environment. OPS leverages OpenWhisk's runtime model while extending its capabilities to support additional customization via Docker.
1211

13-
- [🚧 Node](actions-nodejs)
12+
---
13+
14+
## Overview of OPS Runtimes
15+
16+
A **runtime** in OPS is a preconfigured environment that executes a serverless function.
17+
Since serverless platforms allocate compute resources dynamically, a runtime ensures:
18+
19+
1. **Portability** – Developers can write code in different languages without managing dependencies.
20+
2. **Scalability** – The system provisions and scales runtimes automatically based on demand.
21+
3. **Isolation** – Each Action runs within its own dedicated runtime environment, ensuring security and consistency.
22+
4. **Resource Efficiency** – The platform optimizes resource allocation by suspending inactive runtimes and reusing active ones when possible.
23+
24+
OPS natively supports the following runtimes:
25+
- **Python**
26+
- **Node.js**
27+
- **PHP**
28+
29+
However, since OPS is built on OpenWhisk, it inherits compatibility with all [OpenWhisk-supported runtimes](https://openwhisk.apache.org/documentation.html#runtimes) (e.g., Java, Go) and allows users to define custom runtimes using Docker containers.
30+
31+
For greater flexibility, developers can also package their own runtime environments using Docker to create "black box" actions.
32+
33+
---
34+
35+
## How OPS Runtimes Work
36+
37+
### 1. Runtime Lifecycle
38+
OPS follows OpenWhisk's runtime model, where each function invocation occurs in an isolated container. The lifecycle includes:
39+
1. **Initialization**: A container is provisioned with the selected runtime.
40+
2. **Execution**: The function code runs within the container.
41+
3. **Idle**: The container is paused (but retained) for reuse (Warm Start).
42+
4. **Destroying**: Idle containers are garbage-collected after some time.
43+
44+
### 2. Cold vs. Warm Starts
45+
- **Cold Start**: A new container is created, increasing latency.
46+
- **Warm Start**: Reuses a paused container for faster execution.
47+
48+
### 3. Runtime Composition
49+
Each runtime includes:
50+
- **Language Interpreter/Compiler**: (e.g., Python 3.12, Node.js 21).
51+
- **Action Interface**: A proxy that implements a canonical protocol to integrate with the OpenWhisk platform.
52+
- **Dependencies**: Preinstalled libraries (e.g., `requests` for Python).
53+
54+
---
55+
56+
## Actions
57+
58+
**Actions** are the fundamental execution units in Apache OpenServerless. They are stateless functions that run on the OpenWhisk platform.
59+
60+
An action can be used to update a database, respond to an API call, communicate with another system, ecc.
1461

15-
- [🚧 Python](actions-python)
62+
To use a function as an action, it must conform to the following:
1663

17-
- [🚧 Go](actions-go)
64+
- The function accepts a dictionary as input and produces a dictionary as output. The input and output dictionaries are
65+
key-value pairs, where the key is a string and the value is any valid JSON value. The dictionaries are
66+
canonically represented as JSON objects when interfacing to an action via the REST API or the `ops` CLI.
1867

19-
- [🚧 Java](actions-java)
68+
- The function must be called `main` or exposed as main
2069

21-
- [🚧 PHP](actions-php)

0 commit comments

Comments
 (0)