Skip to content

Commit b0516e4

Browse files
Merge branch 'main' into add-ClientAdvisor-Template
2 parents efbd0d7 + 12b1b85 commit b0516e4

11 files changed

+466
-195
lines changed

.github/workflows/test_research_assistant.yml

Lines changed: 26 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@ name: Unit Tests - Research Assistant
33
on:
44
push:
55
branches: main
6-
# Trigger on changes in these specific paths
76
paths:
87
- 'ResearchAssistant/**'
98
pull_request:
@@ -20,45 +19,49 @@ jobs:
2019
test_research_assistant:
2120
name: Research Assistant Tests
2221
runs-on: ubuntu-latest
23-
# The if condition ensures that this job only runs if changes are in the ResearchAssistant folder
24-
22+
2523
steps:
2624
- uses: actions/checkout@v4
25+
2726
- name: Set up Python
2827
uses: actions/setup-python@v5
2928
with:
3029
python-version: "3.11"
30+
3131
- name: Install Backend Dependencies
3232
run: |
3333
cd ResearchAssistant/App
34+
python -m pip install --upgrade pip
3435
python -m pip install -r requirements.txt
35-
python -m pip install coverage pytest-cov
36+
python -m pip install coverage pytest pytest-cov pytest-asyncio
37+
3638
- name: Run Backend Tests with Coverage
3739
run: |
3840
cd ResearchAssistant/App
39-
python -m pytest -vv --cov=app --cov-report=xml --cov-report=html --cov-report=term-missing --cov-fail-under=80 --junitxml=coverage-junit.xml
41+
python -m pytest -vv --disable-warnings --cov=. --cov-report=xml --cov-report=html --cov-report=term-missing --junitxml=coverage-junit.xml || true
42+
4043
- uses: actions/upload-artifact@v4
4144
with:
4245
name: research-assistant-coverage
4346
path: |
4447
ResearchAssistant/App/coverage.xml
4548
ResearchAssistant/App/coverage-junit.xml
4649
ResearchAssistant/App/htmlcov/
47-
- name: Set up Node.js
48-
uses: actions/setup-node@v3
49-
with:
50-
node-version: '20'
51-
- name: Install Frontend Dependencies
52-
run: |
53-
cd ResearchAssistant/App/frontend
54-
npm install
55-
- name: Run Frontend Tests with Coverage
56-
run: |
57-
cd ResearchAssistant/App/frontend
58-
npm run test -- --coverage
59-
- uses: actions/upload-artifact@v4
60-
with:
61-
name: research-assistant-frontend-coverage
62-
path: |
63-
ResearchAssistant/App/frontend/coverage/
64-
ResearchAssistant/App/frontend/coverage/lcov-report/
50+
# - name: Set up Node.js
51+
# uses: actions/setup-node@v3
52+
# with:
53+
# node-version: '20'
54+
# - name: Install Frontend Dependencies
55+
# run: |
56+
# cd ResearchAssistant/App/frontend
57+
# npm install
58+
# - name: Run Frontend Tests with Coverage
59+
# run: |
60+
# cd ResearchAssistant/App/frontend
61+
# npm run test -- --coverage
62+
# - uses: actions/upload-artifact@v4
63+
# with:
64+
# name: research-assistant-frontend-coverage
65+
# path: |
66+
# ResearchAssistant/App/frontend/coverage/
67+
# ResearchAssistant/App/frontend/coverage/lcov-report/

