-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #5 from konstellation-io/feat/KAI-140-add-scripts-…
…images Feat/kai 140, 141, 139
- Loading branch information
Showing
29 changed files
with
1,553 additions
and
144 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,34 +1,34 @@ | ||
# name: "Linter" | ||
name: "Linter" | ||
|
||
# on: | ||
# pull_request: | ||
# branches: | ||
# - main | ||
on: | ||
pull_request: | ||
branches: | ||
- main | ||
|
||
# jobs: | ||
# quality-checks: | ||
# runs-on: ubuntu-latest | ||
jobs: | ||
quality-checks: | ||
runs-on: ubuntu-latest | ||
|
||
# permissions: | ||
# contents: read | ||
# pull-requests: read | ||
# checks: write | ||
permissions: | ||
contents: read | ||
pull-requests: read | ||
checks: write | ||
|
||
# steps: | ||
# - uses: actions/checkout@v4 | ||
# with: | ||
# fetch-depth: 0 | ||
# persist-credentials: false | ||
steps: | ||
- uses: actions/checkout@v4 | ||
with: | ||
fetch-depth: 0 | ||
persist-credentials: false | ||
|
||
# - name: Setup Go | ||
# uses: actions/setup-go@v5 | ||
# with: | ||
# go-version: 1.23.2 | ||
- name: Setup Go | ||
uses: actions/setup-go@v5 | ||
with: | ||
go-version: 1.23.2 | ||
|
||
# - name: API Go Lint | ||
# uses: golangci/golangci-lint-action@v6 | ||
# with: | ||
# version: v1.62.2 | ||
# working-directory: ./src | ||
# args: --config ../.github/.golangci.yml | ||
# github-token: ${{ secrets.GITHUB_TOKEN }} | ||
- name: API Go Lint | ||
uses: golangci/golangci-lint-action@v6 | ||
with: | ||
version: v1.62.2 | ||
working-directory: ./src/demo-workflow/triggers/rest-trigger | ||
args: --config ../../../../.github/.golangci.yml | ||
github-token: ${{ secrets.GITHUB_TOKEN }} |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,65 @@ | ||
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 | ||
replicas: 1 | ||
gpu: false | ||
config: | ||
path: /rest-trigger | ||
port: "8080" | ||
objectStore: null | ||
secrets: [] | ||
subscriptions: | ||
- exit | ||
networking: | ||
targetPort: 8080 | ||
destinationPort: 8080 | ||
protocol: HTTP | ||
resourceLimits: | ||
CPU: | ||
request: "0.5" | ||
limit: "1" | ||
memory: | ||
request: 400M | ||
limit: 800M | ||
- name: training | ||
type: task | ||
image: registry.kai.local/kai-project-template_training:v0.0.4 | ||
replicas: 1 | ||
gpu: false | ||
objectStore: null | ||
secrets: [] | ||
subscriptions: | ||
- trigger | ||
networking: null | ||
resourceLimits: | ||
CPU: | ||
request: "0.5" | ||
limit: "1" | ||
memory: | ||
request: 400M | ||
limit: 800M | ||
- name: exit | ||
type: exit | ||
image: registry.kai.local/kai-project-template_exit:v0.0.2 | ||
replicas: 1 | ||
gpu: false | ||
objectStore: null | ||
secrets: [] | ||
subscriptions: | ||
- training | ||
networking: null | ||
resourceLimits: | ||
CPU: | ||
request: "0.5" | ||
limit: "1" | ||
memory: | ||
request: 400M | ||
limit: 800M |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,77 @@ | ||
# This variable have the environment to use, by default is local, but you can change when you run the make command | ||
ENV ?= local | ||
|
||
# Read the PRODUCT_NAME variable based on the file inside the corresponding directory | ||
PRODUCT_NAME := $(shell basename $(wildcard .kai/$(ENV)/*.yaml) .yaml) | ||
|
||
# Read the PRODUCT_VERSION variable based on the file inside the corresponding directory | ||
PRODUCT_VERSION := $(shell grep 'version:' .kai/$(ENV)/$(PRODUCT_NAME).yaml | awk '{print $$2}') | ||
|
||
# Sub folders of process | ||
SUBDIRS = src/demo-workflow/triggers/rest-trigger src/demo-workflow/tasks/training src/demo-workflow/exits/exit | ||
|
||
# Test for the see the value of the variables | ||
.PHONY: show-vars | ||
show-vars: | ||
@echo "ENV: $(ENV)" | ||
@echo "PRODUCT_NAME: $(PRODUCT_NAME)" | ||
@echo "PRODUCT_VERSION: $(PRODUCT_VERSION)" | ||
|
||
# AutoDoc | ||
# ------------------------------------------------------------------------- | ||
.PHONY: help | ||
help: ## This help | ||
@awk 'BEGIN {FS = ":.*?## "} /^[a-zA-Z_-]+:.*?## / {printf "\033[36m%-30s\033[0m %s\n", $$1, $$2}' $(MAKEFILE_LIST) | ||
.DEFAULT_GOAL := help | ||
|
||
.PHONY: login | ||
login: ## Login to the aio platform | ||
kli server login --client-id kai-kli-oidc --realm konstellation | ||
|
||
.PHONY: update-process-env | ||
update-process-env: ## Update process environment | ||
./scripts/update_process_env.sh | ||
|
||
.PHONY: create-product | ||
create-product: ## Push processes images | ||
kli product create $(PRODUCT_NAME) --description "Kai Project Template" | ||
|
||
.PHONY: push-all-process-images | ||
push-all-process-images: ## Push all process image by default | ||
@for dir in $(SUBDIRS); do \ | ||
$(MAKE) -C $$dir push-image; \admin/master/console/#/konstellation/users/2cb1e3b2-3ffd-4cda-84e7-a0c16d042706/credentials | ||
done | ||
|
||
.PHONY: push-product-version | ||
push-product-version: ## Push new product version | ||
kli product version push .kai/$(ENV)/$(PRODUCT_NAME).yaml | ||
|
||
.PHONY: start-product-version | ||
start-product-version: ## Start the product version | ||
kli product version start $(PRODUCT_NAME) $(PRODUCT_VERSION) "starting $(PRODUCT_VERSION) version..." | ||
|
||
.PHONY: stop-product-version | ||
stop-product-version: ## Stop the product version | ||
kli product version stop $(PRODUCT_NAME) $(PRODUCT_VERSION) "stopping $(PRODUCT_VERSION) version..." | ||
|
||
.PHONY: publish-product-version | ||
publish-product-version: ## Publish the product version skipping the unpublished step | ||
kli product version publish $(PRODUCT_NAME) $(PRODUCT_VERSION) "publishing $(PRODUCT_VERSION) version..." --force | ||
|
||
.PHONY: send-request | ||
send-request: ## Send a request to the product version | ||
./scripts/send_request.sh | ||
|
||
.PHONY: unpublish-product-version | ||
unpublish-product-version: ## Unpublish the product version | ||
kli product version unpublish $(PRODUCT_NAME) $(PRODUCT_VERSION) "unpublishing $(PRODUCT_VERSION) version..." | ||
|
||
##### HELPERS ##### | ||
|
||
.PHONY: list-processes-images # | ||
list-processes-images: ## List workflow processes | ||
kli process-registry ls $(PRODUCT_NAME) | ||
|
||
.PHONY: list-product-versions | ||
list-product-versions: ## List product versions | ||
kli product version list $(PRODUCT_NAME) |
Oops, something went wrong.