Python Runtime
The Python runtime enables you to execute user-defined Python handlers. It registers a Function
kind python
and supports three actions: job
, serve
, and build
.
job
: Execute a Python handler as a one-off jobserve
: Deploy a Python handler as a long-lived servicebuild
: Create a Docker image with all required dependencies for efficient execution
Prerequisites
Supported Python versions:
- Python ≥ 3.9, < 3.13
Required package:
digitalhub-runtime-python
Install from PyPI:
Usage overview
To execute a Python handler on the platform:
- Implement the handler as described in handler definition.
- Create a
Function
resource that references your handler and declares inputs/outputs and callfunction.run()
to execute the handler. - Retrieve eventual outputs from the
Run
.
See Examples for code samples.