Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update deployment name variables for OpenAI chat service #163

Merged
merged 2 commits into from
Sep 11, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .devcontainer/devcontainer.json
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
"customizations": {
"vscode": {
"extensions": [
"prompt-flow.prompt-flow",
"ms-toolsai.prompty@prerelease",
"ms-azuretools.vscode-docker",
"ms-python.python",
"ms-toolsai.jupyter",
Expand Down
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
Loading