Skip to content

Commit

Permalink
added aihub
Browse files Browse the repository at this point in the history
  • Loading branch information
cmendible committed Jan 18, 2024
1 parent 97cd35b commit 5b345d7
Show file tree
Hide file tree
Showing 35 changed files with 1,321 additions and 352 deletions.
71 changes: 71 additions & 0 deletions .github/workflows/main.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,71 @@
# Docs for the Azure Web Apps Deploy action: https://github.com/Azure/webapps-deploy
# More GitHub Actions for Azure: https://github.com/Azure/actions

name: build

on:
push:
branches:
- main
- aihub
tags:
- v*
pull_request:
branches:
- main
workflow_dispatch:

env:
REGISTRY: ghcr.io
IMAGE_NAME: aihub-prepdocs

jobs:
build:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v4

- name: Set up .NET Core
uses: actions/setup-dotnet@v1
with:
dotnet-version: '8.x'
include-prerelease: true

- name: Setup MinVer
run: |
dotnet tool install --global minver-cli --version 4.3.0
- name: Calculate Version
run: |
echo "MINVERVERSIONOVERRIDE=$($HOME/.dotnet/tools/minver -t v. -m 1.0 -d preview)" >> $GITHUB_ENV
- name: Login to the Container registry
uses: docker/login-action@v3
with:
registry: ${{ env.REGISTRY }}
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}

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

- name: Extract metadata (tags, labels) for Docker
id: meta
uses: docker/metadata-action@v3
with:
images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}

- name: Lower case REPO
run: |
echo "GITHUB_REPOSITORY_LOWER_CASE=${GITHUB_REPOSITORY,,}" >> ${GITHUB_ENV}
- name: Build and push Docker image
uses: docker/build-push-action@v3
with:
context: ./scripts/
file: ./scripts/Dockerfile
push: ${{ github.event_name != 'pull_request' }}
tags: ${{ env.REGISTRY }}/${{ env.GITHUB_REPOSITORY_LOWER_CASE }}/${{ env.IMAGE_NAME }}:${{ env.MINVERVERSIONOVERRIDE }}
labels: ${{ steps.meta.outputs.labels }}

134 changes: 67 additions & 67 deletions infra/.terraform.lock.hcl

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

84 changes: 47 additions & 37 deletions infra/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -111,6 +111,18 @@ module "openai" {
principal_id = module.mi.principal_id
}

module "cog" {
source = "./modules/cog"
location = azurerm_resource_group.rg.location
resource_group_name = azurerm_resource_group.rg.name
resource_group_id = azurerm_resource_group.rg.id
principal_id = module.mi.principal_id
bing_name = var.bing_name
cognitive_services_name = var.cognitive_services_name
content_safety_name = var.content_safety_name
speech_name = var.speech_name
}

module "cae" {
source = "./modules/cae"
location = azurerm_resource_group.rg.location
Expand All @@ -122,11 +134,11 @@ module "cae" {
appi_key = module.appi.appi_key
}

module "ca_back" {
source = "./modules/ca-back"
module "ca_chat" {
source = "./modules/ca-chat"
location = azurerm_resource_group.rg.location
resource_group_id = azurerm_resource_group.rg.id
ca_name = var.ca_back_name
ca_name = var.ca_chat_name
cae_id = module.cae.cae_id
managed_identity_id = module.mi.mi_id
chat_gpt_deployment = module.openai.gpt_deployment_name
Expand All @@ -137,42 +149,40 @@ module "ca_back" {
storage_container_name = module.st.storage_container_name
search_service_name = module.search.search_service_name
search_index_name = module.search.search_index_name
openai_service_name = var.enable_apim ? module.apim.gateway_url : module.openai.openai_endpoint
openai_endpoint = var.enable_apim ? module.apim.gateway_url : module.openai.openai_endpoint
tenant_id = data.azurerm_subscription.current.tenant_id
managed_identity_client_id = module.mi.client_id
enable_entra_id_authentication = var.enable_entra_id_authentication
}

# module "ca_webapi" {
# source = "./modules/ca-webapi"
# location = azurerm_resource_group.rg.location
# resource_group_id = azurerm_resource_group.rg.id
# ca_name = var.ca_webapi_name
# cae_id = module.cae.cae_id
# cae_default_domain = module.cae.defaultDomain
# ca_webapp_name = var.ca_webapp_name
# managed_identity_id = module.mi.mi_id
# chat_gpt_deployment = module.openai.gpt_deployment_name
# chat_gpt_model = module.openai.gpt_deployment_name
# embeddings_deployment = module.openai.embedding_deployment_name
# embeddings_model = module.openai.embedding_deployment_name
# storage_account_name = module.st.storage_account_name
# storage_container_name = module.st.storage_container_name
# search_service_name = module.search.search_service_name
# search_index_name = module.search.search_index_name
# openai_service_name = module.openai.openai_service_name
# tenant_id = data.azurerm_subscription.current.tenant_id
# managed_identity_client_id = module.mi.client_id
# }

# module "ca_webapp" {
# source = "./modules/ca-webapp"
# location = azurerm_resource_group.rg.location
# resource_group_id = azurerm_resource_group.rg.id
# ca_name = var.ca_webapp_name
# cae_id = module.cae.cae_id
# managed_identity_id = module.mi.mi_id
# tenant_id = data.azurerm_subscription.current.tenant_id
# managed_identity_client_id = module.mi.client_id
# backend_url = module.ca_webapi.fqdn
# }
module "ca_aihub" {
source = "./modules/ca-aihub"
location = azurerm_resource_group.rg.location
resource_group_id = azurerm_resource_group.rg.id
ca_name = var.ca_aihub_name
cae_id = module.cae.cae_id
managed_identity_id = module.mi.mi_id
chat_gpt_deployment = module.openai.gpt_deployment_name
chat_gpt_model = module.openai.gpt_deployment_name
embeddings_deployment = module.openai.embedding_deployment_name
embeddings_model = module.openai.embedding_deployment_name
storage_account_name = module.st.storage_account_name
storage_container_name = module.st.storage_container_name
search_service_name = module.search.search_service_name
search_index_name = module.search.search_index_name
openai_endpoint = var.enable_apim ? module.apim.gateway_url : module.openai.openai_endpoint
chat_fqdn = module.ca_chat.fqdn
pbi_report_link = var.pbi_report_link
content_safety_endpoint = module.cog.content_safety_endpoint
content_safety_key = module.cog.content_safety_key
cognitive_service_endpoint = module.cog.cognitive_service_endpoint
cognitive_service_key = module.cog.cognitive_service_key
speech_key = module.cog.speech_key

storage_connection_string = module.st.connection_string
bing_key = var.bing_key

tenant_id = data.azurerm_subscription.current.tenant_id
managed_identity_client_id = module.mi.client_id
enable_entra_id_authentication = var.enable_entra_id_authentication
}
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ resource "null_resource" "update_redirect_uris" {
azapi_resource.current
]
triggers = {
input_json = md5(local.update_redirect_uris_command)
update_redirect_uris_command = local.update_redirect_uris_command
client_id = module.sp[0].client_id,
redirect_uris_count = module.sp[0].redirect_uris_count,
}
}
Loading

0 comments on commit 5b345d7

Please sign in to comment.