Skip to content

Commit 15e12c0

Browse files
committed
Update docs for new runtime API (nodejs26, python314)
Split out from #2594 to keep the docs review separate from the runtime/controller code changes. - docs/user/00-80-migrate-to-new-runtime-api.md: new migration guide - docs/user/00-90-runtime-deprecation-schedule.md: schedule for legacy runtimes - docs/user/technical-reference/05-20-env-variables.md: env var renames - docs/user/technical-reference/07-70-function-specification.md: SDK reference - components/runtimes/{nodejs26,python314}/README_template.md: ejected workspace README (shipped via kyma function eject)
1 parent 701e055 commit 15e12c0

5 files changed

Lines changed: 78 additions & 66 deletions

File tree

components/runtimes/nodejs26/README_template.md

Lines changed: 18 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,45 +1,48 @@
11
# Ejected Functions Workspace
22

3-
This folder contains the most important block to test, run, deploy, and productize your business application and consists of the following elements:
3+
This folder contains the files you need to test, run, deploy, and productize your business application:
44

5-
* `handler.js` - source code of the buisness application
6-
* `server.mjs` - server source code required to run `handler.js`
7-
* `package.json` - dependencies file required for the `handler.js` and the `server.mjs` files to run
8-
* `lib/` - directory containing server SDK (like cloudevents or tracing functionality)
9-
* `resources/` - directory with basic Kubernetes resources required to deploy the application on a cluster
10-
* `Dockerfile` - application image definition
11-
* `Makefile` - basic portion of automations and scripts
5+
* `handler.js` — source code of your business application
6+
* `server.mjs` — server that loads and runs `handler.js`
7+
* `package.json` — dependencies for `handler.js` and `server.mjs`
8+
* `lib/` — internal server modules (tracing, metrics, request timeout, and graceful shutdown)
9+
* `sdk/` — user-facing SDK module (`require('sdk')`) exposing CloudEvent helpers, tracer, and function metadata getters
10+
* `resources/` — basic Kubernetes resources for deploying the application on a cluster
11+
* `Dockerfile` — application image definition
12+
* `Makefile` — automation scripts
1213

1314
## Scripts and Automations
1415

15-
The `Makefile` file is designed to speed up processes such as running an application locally or building or deploying it on a k3d cluster.
16+
Use the `Makefile` targets to run the application locally or build and deploy it on a k3d cluster. To see all available targets, run:
1617

17-
Read more about possibilities and functionalites by running the `make help` target.
18+
```bash
19+
make help
20+
```
1821

1922
### Run Application Locally
2023

21-
> [!NOTE]
22-
> Because the application is run outside the cluster, it cannot simply reach in-cluster services and use container envs. It is strongly recommended to use the following target to test the application without such dependencies or mock them and export container envs manually.
24+
> [!NOTE]
25+
> When you run the application outside the cluster, it cannot reach in-cluster services or read container environment variables. Use this target to test without such dependencies, or mock them and export the environment variables manually.
2326
2427
```bash
2528
export FUNC_NAME=<name>
2629
export FUNC_RUNTIME=<runtime>
27-
export SERVICE_NAMESPACE=<SERVICE_NAMESPACE>
30+
export SERVICE_NAMESPACE=<namespace>
2831

2932
make run
3033
```
3134

3235
### Deploy Application on k3d
3336

34-
The workspace is designed to easily start working on the productization of a business application extracted from Function. It allows testing it on a k3d cluster by building, importing, and deploying it:
37+
To build, import, and deploy the application on a k3d cluster:
3538

3639
```bash
3740
make k3d-deploy
3841
```
3942

4043
### Build and Push Application
4144

42-
Build and push your image to the location specified by `IMG`:
45+
To build and push your image to the location specified by `IMG`:
4346

4447
```bash
4548
make docker-build docker-push IMG=<image>

components/runtimes/python314/README_template.md

Lines changed: 19 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1,45 +1,47 @@
11
# Ejected Functions Workspace
22

3-
This folder contains the most important block to test, run, deploy, and productize your business application and consists of the following elements:
4-
5-
* `handler.py` - source code of the buisness application
6-
* `server.py` - server source code required to run `handler.py`
7-
* `requirements.txt` - dependencies file required for the `handler.py` and the `server.py` files to run
8-
* `lib/` - directory containing server SDK (like cloudevents or tracing functionality)
9-
* `resources/` - directory with basic Kubernetes resources required to deploy the application on a cluster
10-
* `Dockerfile` - application image definition
11-
* `Makefile` - basic portion of automations and scripts
12-
3+
This folder contains the files you need to test, run, deploy, and productize your business application:
4+
5+
* `handler.py` source code of your business application
6+
* `server.py` server that loads and runs `handler.py`
7+
* `requirements.txt` dependencies for `handler.py` and `server.py`
8+
* `lib/` server SDK modules (CloudEvents, tracing, and similar)
9+
* `resources/` basic Kubernetes resources for deploying the application on a cluster
10+
* `Dockerfile` application image definition
11+
* `Makefile` — automation scripts
12+
1313
## Scripts and Automations
1414

15-
The `Makefile` file is designed to speed up processes such as running an application locally or building or deploying it on a k3d cluster.
15+
Use the `Makefile` targets to run the application locally or build and deploy it on a k3d cluster. To see all available targets, run:
1616

17-
Read more about possibilities and functionalites by running the `make help` target.
17+
```bash
18+
make help
19+
```
1820

1921
### Run Application Locally
2022

21-
> [!NOTE]
22-
> Because the application is run outside the cluster, it cannot simply reach in-cluster services and use container envs. It is strongly recommended to use the following target to test the application without such dependencies or mock them and export container envs manually.
23+
> [!NOTE]
24+
> When you run the application outside the cluster, it cannot reach in-cluster services or read container environment variables. Use this target to test without such dependencies, or mock them and export the environment variables manually.
2325
2426
```bash
2527
export FUNC_NAME=<name>
2628
export FUNC_RUNTIME=<runtime>
27-
export SERVICE_NAMESPACE=<SERVICE_NAMESPACE>
29+
export SERVICE_NAMESPACE=<namespace>
2830

