Skip to content

Commit 97a005e

Browse files
Merge pull request #15 from microsoft/dev
fix: Added executable permission for shell scripts in dev container & added docker build pipelines
2 parents 8ac235b + f45fc8c commit 97a005e

File tree

9 files changed

+219
-255
lines changed

9 files changed

+219
-255
lines changed

.devcontainer/setupEnv.sh

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,22 +1,30 @@
11
#!/bin/sh
22

3+
echo "Pull latest code for the current branch"
4+
git fetch
5+
git pull
6+
37
set -e # Exit on error
48

59
echo "Setting up ContentProcessor..."
610
cd ./src/ContentProcessor
711
uv sync --frozen
812
cd ../../
913

10-
pwd
11-
1214
echo "Setting up ContentProcessorApi..."
1315
cd ./src/ContentProcessorAPI
1416
uv sync --frozen
1517
cd ../../
16-
pwd
1718

1819
echo "Installing dependencies for ContentProcessorWeb..."
1920
cd ./src/ContentProcessorWeb
2021
yarn install
2122

23+
cd ../../
24+
25+
echo "Setting up executable permission for shell scripts"
26+
sudo chmod +x ./infra/scripts/docker-build.sh
27+
sudo chmod +x ./src/ContentProcessorAPI/samples/upload_files.sh
28+
sudo chmod +x ./src/ContentProcessorAPI/samples/schemas/register_schema.sh
29+
2230
echo "Setup complete! 🎉"
Lines changed: 87 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,87 @@
1+
name: Build and Push Docker Images
2+
3+
on:
4+
push:
5+
branches: [main, dev, demo, hotfix]
6+
pull_request:
7+
branches: [main, dev, demo, hotfix]
8+
types: [opened, ready_for_review, reopened, synchronize]
9+
workflow_dispatch:
10+
11+
jobs:
12+
build-and-push:
13+
runs-on: ubuntu-latest
14+
env:
15+
ACR_LOGIN_SERVER: ${{ secrets.ACR_LOGIN_SERVER }}
16+
ACR_USERNAME: ${{ secrets.ACR_USERNAME }}
17+
ACR_PASSWORD: ${{ secrets.ACR_PASSWORD }}
18+
19+
steps:
20+
- name: Checkout repository
21+
uses: actions/checkout@v2
22+
23+
- name: Set up Docker Buildx
24+
uses: docker/setup-buildx-action@v1
25+
26+
- name: Get current date
27+
id: date
28+
run: echo "date=$(date +'%Y-%m-%d')" >> $GITHUB_OUTPUT
29+
30+
- name: Log in to Azure Container Registry
31+
if: ${{ github.ref_name == 'main' || github.ref_name == 'dev' || github.ref_name == 'demo' || github.ref_name == 'hotfix' }}
32+
uses: azure/docker-login@v2
33+
with:
34+
login-server: ${{ env.ACR_LOGIN_SERVER }}
35+
username: ${{ env.ACR_USERNAME }}
36+
password: ${{ env.ACR_PASSWORD }}
37+
38+
- name: Set Docker image tags
39+
id: tag
40+
run: |
41+
BRANCH="${{ github.ref_name }}"
42+
DATE="${{ steps.date.outputs.date }}"
43+
if [[ "$BRANCH" == "main" ]]; then
44+
BASE_TAG="latest"
45+
elif [[ "$BRANCH" == "dev" ]]; then
46+
BASE_TAG="dev"
47+
elif [[ "$BRANCH" == "demo" ]]; then
48+
BASE_TAG="demo"
49+
elif [[ "$BRANCH" == "hotfix" ]]; then
50+
BASE_TAG="hotfix"
51+
else
52+
BASE_TAG="pullrequest-ignore"
53+
fi
54+
DATE_TAG="${BASE_TAG}-${DATE}"
55+
echo "BASE_TAG=${BASE_TAG}" >> $GITHUB_ENV
56+
echo "DATE_TAG=${DATE_TAG}" >> $GITHUB_ENV
57+
echo "Base tag: $BASE_TAG, Date tag: $DATE_TAG"
58+
59+
- name: Build and Push ContentProcessor Docker image
60+
uses: docker/build-push-action@v6
61+
with:
62+
context: ./src/ContentProcessor
63+
file: ./src/ContentProcessor/Dockerfile
64+
push: ${{ github.ref_name == 'main' || github.ref_name == 'dev' || github.ref_name == 'demo' || github.ref_name == 'hotfix' }}
65+
tags: |
66+
${{ env.ACR_LOGIN_SERVER }}/contentprocessor:${{ env.BASE_TAG }}
67+
${{ env.ACR_LOGIN_SERVER }}/contentprocessor:${{ env.DATE_TAG }}
68+
69+
- name: Build and Push ContentProcessorAPI Docker image
70+
uses: docker/build-push-action@v6
71+
with:
72+
context: ./src/ContentProcessorAPI
73+
file: ./src/ContentProcessorAPI/Dockerfile
74+
push: ${{ github.ref_name == 'main' || github.ref_name == 'dev' || github.ref_name == 'demo' || github.ref_name == 'hotfix' }}
75+
tags: |
76+
${{ env.ACR_LOGIN_SERVER }}/contentprocessorapi:${{ env.BASE_TAG }}
77+
${{ env.ACR_LOGIN_SERVER }}/contentprocessorapi:${{ env.DATE_TAG }}
78+
79+
- name: Build and Push ContentProcessorWeb Docker image
80+
uses: docker/build-push-action@v6
81+
with:
82+
context: ./src/ContentProcessorWeb
83+
file: ./src/ContentProcessorWeb/Dockerfile
84+
push: ${{ github.ref_name == 'main' || github.ref_name == 'dev' || github.ref_name == 'demo' || github.ref_name == 'hotfix' }}
85+
tags: |
86+
${{ env.ACR_LOGIN_SERVER }}/contentprocessorweb:${{ env.BASE_TAG }}
87+
${{ env.ACR_LOGIN_SERVER }}/contentprocessorweb:${{ env.DATE_TAG }}

