Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update #173

Merged
merged 2 commits into from
May 23, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 3 additions & 2 deletions Kubernetes/Components/Bot/Chart.yaml
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
apiVersion: v2
name: Bot
description: A Helm chart for Bot
description: A Helm chart for Train-bot

type: application

version: 0.1.0
appVersion: 2.0.0
appVersion: 2.0.0

97 changes: 44 additions & 53 deletions Kubernetes/Components/Bot/templates/deployment-byk-bot.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -13,59 +13,50 @@ spec:
app: "{{ .Values.release_name }}"
spec:
initContainers:
- name: bring-loba-folder-for-init-train
image: alpine/git:2.36.3
volumeMounts:
- name: loba-volume
mountPath: /app
command: ["/bin/sh"]
args:
- "-c"
- >
git clone $DSL_REPO /tmp/dsl-source &&
echo 'downloaded' &&
cp -r /tmp/dsl-source/$DSL_PATH/loba/* /app/ &&
echo 'moved' &&
ls /app
env:
- name: DSL_REPO
value: {{ .Values.images.bot.dsl.repo }}
- name: DSL_PATH
value: {{ .Values.images.bot.dsl.path }}
# - name: bring-loba-folder-for-init-train
# image: alpine/git:2.36.3
# volumeMounts:
# - name: rasa-training-data
# mountPath: /app
# command: ["/bin/sh"]
# args:
# - "-c"
# - >
# git clone $DSL_REPO /tmp/dsl-source &&
# echo 'downloaded' &&
# cp -r /tmp/dsl-source/$DSL_PATH/loba/* /app/ &&
# echo 'moved' &&
# adduser --no-create-home --disabled-password rasa &&
# chown -R rasa:rasa /app &&
# ls /app

# env:
# - name: DSL_REPO
# value: {{ .Values.bot.dsl.repo }}
# - name: DSL_PATH
# value: {{ .Values.bot.dsl.path }}

containers:
- name: byk-bot
image: riaee/byk:bot-20220728
command: ["/bin/sh"]
args:
- "-c"
- >
rasa train --fixed-model-name loba-model &&
rasa run
ports:
- containerPort: 5005
volumeMounts:
- name: loba-volume
mountPath: /app/
# resources:
# limits:
# memory: "1Gi"
# cpu: "500m"
- name: byk-bot-action
image: "{{ .Values.images.scope.bot_action.image }}"
command: ["python", "-m", "rasa_sdk.endpoint", "--actions", "actions"]

ports:
- containerPort: 5055
volumeMounts:
- name: loba-volume
mountPath: /app/
resources:
limits:
memory: "512Mi"
cpu: "500m"
- name: "{{ .Values.release_name }}"
image: "{{ .Values.images.scope.registry }}/{{ .Values.images.scope.repository }}:{{ .Values.images.scope.tag }}"
env:
- name: RASA_MAX_CACHE_SIZE
value: "0"
command: ["/bin/sh"]
args:
- "-c"
- >
rasa run --enable-api

ports:
- containerPort: 5005
volumeMounts:
- name: bot-rasa-models
mountPath: /app/models
volumes:
- name: loba-volume
persistentVolumeClaim:
claimName: pvc-loba

- name: bot-rasa-models
persistentVolumeClaim:
claimName: pvc-bot-models



10 changes: 10 additions & 0 deletions Kubernetes/Components/Bot/templates/pvc-bot-models.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
apiVersion: v1
kind: PersistentVolumeClaim
metadata:
name: pvc-bot-models
spec:
accessModes:
- ReadWriteMany
resources:
requests:
storage: 500Mi
27 changes: 0 additions & 27 deletions Kubernetes/Components/Bot/templates/service-byk-bot.yaml

This file was deleted.

12 changes: 12 additions & 0 deletions Kubernetes/Components/Bot/templates/service-byk-trainbot.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
apiVersion: v1
kind: Service
metadata:
name: {{ .Values.release_name }}
spec:
selector:
app: {{ .Values.release_name }}
ports:
- protocol: TCP
port: 5005
targetPort: 5005
name: http
25 changes: 13 additions & 12 deletions Kubernetes/Components/Bot/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -17,21 +17,22 @@ securityContext: {}

domain: test.buerokratt.ee # Domain name

#ingress:
# tlsConfigMapName: byk-tls-configmap

ingress:
certIssuerName: letsencrypt-prod # Change this if your certIssuerName has set up different
certIssuerName: letsencrypt-prod-issuer

release_name: "byk-bot"
releaseName: "byk-bot"
release_name: "component-byk-bot"


images:
scope:
bot:
image: "riaee/byk:bot-20220728"
bot_action:
image: "riaee/byk:bot-action-server-20220728"
bot:
dsl:
repo: https://github.com/buerokratt/Installation-Guides.git
path: default-setup/chatbot-and-training/bot

registry: "ghcr.io"
repository: "varmoh/rasa-for-buerokratt"
tag: "pre-alpha-1.1.0" # Images (tags) are up to date, currently no changes needed

bot:
dsl:
repo: https://github.com/buerokratt/Installation-Guides.git
path: default-setup/chatbot-and-training/bot
7 changes: 7 additions & 0 deletions Kubernetes/Components/CronManager/Chart.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
apiVersion: v2
name: Cronmanager
description: A Helm chart for Kubernetes

type: application
version: 0.1.0
appVersion: "1.1.0"
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
apiVersion: v1
kind: ConfigMap
metadata:
name: cronconst
data:
constants.ini: |
TRAINING_PUBLIC_RUUTER=http://component-byk-ruuter-private:8080/training
TRAINING_DMAPPER=http://component-byk-dmapper:3000
TRAINING_OPENSEARCH=http://component-opensearch-node:9200
TRAINING_TIM=http://component-byk-tim:8085
TRAINING_RESQL=http://component-byk-resql:8082/training
TRAINING_USERS_RESQL=http://component-byk-resql:8082/training
TRAINING_PIPELINE=http://module-byk-training-gui-pipelines:3010
TRAINING_RASA=http://component-byk-train-bot:5005
S3_FERRY=http://component-byk-s3:3000
SERVICES_RESQL=http://component-byk-resql:8082/training
CRON_INSTANCE=http://component-byk-cronmanager:9010
CRON_MANAGER=http://component-byk-cronmanager:9010

TRAINING_FILES_PATH=/rasa/locations/data/
TESTING_FILES_PATH=/rasa/locations/tests/
CROSS_VALIDATION_FILES_PATH=/rasa/locations/data/nlu/
64 changes: 64 additions & 0 deletions Kubernetes/Components/CronManager/templates/deployment.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,64 @@
apiVersion: apps/v1
kind: Deployment
metadata:
name: "{{ .Values.release_name }}"
spec:
replicas: 1
selector:
matchLabels:
app: "{{ .Values.release_name }}"
template:
metadata:
labels:
app: "{{ .Values.release_name }}"
spec:
containers:
- name: "{{ .Values.release_name }}"
image: "{{ .Values.images.scope.registry }}/{{ .Values.images.scope.repository }}:{{ .Values.images.scope.tag }}"
ports:
- containerPort: 9010
env:
- name: TRAINING_PUBLIC_RUUTER
value: "{{ .Values.contstants.TRAINING_PUBLIC_RUUTER }}"
- name: TRAINING_DMAPPER
value: "{{ .Values.contstants.TRAINING_DMAPPER }}"
- name: TRAINING_OPENSEARCH
value: "{{ .Values.contstants.TRAINING_OPENSEARCH }}"
- name: TRAINING_TIM
value: "{{ .Values.contstants.TRAINING_TIM }}"
- name: TRAINING_RESQL
value: "{{ .Values.contstants.TRAINING_RESQL }}"
- name: TRAINING_USERS_RESQL
value: "{{ .Values.contstants.TRAINING_USERS_RESQL }}"
- name: TRAINING_PIPELINE
value: "{{ .Values.contstants.TRAINING_PIPELINE }}"
- name: TRAINING_RASA
value: "{{ .Values.contstants.TRAINING_RASA }}"
- name: S3_FERRY
value: "{{ .Values.contstants.S3_FERRY }}"
- name: SERVICES_RESQL
value: "{{ .Values.contstants.SERVICES_RESQL }}"
- name: CRON_INSTANCE
value: "{{ .Values.contstants.CRON_INSTANCE }}"
- name: CRON_MANAGER
value: "{{ .Values.contstants.CRON_MANAGER }}"
- name: TRAINING_FILES_PATH
value: "{{ .Values.contstants.TRAINING_FILES_PATH }}"
- name: TESTING_FILES_PATH
value: "{{ .Values.contstants.TESTING_FILES_PATH }}"
- name: CROSS_VALIDATION_FILES_PATH
value: "{{ .Values.contstants.CROSS_VALIDATION_FILES_PATH }}"

volumeMounts:
- name: trainbot-rasa-models
mountPath: /data
- name: cronconst
mountPath: /app/constants.ini
subPath: constants.ini
volumes:
- name: trainbot-rasa-models
persistentVolumeClaim:
claimName: pvc-trainbot-models
- name: cronconst
configMap:
name: cronconst
13 changes: 13 additions & 0 deletions Kubernetes/Components/CronManager/templates/service.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
apiVersion: v1
kind: Service
metadata:
name: {{ .Values.release_name }}
spec:
selector:
app: {{ .Values.release_name }}
ports:
- protocol: TCP
port: 9010
targetPort: 8080
name: http

48 changes: 48 additions & 0 deletions Kubernetes/Components/CronManager/values.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
imagePullSecrets: []
nameOverride: ""
fullnameOverride: ""

podAnnotations: {}

podSecurityContext: {}
# fsGroup: 2000

securityContext: {}
# capabilities:
# drop:
# - ALL
# readOnlyRootFilesystem: true
# runAsNonRoot: true
# runAsUser: 1000

domain: test.buerokratt.ee # Domain name
#secretname: ruuter.test.buerokratt.ee1904prod # Cert name value, change this as suited to environment
#ingress:
# certIssuerName: letsencrypt-prod # Change this if your certIssuerName has set up different

release_name: "component-byk-cronmanager"

images:
scope:
registry: "ghcr.io"
repository: "varmoh/cronmanager"
tag: "pre-alpha-1.2.0" # Images (tags) are up to date, currently no changes needed


contstants:
TRAINING_PUBLIC_RUUTER: "http://component-byk-ruuter-private:8080"
TRAINING_DMAPPER: "http://component-byk-dmapper-v1:3000" # Vaata üle täpselt mi siia läks
TRAINING_OPENSEARCH: "http://component-opensearch-node:9200"
TRAINING_TIM: "http://component-byk-tim:8085"
TRAINING_RESQL: "http://component-byk-resql:8082"
TRAINING_USERS_RESQL: http://component-byk-resql:8082
TRAINING_PIPELINE: "http://module-byk-training-gui-pipelines:3010"
TRAINING_RASA: "http://component-byk-train-bot:5005" # ehita training rasa image, muuda trin-bot? deploy kausta, midagi seal all juba valmis kah
S3_FERRY: "http://component-byk-s3:3000"
SERVICES_RESQL: "http://component-byk-resql:8082"
CRON_INSTANCE: "http://component-byk-cronmanager:9010"
CRON_MANAGER: "http://component-byk-cronmanager:9010"

TRAINING_FILES_PATH: "/rasa/locations/data/"
TESTING_FILES_PATH: "/rasa/locations/tests/"
CROSS_VALIDATION_FILES_PATH: "/rasa/locations/data/nlu/"
Loading