Skip to content

Commit

Permalink
Improve cost optimization and documentation (Azure-Samples#141)
Browse files Browse the repository at this point in the history
  • Loading branch information
jgbradley1 authored Aug 14, 2024
1 parent 2e06f3f commit 2d5ab6d
Show file tree
Hide file tree
Showing 5 changed files with 39 additions and 6 deletions.
8 changes: 5 additions & 3 deletions backend/indexing-job-template.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -18,17 +18,19 @@ spec:
spec:
serviceAccountName: PLACEHOLDER
restartPolicy: OnFailure
nodeSelector:
workload: graphrag-indexing
containers:
- name: graphrag
image: PLACEHOLDER
imagePullPolicy: Always
resources:
requests:
cpu: "6"
memory: "24Gi"
memory: "56Gi"
limits:
cpu: "10"
memory: "32Gi"
cpu: "8"
memory: "64Gi"
envFrom:
- configMapRef:
name: graphrag
Expand Down
Binary file modified docs/assets/graphrag-architecture-diagram.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified docs/assets/graphrag-architecture-diagram.vsdx
Binary file not shown.
35 changes: 32 additions & 3 deletions infra/core/aks/aks.bicep
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ param systemOsDiskSizeGB int = 128

@description('The number of nodes for the system node pool.')
@minValue(1)
@maxValue(50)
@maxValue(20)
param systemNodeCount int = 1

@description('The size of the system Virtual Machine.')
Expand All @@ -37,8 +37,11 @@ param systemVMSize string = 'standard_d4s_v5'
@maxValue(50)
param graphragNodeCount int = 1

@description('The size of the GraphRAG Virtual Machine.')
param graphragVMSize string = 'standard_e16as_v5' // 16 vcpus, 128 GiB memory
@description('The VM size of nodes running the GraphRAG API.')
param graphragVMSize string = 'standard_d8s_v5' // 8 vcpu, 32 GB memory

@description('The VM size of nodes running GraphRAG indexing jobs.')
param graphragIndexingVMSize string = 'standard_e8s_v5' // 8 vcpus, 64 GB memory

@description('User name for the Linux Virtual Machines.')
param linuxAdminUsername string = 'azureuser'
Expand Down Expand Up @@ -161,6 +164,32 @@ resource aks 'Microsoft.ContainerService/managedClusters@2024-02-01' = {
type: 'VirtualMachineScaleSets'
}
}

resource graphragIndexingNodePool 'agentPools@2024-02-01' = {
name: 'indexing'
properties: {
enableAutoScaling: true
upgradeSettings: {
maxSurge: '50%'
}
minCount: 0
maxCount: 10
osDiskSizeGB: systemOsDiskSizeGB
count: 0
vmSize: graphragIndexingVMSize
osType: 'Linux'
mode: 'User'
enableEncryptionAtHost: enableEncryptionAtHost
vnetSubnetID: subnetId
nodeLabels: {
workload: 'graphrag-indexing'
}
tags: {
workload: 'graphrag'
}
type: 'VirtualMachineScaleSets'
}
}
}

resource aksManagedAutoUpgradeSchedule 'Microsoft.ContainerService/managedClusters/maintenanceConfigurations@2024-03-02-preview' = {
Expand Down
2 changes: 2 additions & 0 deletions infra/main.bicep
Original file line number Diff line number Diff line change
Expand Up @@ -186,6 +186,8 @@ module aks 'core/aks/aks.bicep' = {
params:{
clusterName: '${abbrs.containerServiceManagedClusters}${resourceBaseNameFinal}'
location: location
graphragVMSize: 'standard_d8s_v5' // 8 vcpu, 32 GB memory
graphragIndexingVMSize: 'standard_e8s_v5' // 8 vcpus, 64 GB memory
sshRSAPublicKey: aksSshRsaPublicKey
logAnalyticsWorkspaceId: log.outputs.id
subnetId: vnet.properties.subnets[1].id // aks subnet
Expand Down

0 comments on commit 2d5ab6d

Please sign in to comment.