A KRT yaml file is a declarative file describing the content of the KRT. It has general description of the Version, a GRPC entrypoint for the Runtime Version and nodes that are connected between each other to form workflows that will be access through GRPC services defined on the entrypoint.
Example below is directly taken from our krt v2 demo repo:
version: classificator-v1
krtVersion: v2 # new tagged krt version
description: Demo email classificator for branching features.
entrypoint:
proto: public_input.proto
image: konstellation/kre-entrypoint:latest
config:
variables:
- EARLY_REPLY_ENABLED
- WEBHOOK_URL
workflows:
- name: classificator
entrypoint: Classificator
exitpoint: exitpoint-node # name must match node's
nodes:
- name: etl
image: konstellation/kre-py:latest
src: src/etl/main.py
gpu: false
replicas: 1
subscriptions:
- "entrypoint"
objectStore:
name: emails
scope: workflow
- name: email-classificator
image: konstellation/kre-py:latest
src: src/email_classificator/main.py
gpu: false
replicas: 1
subscriptions:
- "etl"
objectStore:
name: emails
scope: workflow
- name: repairs-handler
image: konstellation/kre-go:latest
src: bin/repairs_handler
gpu: false
replicas: 2
subscriptions:
- "email-classificator.repairs" #consume from a subtopic
- name: stats-storer
image: konstellation/kre-go:latest
src: bin/stats_storer
gpu: false
replicas: 1
subscriptions:
- "email-classificator"
- name: exitpoint-node
image: konstellation/kre-go:latest
src: bin/exitpoint
gpu: false
replicas: 1
subscriptions:
- "etl"
- "stats-storer"
Here is a description of each field divided in five main concepts that make a KRT file:
Descriptive information of the Runtime Version.
This section describes all variables and files that are environment related and would be configured once the Runtime Version is uploaded to a KAI Server instance. This includes sensible data that should not be included on the KRT file, for example passwords.
All configuration defined here is mandatory, the Runtime Version won’t run if any of them is undefined.
This section describes how to access the Runtime Version.
This section includes the list of workflows contained in the KRT file. Each workflow has one or more nodes defined inside, of which one of them must be assigned to be the exitpoint.
entrypoint.proto
above.To define each node inside the workflows, you need to specify a name, a base image, its main source file and its subscriptions.
- name: repairs-handler
image: konstellation/kre-go:latest
src: bin/repairs_handler
gpu: false
replicas: 2
subscriptions:
- "email-classificator.repairs"
- "other-subscription"
- "other-subscription.subtopic"