This is a template for a new project in the kai ecosystem. It includes a basic project structure.
To use this template, click the "Use this template" button on the GitHub page. This will create a new repository with the same structure as this one.
TBD
TBD
This section describe the step by step process to setup the local infrastructure for testing the project.
Before starting, make sure to meet the following requirements:
-
Install local KAI:
- Verify that all necessary components KAI Requirements are installed. There is no specific version until now.
- Download the latest version of KAI from the github repository.
- Deploy KAI locally using
kaictl.sh
script, avoid errors for a previous version installed using flagdracarys
../kaictl.sh dev --dracarys
-
Create a User in Keycloak:
- Access the Keycloak admin console (
auth.kai.local
) using the administrator credentials. - Create a new user in the Konstellation realm and assign them to the
admin
group. - Remove refresh token from the user created.
- Access the Keycloak admin console (
-
Install Kai-Kli:
- If
Go
is not installed, install it. There is no specific version until now. - At this moment there is no binary release, so you need to generate the
kai-kli
binary locally by download github repository and running the following command in the repository root:make generate
- Using the CLI generated in the previous step for create configuration for the KAI server created in the first step:
kli server add local kai.local --insecure # Add the local server without security kli server login # Login to the server with the user created in Keycloak
- If
-
When start product
- When you create a product and want to start it, you need to include information about email, name and surname in the Keycloak (
auth.kai.local
) user (kai-project-template
) auto-generated. If not, minio will not initialize corretly.
- When you create a product and want to start it, you need to include information about email, name and surname in the Keycloak (
In this template have been included a simple workflow for showing the basic use of KLI for process and product management.
This section contains the instructions to deploy the workflow processes using the provided Makefile
commands.
- Kai CLI: Install the Kai CLI tool (
kli
) on your machine. - Docker: Ensure Docker is installed and running.
- Make: Ensure
make
is installed to run the Makefile commands.
Log in to the platform to authenticate your session:
make login
Create the product for the workflow
make create-product
Depending of what you need, use root Makefile or Makefile inside each process folder. The Makefile inside each process you can use
make -C src/demo-workflow/<type-process>/<process-folder> push-image <env> <version>
The env and version are optionals, you can change directly in the Makefile. In you need to push all images, use the root Makefile that push with the defaults env and version
make push-all-process-images
Manually update the .kai//.yaml file with the correct versions for each process and product. Ensure the versions match the ones used in the previous step.
version: v0.1.4
description: kai-project-template
config: {}
workflows:
- name: demo-workflow
type: training
config: {}
processes:
- name: trigger
type: trigger
image: registry.kai.local/kai-project-template_rest-trigger:v0.0.1
....
After updating the configuration, push the product version:
make push-product-version
Before starting the product for the first time, check in the Keycloak configuration whether the KAI user has their email, first name, and last name set up. If not, these fields must be completed; otherwise, the process creation will fail.
Start the specific product version
make start-product-version
Start the specific product version
make publish-product-version
Start the specific product version
make publish-product-version
-
List Workflow Processes: Display all the process images and the state of each one.
make list-processes-images
-
List Product Versions: Show all versions of the product.
make list-product-versions