Skip to content

Commit

Permalink
Clean up and prepar for semantic search deployment.
Browse files Browse the repository at this point in the history
  • Loading branch information
sjkp committed Mar 29, 2024
1 parent 913fb6d commit d106bee
Show file tree
Hide file tree
Showing 8 changed files with 116 additions and 251 deletions.
31 changes: 31 additions & 0 deletions .devcontainer/devcontainer.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
{
"name": "Azure Developer CLI",
"image": "mcr.microsoft.com/devcontainers/python:3.10-bullseye",
"features": {
// See https://containers.dev/features for list of features
"ghcr.io/devcontainers/features/docker-in-docker:2": {
},
"ghcr.io/azure/azure-dev/azd:latest": {}
},
"customizations": {
"vscode": {
"extensions": [
"GitHub.vscode-github-actions",
"ms-azuretools.azure-dev",
"ms-azuretools.vscode-azurefunctions",
"ms-azuretools.vscode-bicep",
"ms-azuretools.vscode-docker"
// Include other VSCode language extensions if needed
// Right click on an extension inside VSCode to add directly to devcontainer.json, or copy the extension ID
]
}
},
"forwardPorts": [
// Forward ports if needed for local development
],
"postCreateCommand": "",
"remoteUser": "vscode",
"hostRequirements": {
"memory": "8gb"
}
}
82 changes: 62 additions & 20 deletions infrastructure/aca-with-storage-mount.bicep
Original file line number Diff line number Diff line change
Expand Up @@ -3,24 +3,19 @@
param name string
param location string
param lawClientId string
@secure()
param lawClientSecret string

@description('Specifies the docker container image to deploy.')
param containerImage string = 'mcr.microsoft.com/azuredocs/containerapps-helloworld:latest'

@description('Specifies the container port.')
param targetPort int = 80

@description('Number of CPU cores the container can use. Can be with a maximum of two decimals.')
param cpuCore string = '0.5'
param cpuCore string = '0.25'

@description('Amount of memory (in gibibytes, GiB) allocated to the container up to 4GiB. Can be with a maximum of two decimals. Ratio with CPU cores must be equal to 2.')
param memorySize string = '1'
param memorySize string = '0.5'

@description('Minimum number of replicas that will be deployed')
@minValue(0)
@maxValue(25)
param minReplicas int = 1
param minReplicas int = 0

@description('Maximum number of replicas that will be deployed')
@minValue(0)
Expand Down Expand Up @@ -50,10 +45,8 @@ resource env 'Microsoft.App/managedEnvironments@2022-03-01'= {
var storageName = 'acastorage'

resource envStorage 'Microsoft.App/managedEnvironments/storages@2022-03-01' = {
name: 'containerapp-env-${name}/${storageName}'
dependsOn: [
env
]
parent: env
name: storageName
properties: {
azureFile: {
accessMode: 'ReadWrite'
Expand All @@ -64,9 +57,9 @@ resource envStorage 'Microsoft.App/managedEnvironments/storages@2022-03-01' = {
}
}


resource containerApp 'Microsoft.App/containerApps@2022-01-01-preview' = {
name: 'container-app-${name}'
// qdrant container
resource containerApp 'Microsoft.App/containerApps@2023-11-02-preview' = {
name: 'container-app-${name}-qdrant'
dependsOn: [
envStorage
]
Expand All @@ -75,8 +68,16 @@ resource containerApp 'Microsoft.App/containerApps@2022-01-01-preview' = {
managedEnvironmentId: env.id
configuration: {
ingress: {
additionalPortMappings: [
{
exposedPort: 6334
external: true
targetPort: 6334
}
]
external: true
targetPort: targetPort
targetPort: 6333
exposedPort: 6333
allowInsecure: false
traffic: [
{
Expand All @@ -96,15 +97,15 @@ resource containerApp 'Microsoft.App/containerApps@2022-01-01-preview' = {
]
containers: [
{
name: 'container-app-${name}'
image: containerImage
name: 'container-app-${name}-qdrant'
image: 'qdrant/qdrant:latest'
resources: {
cpu: json(cpuCore)
memory: '${memorySize}Gi'
}
volumeMounts: [
{
mountPath: '/usr/share/nginx/html/'
mountPath: '/qdrant/storage'
volumeName: 'externalstorage'
}
]
Expand All @@ -117,3 +118,44 @@ resource containerApp 'Microsoft.App/containerApps@2022-01-01-preview' = {
}
}
}


resource containerApp2 'Microsoft.App/containerApps@2023-11-02-preview' = {
name: 'container-app-${name}-embed'
dependsOn: [
envStorage
]
location: location
properties: {
managedEnvironmentId: env.id
configuration: {
ingress: {
external: true
targetPort: 8080
allowInsecure: false
traffic: [
{
latestRevision: true
weight: 100
}
]
}
}
template: {
containers: [
{
name: 'container-app-${name}-embed'
image: 'sjkp/blitz-embed:v1'
resources: {
cpu: json(cpuCore)
memory: '${memorySize}Gi'
}
}
]
scale: {
minReplicas: minReplicas
maxReplicas: maxReplicas
}
}
}
}
82 changes: 0 additions & 82 deletions infrastructure/aca.bicep

This file was deleted.

51 changes: 0 additions & 51 deletions infrastructure/keyvault.bicep

This file was deleted.

5 changes: 4 additions & 1 deletion infrastructure/logs.bicep
Original file line number Diff line number Diff line change
@@ -1,10 +1,13 @@
param location string
param name string

resource law 'Microsoft.OperationalInsights/workspaces@2020-03-01-preview' = {
resource law 'Microsoft.OperationalInsights/workspaces@2023-09-01' = {
name: name
location: location
properties: any({
qoutas: {
dailyDataVolumeCap: 1
}
retentionInDays: 30
features: {
searchVersion: 1
Expand Down
74 changes: 0 additions & 74 deletions infrastructure/main-with-storage.bicep

This file was deleted.

Loading

0 comments on commit d106bee

Please sign in to comment.