first commit

This commit is contained in:
Beyhan Oğur
2026-04-26 21:52:23 +03:00
commit 880f412e2c
2662 changed files with 866266 additions and 0 deletions

View File

@@ -0,0 +1,36 @@
# Bifrost on Azure AKS
Deploys Bifrost as a Kubernetes workload on Azure Kubernetes Service.
## Prerequisites
- Azure subscription
- Azure CLI authenticated (`az login`)
- Terraform >= 1.0
## Usage
```bash
# Copy and edit the example variables file
cp terraform.tfvars.example terraform.tfvars
# Deploy
terraform init
terraform plan
terraform apply
```
## Configuration
Two approaches can be combined:
1. **File-based** -- Set `config_json_file` to point to an existing `config.json`.
2. **Variable-based** -- Set individual variables (`config_store`, `logs_store`, `providers_config`). These override matching keys from the file.
See `terraform.tfvars.example` for examples of both.
## Cleanup
```bash
terraform destroy
```

View File

@@ -0,0 +1,50 @@
terraform {
required_version = ">= 1.0"
required_providers {
azurerm = {
source = "hashicorp/azurerm"
version = "~> 3.0"
}
kubernetes = {
source = "hashicorp/kubernetes"
version = "~> 2.0"
}
}
}
provider "azurerm" {
features {}
}
module "bifrost" {
source = "../../modules/bifrost"
cloud_provider = "azure"
service = "aks"
region = var.region
image_tag = var.image_tag
name_prefix = var.name_prefix
# Config: use a file as base, override with variables
config_json_file = var.config_json_file
# Override specific config sections
config_store = var.config_store
logs_store = var.logs_store
providers_config = var.providers_config
# Compute
desired_count = var.desired_count
cpu = var.cpu
memory = var.memory
create_cluster = var.create_cluster
node_count = var.node_count
create_load_balancer = var.create_load_balancer
# Autoscaling
enable_autoscaling = var.enable_autoscaling
min_capacity = var.min_capacity
max_capacity = var.max_capacity
# Azure-specific
azure_resource_group_name = var.resource_group_name
}

View File

@@ -0,0 +1,9 @@
output "service_url" {
description = "URL to access the Bifrost service."
value = module.bifrost.service_url
}
output "health_check_url" {
description = "URL to the Bifrost health check endpoint."
value = module.bifrost.health_check_url
}

View File

@@ -0,0 +1,66 @@
# =============================================================================
# Azure AKS Example — terraform.tfvars
# WARNING: Do NOT commit this file with real secrets (API keys, passwords).
# Use environment variables, a secrets manager, or .gitignore this file.
# =============================================================================
region = "eastus"
image_tag = "latest"
name_prefix = "bifrost"
resource_group_name = "bifrost-rg"
# -----------------------------------------------------------------------------
# Config approach 1: File-based
# Point to an existing config.json. Variable overrides below will merge on top.
# -----------------------------------------------------------------------------
# config_json_file = "./config.json"
# -----------------------------------------------------------------------------
# Config approach 2: Variable-based
# Define config sections directly. These override matching keys from the file.
# -----------------------------------------------------------------------------
config_store = {
enabled = true
type = "sqlite"
config = {
path = "/app/data/bifrost.db"
}
}
logs_store = {
enabled = true
type = "sqlite"
config = {
path = "/app/data/bifrost-logs.db"
}
}
providers_config = {
openai = {
api_key = "sk-..."
}
azure = {
api_key = "..."
resource_id = "my-azure-openai-resource"
}
}
# -----------------------------------------------------------------------------
# Compute
# -----------------------------------------------------------------------------
desired_count = 2
cpu = 500
memory = 1024
create_cluster = true
node_count = 3
create_load_balancer = true
# -----------------------------------------------------------------------------
# Autoscaling
# -----------------------------------------------------------------------------
# NOTE: If you are using OSS version - running multiple nodes has an effect on
# functionality of the system. Please read
# https://docs.getbifrost.ai/deployment-guides/how-to/multinode
enable_autoscaling = false
# min_capacity = 1
# max_capacity = 5

View File

@@ -0,0 +1,111 @@
variable "region" {
description = "Azure region to deploy into."
type = string
default = "eastus"
}
variable "image_tag" {
description = "Bifrost Docker image tag."
type = string
default = "latest"
}
variable "name_prefix" {
description = "Prefix for all resource names."
type = string
default = "bifrost"
}
variable "resource_group_name" {
description = "Azure resource group name. If null, a new one will be created."
type = string
default = null
}
# --- Config: file-based ---
variable "config_json_file" {
description = "Path to a Bifrost config.json file. Variables below override matching keys."
type = string
default = null
}
# --- Config: variable-based overrides ---
variable "config_store" {
description = "Config store configuration (type: sqlite/postgres)."
type = any
default = null
}
variable "logs_store" {
description = "Logs store configuration (type: sqlite/postgres)."
type = any
default = null
}
variable "providers_config" {
description = "LLM provider configurations (openai, anthropic, azure, etc.)."
type = any
default = null
}
# --- Compute ---
variable "desired_count" {
description = "Number of Kubernetes pods."
type = number
default = 1
}
variable "cpu" {
description = "CPU in millicores for each pod."
type = number
default = 500
}
variable "memory" {
description = "Memory in MB for each pod."
type = number
default = 1024
}
# --- Cluster ---
variable "create_cluster" {
description = "Create a new AKS cluster. Set to false to use an existing cluster."
type = bool
default = true
}
variable "node_count" {
description = "Number of nodes in the AKS node pool."
type = number
default = 3
}
variable "create_load_balancer" {
description = "Create a load balancer via Kubernetes Ingress."
type = bool
default = true
}
# --- Autoscaling ---
variable "enable_autoscaling" {
description = "Enable Horizontal Pod Autoscaler."
type = bool
default = false
}
variable "min_capacity" {
description = "Minimum number of pods when autoscaling is enabled."
type = number
default = 1
}
variable "max_capacity" {
description = "Maximum number of pods when autoscaling is enabled."
type = number
default = 10
}