.gitignore

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
## files generated by popular Visual Studio add-ons.
33
##
44
## Get latest from https://github.com/github/gitignore/blob/main/VisualStudio.gitignore
5-
5+
.venv/
66
# User-specific files
77
*.rsuser
88
*.suo
Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
## Purpose
2+
<!-- Describe the intention of the changes being proposed. What problem does it solve or functionality does it add? -->
3+
* ...
4+
5+
## Does this introduce a breaking change?
6+
<!-- Mark one with an "x". -->
7+
8+
- [ ] Yes
9+
- [ ] No
10+
11+
<!-- Please prefix your PR title with one of the following:
12+
* `feat`: A new feature
13+
* `fix`: A bug fix
14+
* `docs`: Documentation only changes
15+
* `style`: Changes that do not affect the meaning of the code (white-space, formatting, missing semi-colons, etc)
16+
* `refactor`: A code change that neither fixes a bug nor adds a feature
17+
* `perf`: A code change that improves performance
18+
* `test`: Adding missing tests or correcting existing tests
19+
* `build`: Changes that affect the build system or external dependencies (example scopes: gulp, broccoli, npm)
20+
* `ci`: Changes to our CI configuration files and scripts (example scopes: Travis, Circle, BrowserStack, SauceLabs)
21+
* `chore`: Other changes that don't modify src or test files
22+
* `revert`: Reverts a previous commit
23+
* !: A breaking change is indicated with a `!` after the listed prefixes above, e.g. `feat!`, `fix!`, `refactor!`, etc.
24+
-->
25+
26+
## Golden Path Validation
27+
- [ ] I have tested the primary workflows (the "golden path") to ensure they function correctly without errors.
28+
29+
## Deployment Validation
30+
- [ ] I have validated the deployment process successfully and all services are running as expected with this change.
31+
32+
## What to Check
33+
Verify that the following are valid
34+
* ...
35+
36+
## Other Information
37+
<!-- Add any other helpful information that may be needed here. -->
Lines changed: 149 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,149 @@
1+
@description('Specifies the location for resources.')
2+
param solutionName string
3+
param solutionLocation string
4+
@secure()
5+
param azureOpenAIApiKey string
6+
param azureOpenAIApiVersion string
7+
param azureOpenAIEndpoint string
8+
@secure()
9+
param azureSearchAdminKey string
10+
param azureSearchServiceEndpoint string
11+
param azureSearchIndex string
12+
param sqlServerName string
13+
param sqlDbName string
14+
param sqlDbUser string
15+
@secure()
16+
param sqlDbPwd string
17+
param functionAppVersion string
18+
19+
var functionAppName = '${solutionName}fn'
20+
var azureOpenAIDeploymentModel = 'gpt-4'
21+
var azureOpenAIEmbeddingDeployment = 'text-embedding-ada-002'
22+
var valueOne = '1'
23+
24+
resource storageAccount 'Microsoft.Storage/storageAccounts@2021-04-01' = {
25+
name: '${solutionName}fnstorage'
26+
location: solutionLocation
27+
sku: {
28+
name: 'Standard_LRS'
29+
}
30+
kind: 'StorageV2'
31+
properties: {
32+
allowSharedKeyAccess: false
33+
}
34+
}
35+
36+
resource logAnalyticsWorkspace 'Microsoft.OperationalInsights/workspaces@2022-10-01' = {
37+
name: 'workspace-${solutionName}'
38+
location: solutionLocation
39+
}
40+
41+
resource ApplicationInsights 'Microsoft.Insights/components@2020-02-02' = {
42+
name: functionAppName
43+
location: solutionLocation
44+
kind: 'web'
45+
properties: {
46+
Application_Type: 'web'
47+
publicNetworkAccessForIngestion: 'Enabled'
48+
publicNetworkAccessForQuery: 'Enabled'
49+
WorkspaceResourceId: logAnalyticsWorkspace.id
50+
}
51+
}
52+
53+
resource containerAppEnv 'Microsoft.App/managedEnvironments@2022-06-01-preview' = {
54+
name: '${solutionName}env'
55+
location: solutionLocation
56+
sku: {
57+
name: 'Consumption'
58+
}
59+
properties: {
60+
appLogsConfiguration: {
61+
destination: 'log-analytics'
62+
logAnalyticsConfiguration: {
63+
customerId: logAnalyticsWorkspace.properties.customerId
64+
sharedKey: logAnalyticsWorkspace.listKeys().primarySharedKey
65+
}
66+
}
67+
}
68+
}
69+
70+
resource functionApp 'Microsoft.Web/sites@2024-04-01' = {
71+
name: functionAppName
72+
location: solutionLocation
73+
kind: 'functionapp'
74+
identity: {
75+
type: 'SystemAssigned'
76+
}
77+
properties: {
78+
managedEnvironmentId: containerAppEnv.id
79+
siteConfig: {
80+
linuxFxVersion: 'DOCKER|bycwacontainerreg.azurecr.io/byc-wa-fn:${functionAppVersion}'
81+
appSettings: [
82+
{
83+
name: 'APPINSIGHTS_INSTRUMENTATIONKEY'
84+
value: reference(ApplicationInsights.id, '2015-05-01').InstrumentationKey
85+
}
86+
{
87+
name: 'AZURE_OPEN_AI_API_KEY'
88+
value: azureOpenAIApiKey
89+
}
90+
{
91+
name: 'AZURE_OPEN_AI_DEPLOYMENT_MODEL'
92+
value: azureOpenAIDeploymentModel
93+
}
94+
{
95+
name: 'AZURE_OPEN_AI_ENDPOINT'
96+
value: azureOpenAIEndpoint
97+
}
98+
{
99+
name: 'AZURE_OPENAI_EMBEDDING_DEPLOYMENT'
100+
value: azureOpenAIEmbeddingDeployment
101+
}
102+
{
103+
name: 'OPENAI_API_VERSION'
104+
value: azureOpenAIApiVersion
105+
}
106+
{
107+
name: 'AZURE_AI_SEARCH_API_KEY'
108+
value: azureSearchAdminKey
109+
}
110+
{
111+
name: 'AZURE_AI_SEARCH_ENDPOINT'
112+
value: azureSearchServiceEndpoint
113+
}
114+
{
115+
name: 'AZURE_SEARCH_INDEX'
116+
value: azureSearchIndex
117+
}
118+
{
119+
name: 'PYTHON_ENABLE_INIT_INDEXING'
120+
value: valueOne
121+
}
122+
{
123+
name: 'PYTHON_ISOLATE_WORKER_DEPENDENCIES'
124+
value: valueOne
125+
}
126+
{
127+
name: 'SQLDB_CONNECTION_STRING'
128+
value: 'TBD'
129+
}
130+
{
131+
name: 'SQLDB_SERVER'
132+
value: sqlServerName
133+
}
134+
{
135+
name: 'SQLDB_DATABASE'
136+
value: sqlDbName
137+
}
138+
{
139+
name: 'SQLDB_USERNAME'
140+
value: sqlDbUser
141+
}
142+
{
143+
name: 'SQLDB_PASSWORD'
144+
value: sqlDbPwd
145+
}
146+
]
147+
}
148+
}
149+
}

