Skip to content

Commit a0f0b39

Browse files
committed
AAP-43385: On-prem: Automate provision and related configuration changes
1 parent 18b3ea8 commit a0f0b39

16 files changed

+502
-215
lines changed

config/crd/bases/aiconnect.ansible.com_ansibleaiconnects.yaml

Lines changed: 37 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -61,6 +61,30 @@ spec:
6161
chatbot_image_version:
6262
description: Chatbot API container image tag or version to use
6363
type: string
64+
chatbot_rag_db_image:
65+
description: Registry path to Chatbot RAG database container image to use
66+
type: string
67+
chatbot_rag_db_image_version:
68+
description: Chatbot RAG database container image tag or version to use
69+
type: string
70+
chatbot_mcp_gateway_image:
71+
description: Registry path to AAP Gateway MCP server container image to use
72+
type: string
73+
chatbot_mcp_gateway_image_version:
74+
description: AAP Gateway MCP server container image tag or version to use
75+
type: string
76+
chatbot_mcp_controller_image:
77+
description: Registry path to AAP Controller MCP server container image to use
78+
type: string
79+
chatbot_mcp_controller_image_version:
80+
description: AAP Controller MCP server container image tag or version to use
81+
type: string
82+
chatbot_mcp_lightspeed_image:
83+
description: Registry path to AAP Lightspeed MCP server container image to use
84+
type: string
85+
chatbot_mcp_lightspeed_image_version:
86+
description: AAP Lightspeed MCP server container image tag or version to use
87+
type: string
6488
additional_labels:
6589
description: Additional labels defined on the resource, which should be propagated to child resources
6690
type: array
@@ -1031,11 +1055,23 @@ spec:
10311055
description: The version of the image used for the deployed instance
10321056
type: string
10331057
chatbotImage:
1034-
description: URL of the chatbot image used for the deployed instance
1058+
description: URL of the Chatbot image used for the deployed instance
10351059
type: string
10361060
chatbotVersion:
10371061
description: The version of the Chatbot image used for the deployed instance
10381062
type: string
1063+
chatbotRAGDatabaseImage:
1064+
description: URL of the Chatbot RAG database image used for the deployed instance
1065+
type: string
1066+
chatbotMCPGatewayImage:
1067+
description: URL of the Chatbot MCP Gateway Server image used for the deployed instance
1068+
type: string
1069+
chatbotMCPControllerImage:
1070+
description: URL of the Chatbot MCP Controller Server image used for the deployed instance
1071+
type: string
1072+
chatbotMCPLightspeedImage:
1073+
description: URL of the Chatbot MCP Lightspeed Server image used for the deployed instance
1074+
type: string
10391075
URL:
10401076
description: URL to access the deployed instance
10411077
type: string

config/manager/kustomization.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,5 +4,5 @@ apiVersion: kustomize.config.k8s.io/v1beta1
44
kind: Kustomization
55
images:
66
- name: controller
7-
newName: quay.io/ansible/ansible-ai-connect-operator
8-
newTag: 0.1.0
7+
newName: quay.io/manstis/ansible-ai-connect-operator
8+
newTag: 0.0.1

