Skip to content

Commit

Permalink
Merge remote-tracking branch 'upstream/main'
Browse files Browse the repository at this point in the history
  • Loading branch information
Roopan-Microsoft committed Nov 26, 2024
2 parents f7791e9 + 1ae5e9c commit 7e0cad1
Show file tree
Hide file tree
Showing 8 changed files with 46 additions and 26 deletions.
8 changes: 4 additions & 4 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,15 +7,15 @@ updates:
- package-ecosystem: "github-actions"
directory: "/"
schedule:
interval: "weekly"
interval: "monthly"

commit-message:
prefix: "build"
target-branch: "dependabotchanges"
- package-ecosystem: "pip"
directory: "/"
schedule:
interval: "weekly"
interval: "monthly"


commit-message:
Expand All @@ -29,7 +29,7 @@ updates:
- package-ecosystem: "npm"
directory: "/code/frontend"
schedule:
interval: "weekly"
interval: "monthly"


commit-message:
Expand All @@ -39,7 +39,7 @@ updates:
- package-ecosystem: "npm"
directory: "/tests/integration/ui"
schedule:
interval: "weekly"
interval: "monthly"


commit-message:
Expand Down
16 changes: 11 additions & 5 deletions .github/workflows/build-docker-images.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,15 @@ on:
workflow_run:
workflows: [Tests]
types: [completed]
branches: [main, dev, demo]
branches:
- main
- dev
- demo
pull_request:
branches: [main, dev, demo]
branches:
- main
- dev
- demo
types:
- opened
- ready_for_review
Expand All @@ -28,9 +34,9 @@ jobs:
dockerfile: docker/Frontend.Dockerfile
uses: ./.github/workflows/build-docker.yml
with:
registry: cwydcontainerreg.azurecr.io
username: cwydcontainerreg
registry: ${{ github.event.workflow_run.head_branch == 'main' && 'fruoccopublic.azurecr.io' || 'cwydcontainerreg.azurecr.io'}}
username: ${{ github.event.workflow_run.head_branch == 'main' && 'fruoccopublic' || 'cwydcontainerreg'}}
app_name: ${{ matrix.app_name }}
dockerfile: ${{ matrix.dockerfile }}
push: ${{ github.event_name == 'workflow_run' && github.event.workflow_run.head_branch == 'main' }}
push: ${{ github.event.workflow_run.head_branch == 'main' || github.event.workflow_run.head_branch == 'dev' || github.event.workflow_run.head_branch == 'demo' }}
secrets: inherit
16 changes: 13 additions & 3 deletions .github/workflows/build-docker.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,8 @@ on:
secrets:
DOCKER_PASSWORD:
required: false
DEV_DOCKER_PASSWORD:
required: false

jobs:
docker-build:
Expand All @@ -31,13 +33,21 @@ jobs:
uses: actions/checkout@v4

- name: Docker Login
if: ${{ inputs.push }}
if: ${{ inputs.push == true && github.ref_name == 'main' }}
uses: docker/login-action@v3
with:
registry: ${{ inputs.registry }}
username: ${{ inputs.username }}
password: ${{ secrets.DOCKER_PASSWORD }}

- name: Dev Docker Login
if: ${{ inputs.push == true && (github.ref_name == 'dev' || github.ref_name == 'demo') }}
uses: docker/login-action@v3
with:
registry: ${{ inputs.registry }}
username: ${{ inputs.username }}
password: ${{ secrets.DEV_DOCKER_PASSWORD }}

- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3