infra/deploy_ai_foundry.bicep

Lines changed: 0 additions & 219 deletions
Original file line numberDiff line numberDiff line change
@@ -245,225 +245,6 @@ resource aiHubProject 'Microsoft.MachineLearningServices/workspaces@2024-01-01-p
245245
}
246246
}
247247

248-
// 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']
249-
250-
// var isInPhiList = contains(phiModelRegions, location)
251-
252-
// var serverlessModelName = 'Phi-4' //'Phi-3-medium-4k-instruct'
253-
// var phiserverlessName = '${solutionName}-${serverlessModelName}'
254-
// resource phiserverless 'Microsoft.MachineLearningServices/workspaces/serverlessEndpoints@2024-10-01' = if (isInPhiList) {
255-
// parent: aiHubProject
256-
// location: location
257-
// name: phiserverlessName
258-
// properties: {
259-
// authMode: 'Key'
260-
// contentSafety: {
261-
// contentSafetyStatus: 'Enabled'
262-
// }
263-
// modelSettings: {
264-
// modelId: 'azureml://registries/azureml/models/${serverlessModelName}'
265-
// }
266-
// }
267-
// sku: {
268-
// name: 'Consumption'
269-
// tier: 'Free'
270-
// }
271-
// }
272-
273-
resource tenantIdEntry 'Microsoft.KeyVault/vaults/secrets@2021-11-01-preview' = {
274-
parent: keyVault
275-
name: 'TENANT-ID'
276-
properties: {
277-
value: subscription().tenantId
278-
}
279-
}
280-
281-
// resource adlsAccountNameEntry 'Microsoft.KeyVault/vaults/secrets@2021-11-01-preview' = {
282-
// parent: keyVault
283-
// name: 'ADLS-ACCOUNT-NAME'
284-
// properties: {
285-
// value: storageName
286-
// }
287-
// }
288-
289-
// resource adlsAccountContainerEntry 'Microsoft.KeyVault/vaults/secrets@2021-11-01-preview' = {
290-
// parent: keyVault
291-
// name: 'ADLS-ACCOUNT-CONTAINER'
292-
// properties: {
293-
// value: 'data'
294-
// }
295-
// }
296-
297-
// resource adlsAccountKeyEntry 'Microsoft.KeyVault/vaults/secrets@2021-11-01-preview' = {
298-
// parent: keyVault
299-
// name: 'ADLS-ACCOUNT-KEY'
300-
// properties: {
301-
// value: storage.listKeys().keys[0].value
302-
// }
303-
// }
304-
305-
// resource azureOpenAIInferenceEndpoint 'Microsoft.KeyVault/vaults/secrets@2021-11-01-preview' = {
306-
// parent: keyVault
307-
// name: 'AZURE-OPENAI-INFERENCE-ENDPOINT'
308-
// properties: {
309-
// value: phiserverless != null ? phiserverless.properties.inferenceEndpoint.uri : ''
310-
// // value: phiserverless.properties.inferenceEndpoint.uri
311-
// }
312-
// }
313-
314-
// resource azureOpenAIInferenceKey 'Microsoft.KeyVault/vaults/secrets@2021-11-01-preview' = {
315-
// parent: keyVault
316-
// name: 'AZURE-OPENAI-INFERENCE-KEY'
317-
// properties: {
318-
// value: phiserverless != null ? listKeys(phiserverless.id, '2024-10-01').primaryKey : ''
319-
// // listKeys(phiserverless.id, '2024-10-01').primaryKey
320-
// }
321-
// }
322-
323-
resource azureOpenAIApiKeyEntry 'Microsoft.KeyVault/vaults/secrets@2021-11-01-preview' = {
324-
parent: keyVault
325-
name: 'AZURE-OPENAI-KEY'
326-
properties: {
327-
value: aiServices.listKeys().key1 //aiServices_m.listKeys().key1
328-
}
329-
}
330-
331-
resource azureOpenAIDeploymentModel 'Microsoft.KeyVault/vaults/secrets@2021-11-01-preview' = {
332-
parent: keyVault
333-
name: 'AZURE-OPEN-AI-DEPLOYMENT-MODEL'
334-
properties: {
335-
value: gptModelName
336-
}
337-
}
338-
339-
resource gptModelVersionEntry 'Microsoft.KeyVault/vaults/secrets@2021-11-01-preview' = {
340-
parent: keyVault
341-
name: 'AZURE-OPENAI-PREVIEW-API-VERSION'
342-
properties: {
343-
value: gptModelVersion //'2024-02-15-preview'
344-
}
345-
}
346-
347-
resource azureOpenAIEndpointEntry 'Microsoft.KeyVault/vaults/secrets@2021-11-01-preview' = {
348-
parent: keyVault
349-
name: 'AZURE-OPENAI-ENDPOINT'
350-
properties: {
351-
value: aiServices.properties.endpoint //aiServices_m.properties.endpoint
352-
}
353-
}
354-
355-
resource azureAIProjectConnectionStringEntry 'Microsoft.KeyVault/vaults/secrets@2021-11-01-preview' = {
356-
parent: keyVault
357-
name: 'AZURE-AI-PROJECT-CONN-STRING'
358-
properties: {
359-
value: '${split(aiHubProject.properties.discoveryUrl, '/')[2]};${subscription().subscriptionId};${resourceGroup().name};${aiHubProject.name}'
360-
}
361-
}
362-
363-
resource azureOpenAICUEndpointEntry 'Microsoft.KeyVault/vaults/secrets@2021-11-01-preview' = {
364-
parent: keyVault
365-
name: 'AZURE-OPENAI-CU-ENDPOINT'
366-
properties: {
367-
value: aiServices_CU.properties.endpoint
368-
}
369-
}
370-
371-
resource azureOpenAICUApiKeyEntry 'Microsoft.KeyVault/vaults/secrets@2021-11-01-preview' = {
372-
parent: keyVault
373-
name: 'AZURE-OPENAI-CU-KEY'
374-
properties: {
375-
value: aiServices_CU.listKeys().key1
376-
}
377-
}
378-
379-
resource azureOpenAICUApiVersionEntry 'Microsoft.KeyVault/vaults/secrets@2021-11-01-preview' = {
380-
parent: keyVault
381-
name: 'AZURE-OPENAI-CU-VERSION'
382-
properties: {
383-
value: '?api-version=2024-12-01-preview'
384-
}
385-
}
386-
387-
// resource azureSearchAdminKeyEntry 'Microsoft.KeyVault/vaults/secrets@2021-11-01-preview' = {
388-
// parent: keyVault
389-
// name: 'AZURE-SEARCH-KEY'
390-
// properties: {
391-
// value: aiSearch.listAdminKeys().primaryKey
392-
// }
393-
// }
394-
395-
// resource azureSearchServiceEndpointEntry 'Microsoft.KeyVault/vaults/secrets@2021-11-01-preview' = {
396-
// parent: keyVault
397-
// name: 'AZURE-SEARCH-ENDPOINT'
398-
// properties: {
399-
// value: 'https://${aiSearch.name}.search.windows.net'
400-
// }
401-
// }
402-
403-
// resource azureSearchServiceEntry 'Microsoft.KeyVault/vaults/secrets@2021-11-01-preview' = {
404-
// parent: keyVault
405-
// name: 'AZURE-SEARCH-SERVICE'
406-
// properties: {
407-
// value: aiSearch.name
408-
// }
409-
// }
410-
411-
// resource azureSearchIndexEntry 'Microsoft.KeyVault/vaults/secrets@2021-11-01-preview' = {
412-
// parent: keyVault
413-
// name: 'AZURE-SEARCH-INDEX'
414-
// properties: {
415-
// value: 'transcripts_index'
416-
// }
417-
// }
418-
419-
resource cogServiceEndpointEntry 'Microsoft.KeyVault/vaults/secrets@2021-11-01-preview' = {
420-
parent: keyVault
421-
name: 'COG-SERVICES-ENDPOINT'
422-
properties: {
423-
value: aiServices.properties.endpoint
424-
}
425-
}
426-
427-
resource cogServiceKeyEntry 'Microsoft.KeyVault/vaults/secrets@2021-11-01-preview' = {
428-
parent: keyVault
429-
name: 'COG-SERVICES-KEY'
430-
properties: {
431-
value: aiServices.listKeys().key1
432-
}
433-
}
434-
435-
resource cogServiceNameEntry 'Microsoft.KeyVault/vaults/secrets@2021-11-01-preview' = {
436-
parent: keyVault
437-
name: 'COG-SERVICES-NAME'
438-
properties: {
439-
value: aiServicesName
440-
}
441-
}
442-
443-
resource azureSubscriptionIdEntry 'Microsoft.KeyVault/vaults/secrets@2021-11-01-preview' = {
444-
parent: keyVault
445-
name: 'AZURE-SUBSCRIPTION-ID'
446-
properties: {
447-
value: subscription().subscriptionId
448-
}
449-
}
450-
451-
resource resourceGroupNameEntry 'Microsoft.KeyVault/vaults/secrets@2021-11-01-preview' = {
452-
parent: keyVault
453-
name: 'AZURE-RESOURCE-GROUP'
454-
properties: {
455-
value: resourceGroup().name
456-
}
457-
}
458-
459-
resource azureLocatioEntry 'Microsoft.KeyVault/vaults/secrets@2021-11-01-preview' = {
460-
parent: keyVault
461-
name: 'AZURE-LOCATION'
462-
properties: {
463-
value: solutionLocation
464-
}
465-
}
466-
467248
output aiServicesTarget string = aiServices.properties.endpoint //aiServices_m.properties.endpoint
468249
output aiServicesCUEndpoint string = aiServices_CU.properties.endpoint //aiServices_m.properties.endpoint
469250
output aiServicesName string = aiServicesName //aiServicesName_m

