- Built with:
- .NET 8 (LTS, not RC version, Visual Studio 17.8.0 or later required)
- Blazor server
- Contains:
- Contains all application logic, services and jobs concerning:
- Indexing
- Managing tenants
- Scraping
- Holding conversations
- Consumption cost
- Multitenancy
- Contains all application logic, services and jobs concerning:
- Built with
- Node 18.18.0
- Express
- Puppeteer
- Contains:
- Simple web application that spawns a headless chrome instance that scrapes a page
- Built with
- Node 18.18.0
- Preact
- Vite
- Contains:
- A (for now) unstyled chat component developed in Preact that gets built into a WebComponent.
- Take a look at
webcomponent.html
for consumer usage
- Take a look at
- The goal is for this component is to be used for consumers and client demo purposes.
- A (for now) unstyled chat component developed in Preact that gets built into a WebComponent.
The following command will boot up:
- A SQL Server database docker container
- Unstructured docker container (tool which chunks html content)
- Weaviate vector database with text2vec transformers and multi2vec-clip modules
- Scraper docker container using puppeteer
docker-compose up -d csp-db-amd64 unstructured weaviate t2v-transformers multi2vec-clip scraper azurite
docker-compose up -d csp-db-arm unstructured weaviate t2v-transformers multi2vec-clip scraper-arm azurite
- Use the
dotnet ef update
statements below for both DbContexts to update your database to the latest migrations. - This will install several users, roles and tenants which can be found in
UserAndRolesDatabaseSeeder
anTenantSeeder
- Use your favorite IDE Visual Studio / Rider / VS Code or even the CLI (dotnet run) to start
the
ConversationalSearchPlatform.Backoffice
application with the development profile. - At first startup some Hangfire schema migrations might occur.
dotnet ef migrations add --project backoffice/ConversationalSearchPlatform.BackOffice/ConversationalSearchPlatform.BackOffice.csproj --startup-project backoffice/ConversationalSearchPlatform.BackOffice/ConversationalSearchPlatform.BackOffice.csproj --context ConversationalSearchPlatform.BackOffice.Data.ApplicationDbContext --configuration Debug MIGRATION_NAME --output-dir Data/Migrations
dotnet ef database update --project backoffice/ConversationalSearchPlatform.BackOffice/ConversationalSearchPlatform.BackOffice.csproj --startup-project backoffice/ConversationalSearchPlatform.BackOffice/ConversationalSearchPlatform.BackOffice.csproj --context ConversationalSearchPlatform.BackOffice.Data.ApplicationDbContext --configuration Debug GENERATED_MIGRATION_NAME
dotnet ef migrations add --project backoffice/ConversationalSearchPlatform.BackOffice/ConversationalSearchPlatform.BackOffice.csproj --startup-project backoffice/ConversationalSearchPlatform.BackOffice/ConversationalSearchPlatform.BackOffice.csproj --context ConversationalSearchPlatform.BackOffice.Data.TenantDbContext --configuration Debug MIGRATION_NAME --output-dir Data/Migrations/Tenant
dotnet ef database update --project backoffice/ConversationalSearchPlatform.BackOffice/ConversationalSearchPlatform.BackOffice.csproj --startup-project backoffice/ConversationalSearchPlatform.BackOffice/ConversationalSearchPlatform.BackOffice.csproj --context ConversationalSearchPlatform.BackOffice.Data.TenantDbContext --configuration Debug GENERATED_MIGRATION_NAME
- In the
ConversationalSearchPlatform.Scraper folder execute:
npm install
npm run start
- In the
ConversationalSearchPlatform.Widget folder execute:
yarn install
yarn dev
- There are two workflows:
application.yml
: deployment for the application, should be triggered on pushes onmain
+ changes in thebackoffice/**
folderscraper.yml
: deployment for the application, should be triggered on pushes onmain
+ changes in thescraper/**
folder
- Some remarks for if this project ever gets moved to another resource group:
- Make sure that
AZURE_CLIENT_ID
,AZURE_TENANT_ID
,AZURE_SUBSCRIPTION_ID
exist in Github secrets (and are valid). - Make sure there is a new service principal which can be used to pull and push images (AcrPull, AcrPush roles) to the container registry which is bound the AKS cluster.
- Make sure that
- Deployment is done to Kubernetes.
You will only have to execute these steps once to save the kubeconfig credentials locally.
- Azure CLI
- Find your tenantId in Azure Portal (Top right hand corner -> Switch directory -> Directory ID)
az login --tenant {AzureTenantId}
- From this command you will get a list of subscriptions, choose the right subscription id and execute:
az account set --subscription {SubscriptionId}
- Go to Azure Portal and copy the resource group name and AKS deployment name. Execute the following command:
az aks get-credentials --overwrite-existing --resource-group {ResourceGroupName} --name {AKSDeploymentName}
- You have now added the credentials to your local kubeconfig. Subsequently you can now use (Open)Lens to view progress in the cluster.
- In the
iac
folder, manifests can be found per application which can be applied with `kubectl apply -f ./foldername' - The following resources reside in the iac folder:
- Contains the nginx loadbalancer controller and cert manager CRDs. These should be deployed first as the other applications might need an ingress or a certificate.
- Contains a SecretProvider that allows secrets from Azure Key Vault to be mounted in pods.
- Has a pod declaration which defines which Docker image is used, which resources are allowed and also uses the SecretProvider mentioned above.
- Has a service declaration which defines on how to expose the pod internally.
- Has an ingress which refers to a ClusterIssuer (needed for a certificate) and configures which domain should be used.
- Contains a ClusterIssuer which defines the way how the certificate should be generated and validated using DNS.
- The weaviate folder does not use plain old Kubernetes objects, but uses helm instead. Read the README.md in
the
2-weaviate
folder to understand how to (re)deploy weaviate.
- Only contains a pod declaration and a service declaration as the scraper will not be exposed to the outside world.
- Only contains a pod declaration and a service declaration as the chunker will not be exposed to the outside world.
- Some remarks for when we should ever move this POC to another resource group in context of it being not a POC anymore:
- The application, which can be found in the
1-app
folder has:- a
SecretProvider
class. This Secret provider class needsWorkload identity
creation before being able to pull secrets from an Azure KeyVault.- Use the following guide to create
this
Workload identity
https://learn.microsoft.com/en-us/azure/aks/csi-secrets-store-driver. - Also make sure that the Kubernetes cluster has OIDC Issuer enabled https://learn.microsoft.com/en-us/azure/aks/use-oidc-issuer#update-an-aks-cluster-with-oidc-issuer
- Use the following guide to create
this
- If the pod cannot mount the secrets volume:
- make sure to check all the steps concerning the secret provider.
- make sure all the secrets mentioned in the SecretProvider are in the keyvault.
- a
- Run the Github Action Workflows first, they will create the correct images in the container registry before trying to deploy to AKS.
- The application, which can be found in the