config/manifests/bases/ansible-ai-connect-operator.clusterserviceversion.yaml

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,38 @@ spec:
5353
path: chatbot_image_version
5454
x-descriptors:
5555
- urn:alm:descriptor:com.tectonic.ui:advanced
56+
- displayName: Chatbot RAG database container image
57+
path: chatbot_rag_db_image
58+
x-descriptors:
59+
- urn:alm:descriptor:com.tectonic.ui:advanced
60+
- displayName: Chatbot RAG database container image Version
61+
path: chatbot_rag_db_image_version
62+
x-descriptors:
63+
- urn:alm:descriptor:com.tectonic.ui:advanced
64+
- displayName: AAP Gateway MCP server container image
65+
path: chatbot_mcp_gateway_image
66+
x-descriptors:
67+
- urn:alm:descriptor:com.tectonic.ui:advanced
68+
- displayName: AAP Gateway MCP server container image Version
69+
path: chatbot_mcp_gateway_image_version
70+
x-descriptors:
71+
- urn:alm:descriptor:com.tectonic.ui:advanced
72+
- displayName: AAP Controller MCP server container image
73+
path: chatbot_mcp_controller_image
74+
x-descriptors:
75+
- urn:alm:descriptor:com.tectonic.ui:advanced
76+
- displayName: AAP Controller MCP server container image Version
77+
path: chatbot_mcp_controller_image_version
78+
x-descriptors:
79+
- urn:alm:descriptor:com.tectonic.ui:advanced
80+
- displayName: AAP Lightspeed MCP server container image
81+
path: chatbot_mcp_lightspeed_image
82+
x-descriptors:
83+
- urn:alm:descriptor:com.tectonic.ui:advanced
84+
- displayName: AAP Lightspeed MCP server container image Version
85+
path: chatbot_mcp_lightspeed_image_version
86+
x-descriptors:
87+
- urn:alm:descriptor:com.tectonic.ui:advanced
5688
- displayName: Additional labels defined on the resource, which should be propagated
5789
to child resources
5890
path: additional_labels

docs/using-external-configuration-secrets.md