src/ContentProcessorWeb/src/Components/DocumentViewer/DocumentViewer.styles.scss

Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,3 +4,44 @@
44
border: 1px solid rgb(219, 219, 219)
55
}
66

7+
.imageErrorContainer{
8+
background: rgba(0, 0, 0, 0.3);
9+
/* margin: auto; */
10+
display: flex;
11+
align-items: center;
12+
justify-content: center;
13+
}
14+
15+
.invalidImagePopup{
16+
width: 100%;
17+
padding: auto;
18+
margin: auto;
19+
z-index: 99999;
20+
/* background: white; */
21+
padding: 35px;
22+
box-sizing: content-box;
23+
margin: 30px;
24+
border-radius: 6px;
25+
border: 1px solid #c0c0c0;
26+
/* font-size: 21px; */
27+
/* font-weight: 600; */
28+
box-shadow: azure;
29+
/* transform: translate(-50%, -50%); */
30+
/* top: 50%; */
31+
/* left: 50%; */
32+
background: white;
33+
/* display: flex
34+
; */
35+
background-color: white;
36+
border: 1px solid #ddd;
37+
box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
38+
39+
.imgEH{
40+
font-size: 24px;
41+
font-weight: 600;
42+
}
43+
44+
}
45+
46+
47+

0 commit comments

Comments
 (0)