Expand All @@ -51,7 +61,7 @@ jobs:
context: .
file: ${{ inputs.dockerfile }}
push: ${{ inputs.push }}
cache-from: type=registry,ref=${{ inputs.registry }}/${{ inputs.app_name}}:dev
cache-from: type=registry,ref=${{ inputs.registry }}/${{ inputs.app_name}}:${{ github.ref_name == 'main' && 'latest' || github.ref_name == 'dev' && 'dev' || github.ref_name == 'demo' && 'demo' || 'latest' }}
tags: |
${{ inputs.registry }}/${{ inputs.app_name}}:dev
${{ inputs.registry }}/${{ inputs.app_name}}:${{ github.ref_name == 'main' && 'latest' || github.ref_name == 'dev' && 'dev' || github.ref_name == 'demo' && 'demo' || 'latest' }}
${{ inputs.registry }}/${{ inputs.app_name}}:${{ steps.date.outputs.date }}_${{ github.run_number }}
7 changes: 3 additions & 4 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -54,8 +54,8 @@ jobs:
AZURE_LOCATION: ${{ vars.AZURE_LOCATION }}
AZURE_RESOURCE_GROUP: ${{ vars.AZURE_RESOURCE_GROUP }}
with:
imageName: ghcr.io/roopan-microsoft/psl-cwyd-main
cacheFrom: ghcr.io/roopan-microsoft/psl-cwyd-main
imageName: ghcr.io/azure-samples/chat-with-your-data-solution-accelerator
cacheFrom: ghcr.io/azure-samples/chat-with-your-data-solution-accelerator
imageTag: ${{ env.imageTag }}
runCmd: make ci && make deploy
refFilterForPush: refs/heads/${{ github.event_name == 'schedule' && 'main' || github.ref_name }}
Expand All @@ -77,7 +77,7 @@ jobs:
AZURE_RESOURCE_GROUP: ${{ vars.AZURE_RESOURCE_GROUP }}
with:
push: never
imageName: ghcr.io/roopan-microsoft/psl-cwyd-main
imageName: ghcr.io/azure-samples/chat-with-your-data-solution-accelerator
imageTag: ${{ env.imageTag }}
runCmd: make destroy
env: |
Expand All @@ -92,7 +92,6 @@ jobs:
if: failure()
run: |
RUN_URL="https://github.com/${{ github.repository }}/actions/runs/${{ github.run_id }}"
# Construct the email body
EMAIL_BODY=$(cat <<EOF
{
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@ name: Tests

on:
push:
branches: [main]
branches: [main, dev, demo]
pull_request:
branches: [main]
branches: [main, dev, demo]
types:
- opened
- ready_for_review
Expand Down
2 changes: 1 addition & 1 deletion code/create_app.py
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ def get_markdown_url(source, title, container_sas):


def get_citations(citation_list):
"""Returns Formated Citations"""
"""Returns Formated Citations."""
blob_client = AzureBlobStorageClient()
container_sas = blob_client.get_container_sas()
citations_dict = {"citations": []}
Expand Down
9 changes: 6 additions & 3 deletions infra/main.bicep
Original file line number Diff line number Diff line change
Expand Up @@ -329,6 +329,9 @@ var azureOpenAIEmbeddingModelInfo = string({
modelVersion: azureOpenAIEmbeddingModelVersion
})

var appversion = 'latest' // Update GIT deployment branch
var registryName = 'fruoccopublic' // Update Registry name

// Organize resources in a resource group
resource rg 'Microsoft.Resources/resourceGroups@2021-04-01' = {
name: rgName
Expand Down Expand Up @@ -639,7 +642,7 @@ module web_docker './app/web.bicep' = if (hostingModel == 'container') {
name: '${websiteName}-docker'
location: location
tags: union(tags, { 'azd-service-name': 'web-docker' })
dockerFullImageName: 'fruoccopublic.azurecr.io/rag-webapp:latest'
dockerFullImageName: '${registryName}.azurecr.io/rag-webapp:${appversion}'
appServicePlanId: hostingplan.outputs.name
applicationInsightsName: monitoring.outputs.applicationInsightsName
healthCheckPath: '/api/health'
Expand Down Expand Up @@ -799,7 +802,7 @@ module adminweb_docker './app/adminweb.bicep' = if (hostingModel == 'container')
name: '${adminWebsiteName}-docker'
location: location
tags: union(tags, { 'azd-service-name': 'adminweb-docker' })
dockerFullImageName: 'fruoccopublic.azurecr.io/rag-adminwebapp:latest'
dockerFullImageName: '${registryName}.azurecr.io/rag-adminwebapp:${appversion}'
appServicePlanId: hostingplan.outputs.name
applicationInsightsName: monitoring.outputs.applicationInsightsName
azureOpenAIName: openai.outputs.name
Expand Down Expand Up @@ -974,7 +977,7 @@ module function_docker './app/function.bicep' = if (hostingModel == 'container')
name: '${functionName}-docker'
location: location
tags: union(tags, { 'azd-service-name': 'function-docker' })
dockerFullImageName: 'fruoccopublic.azurecr.io/rag-backend:latest'
dockerFullImageName: '${registryName}.azurecr.io/rag-backend:${appversion}'
appServicePlanId: hostingplan.outputs.name
applicationInsightsName: monitoring.outputs.applicationInsightsName
azureOpenAIName: openai.outputs.name
Expand Down
10 changes: 6 additions & 4 deletions infra/main.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
"_generator": {
"name": "bicep",
"version": "0.31.34.60546",
"templateHash": "11066663538566198133"
"templateHash": "9243131736696562084"
}
},
"parameters": {
Expand Down Expand Up @@ -643,6 +643,8 @@
"keyVaultName": "[format('kv-{0}', parameters('resourceToken'))]",
"azureOpenAIModelInfo": "[string(createObject('model', parameters('azureOpenAIModel'), 'modelName', parameters('azureOpenAIModelName'), 'modelVersion', parameters('azureOpenAIModelVersion')))]",
"azureOpenAIEmbeddingModelInfo": "[string(createObject('model', parameters('azureOpenAIEmbeddingModel'), 'modelName', parameters('azureOpenAIEmbeddingModelName'), 'modelVersion', parameters('azureOpenAIEmbeddingModelVersion')))]",
"appversion": "latest",
"registryName": "fruoccopublic",
"defaultOpenAiDeployments": [
{
"name": "[parameters('azureOpenAIModel')]",
Expand Down Expand Up @@ -3256,7 +3258,7 @@
"value": "[union(variables('tags'), createObject('azd-service-name', 'web-docker'))]"
},
"dockerFullImageName": {
"value": "fruoccopublic.azurecr.io/rag-webapp:latest"
"value": "[format('{0}.azurecr.io/rag-webapp:{1}', variables('registryName'), variables('appversion'))]"
},
"appServicePlanId": {
"value": "[reference(extensionResourceId(format('/subscriptions/{0}/resourceGroups/{1}', subscription().subscriptionId, variables('rgName')), 'Microsoft.Resources/deployments', parameters('hostingPlanName')), '2022-09-01').outputs.name.value]"
Expand Down Expand Up @@ -5235,7 +5237,7 @@
"value": "[union(variables('tags'), createObject('azd-service-name', 'adminweb-docker'))]"
},
"dockerFullImageName": {
"value": "fruoccopublic.azurecr.io/rag-adminwebapp:latest"
"value": "[format('{0}.azurecr.io/rag-adminwebapp:{1}', variables('registryName'), variables('appversion'))]"
},
"appServicePlanId": {
"value": "[reference(extensionResourceId(format('/subscriptions/{0}/resourceGroups/{1}', subscription().subscriptionId, variables('rgName')), 'Microsoft.Resources/deployments', parameters('hostingPlanName')), '2022-09-01').outputs.name.value]"
Expand Down Expand Up @@ -9250,7 +9252,7 @@
"value": "[union(variables('tags'), createObject('azd-service-name', 'function-docker'))]"
},
"dockerFullImageName": {
"value": "fruoccopublic.azurecr.io/rag-backend:latest"
"value": "[format('{0}.azurecr.io/rag-backend:{1}', variables('registryName'), variables('appversion'))]"
},
"appServicePlanId": {
"value": "[reference(extensionResourceId(format('/subscriptions/{0}/resourceGroups/{1}', subscription().subscriptionId, variables('rgName')), 'Microsoft.Resources/deployments', parameters('hostingPlanName')), '2022-09-01').outputs.name.value]"
Expand Down

0 comments on commit 7e0cad1

Please sign in to comment.