Skip to content
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
14 changes: 11 additions & 3 deletions .devcontainer/setupEnv.sh
Original file line number Diff line number Diff line change
@@ -1,22 +1,30 @@
#!/bin/sh

echo "Pull latest code for the current branch"
git fetch
git pull

set -e # Exit on error

echo "Setting up ContentProcessor..."
cd ./src/ContentProcessor
uv sync --frozen
cd ../../

pwd

echo "Setting up ContentProcessorApi..."
cd ./src/ContentProcessorAPI
uv sync --frozen
cd ../../
pwd

echo "Installing dependencies for ContentProcessorWeb..."
cd ./src/ContentProcessorWeb
yarn install

cd ../../

echo "Setting up executable permission for shell scripts"
sudo chmod +x ./infra/scripts/docker-build.sh
sudo chmod +x ./src/ContentProcessorAPI/samples/upload_files.sh
sudo chmod +x ./src/ContentProcessorAPI/samples/schemas/register_schema.sh

echo "Setup complete! 🎉"
87 changes: 87 additions & 0 deletions .github/workflows/build-docker-image.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,87 @@
name: Build and Push Docker Images

on:
push:
branches: [main, dev, demo, hotfix]
pull_request:
branches: [main, dev, demo, hotfix]
types: [opened, ready_for_review, reopened, synchronize]
workflow_dispatch:

jobs:
build-and-push:
runs-on: ubuntu-latest
env:
ACR_LOGIN_SERVER: ${{ secrets.ACR_LOGIN_SERVER }}
ACR_USERNAME: ${{ secrets.ACR_USERNAME }}
ACR_PASSWORD: ${{ secrets.ACR_PASSWORD }}

steps:
- name: Checkout repository
uses: actions/checkout@v2

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

- name: Get current date
id: date
run: echo "date=$(date +'%Y-%m-%d')" >> $GITHUB_OUTPUT

- name: Log in to Azure Container Registry
if: ${{ github.ref_name == 'main' || github.ref_name == 'dev' || github.ref_name == 'demo' || github.ref_name == 'hotfix' }}
uses: azure/docker-login@v2
with:
login-server: ${{ env.ACR_LOGIN_SERVER }}
username: ${{ env.ACR_USERNAME }}
password: ${{ env.ACR_PASSWORD }}

- name: Set Docker image tags
id: tag
run: |
BRANCH="${{ github.ref_name }}"
DATE="${{ steps.date.outputs.date }}"
if [[ "$BRANCH" == "main" ]]; then
BASE_TAG="latest"
elif [[ "$BRANCH" == "dev" ]]; then
BASE_TAG="dev"
elif [[ "$BRANCH" == "demo" ]]; then
BASE_TAG="demo"
elif [[ "$BRANCH" == "hotfix" ]]; then
BASE_TAG="hotfix"
else
BASE_TAG="pullrequest-ignore"
fi
DATE_TAG="${BASE_TAG}-${DATE}"
echo "BASE_TAG=${BASE_TAG}" >> $GITHUB_ENV
echo "DATE_TAG=${DATE_TAG}" >> $GITHUB_ENV
echo "Base tag: $BASE_TAG, Date tag: $DATE_TAG"

- name: Build and Push ContentProcessor Docker image
uses: docker/build-push-action@v6
with:
context: ./src/ContentProcessor
file: ./src/ContentProcessor/Dockerfile
push: ${{ github.ref_name == 'main' || github.ref_name == 'dev' || github.ref_name == 'demo' || github.ref_name == 'hotfix' }}
tags: |
${{ env.ACR_LOGIN_SERVER }}/contentprocessor:${{ env.BASE_TAG }}
${{ env.ACR_LOGIN_SERVER }}/contentprocessor:${{ env.DATE_TAG }}

- name: Build and Push ContentProcessorAPI Docker image
uses: docker/build-push-action@v6
with:
context: ./src/ContentProcessorAPI
file: ./src/ContentProcessorAPI/Dockerfile
push: ${{ github.ref_name == 'main' || github.ref_name == 'dev' || github.ref_name == 'demo' || github.ref_name == 'hotfix' }}
tags: |
${{ env.ACR_LOGIN_SERVER }}/contentprocessorapi:${{ env.BASE_TAG }}
${{ env.ACR_LOGIN_SERVER }}/contentprocessorapi:${{ env.DATE_TAG }}

