Skip to content

Commit

Permalink
Merge pull request #1357 from solliancenet/mg-update-release-080
Browse files Browse the repository at this point in the history
Cherry picked commits from PRs 1353 and 1354 for Release 0.8.0
  • Loading branch information
ciprianjichici authored Aug 7, 2024
2 parents 61e8eba + 2f2b352 commit 368d074
Show file tree
Hide file tree
Showing 9 changed files with 67 additions and 49 deletions.
40 changes: 40 additions & 0 deletions deploy/standard/azd-hooks/postprovision.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,46 @@ finally {
# Navigate to the script directory so that we can use relative paths.
Push-Location $($MyInvocation.InvocationName | Split-Path)
try {
# Create VNET peerings
Invoke-AndRequireSuccess "Provision VNET Peering to Hub" {
$peerings = @(az network vnet peering list `
--resource-group $env:FLLM_NET_RG `
--vnet-name $env:FOUNDATIONALLM_VNET_NAME)

if ($peerings.Contains("$($env:FOUNDATIONALLM_VNET_NAME)-to-$($env:FOUNDATIONALLM_HUB_VNET_NAME)")) {
Write-Host "Peering for $($env:FOUNDATIONALLM_VNET_NAME)-to-$($env:FOUNDATIONALLM_HUB_VNET_NAME) exists..."
} else {
az network vnet peering create `
--name "$($env:FOUNDATIONALLM_VNET_NAME)-to-$($env:FOUNDATIONALLM_HUB_VNET_NAME)" `
--remote-vnet $env:FOUNDATIONALLM_HUB_VNET_ID `
--resource-group $env:FLLM_NET_RG `
--vnet-name $env:FOUNDATIONALLM_VNET_NAME `
--allow-forwarded-traffic 1 `
--allow-gateway-transit 0 `
--allow-vnet-access 1 `
--use-remote-gateways 1
}

$peerings = @(az network vnet peering list `
--resource-group $env:FOUNDATIONALLM_HUB_RESOURCE_GROUP `
--vnet-name $env:FOUNDATIONALLM_HUB_VNET_NAME)

if ($peerings.Contains("$($env:FOUNDATIONALLM_HUB_VNET_NAME)-to-$($env:FOUNDATIONALLM_VNET_NAME)")) {
Write-Host "Peering for $($env:FOUNDATIONALLM_HUB_VNET_NAME)-to-$($env:FOUNDATIONALLM_VNET_NAME) exists..."
} else {
az network vnet peering create `
--name "$($env:FOUNDATIONALLM_HUB_VNET_NAME)-to-$($env:FOUNDATIONALLM_VNET_NAME)" `
--remote-vnet $env:FOUNDATIONALLM_VNET_ID `
--resource-group $env:FOUNDATIONALLM_HUB_RESOURCE_GROUP `
--vnet-name $env:FOUNDATIONALLM_HUB_VNET_NAME `
--allow-forwarded-traffic 1 `
--allow-gateway-transit 1 `
--allow-vnet-access 1 `
--use-remote-gateways 0
}
}


# Convert the manifest resource groups to a hashtable for easier access
$resourceGroup = @{
app = $env:FLLM_APP_RG
Expand Down
6 changes: 3 additions & 3 deletions deploy/standard/infra/app-rg.bicep
Original file line number Diff line number Diff line change
Expand Up @@ -58,9 +58,9 @@ var resourceSuffix = '${project}-${environmentName}-${location}-${workload}'

@description('Tags for all resources')
var tags = {
Environment: environmentName
IaC: 'Bicep'
Project: project
'azd-env-name': environmentName
'iac-type': 'bicep'
'project-name': project
Purpose: 'Services'
}

Expand Down
6 changes: 3 additions & 3 deletions deploy/standard/infra/auth-rg.bicep
Original file line number Diff line number Diff line change
Expand Up @@ -71,9 +71,9 @@ var authSecrets = [

@description('Tags for all resources')
var tags = {
Environment: environmentName
IaC: 'Bicep'
Project: project
'azd-env-name': environmentName
'iac-type': 'bicep'
'project-name': project
Purpose: 'Services'
}

Expand Down
6 changes: 5 additions & 1 deletion deploy/standard/infra/main.bicep
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ var existingOpenAiInstance = {
var tags = {
'compute-type': 'aks'
'create-date': createDate
'env-name': environmentName
'azd-env-name': environmentName
'iac-type': 'bicep'
'project-name': project
}
Expand Down Expand Up @@ -245,6 +245,10 @@ output FLLM_MGMT_PORTAL_HOSTNAME string = managementPortalHostname
output FLLM_CORE_API_HOSTNAME string = coreApiHostname
output FLLM_MGMT_API_HOSTNAME string = managementApiHostname

output FOUNDATIONALLM_VNET_NAME string = networking.outputs.vnetName
output FOUNDATIONALLM_VNET_ID string = networking.outputs.vnetId
output FOUNDATIONALLM_HUB_VNET_NAME string = networking.outputs.hubVnetId

output SERVICE_GATEKEEPER_API_ENDPOINT_URL string = 'http://gatekeeper-api/gatekeeper/'
output SERVICE_GATEKEEPER_INTEGRATION_API_ENDPOINT_URL string = 'http://gatekeeper-integration-api/gatekeeperintegration'
output SERVICE_GATEWAY_ADAPTER_API_ENDPOINT_URL string = 'http://gateway-adapter-api/gatewayadapter'
Expand Down
34 changes: 4 additions & 30 deletions deploy/standard/infra/networking-rg.bicep
Original file line number Diff line number Diff line change
Expand Up @@ -530,9 +530,9 @@ var subnets = [
]

var tags = {
Environment: environmentName
IaC: 'Bicep'
Project: project
'azd-env-name': environmentName
'iac-type': 'bicep'
'project-name': project
Purpose: 'Networking'
}

Expand Down Expand Up @@ -606,30 +606,4 @@ resource hub 'Microsoft.Network/virtualNetworks@2024-01-01' existing = {
scope: resourceGroup(hubSubscriptionId, hubResourceGroup)
}

module srcToDest './modules/vnet-peering.bicep' = {
dependsOn: [ hub ]
name: 'srcToDest-${timestamp}'
scope: resourceGroup()
params: {
vnetName: main.name
destVnetId: hub.id
allowVirtualNetworkAccess: true
allowForwardedTraffic: true
allowGatewayTransit: false
useRemoteGateways: true
}
}

module destToSrc './modules/vnet-peering.bicep' = {
dependsOn: [ hub ]
name: 'destToSrc-${timestamp}'
scope: resourceGroup(hubSubscriptionId, hubResourceGroup)
params: {
vnetName: hub.name
destVnetId: main.id
allowVirtualNetworkAccess: true
allowForwardedTraffic: true
allowGatewayTransit: true
useRemoteGateways: false
}
}
output hubVnetId string = hub.id
6 changes: 3 additions & 3 deletions deploy/standard/infra/openai-rg.bicep
Original file line number Diff line number Diff line change
Expand Up @@ -35,9 +35,9 @@ var openAiInstance = {
var deploymentConfigurations = loadJsonContent('../../common/config/openAiDeploymentConfig.json')

var tags = {
Environment: environmentName
IaC: 'Bicep'
Project: project
'azd-env-name': environmentName
'iac-type': 'bicep'
'project-name': project
Purpose: 'OpenAI'
}

Expand Down
6 changes: 3 additions & 3 deletions deploy/standard/infra/ops-rg.bicep
Original file line number Diff line number Diff line change
Expand Up @@ -42,9 +42,9 @@ var resourceSuffix = '${project}-${environmentName}-${location}-${workload}'

@description('Tags for all resources')
var tags = {
Environment: environmentName
IaC: 'Bicep'
Project: project
'azd-env-name': environmentName
'iac-type': 'bicep'
'project-name': project
Purpose: 'DevOps'
}

Expand Down
6 changes: 3 additions & 3 deletions deploy/standard/infra/storage-rg.bicep
Original file line number Diff line number Diff line change
Expand Up @@ -29,9 +29,9 @@ var resourceSuffix = '${project}-${environmentName}-${location}-${workload}'

@description('Tags for all resources')
var tags = {
Environment: environmentName
IaC: 'Bicep'
Project: project
'azd-env-name': environmentName
'iac-type': 'bicep'
'project-name': project
Purpose: 'Storage'
}

Expand Down
6 changes: 3 additions & 3 deletions deploy/standard/infra/vec-rg.bicep
Original file line number Diff line number Diff line change
Expand Up @@ -29,9 +29,9 @@ var resourceSuffix = '${project}-${environmentName}-${location}-${workload}'

@description('Tags for all resources')
var tags = {
Environment: environmentName
IaC: 'Bicep'
Project: project
'azd-env-name': environmentName
'iac-type': 'bicep'
'project-name': project
Purpose: 'Vectorization'
}

Expand Down

0 comments on commit 368d074

Please sign in to comment.