Skip to content

Commit

Permalink
Update deployment name variables for OpenAI chat service
Browse files Browse the repository at this point in the history
  • Loading branch information
cassiebreviu committed Sep 11, 2024
1 parent af18890 commit d625829
Show file tree
Hide file tree
Showing 7 changed files with 10 additions and 10 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/evaluations.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ jobs:
AZURE_OPENAI_ENDPOINT: ${{ vars.AZURE_OPENAI_ENDPOINT }}
AZURE_OPENAI_API_VERSION: ${{ vars.AZURE_OPENAI_API_VERSION }}
AZURE_OPENAI_4_EVAL_DEPLOYMENT_NAME: ${{ vars.AZURE_OPENAI_4_EVAL_DEPLOYMENT_NAME }}
AZURE_OPENAI_DEPLOYMENT_NAME: ${{ vars.AZURE_OPENAI_DEPLOYMENT_NAME }}
AZURE_OPENAI_CHAT_DEPLOYMENT_NAME: ${{ vars.AZURE_OPENAI_CHAT_DEPLOYMENT_NAME }}
AZURE_OPENAI_35_TURBO_DEPLOYMENT_NAME: ${{ vars.AZURE_OPENAI_35_TURBO_DEPLOYMENT_NAME }}
AZURE_RESOURCE_GROUP: ${{ vars.AZURE_RESOURCE_GROUP }}
AZURE_SEARCH_ENDPOINT: ${{ vars.AZURE_SEARCH_ENDPOINT }}
Expand Down
2 changes: 1 addition & 1 deletion docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ services:
build:
context: src/api
ports:
- "5000:80"
- "80:80"
env_file:
- .env
environment:
Expand Down
2 changes: 1 addition & 1 deletion infra/app/aca.bicep
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ module app '../core/host/container-app-upsert.bicep' = {
value: openAiEndpoint
}
{
name: 'AZURE_OPENAI_DEPLOYMENT'
name: 'AZURE_OPENAI_CHAT_DEPLOYMENT'
value: openAiDeploymentName
}
{
Expand Down
2 changes: 1 addition & 1 deletion infra/hooks/postprovision.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ Write-Output "Building contosochatapi:latest..."
az acr build --subscription $env:AZURE_SUBSCRIPTION_ID --registry $env:AZURE_CONTAINER_REGISTRY_NAME --image contosochatapi:latest ./src/api/
$image_name = $env:AZURE_CONTAINER_REGISTRY_NAME + '.azurecr.io/contosochatapi:latest'
az containerapp update --subscription $env:AZURE_SUBSCRIPTION_ID --name $env:SERVICE_ACA_NAME --resource-group $env:AZURE_RESOURCE_GROUP --image $image_name
az containerapp ingress update --subscription $env:AZURE_SUBSCRIPTION_ID --name $env:SERVICE_ACA_NAME --resource-group $env:AZURE_RESOURCE_GROUP --target-port 5000
az containerapp ingress update --subscription $env:AZURE_SUBSCRIPTION_ID --name $env:SERVICE_ACA_NAME --resource-group $env:AZURE_RESOURCE_GROUP --target-port 80

Write-Host "Starting postprovisioning..."

Expand Down
2 changes: 1 addition & 1 deletion infra/hooks/postprovision.sh
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ echo "Building contosochatapi:latest..."
az acr build --subscription ${AZURE_SUBSCRIPTION_ID} --registry ${AZURE_CONTAINER_REGISTRY_NAME} --image contosochatapi:latest ./src/api/
image_name="${AZURE_CONTAINER_REGISTRY_NAME}.azurecr.io/contosochatapi:latest"
az containerapp update --subscription ${AZURE_SUBSCRIPTION_ID} --name ${SERVICE_ACA_NAME} --resource-group ${AZURE_RESOURCE_GROUP} --image ${image_name}
az containerapp ingress update --subscription ${AZURE_SUBSCRIPTION_ID} --name ${SERVICE_ACA_NAME} --resource-group ${AZURE_RESOURCE_GROUP} --target-port 5000
az containerapp ingress update --subscription ${AZURE_SUBSCRIPTION_ID} --name ${SERVICE_ACA_NAME} --resource-group ${AZURE_RESOURCE_GROUP} --target-port 80


# Retrieve service names, resource group name, and other values from environment variables
Expand Down
6 changes: 3 additions & 3 deletions infra/main.bicep
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ param useSearch bool = true
var aiConfig = loadYamlContent('./ai.yaml')

@description('The API version of the OpenAI resource')
param openAiApiVersion string = ''
param openAiApiVersion string = '2023-03-15-preview'

@description('The type of the OpenAI resource')
param openAiType string = 'azure'
Expand All @@ -76,7 +76,7 @@ param searchServiceName string = ''
param cosmosAccountName string = ''

@description('The name of the OpenAI embedding deployment')
param openAiEmbeddingDeploymentName string = ''
param openAiEmbeddingDeploymentName string = 'text-embedding-ada-002'

@description('The name of the AI search index')
param aiSearchIndexName string = 'contoso-products'
Expand Down Expand Up @@ -301,7 +301,7 @@ module userCosmosAccountRole 'core/security/role-cosmos.bicep' = if (!empty(prin
output AZURE_LOCATION string = location
output AZURE_RESOURCE_GROUP string = resourceGroup.name

output AZURE_OPENAI_DEPLOYMENT string = openAiDeploymentName
output AZURE_OPENAI_CHAT_DEPLOYMENT string = openAiDeploymentName
output AZURE_OPENAI_API_VERSION string = openAiApiVersion
output AZURE_OPENAI_ENDPOINT string = ai.outputs.openAiEndpoint
output AZURE_OPENAI_NAME string = ai.outputs.openAiName
Expand Down
4 changes: 2 additions & 2 deletions infra/main.parameters.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,10 +16,10 @@
"value": "${AZURE_OPENAI_API_VERSION=2023-07-01-preview}"
},
"openAiEmbeddingDeploymentName": {
"value": "${AZURE_OPENAI_EMBEDDING_DEPLOYMENT_NAME=text-embedding-ada-002}"
"value": "${AZURE_EMBEDDING_NAME=text-embedding-ada-002}"
},
"openAiDeploymentName": {
"value": "${AZURE_OPENAI_DEPLOYMENT_NAME=gpt-35-turbo}"
"value": "${AZURE_OPENAI_CHAT_DEPLOYMENT_NAME=gpt-35-turbo}"
},
"principalId": {
"value": "${AZURE_PRINCIPAL_ID}"
Expand Down

0 comments on commit d625829

Please sign in to comment.