- name: Build and Push ContentProcessorWeb Docker image
uses: docker/build-push-action@v6
with:
context: ./src/ContentProcessorWeb
file: ./src/ContentProcessorWeb/Dockerfile
push: ${{ github.ref_name == 'main' || github.ref_name == 'dev' || github.ref_name == 'demo' || github.ref_name == 'hotfix' }}
tags: |
${{ env.ACR_LOGIN_SERVER }}/contentprocessorweb:${{ env.BASE_TAG }}
${{ env.ACR_LOGIN_SERVER }}/contentprocessorweb:${{ env.DATE_TAG }}
219 changes: 0 additions & 219 deletions infra/deploy_ai_foundry.bicep
Original file line number Diff line number Diff line change
Expand Up @@ -245,225 +245,6 @@ resource aiHubProject 'Microsoft.MachineLearningServices/workspaces@2024-01-01-p
}
}

// var phiModelRegions = ['East US', 'East US 2', 'North Central US', 'South Central US', 'Sweden Central', 'West US', 'West US 3', 'eastus','eastus2','northcentralus','southcentralus','swedencentral','westus','westus3']

// var isInPhiList = contains(phiModelRegions, location)

// var serverlessModelName = 'Phi-4' //'Phi-3-medium-4k-instruct'
// var phiserverlessName = '${solutionName}-${serverlessModelName}'
// resource phiserverless 'Microsoft.MachineLearningServices/workspaces/serverlessEndpoints@2024-10-01' = if (isInPhiList) {
// parent: aiHubProject
// location: location
// name: phiserverlessName
// properties: {
// authMode: 'Key'
// contentSafety: {
// contentSafetyStatus: 'Enabled'
// }
// modelSettings: {
// modelId: 'azureml://registries/azureml/models/${serverlessModelName}'
// }
// }
// sku: {
// name: 'Consumption'
// tier: 'Free'
// }
// }

resource tenantIdEntry 'Microsoft.KeyVault/vaults/secrets@2021-11-01-preview' = {
parent: keyVault
name: 'TENANT-ID'
properties: {
value: subscription().tenantId
}
}

// resource adlsAccountNameEntry 'Microsoft.KeyVault/vaults/secrets@2021-11-01-preview' = {
// parent: keyVault
// name: 'ADLS-ACCOUNT-NAME'
// properties: {
// value: storageName
// }
// }

// resource adlsAccountContainerEntry 'Microsoft.KeyVault/vaults/secrets@2021-11-01-preview' = {
// parent: keyVault
// name: 'ADLS-ACCOUNT-CONTAINER'
// properties: {
// value: 'data'
// }
// }

// resource adlsAccountKeyEntry 'Microsoft.KeyVault/vaults/secrets@2021-11-01-preview' = {
// parent: keyVault
// name: 'ADLS-ACCOUNT-KEY'
// properties: {
// value: storage.listKeys().keys[0].value
// }
// }

// resource azureOpenAIInferenceEndpoint 'Microsoft.KeyVault/vaults/secrets@2021-11-01-preview' = {
// parent: keyVault
// name: 'AZURE-OPENAI-INFERENCE-ENDPOINT'
// properties: {
// value: phiserverless != null ? phiserverless.properties.inferenceEndpoint.uri : ''
// // value: phiserverless.properties.inferenceEndpoint.uri
// }
// }

// resource azureOpenAIInferenceKey 'Microsoft.KeyVault/vaults/secrets@2021-11-01-preview' = {
// parent: keyVault
// name: 'AZURE-OPENAI-INFERENCE-KEY'
// properties: {
// value: phiserverless != null ? listKeys(phiserverless.id, '2024-10-01').primaryKey : ''
// // listKeys(phiserverless.id, '2024-10-01').primaryKey
// }
// }

resource azureOpenAIApiKeyEntry 'Microsoft.KeyVault/vaults/secrets@2021-11-01-preview' = {
parent: keyVault
name: 'AZURE-OPENAI-KEY'
properties: {
value: aiServices.listKeys().key1 //aiServices_m.listKeys().key1
}
}

resource azureOpenAIDeploymentModel 'Microsoft.KeyVault/vaults/secrets@2021-11-01-preview' = {
parent: keyVault
name: 'AZURE-OPEN-AI-DEPLOYMENT-MODEL'
properties: {
value: gptModelName
}
}

resource gptModelVersionEntry 'Microsoft.KeyVault/vaults/secrets@2021-11-01-preview' = {
parent: keyVault
name: 'AZURE-OPENAI-PREVIEW-API-VERSION'
properties: {
value: gptModelVersion //'2024-02-15-preview'
}
}

resource azureOpenAIEndpointEntry 'Microsoft.KeyVault/vaults/secrets@2021-11-01-preview' = {
parent: keyVault
name: 'AZURE-OPENAI-ENDPOINT'
properties: {
value: aiServices.properties.endpoint //aiServices_m.properties.endpoint
}
}

resource azureAIProjectConnectionStringEntry 'Microsoft.KeyVault/vaults/secrets@2021-11-01-preview' = {
parent: keyVault
name: 'AZURE-AI-PROJECT-CONN-STRING'
properties: {
value: '${split(aiHubProject.properties.discoveryUrl, '/')[2]};${subscription().subscriptionId};${resourceGroup().name};${aiHubProject.name}'
}
}