ClientAdvisor/Deployment/bicep/deploy_azure_function_script.bicep

Lines changed: 0 additions & 42 deletions
This file was deleted.

ClientAdvisor/Deployment/bicep/main.bicep

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ param cosmosLocation string
1313
// param fabricWorkspaceId string
1414

1515
var resourceGroupLocation = resourceGroup().location
16-
var resourceGroupName = resourceGroup().name
16+
// var resourceGroupName = resourceGroup().name
1717
// var subscriptionId = subscription().subscriptionId
1818

1919
var solutionLocation = resourceGroupLocation
@@ -101,12 +101,11 @@ module uploadFiles 'deploy_upload_files_script.bicep' = {
101101
dependsOn:[storageAccountModule]
102102
}
103103

104-
module azureFunctions 'deploy_azure_function_script.bicep' = {
105-
name : 'deploy_azure_function_script'
104+
module azureFunctions 'deploy_azure_function.bicep' = {
105+
name : 'deploy_azure_function'
106106
params:{
107107
solutionName: solutionPrefix
108108
solutionLocation: solutionLocation
109-
resourceGroupName:resourceGroupName
110109
azureOpenAIApiKey:azOpenAI.outputs.openAIOutput.openAPIKey
111110
azureOpenAIApiVersion:'2024-02-15-preview'
112111
azureOpenAIEndpoint:azOpenAI.outputs.openAIOutput.openAPIEndpoint
@@ -117,8 +116,6 @@ module azureFunctions 'deploy_azure_function_script.bicep' = {
117116
sqlDbName:sqlDBModule.outputs.sqlDbOutput.sqlDbName
118117
sqlDbUser:sqlDBModule.outputs.sqlDbOutput.sqlDbUser
119118
sqlDbPwd:sqlDBModule.outputs.sqlDbOutput.sqlDbPwd
120-
identity:managedIdentityModule.outputs.managedIdentityOutput.id
121-
baseUrl:baseUrl
122119
functionAppVersion: appversion
123120
}
124121
dependsOn:[storageAccountModule]

0 commit comments

Comments
 (0)