Kubeflow Pipelines backend API
July 27, 2026 ยท View on GitHub
Before you begin
Tools needed:
Set the environment variable API_VERSION to the version that you want to generate. We use v1beta1 as example here.
export API_VERSION="v2beta1"
Compiling .proto files to Go client and swagger definitions
Use make generate command to generate clients:
make generate
Default behavior (fast): Uses pre-built image for faster development.
When pre-built images may be outdated: Force building from source:
USE_PREBUILT_IMAGE=false make generate
The source build automatically:
- Builds the API generator Docker image from
backend/api/Dockerfile - Runs the generator inside the container to create client libraries
- Caches the built image for subsequent runs (using
.image-builttarget)
Go client library will be placed into:
./${API_VERSION}/go_client./${API_VERSION}/go_http_client./${API_VERSION}/swagger
Note
./${API_VERSION}/swagger/pipeline.upload.swagger.jsonis manually created, while the rest of./${API_VERSION}/swagger/*.swagger.jsonare compiled from./${API_VERSION}/*.protofiles.
Compiling Python client
To generate the Python client, use the generate-kfp-server-api-package Make target:
make generate-kfp-server-api-package
Default behavior (fast): Uses pre-built image for faster development.
When pre-built images may be outdated: Force building from source:
USE_PREBUILT_IMAGE=false make generate-kfp-server-api-package
The source build automatically:
- Builds the API generator Docker image (with Java) from source if needed
- Runs the Python client generation script inside the container
- The image already includes Java required for the OpenAPI generator
Alternatively, you can run the script directly if you have Java and Python3 installed locally:
./build_kfp_server_api_python_package.sh
Python client will be placed into ./${API_VERSION}/python_http_client.
Updating of API reference documentation
Note Whenever the API definition changes (i.e., the file
kfp_api_single_file.swagger.jsonchanges), the API reference documentation needs to be updated.
API definitions in this folder are used to generate v1beta1 and v2beta1 API reference documentation on kubeflow.org. Follow the steps below to update the documentation:
-
Install bootprint-openapi and html-inline packages using
npm:npm install -g bootprint npm install -g bootprint-openapi npm -g install html-inline -
Generate self-contained html file(s) with API reference documentation from
./${API_VERSION}/swagger/kfp_api_single_file.swagger.json:Fov
v1beta1:bootprint openapi ./v1beta1/swagger/kfp_api_single_file.swagger.json ./temp/v1 html-inline ./temp/v1/index.html > ./temp/v1/kubeflow-pipeline-api-spec.htmlFor
v2beta1:bootprint openapi ./v2beta1/swagger/kfp_api_single_file.swagger.json ./temp/v2 html-inline ./temp/v2/index.html > ./temp/v2/kubeflow-pipeline-api-spec.html -
Use the above generated html file(s) to replace the relevant section(s) on kubeflow.org. When copying th content, make sure to preserve the original headers.
v1beta1: file kubeflow-pipeline-api-spec.html.v2beta1: file kubeflow-pipeline-api-spec.html.
-
Create a PR with the changes in kubeflow.org website repository. See an example here.
Local development and Docker image management
Development Workflow Options
The API generation workflow supports two modes:
1. Fast Development (default): Uses pre-built images
make generate # Uses pre-built image (fast)
make generate-kfp-server-api-package # Uses pre-built image (fast)
2. Source Build (accurate): Builds from current source
USE_PREBUILT_IMAGE=false make generate # Builds from source
USE_PREBUILT_IMAGE=false make generate-kfp-server-api-package # Builds from source
CI/Validation: Always builds from source to ensure accuracy.
When to Use Each Mode
- Pre-built images: Regular development, prototyping, testing
- Source build: When pre-built images may have outdated tool versions, when changing API generation tools, updating dependencies, or before committing API changes
Legacy Targets
make generate-from-scratch: Legacy target, always builds from source
Docker Requirements
- Docker: Required for all API generation operations (BuildKit is enabled automatically for layer caching)
Manual API Generator Image Publishing
The build-tools-images.yml CI workflow automatically publishes API generator images to GitHub Container Registry. Manual publishing is typically not needed, but if required:
- Update the Dockerfile with your changes
- The image will be built and published automatically on the next push to a tracked branch
- For manual publishing, see the
build-tools-images.ymlworkflow for the exact commands