Skip to content

Commit 4eac997

Browse files
committed
Add AI developer temp fix rate limits
1 parent 0569b14 commit 4eac997

File tree

3 files changed

+23
-1
lines changed

3 files changed

+23
-1
lines changed

infra/main.bicep

Lines changed: 17 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ param capacity int = 5
3636
var uniqueId = toLower(uniqueString(subscription().id, Prefix, resourceGroup().location))
3737
var UniquePrefix = 'cm${padLeft(take(uniqueId, 12), 12, '0')}'
3838
var ResourcePrefix = take('cm${Prefix}${UniquePrefix}', 15)
39-
var imageVersion = 'rc1' // Change to 'fnd01' when ready
39+
var imageVersion = 'fnd01'
4040
var location = resourceGroup().location
4141
var dblocation = resourceGroup().location
4242
var cosmosdbDatabase = 'cmsadb'
@@ -454,6 +454,22 @@ resource containers 'Microsoft.Storage/storageAccounts/blobServices/containers@2
454454
dependsOn: [azureAifoundry]
455455
}]
456456

457+
resource aiHubProject 'Microsoft.MachineLearningServices/workspaces@2024-01-01-preview' existing = {
458+
name: '${ResourcePrefix}-prj' // aiProjectName must be calculated - available at main start.
459+
}
460+
461+
resource aiDeveloper 'Microsoft.Authorization/roleDefinitions@2022-04-01' existing = {
462+
name: '64702f94-c441-49e6-a78b-ef80e0188fee'
463+
}
464+
465+
resource aiDeveloperAccessProj 'Microsoft.Authorization/roleAssignments@2022-04-01' = {
466+
name: guid(containerAppBackend.name, aiHubProject.id, aiDeveloper.id)
467+
scope: aiHubProject
468+
properties: {
469+
roleDefinitionId: aiDeveloper.id
470+
principalId: containerAppBackend.identity.principalId
471+
}
472+
}
457473

458474
resource contributorRoleDefinition 'Microsoft.DocumentDB/databaseAccounts/sqlRoleDefinitions@2021-06-15' existing = {
459475
name: '${databaseAccount.name}/00000000-0000-0000-0000-000000000002'

src/backend/sql_agents/convert_script.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
and updates the database with the results.
55
"""
66

7+
import asyncio
78
import json
89
import logging
910

@@ -65,6 +66,8 @@ async def convert_script(
6566
)
6667
carry_response = None
6768
async for response in chat.invoke():
69+
# TEMPORARY: awaiting bug fix for rate limits
70+
await asyncio.sleep(5)
6871
carry_response = response
6972
if response.role == AuthorRole.ASSISTANT.value:
7073
# Our process can terminate with either of these as the last response

src/backend/sql_agents/process_batch.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
It is the main entry point for the SQL migration process.
55
"""
66

7+
import asyncio
78
import logging
89

910
from azure.identity.aio import DefaultAzureCredential
@@ -116,6 +117,8 @@ async def process_batch_async(
116117
batch_service,
117118
sql_agents,
118119
)
120+
# TEMPORARY: awaiting bug fix for rate limits
121+
await asyncio.sleep(5)
119122
if converted_query:
120123
# Add RAI disclaimer to the converted query
121124
converted_query = add_rai_disclaimer(converted_query)

0 commit comments

Comments
 (0)