Skip to content

Commit ab18e90

Browse files
authored
Merge pull request #66 from dminnear-rh/use-mssql-db
Add MS SQL Server as a DB Provider for RAG backend
2 parents bb58898 + e8cf465 commit ab18e90

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

62 files changed

+849
-1382
lines changed

Makefile

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,8 @@
1+
# Azure gpu vars
2+
GPU_VM_SIZE ?= Standard_NC8as_T4_v3
3+
GPU_REPLICAS ?= 1
4+
OVERRIDE_ZONE ?=
5+
16
.PHONY: default
27
default: help
38

@@ -16,8 +21,13 @@ install: operator-deploy post-install ## installs the pattern and loads the secr
1621
@echo "Installed"
1722

1823
.PHONY: create-gpu-machineset
19-
create-gpu-machineset: ## Creates a gpu machineset
20-
ansible-playbook ansible/playbooks/create-gpu-machine-set.yaml
24+
create-gpu-machineset: ## Creates a gpu machineset for AWS
25+
ansible-playbook ansible/playbooks/create-gpu-machineset.yaml
26+
27+
.PHONY: create-gpu-machineset-azure
28+
create-gpu-machineset-azure: ## Creates an Azure GPU machineset (overrides: GPU_VM_SIZE, GPU_REPLICAS, OVERRIDE_ZONE)
29+
ansible-playbook ansible/playbooks/create-gpu-machineset-azure.yaml \
30+
-e "gpu_vm_size=$(GPU_VM_SIZE) gpu_replicas=$(GPU_REPLICAS) override_zone=$(OVERRIDE_ZONE)"
2131

2232
.PHONY: post-install
2333
post-install: ## Post-install tasks
Lines changed: 65 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,65 @@
1+
- name: Generate GPU MachineSet for Azure-based clusters
2+
hosts: localhost
3+
connection: local
4+
gather_facts: false
5+
vars:
6+
gpu_vm_size: Standard_NC8as_T4_v3
7+
gpu_replicas: 1
8+
override_zone: ""
9+
namespace: openshift-machine-api
10+
tasks:
11+
- name: Get cluster infrastructure object
12+
kubernetes.core.k8s_info:
13+
api_version: config.openshift.io/v1
14+
kind: Infrastructure
15+
name: cluster
16+
register: infra_info
17+
18+
- name: Save cluster ID
19+
set_fact:
20+
cluster_id: "{{ infra_info.resources[0].status.infrastructureName }}"
21+
22+
- name: Gather all MachineSets
23+
kubernetes.core.k8s_info:
24+
api_version: machine.openshift.io/v1beta1
25+
kind: MachineSet
26+
namespace: "{{ namespace }}"
27+
register: ms_list
28+
29+
- name: Pick the first *worker* MachineSet as a template
30+
set_fact:
31+
base_ms: "{{ item }}"
32+
loop: "{{ ms_list.resources | sort(attribute='metadata.name') }}"
33+
when:
34+
- "'worker' in (item.metadata.labels['machine.openshift.io/cluster-api-machine-role'] | default(''))"
35+
run_once: true
36+
37+
- name: Extract provider-specific details from the base MachineSet
38+
set_fact:
39+
azure_location: "{{ base_ms.spec.template.spec.providerSpec.value.location }}"
40+
base_zone: "{{ base_ms.spec.template.spec.providerSpec.value.zone }}"
41+
resource_group: "{{ base_ms.spec.template.spec.providerSpec.value.resourceGroup }}"
42+
network_resource_group: "{{ base_ms.spec.template.spec.providerSpec.value.networkResourceGroup }}"
43+
vnet: "{{ base_ms.spec.template.spec.providerSpec.value.vnet }}"
44+
subnet: "{{ base_ms.spec.template.spec.providerSpec.value.subnet }}"
45+
image: "{{ base_ms.spec.template.spec.providerSpec.value.image }}"
46+
os_disk: "{{ base_ms.spec.template.spec.providerSpec.value.osDisk }}"
47+
user_data: "{{ base_ms.spec.template.spec.providerSpec.value.userDataSecret }}"
48+
cred_secret: "{{ base_ms.spec.template.spec.providerSpec.value.credentialsSecret }}"
49+
public_ip: "{{ base_ms.spec.template.spec.providerSpec.value.publicIP | default(false) }}"
50+
51+
- name: Decide which availability zone to use
52+
set_fact:
53+
gpu_zone: "{{ (override_zone | trim) | default(base_zone, true) }}"
54+
55+
- name: Render GPU MachineSet manifest
56+
template:
57+
src: templates/gpu-machineset-azure.j2
58+
dest: /tmp/gpu-machineset-azure.yaml
59+
vars:
60+
ms_name: "nvidia-worker-{{ azure_location | replace(' ', '') }}{{ gpu_zone }}"
61+
62+
- name: Apply the GPU MachineSet
63+
kubernetes.core.k8s:
64+
state: present
65+
src: /tmp/gpu-machineset-azure.yaml