Lines changed: 21 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -88,10 +88,9 @@ stringData:
8888
chatbot_url: <Chatbot LLM URL>
8989
chatbot_model: <Chatbot model name>
9090
chatbot_token: <Chatbot LLM access token>
91-
chatbot_llm_provider_type: <Chatbot LLM provider type>
92-
chatbot_llm_provider_project_id: <Chatbot LLM provider project id>
93-
chatbot_context_window_size: <Chatbot LLM context window size>
94-
chatbot_temperature_override: <Chatbot LLM temperature parameter>
91+
aap_gateway_url: <AAP Gateway URL>
92+
aap_gateway_token: <AAP Gateway Token>
93+
aap_controller_url: <AAP Controller URL>
9594
type: Opaque
9695
```
9796
**Required Parameters**
@@ -100,38 +99,29 @@ type: Opaque
10099
* `chatbot_model`
101100
* `chatbot_token`
102101

103-
**Optional Parameters**
102+
**Parameter combinations**
104103

105-
Both `chatbot_llm_provider_type` and `chatbot_context_window_size` are optional. If either is omitted, the
106-
following default values will be used:
104+
Providing `aap_gateway_url`, `aap_gateway_token` and/or `aap_controller_url` affect how the Chatbot is provisioned.
107105

108-
* `chatbot_llm_provider_type`: `rhoai_vllm`
109-
* `chatbot_context_window_size`: `128000`
106+
If none of these parameters are provided no MCP servers will be provisioned or registered with the underlying LLM's tool runtime.
110107

111-
When `chatbot_llm_provider_type` is set to `watsonx`,
112-
`chatbot_llm_provider_project_id` is required to set to your watsonx.ai project ID.
108+
If only `aap_gateway_url` is set the following MCP server will be provisioned:
109+
- Ansible Lightspeed Service MCP server.
110+
- Authentication will attempt to use the JWT token associated with the User's authenticated context.
113111

114-
`chatbot_temperature_override` is also optional. It is provided for
115-
following Open AI models that do not support the default temperature setting used for
116-
other Open AI models:
112+
If `aap_gateway_url` and `aap_gateway_token` are set the following MCP servers will be provisioned:
113+
- AAP Gateway Service MCP server.
114+
- Authentication will attempt to use the `aap_gateway_token`
115+
- Ansible Lightspeed Service MCP server.
116+
- Authentication will attempt to use either the JWT token associated with the User's authenticated context or `aap_gateway_token`.
117117

118-
* `o1`
119-
* `o3-mini`
120-
* `o4-mini`
121-
122-
When one of these models is used, set `chatbot_temperature_override` to `null`,
123-
which disables the default temperature setting.
124-
125-
126-
**_Azure AI_ Parameters**
127-
128-
In case of using the _Azure AI_ model provider, please also ensure the following required parameters are properly set:
129-
* `chatbot_llm_provider_type`: `azure_openai`
130-
* `chatbot_url`: `<<Azure AI project serving URL>>`
131-
* `chatbot_model`: `<<Azure AI model name>>`
132-
* `chatbot_token`: `<<Azure AI access token>>`
133-
* `chatbot_azure_deployment_name`: `<<Azure AI [deployment name](https://learn.microsoft.com/en-us/azure/ai-services/openai/how-to/create-resource?pivots=web-portal#deploy-a-model)>>`
134-
* `chatbot_azure_api_version`: `<<Optional - Azure AI API version>>`
118+
If `aap_gateway_url`, `aap_gateway_token` and `aap_controller_url` are set the following MCP servers will be provisioned:
119+
- AAP Gateway Service MCP server
120+
- Authentication will attempt to use the `aap_gateway_token`
121+
- AAP Controller Service MCP server
122+
- Authentication will attempt to use either the JWT token associated with the User's authenticated context or `aap_gateway_token`.
123+
- Ansible Lightspeed Service MCP server
124+
- Authentication will attempt to use either the JWT token associated with the User's authenticated context or `aap_gateway_token`.
135125

136126
## Troubleshooting
137127

roles/chatbot/defaults/main.yml

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,9 +7,21 @@
77
api_version: 'aiconnect.ansible.com/v1alpha1'
88
deployment_type: 'ansible-ai-connect'
99

10-
_chatbot_image: quay.io/ansible/ansible-chatbot-service
10+
# Chatbot container image
11+
_chatbot_image: quay.io/ansible/ansible-chatbot-stack
1112
_chatbot_image_version: "{{ lookup('env', 'DEFAULT_CHATBOT_AI_CONNECT_VERSION') or 'latest' }}"
1213

14+
# Chatbot RAG database container images
15+
_chatbot_rag_db_image: quay.io/ansible/aap-rag-content
16+
_chatbot_rag_db_image_version: "{{ lookup('env', 'DEFAULT_CHATBOT_RAG_DB_VERSION') or 'latest' }}"
17+
18+
# Chatbot MCP Server container images
19+
_chatbot_mcp_gateway_image: quay.io/ansible/ansible-mcp-gateway
20+
_chatbot_mcp_gateway_image_version: "{{ lookup('env', 'DEFAULT_CHATBOT_MCP_GATEWAY_VERSION') or 'latest' }}"
21+
_chatbot_mcp_controller_image: quay.io/ansible/ansible-mcp-controller
22+
_chatbot_mcp_controller_image_version: "{{ lookup('env', 'DEFAULT_CHATBOT_MCP_CONTROLLER_VERSION') or 'latest' }}"
23+
_chatbot_mcp_lightspeed_image: quay.io/ansible/ansible-mcp-lightspeed
24+
_chatbot_mcp_lightspeed_image_version: "{{ lookup('env', 'DEFAULT_CHATBOT_MCP_LIGHTSPEED_VERSION') or 'latest' }}"
1325
# ========================================
1426

1527

roles/chatbot/tasks/deploy_chatbot_api.yml

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,13 @@
11
---
2-
- name: Apply Chatbot ConfigMap resources
3-
kubernetes.core.k8s:
4-
apply: yes
5-
definition: "{{ lookup('template', 'chatbot.configmap.yaml.j2') }}"
6-
wait: yes
7-
82
- name: Apply Chatbot deployment resources
93
kubernetes.core.k8s:
104
apply: yes
115
definition: "{{ lookup('template', item + '.yaml.j2') }}"
126
wait: no
137
loop:
8+
- 'chatbot.pvc'
149
- 'chatbot.service'
10+
- 'chatbot.configmap'
1511
- 'chatbot.deployment'
1612

1713
- name: Check for Chatbot Pod
@@ -30,7 +26,7 @@
3026
- "chatbot_api_pod['resources'] | length"
3127
- "chatbot_api_pod['resources'][0]['status']['phase'] == 'Running'"
3228
- "chatbot_api_pod['resources'][0]['status']['containerStatuses'][0]['ready'] == true"
33-
retries: 60
29+
retries: 30
3430
delay: 5
3531

3632
- name: Set the Chatbot API Pod name as a variable.

roles/chatbot/tasks/main.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,9 @@
88
- name: Set AnsibleAIConnect's Chatbot service images
99
ansible.builtin.include_tasks: set_images.yml
1010

11+
- name: Set AnsibleAIConnect and AnsibleAIConnect's Chatbot service URLs
12+
ansible.builtin.include_tasks: set_service_urls.yml
13+
1114
- name: Read AnsibleAIConnect's Chatbot secret
1215
ansible.builtin.include_tasks: read_chatbot_configuration_secret.yml
1316

roles/chatbot/tasks/read_chatbot_configuration_secret.yml

Lines changed: 16 additions & 62 deletions
Original file line numberDiff line numberDiff line change
@@ -43,82 +43,36 @@
4343
You must specify a 'chatbot_token' in your Secret.
4444
when: not _chatbot_config_resource["resources"][0]["data"].chatbot_token
4545

46-
- name: Set Chatbot Configuration
46+
- name: Set Chatbot Token
4747
ansible.builtin.set_fact:
48-
chatbot_config: '{{ _chatbot_config_resource }}'
48+
chatbot_token: '{{ _chatbot_config_resource["resources"][0]["data"].chatbot_token | b64decode }}'
4949
no_log: "{{ no_log }}"
5050

51-
- name: Set LLM provider type if it is defined in the config
51+
- name: Set AAP Gateway token
5252
ansible.builtin.set_fact:
53-
chatbot_llm_provider_type: '{{ _chatbot_config_resource["resources"][0]["data"].chatbot_llm_provider_type | b64decode }}'
53+
_aap_gateway_token: '{{ _chatbot_config_resource["resources"][0]["data"].aap_gateway_token | b64decode }}'
5454
no_log: "{{ no_log }}"
55-
when: _chatbot_config_resource["resources"][0]["data"].chatbot_llm_provider_type is defined
56-
57-
- name: Validate watsonx.ai project ID if LLM provider type is set to "watsonx"
58-
ansible.builtin.fail:
59-
msg: |
60-
You must specify a 'chatbot_llm_provider_project_id' in your Secret when 'chatbot_llm_provider_type' is set to 'watsonx'
6155
when:
62-
- chatbot_llm_provider_type is defined
63-
- chatbot_llm_provider_type == "watsonx"
64-
- not _chatbot_config_resource["resources"][0]["data"].chatbot_llm_provider_project_id is defined
56+
- _chatbot_config_resource["resources"][0]["data"].aap_gateway_token is defined
57+
- _chatbot_config_resource["resources"][0]["data"].aap_gateway_token | length
6558

66-
- name: Set watsonx.ai project ID if it is defined in the config
59+
- name: Set AAP Gateway URL
6760
ansible.builtin.set_fact:
68-
chatbot_llm_provider_project_id: '{{ _chatbot_config_resource["resources"][0]["data"].chatbot_llm_provider_project_id | b64decode }}'
69-
no_log: "{{ no_log }}"
70-
when: _chatbot_config_resource["resources"][0]["data"].chatbot_llm_provider_project_id is defined
71-
72-
- name: Set context window size if it is defined in the config
73-
ansible.builtin.set_fact:
74-
chatbot_context_window_size: '{{ _chatbot_config_resource["resources"][0]["data"].chatbot_context_window_size | b64decode | int }}'
75-
no_log: "{{ no_log }}"
76-
when: _chatbot_config_resource["resources"][0]["data"].chatbot_context_window_size is defined
77-
78-
- name: Set LLM temperature parameter override if it is defined in the config
79-
ansible.builtin.set_fact:
80-
chatbot_temperature_override: '{{ _chatbot_config_resource["resources"][0]["data"].chatbot_temperature_override | b64decode }}'
81-
no_log: "{{ no_log }}"
82-
when: _chatbot_config_resource["resources"][0]["data"].chatbot_temperature_override is defined
83-
84-
- name: Set Azure AI deployment name if it is defined in the config
85-
ansible.builtin.set_fact:
86-
chatbot_azure_deployment_name: '{{ _chatbot_config_resource["resources"][0]["data"].chatbot_azure_deployment_name | b64decode }}'
61+
_aap_gateway_url: '{{ _chatbot_config_resource["resources"][0]["data"].aap_gateway_url | b64decode }}'
8762
no_log: "{{ no_log }}"
8863
when:
89-
- chatbot_llm_provider_type is defined
90-
- chatbot_llm_provider_type is search("azure_openai")
91-
- _chatbot_config_resource["resources"][0]["data"].chatbot_azure_deployment_name is defined
64+
- _chatbot_config_resource["resources"][0]["data"].aap_gateway_url is defined
65+
- _chatbot_config_resource["resources"][0]["data"].aap_gateway_url | length
9266

93-
- name: Set Azure AI API version if it is defined in the config
67+
- name: Set AAP Controller URL
9468
ansible.builtin.set_fact:
95-
chatbot_azure_api_version: '{{ _chatbot_config_resource["resources"][0]["data"].chatbot_azure_api_version | b64decode }}'
69+
_aap_controller_url: '{{ _chatbot_config_resource["resources"][0]["data"].aap_controller_url | b64decode }}'
9670
no_log: "{{ no_log }}"
9771
when:
98-
- chatbot_llm_provider_type is defined
99-
- chatbot_llm_provider_type is search("azure_openai")
100-
- _chatbot_config_resource["resources"][0]["data"].chatbot_azure_api_version is defined
101-
102-
- name: Set Chatbot Include Fake LLMs to false if it is not defined in the config
103-
ansible.builtin.set_fact:
104-
chatbot_include_fake_llms: false
105-
no_log: "{{ no_log }}"
106-
when: not _chatbot_config_resource["resources"][0]["data"].chatbot_include_fake_llms is defined
107-
108-
- name: Set Chatbot Include Fake LLMs if it is defined in the config
109-
ansible.builtin.set_fact:
110-
chatbot_include_fake_llms: '{{ _chatbot_config_resource["resources"][0]["data"].chatbot_include_fake_llms | default(false) | b64decode }}'
111-
no_log: "{{ no_log }}"
112-
when: _chatbot_config_resource["resources"][0]["data"].chatbot_include_fake_llms is defined
113-
114-
- name: Set Chatbot Fake Streaming Chunks
115-
ansible.builtin.set_fact:
116-
chatbot_fake_streaming_chunks: '{{ _chatbot_config_resource["resources"][0]["data"].chatbot_fake_streaming_chunks | b64decode }}'
117-
no_log: "{{ no_log }}"
118-
when: _chatbot_config_resource["resources"][0]["data"].chatbot_fake_streaming_chunks is defined
72+
- _chatbot_config_resource["resources"][0]["data"].aap_controller_url is defined
73+
- _chatbot_config_resource["resources"][0]["data"].aap_controller_url | length
11974

120-
- name: Set Chatbot Fake Streaming Sleep
75+
- name: Set Chatbot Configuration
12176
ansible.builtin.set_fact:
122-
chatbot_fake_streaming_sleep: '{{ _chatbot_config_resource["resources"][0]["data"].chatbot_fake_streaming_sleep | b64decode }}'
77+
chatbot_config: '{{ _chatbot_config_resource }}'
12378
no_log: "{{ no_log }}"
124-
when: _chatbot_config_resource["resources"][0]["data"].chatbot_fake_streaming_sleep is defined

roles/chatbot/tasks/remove_chatbot_api.yml

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,4 @@
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 }}-chatbot-env-properties'
7-
namespace: '{{ ansible_operator_meta.namespace }}'
8-
wait: yes
9-
102
- name: Remove Chatbot Service resources
113
kubernetes.core.k8s:
124
state: absent

0 commit comments

Comments
 (0)