resource azureOpenAICUEndpointEntry 'Microsoft.KeyVault/vaults/secrets@2021-11-01-preview' = {
parent: keyVault
name: 'AZURE-OPENAI-CU-ENDPOINT'
properties: {
value: aiServices_CU.properties.endpoint
}
}

resource azureOpenAICUApiKeyEntry 'Microsoft.KeyVault/vaults/secrets@2021-11-01-preview' = {
parent: keyVault
name: 'AZURE-OPENAI-CU-KEY'
properties: {
value: aiServices_CU.listKeys().key1
}
}

resource azureOpenAICUApiVersionEntry 'Microsoft.KeyVault/vaults/secrets@2021-11-01-preview' = {
parent: keyVault
name: 'AZURE-OPENAI-CU-VERSION'
properties: {
value: '?api-version=2024-12-01-preview'
}
}

// resource azureSearchAdminKeyEntry 'Microsoft.KeyVault/vaults/secrets@2021-11-01-preview' = {
// parent: keyVault
// name: 'AZURE-SEARCH-KEY'
// properties: {
// value: aiSearch.listAdminKeys().primaryKey
// }
// }

// resource azureSearchServiceEndpointEntry 'Microsoft.KeyVault/vaults/secrets@2021-11-01-preview' = {
// parent: keyVault
// name: 'AZURE-SEARCH-ENDPOINT'
// properties: {
// value: 'https://${aiSearch.name}.search.windows.net'
// }
// }

// resource azureSearchServiceEntry 'Microsoft.KeyVault/vaults/secrets@2021-11-01-preview' = {
// parent: keyVault
// name: 'AZURE-SEARCH-SERVICE'
// properties: {
// value: aiSearch.name
// }
// }

// resource azureSearchIndexEntry 'Microsoft.KeyVault/vaults/secrets@2021-11-01-preview' = {
// parent: keyVault
// name: 'AZURE-SEARCH-INDEX'
// properties: {
// value: 'transcripts_index'
// }
// }

resource cogServiceEndpointEntry 'Microsoft.KeyVault/vaults/secrets@2021-11-01-preview' = {
parent: keyVault
name: 'COG-SERVICES-ENDPOINT'
properties: {
value: aiServices.properties.endpoint
}
}

resource cogServiceKeyEntry 'Microsoft.KeyVault/vaults/secrets@2021-11-01-preview' = {
parent: keyVault
name: 'COG-SERVICES-KEY'
properties: {
value: aiServices.listKeys().key1
}
}

resource cogServiceNameEntry 'Microsoft.KeyVault/vaults/secrets@2021-11-01-preview' = {
parent: keyVault
name: 'COG-SERVICES-NAME'
properties: {
value: aiServicesName
}
}

resource azureSubscriptionIdEntry 'Microsoft.KeyVault/vaults/secrets@2021-11-01-preview' = {
parent: keyVault
name: 'AZURE-SUBSCRIPTION-ID'
properties: {
value: subscription().subscriptionId
}
}

resource resourceGroupNameEntry 'Microsoft.KeyVault/vaults/secrets@2021-11-01-preview' = {
parent: keyVault
name: 'AZURE-RESOURCE-GROUP'
properties: {
value: resourceGroup().name
}
}

resource azureLocatioEntry 'Microsoft.KeyVault/vaults/secrets@2021-11-01-preview' = {
parent: keyVault
name: 'AZURE-LOCATION'
properties: {
value: solutionLocation
}
}

output aiServicesTarget string = aiServices.properties.endpoint //aiServices_m.properties.endpoint
output aiServicesCUEndpoint string = aiServices_CU.properties.endpoint //aiServices_m.properties.endpoint
output aiServicesName string = aiServicesName //aiServicesName_m
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,3 +4,44 @@
border: 1px solid rgb(219, 219, 219)
}

.imageErrorContainer{
background: rgba(0, 0, 0, 0.3);
/* margin: auto; */
display: flex;
align-items: center;
justify-content: center;
}

.invalidImagePopup{
width: 100%;
padding: auto;
margin: auto;
z-index: 99999;
/* background: white; */
padding: 35px;
box-sizing: content-box;
margin: 30px;
border-radius: 6px;
border: 1px solid #c0c0c0;
/* font-size: 21px; */
/* font-weight: 600; */
box-shadow: azure;
/* transform: translate(-50%, -50%); */
/* top: 50%; */
/* left: 50%; */
background: white;
/* display: flex
; */
background-color: white;
border: 1px solid #ddd;
box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);

.imgEH{
font-size: 24px;
font-weight: 600;
}

}



Loading
Loading