ansible/playbooks/create-gpu-machine-set.yaml renamed to ansible/playbooks/create-gpu-machineset.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,7 @@
7272

7373
- name: "[create-gpu-machine-set] Generate machineset"
7474
ansible.builtin.template:
75-
src: templates/gpu-machine-sets.j2
75+
src: templates/gpu-machineset.j2
7676
dest: /tmp/gpu-machineset.yaml
7777

7878
- name: "[create-gpu-machine-set] Apply machineset to cluster {{ clusterId }}"
Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
apiVersion: machine.openshift.io/v1beta1
2+
kind: MachineSet
3+
metadata:
4+
name: {{ ms_name }}
5+
namespace: openshift-machine-api
6+
labels:
7+
machine.openshift.io/cluster-api-cluster: {{ cluster_id }}
8+
spec:
9+
replicas: {{ gpu_replicas }}
10+
selector:
11+
matchLabels:
12+
machine.openshift.io/cluster-api-cluster: {{ cluster_id }}
13+
machine.openshift.io/cluster-api-machineset: {{ ms_name }}
14+
template:
15+
metadata:
16+
labels:
17+
machine.openshift.io/cluster-api-cluster: {{ cluster_id }}
18+
machine.openshift.io/cluster-api-machine-role: worker
19+
machine.openshift.io/cluster-api-machine-type: worker
20+
machine.openshift.io/cluster-api-machineset: {{ ms_name }}
21+
spec:
22+
taints:
23+
- key: odh-notebook
24+
value: "true"
25+
effect: NoSchedule
26+
metadata:
27+
labels:
28+
node-role.kubernetes.io/odh-notebook: ''
29+
providerSpec:
30+
value:
31+
apiVersion: machine.openshift.io/v1beta1
32+
kind: AzureMachineProviderSpec
33+
credentialsSecret: {{ cred_secret | to_json }}
34+
location: {{ azure_location | to_json }}
35+
zone: {{ gpu_zone | to_json }}
36+
resourceGroup: {{ resource_group | to_json }}
37+
networkResourceGroup: {{ network_resource_group | to_json }}
38+
vnet: {{ vnet | to_json }}
39+
subnet: {{ subnet | to_json }}
40+
vmSize: {{ gpu_vm_size | to_json }}
41+
image: {{ image | to_json }}
42+
osDisk: {{ os_disk | to_json }}
43+
publicIP: {{ public_ip | to_json }}
44+
userDataSecret: {{ user_data | to_json }}

ansible/playbooks/templates/gpu-machine-sets.j2 renamed to ansible/playbooks/templates/gpu-machineset.j2

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ metadata:
1111
name: {{ clusterId }}-gpu-{{ cloudRegion }}
1212
namespace: openshift-machine-api
1313
spec:
14-
replicas: 3
14+
replicas: 1
1515
selector:
1616
matchLabels:
1717
machine.openshift.io/cluster-api-cluster: {{ clusterId }}

charts/all/llm-serving-service/Chart.yaml

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

charts/all/llm-serving-service/templates/_helpers.tpl

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

charts/all/llm-serving-service/templates/download-model.yaml

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

charts/all/llm-serving-service/templates/inference-service.yaml

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

charts/all/llm-serving-service/templates/model-pvc.yaml

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

0 commit comments

Comments
 (0)