Skip to content

Commit b724e97

Browse files
committed
Changes to support use of lightspeed-stack
1 parent c769faa commit b724e97

File tree

7 files changed

+74
-48
lines changed

7 files changed

+74
-48
lines changed

roles/chatbot/tasks/deploy_chatbot_api.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77
loop:
88
- 'chatbot.pvc'
99
- 'chatbot.service'
10+
- 'chatbot.configmap'
1011
- 'chatbot.deployment'
1112

1213
- name: Check for Chatbot Pod

roles/chatbot/tasks/main.yml

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -17,9 +17,6 @@
1717
- name: Deploy AnsibleAIConnect's Chatbot service
1818
ansible.builtin.include_tasks: deploy_chatbot_api.yml
1919

20-
- name: Register MCP servers
21-
ansible.builtin.include_tasks: register_mcp_servers.yml
22-
2320
when:
2421
- chatbot_config_secret_name is defined
2522
- chatbot_config_secret_name | length

roles/chatbot/tasks/register_mcp_servers.yml

Lines changed: 0 additions & 43 deletions
This file was deleted.

roles/chatbot/tasks/remove_chatbot_api.yml

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,12 @@
11
---
2+
- name: Remove Chatbot ConfigMap resources
3+
kubernetes.core.k8s:
4+
state: absent
5+
kind: ConfigMap
6+
name: '{{ ansible_operator_meta.name }}-{{ deployment_type }}-lightspeed-stack-config'
7+
namespace: '{{ ansible_operator_meta.namespace }}'
8+
wait: yes
9+
210
- name: Remove Chatbot Service resources
311
kubernetes.core.k8s:
412
state: absent
@@ -14,3 +22,10 @@
1422
name: '{{ ansible_operator_meta.name }}-chatbot-api'
1523
namespace: '{{ ansible_operator_meta.namespace }}'
1624
wait: yes
25+
26+
- name: Remove Chatbot PVC
27+
kubernetes.core.k8s:
28+
state: absent
29+
kind: PersistentVolumeClaim
30+
name: "{{ ansible_operator_meta.name }}-chatbot-pvc"
31+
namespace: "{{ ansible_operator_meta.namespace }}"
Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
---
2+
apiVersion: v1
3+
kind: ConfigMap
4+
metadata:
5+
name: '{{ ansible_operator_meta.name }}-{{ deployment_type }}-lightspeed-stack-config'
6+
namespace: '{{ ansible_operator_meta.namespace }}'
7+
labels:
8+
{{ lookup("template", "../common/templates/labels/common.yaml.j2") | indent(width=4) | trim }}
9+
annotations:
10+
checksum-secret-chatbot_config: "{{ lookup('ansible.builtin.vars', 'chatbot_config', default='')["resources"][0]["data"] | default('') | sha1 }}"
11+
data:
12+
lightspeed-stack.yaml: |
13+
name: Ansible Lightspeed Intelligent Assistant
14+
service:
15+
host: 0.0.0.0
16+
port: 8080
17+
auth_enabled: false
18+
workers: 1
19+
color_log: true
20+
access_log: true
21+
llama_stack:
22+
use_as_library_client: true
23+
library_client_config_path: /.llama/distributions/ansible-chatbot/ansible-chatbot-run.yaml
24+
user_data_collection:
25+
feedback_disabled: true
26+
transcripts_disabled: true
27+
{% if _aap_gateway_url is defined or _aap_controller_url is defined %}
28+
mcp_servers:
29+
{% if _aap_gateway_url is defined and _aap_controller_url is defined %}
30+
- name: mcp::aap-controller
31+
provider_id: model-context-protocol
32+
url: http://127.0.0.1:8004/sse
33+
{% endif %}
34+
{% if _aap_gateway_url is defined %}
35+
- name: mcp::aap-lightspeed
36+
provider_id: model-context-protocol
37+
url: http://127.0.0.1:8005/sse
38+
{% endif %}
39+
{% endif %}

roles/chatbot/templates/chatbot.deployment.yaml.j2

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,7 @@ spec:
3434
app.kubernetes.io/component: '{{ deployment_type }}-chatbot-api'
3535
annotations:
3636
kubectl.kubernetes.io/default-container: 'ansible-chatbot'
37+
checksum-chatbot.configmap: "{{ lookup('template', 'chatbot.configmap.yaml.j2') | sha1 }}"
3738
checksum-secret-chatbot_config: "{{ lookup('ansible.builtin.vars', 'chatbot_config', default='')["resources"][0]["data"] | default('') | sha1 }}"
3839
spec:
3940
serviceAccountName: '{{ ansible_operator_meta.name }}'
@@ -105,6 +106,9 @@ spec:
105106
ports:
106107
- containerPort: 8321
107108
volumeMounts:
109+
- name: lightspeed-stack-config
110+
mountPath: /.llama/data/lightspeed-stack.yaml
111+
subPath: lightspeed-stack.yaml
108112
- name: ansible-chatbot-storage
109113
mountPath: /.llama/data
110114
{% if is_openshift %}
@@ -268,6 +272,9 @@ spec:
268272
- name: ansible-chatbot-storage
269273
persistentVolumeClaim:
270274
claimName: "{{ ansible_operator_meta.name }}-chatbot-pvc"
275+
- name: lightspeed-stack-config
276+
configMap:
277+
name: '{{ ansible_operator_meta.name }}-{{ deployment_type }}-lightspeed-stack-config'
271278
{% if is_openshift %}
272279
- name: server-tls-certs
273280
configMap:

roles/model/templates/secrets/model_pipeline_config.yaml.j2

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,12 @@ stringData:
2323
{% endif %}
2424
model_id: '{{ chatbot_model }}'
2525
enable_health_check: 'True'
26-
provider: 'llama-stack'
26+
mcp_servers:
27+
- name: 'mcp::aap-controller'
28+
type: 'controller'
29+
- name: 'mcp::aap-lightspeed'
30+
type: 'lightspeed'
31+
provider: 'http'
2732
ModelPipelineStreamingChatBot:
2833
config:
2934
{% if not is_openshift %}
@@ -34,7 +39,12 @@ stringData:
3439
{% endif %}
3540
model_id: '{{ chatbot_model }}'
3641
enable_health_check: 'True'
37-
provider: 'llama-stack'
42+
mcp_servers:
43+
- name: 'mcp::aap-controller'
44+
type: 'controller'
45+
- name: 'mcp::aap-lightspeed'
46+
type: 'lightspeed'
47+
provider: 'http'
3848
{% endif %}
3949
{% if model_config is defined %}
4050
ModelPipelineCompletions:

0 commit comments

Comments
 (0)