From 826f452188d063207d76134512f5ec7b94f0dfc4 Mon Sep 17 00:00:00 2001 From: Fabian von Feilitzsch Date: Tue, 20 Aug 2024 10:34:47 -0400 Subject: [PATCH] Updates for https://github.com/konveyor/kai/pull/308 Signed-off-by: Fabian von Feilitzsch --- roles/tackle/defaults/main.yml | 2 +- roles/tackle/tasks/kai.yml | 10 +++++----- roles/tackle/tasks/main.yml | 5 ++--- .../templates/kai/kai-api-deployment.yaml.j2 | 16 ++++++++-------- .../templates/kai/kai-db-deployment.yaml.j2 | 6 +++--- .../kai/kai-importer-deployment.yaml.j2 | 16 ++++++++-------- 6 files changed, 27 insertions(+), 28 deletions(-) diff --git a/roles/tackle/defaults/main.yml b/roles/tackle/defaults/main.yml index f3bddb8..a9d9f46 100644 --- a/roles/tackle/defaults/main.yml +++ b/roles/tackle/defaults/main.yml @@ -239,7 +239,7 @@ kai_enable_trace: "true" kai_model_provider: "ChatIBMGenAI" kai_model_id: "mistralai/mixtral-8x7b-instruct-v01" -kai_hub_importer_args: "-k" +kai_hub_importer_args: "" kai_database_image_fqin: "{{ keycloak_database_image_fqin }}" kai_database_secret_name: kai-db-secret diff --git a/roles/tackle/tasks/kai.yml b/roles/tackle/tasks/kai.yml index 522e5e7..54c8ab7 100644 --- a/roles/tackle/tasks/kai.yml +++ b/roles/tackle/tasks/kai.yml @@ -41,15 +41,15 @@ name: "{{ kai_database_secret_name }}" namespace: "{{ app_namespace }}" stringData: - POSTGRES_HOST: "{{ kai_database_address }}" - POSTGRES_DB: kai - POSTGRES_PASSWORD: "{{ pg_password }}" - POSTGRES_USER: kai + POSTGRESQL_HOST: "{{ kai_database_address }}" + POSTGRESQL_DATABASE: kai + POSTGRESQL_PASSWORD: "{{ pg_password }}" + POSTGRESQL_USER: kai when: (kai_db_secret_status.resources|length) == 0 - name: Decode pg_password from secret set_fact: - pg_password: "{{ kai_db_secret_status.resources.0.data.POSTGRES_PASSWORD | b64decode }}" + pg_password: "{{ kai_db_secret_status.resources.0.data.POSTGRESQL_PASSWORD | b64decode }}" when: (kai_db_secret_status.resources|length) > 0 - name: Retrieve Hub Secret diff --git a/roles/tackle/tasks/main.yml b/roles/tackle/tasks/main.yml index 2d179e2..6ec6878 100644 --- a/roles/tackle/tasks/main.yml +++ b/roles/tackle/tasks/main.yml @@ -734,6 +734,5 @@ - (pathfinder_pod.resources|length) == 0 - name: Run kai tasks - when: - - (experimental_deploy_kai|bool) - include_tasks: kai.yml + when: experimental_deploy_kai + import_tasks: kai.yml diff --git a/roles/tackle/templates/kai/kai-api-deployment.yaml.j2 b/roles/tackle/templates/kai/kai-api-deployment.yaml.j2 index 0a229b1..2ea488b 100644 --- a/roles/tackle/templates/kai/kai-api-deployment.yaml.j2 +++ b/roles/tackle/templates/kai/kai-api-deployment.yaml.j2 @@ -20,26 +20,26 @@ spec: ports: - containerPort: 8080 env: - - name: POSTGRES_HOST + - name: POSTGRESQL_HOST valueFrom: secretKeyRef: name: "{{ kai_db_secret_name }}" - key: POSTGRES_HOST - - name: POSTGRES_DB + key: POSTGRESQL_HOST + - name: POSTGRESQL_DATABASE valueFrom: secretKeyRef: name: "{{ kai_db_secret_name }}" - key: POSTGRES_DB - - name: POSTGRES_PASSWORD + key: POSTGRESQL_DB + - name: POSTGRESQL_PASSWORD valueFrom: secretKeyRef: name: "{{ kai_db_secret_name }}" - key: POSTGRES_PASSWORD - - name: POSTGRES_USER + key: POSTGRESQL_PASSWORD + - name: POSTGRESQL_USER valueFrom: secretKeyRef: name: "{{ kai_db_secret_name }}" - key: POSTGRES_USER + key: POSTGRESQL_USER - name: DEMO_MODE value: "False" - name: HUB_URL diff --git a/roles/tackle/templates/kai/kai-db-deployment.yaml.j2 b/roles/tackle/templates/kai/kai-db-deployment.yaml.j2 index 6b37d56..4fc61b8 100644 --- a/roles/tackle/templates/kai/kai-db-deployment.yaml.j2 +++ b/roles/tackle/templates/kai/kai-db-deployment.yaml.j2 @@ -22,17 +22,17 @@ spec: valueFrom: secretKeyRef: name: "{{ kai_db_secret_name }}" - key: POSTGRES_DB + key: POSTGRESQL_DATABASE - name: POSTGRESQL_PASSWORD valueFrom: secretKeyRef: name: "{{ kai_db_secret_name }}" - key: POSTGRES_PASSWORD + key: POSTGRESQL_PASSWORD - name: POSTGRESQL_USER valueFrom: secretKeyRef: name: "{{ kai_db_secret_name }}" - key: POSTGRES_USER + key: POSTGRESQL_USER volumeMounts: - mountPath: /var/lib/postgresql/data name: kai-db-data diff --git a/roles/tackle/templates/kai/kai-importer-deployment.yaml.j2 b/roles/tackle/templates/kai/kai-importer-deployment.yaml.j2 index 3f34a03..8a9899f 100644 --- a/roles/tackle/templates/kai/kai-importer-deployment.yaml.j2 +++ b/roles/tackle/templates/kai/kai-importer-deployment.yaml.j2 @@ -18,26 +18,26 @@ spec: - name: kai-hub-importer image: "{{ kai_fqin }}" env: - - name: POSTGRES_HOST + - name: POSTGRESQL_HOST valueFrom: secretKeyRef: name: "{{ kai_database_secret_name }}" - key: POSTGRES_HOST - - name: POSTGRES_DB + key: POSTGRESQL_HOST + - name: POSTGRESQL_DATABASE valueFrom: secretKeyRef: name: "{{ kai_database_secret_name }}" - key: POSTGRES_DB - - name: POSTGRES_PASSWORD + key: POSTGRESQL_DB + - name: POSTGRESQL_PASSWORD valueFrom: secretKeyRef: name: "{{ kai_database_secret_name }}" - key: POSTGRES_PASSWORD - - name: POSTGRES_USER + key: POSTGRESQL_PASSWORD + - name: POSTGRESQL_USER valueFrom: secretKeyRef: name: "{{ kai_database_secret_name }}" - key: POSTGRES_USER + key: POSTGRESQL_USER - name: DEMO_MODE value: "{{ kai_enable_demo_mode }}" - name: HUB_URL