Coder Social home page Coder Social logo

azure-ai-demo's Introduction

AI Application Demo Using Terrafrom and AKS

This sample demo app consists of a group of containerized microservices that can be easily deployed into an Azure Kubernetes Service (AKS) cluster. This is meant to show a realistic scenario using a polyglot architecture, event-driven design, and common open source back-end services (eg - RabbitMQ, MongoDB). The application also leverages OpenAI's GPT-3 models to generate product descriptions. This can be done using either Azure OpenAI or OpenAI.

This application is inspired by another demo app called Red Dog.

Note: This is not meant to be an example of perfect code to be used in production, but more about showing a realistic application running in AKS.

Architecture

The application has the following services:

Service Description
makeline-service This service handles processing orders from the queue and completing them (Golang)
order-service This service is used for placing orders (Javascript)
product-service This service is used to perform CRUD operations on products (Rust)
store-front Web app for customers to place orders (Vue.js)
store-admin Web app used by store employees to view orders in queue and manage products (Vue.js)
virtual-customer Simulates order creation on a scheduled basis (Rust)
virtual-worker Simulates order completion on a scheduled basis (Rust)
ai-service Optional service for adding generative text and graphics creation (Python)
mongodb MongoDB instance for persisted data
rabbitmq RabbitMQ for an order queue

Prerequisites

For this demo, you can either use Azure OpenAI service or OpenAI service. If you plan on using Azure OpenAI service, you need to request access to enable it on your Azure subscription using the Request Access to Azure OpenAI Service form.

If you plan on using OpenAI, sign up on the OpenAI website.

To Deploy

  1. Open a cloud Shell from the Azure portal
  2. Clone this repo by running this command:
git clone https://github.com/dawright22/azure-ai-demo.git
  1. Change into the directory this created
  2. Now copy and Run this command:
Terraform init
  1. Now copy and Run this command:
Terraform apply

Once the deployment is complete you will see the outputs of the deployment. Then rename [pki_build.tf.second] to [pki_build.tf] and run terraform apply again. This will deploy the PKI components.

Finally, you will need to run the following command to deploy the application: Rename [app_build.tf.third] to [app_build.tf] and run terraform apply again. This will deploy the application components.

That's all Fokes! [to quote bugs bunny]

If you want to customise location or other componets then you can start playing with the Variables file to suit you.

Terraform Outputs give you all the names of resocurces created so you can use them to connect to the resources.

Requirements

Name Version
helm ~> 2.0.2
local ~>2.4.0
random =3.5.1

Providers

Name Version
azurerm n/a
helm ~> 2.0.2
kubernetes n/a
random =3.5.1

Modules

No modules.

Resources

Name Type
azurerm_cognitive_account.tf-ai-demo resource
azurerm_cognitive_deployment.tf-ai-demo resource
azurerm_cosmosdb_account.tf-ai-demo resource
azurerm_cosmosdb_mongo_collection.tf-ai-demo resource
azurerm_cosmosdb_mongo_database.tf-ai-demo resource
azurerm_federated_identity_credential.tf-ai-demo resource
azurerm_kubernetes_cluster.tf-ai-demo resource
azurerm_resource_group.tf-ai-demo resource
azurerm_role_assignment.tf-ai-demo_aoai_me resource
azurerm_role_assignment.tf-ai-demo_aoai_mi resource
azurerm_servicebus_namespace.tf-ai-demo resource
azurerm_servicebus_namespace_authorization_rule.tf-ai-demo resource
azurerm_servicebus_queue.tf-ai-demo resource
azurerm_servicebus_queue_authorization_rule.tf-ai-demo resource
azurerm_user_assigned_identity.tf-ai-demo resource
helm_release.CertManger resource
helm_release.traefik resource
helm_release.vault resource
kubernetes_namespace.CertManager resource
random_integer.tf-ai-demo resource
random_pet.tf-ai-demo resource
azurerm_client_config.current data source
azurerm_subscription.current data source

Inputs

Name Description Type Default Required
ai_location value of azure region for deploying azure ai service string "Australia East" no
k8s_namespace value of kubernetes namespace string "default" no
location n/a string "Australia East" no
openai_model_capacity value of azure openai model capacity number 120 no
openai_model_name value of azure openai model name string "gpt-35-turbo" no
openai_model_version value of azure openai model version string "0613" no

Outputs

Name Description
ai_endpoint n/a
ai_key n/a
ai_managed_identity_client_id n/a
ai_model_name n/a
ai_openai_deployment_name n/a
aks_name n/a
db_account_name n/a
db_key n/a
db_uri n/a
k8s_namespace n/a
rg_name n/a
sb_listener_key n/a
sb_listener_username n/a
sb_namespace_host n/a
sb_namespace_uri n/a
sb_sender_key n/a
sb_sender_username n/a

Additional Resources

azure-ai-demo's People

Contributors

dawright22 avatar

Stargazers

 avatar Iurie Diaconu avatar  avatar

Watchers

 avatar

Forkers

devopsmayur

azure-ai-demo's Issues

Is it possible to run this demo locally instead of Azure terminal?

Hi David, I have just finished watching your talk at

https://medius.microsoft.com/video/asset/HIGHMP4/1cf9fcd6-0ead-480e-9e97-b5aedb672a9d?referrer=Microsoft+Build+%7C+May+21-23%2C+2024+%7C+Seattle+and+Online-%2Fen-US%2Fsessions%2Ff14e7fcd-b34c-45d0-8cb8-2b361878157c&mhid=build&uid=b5537a2a-e50e-4232-b8c4-304b4af6638a&loc=en-us

and went through your blog article about the same title, very interesting and informative. Here, in the instructions, you indicate "Open a cloud Shell from the Azure portal", is it possible to work locally on my laptops as I have TF and an Azure Account. I always run TF app with AZ cli locally.
If yes, whar are the prerequisites?
Thanks in advance

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.