2931
make run
3032
```
3133

3234
### Deploy Application on k3d
3335

34-
The workspace is designed to easily start working on the productization of a business application extracted from Function. It allows testing it on a k3d cluster by building, importing, and deploying it:
36+
To build, import, and deploy the application on a k3d cluster:
3537

3638
```bash
3739
make k3d-deploy
3840
```
3941

4042
### Build and Push Application
4143

42-
Build and push your image to the location specified by `IMG`:
44+
To build and push your image to the location specified by `IMG`:
4345

4446
```bash
4547
make docker-build docker-push IMG=<image>

docs/user/00-80-migrate-to-new-runtime-api.md

Lines changed: 39 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -83,16 +83,18 @@ module.exports = {
8383

8484
```javascript
8585
// After — sdk functions
86-
import { getTracer, getFunctionName, getNamespace, getRuntime, getTimeout, getBodySizeLimit } from 'sdk';
87-
88-
export function main(req, res) {
89-
const tracer = getTracer();
90-
console.log(getFunctionName());
91-
console.log(getNamespace());
92-
console.log(getRuntime());
93-
console.log(getTimeout());
94-
console.log(getBodySizeLimit());
95-
res.send('ok');
86+
const { getTracer, getFunctionName, getNamespace, getRuntime, getTimeout, getBodySizeLimit } = require('sdk');
87+
88+
module.exports = {
89+
main: async function (req, res) {
90+
const tracer = getTracer();
91+
console.log(getFunctionName());
92+
console.log(getNamespace());
93+
console.log(getRuntime());
94+
console.log(getTimeout());
95+
console.log(getBodySizeLimit());
96+
res.send('ok');
97+
}
9698
}
9799
```
98100

@@ -157,22 +159,24 @@ module.exports = {
157159

158160
```javascript
159161
// After — getCloudEvent() returns a standard CloudEvent object
160-
import { getCloudEvent } from 'sdk';
161-
162-
export function main(req, res) {
163-
const ce = getCloudEvent(req);
164-
if (ce) {
165-
console.log(ce.type);
166-
console.log(ce.source);
167-
console.log(ce.specversion);
168-
console.log(ce.id);
169-
console.log(ce.time);
170-
console.log(ce.datacontenttype);
171-
console.log(ce.data);
172-
res.send(ce.type);
173-
return;
162+
const { getCloudEvent } = require('sdk');
163+
164+
module.exports = {
165+
main: function (req, res) {
166+
const ce = getCloudEvent(req);
167+
if (ce) {
168+
console.log(ce.type);
169+
console.log(ce.source);
170+
console.log(ce.specversion);
171+
console.log(ce.id);
172+
console.log(ce.time);
173+
console.log(ce.datacontenttype);
174+
console.log(ce.data);
175+
res.send(ce.type);
176+
return;
177+
}
178+
res.send("not a cloud event");
174179
}
175-
res.send("not a cloud event");
176180
}
177181
```
178182

@@ -239,15 +243,17 @@ module.exports = {
239243

240244
```javascript
241245
// After
242-
import { emitCloudEvent } from 'sdk';
246+
const { emitCloudEvent } = require('sdk');
243247

244-
export async function main(req, res) {
245-
await emitCloudEvent(
246-
'com.example.order.created',
247-
'/orders',
248-
{ orderId: '123' }
249-
);
250-
res.send("event emitted");
248+
module.exports = {
249+
main: async function (req, res) {
250+
await emitCloudEvent(
251+
'com.example.order.created',
252+
'/orders',
253+
{ orderId: '123' }
254+
);
255+
res.send("event emitted");
256+
}
251257
}
252258
```
253259

docs/user/00-90-runtime-deprecation-schedule.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ This document outlines the planned deprecation and end-of-life (EOL) dates for s
99
| Node.js 20 | February 2026 | April 2026 |
1010
| Node.js 22 | July 2026 | November 2026 |
1111
| Node.js 24 | TBD | TBD |
12+
| Node.js 26 | TBD | TBD |
1213
| Python 3.12 | September 2026 | March 2027 |
1314
| Python 3.14 | TBD | TBD |
1415

docs/user/technical-reference/07-70-function-specification.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -371,7 +371,7 @@ You can use a custom runtime image to override the existing one. Your image must
371371

372372
- Expose the workload endpoint on the right port
373373
- Provide liveness and readiness check endpoints at `/healthz`
374-
- Fetch sources from the path under the `KUBELESS_INSTALL_VOLUME` environment
374+
- Fetch sources from the path under the `HANDLER_PATH` environment
375375
- Security support. Kyma runtimes are secure by default. You only need to protect your images.
376376

377377
Every Function's Pods container has the same system environments, which helps you configure the Functions server. For more information, read the [Environment variables](05-20-env-variables.md) page.

0 commit comments

Comments
 (0)