Skip to content

A demo Dapr & Azure Cognitive Services application to transcribe Podcasts

License

Notifications You must be signed in to change notification settings

briandenicola/traduire

 
 

Repository files navigation

Overview

This is an application to demonstrates various Azure services. It will transcribe an audio podcast (up to 50mb in size) to text using Azure Cognitive Services. It uses the Saga pattern and to manage the transcription process. It uses Dapr as the distributive runtime to manage communication between the various service components. Dapr Virtual Actors are also leveraged.

The application exposes both a REST API consumed by a React-based UI and a gRPC API consumed by a commandline application

Components

Component Usage
Azure Kubernetes Service Container Orchestration Runtime Platform
Azure Blob Storage Podcast Storage
Azure Cognitive Services Service that does actual transcription
Azure Service Bus Pubsub
Azure Web PubSub Real-time UI upates
Azure Static Web Apps Hosting platform for React UI
Azure PosgreSQL Backing store
Azure Key Vault Secret store
Kong API Gateway
Keda Autoscaler for saga components

Architecture

Dapr

Deployment

Open in GitHub Codespaces Open in Dev Containers

Prerequisites

  • A Linux machine or Windows Subsytem for Linux or Docker for Windows
  • PowerShell 7 in Linux/WSL
  • Azure Cli and an Azure Subscription
  • Terraform
  • Kubectl
  • Helm 3
  • Docker
  • Azure subscription with Owner access permissions
  • AKS Preview Features
    • Script requires /usr/bin/watch which is not part of the default bash shell on macos.
    • Run brew install watch on macos

Infrastructure

    cd ./scripts
    pwsh ./create_infrastructure.ps1 -Subscription BJD_AZ_SUB01 -Region southcentralus 

Application Deployment

    cd ./scripts
    pwsh ./deploy_services.ps1 -AppName $AppName -Subscription BJD_AZ_SUB01 -DomainName bjd.tech -verbose

NOTE: Update the DNS record of Uri to the IP Address returned by the script in the form of ${APP_NAME}.api.traduire.bjd.tech

Script Flags

  • -Upgrade flag: Reuse existing Helm chart values and upgrade the deployment to the latest build
  • -SkipBuild flag: Skip the build process and re-deploy the existing build
  • -BuildOnly flag: Just build. Do not deploy

UI Deployment

    cd ./scripts
    pwsh ./deploy_ui.ps1 -AppName $AppName -Subscription BJD_AZ_SUB01 -DomainName bjd.tech -Verbose

NOTE: Create a CNAME record in the DNS to point to the Azure Static Web App in the form of ${APP_NAME}.traduire.bjd.tech

Validate

Automated with Playwright

    cd ./scripts
    ./run-tests.sh traduire.bjd.tech #Or whatever your default Url from Azure Static Web Apps

NOTE: Playwright will test the UI functionality and display the trace on completion.

Playwright

Interactively

  • Launch Browser
  • Navigate to the URI outputed by the deploy_ui.ps1
  • Select and upload any podcast.
  • The UI will update the status every 30 seconds until the transcription is complete. UI UI
  • The transcriptions takes between 5 and 10 minutes to complete.
  • Once the status has been updated to Completed then click the Get Transcription button
  • Then the final result should be: UI

Backlog

  • Add null_resource to bin Keda's identity to cluster
  • Test Cluster creation with new Terraform and Flux extension
  • Update Helm Chart - Service Accounts/Deployments
  • Test applciation deployment
  • Validate application functionality
  • Update to Workload Identity
  • Update React UI to Next.js
  • Update to dotnet8
  • Deployment Updates
  • Swap Cognitive Services with OpenAI

Languages

  • C# 46.2%
  • HCL 30.6%
  • PowerShell 11.3%
  • TypeScript 6.8%
  • CSS 3.7%
  • Shell 1.1%
  • Other 0.3%