mirror of
https://github.com/turnstonelabs/turnstone.git
synced 2026-08-17 01:11:33 -06:00
2b58c127b1
* Add pluggable storage backend (SQLite + PostgreSQL) and deployment packaging Database abstraction: StorageBackend protocol with 21 methods, SQLAlchemy Core schema, SQLite backend (FTS5), PostgreSQL backend (tsvector/ILIKE), Alembic migrations, singleton registry. memory.py reduced to thin facade. Session.py open_db() calls replaced with generic KV methods. [database] config section with env var support. Deployment: Docker Compose production profile with PostgreSQL, Dockerfile with postgres extras and migration entrypoint, Helm chart with bitnami subcharts, Terraform AWS ECS/Fargate module with RDS + ElastiCache + ALB. 39 new storage tests (934 total). mypy strict clean. Docs and diagrams updated. * Address PR #20 review feedback (16 items) - Backends only call create_all() when Alembic migrations are disabled - Helm configmap uses correct TURNSTONE_DB_BACKEND env var; DB URL constructed via env expansion with secret reference instead of ConfigMap - Migration errors fail fast for PostgreSQL (only non-fatal for SQLite) - save_memory/delete_memory wrapped in exception handling like other facade fns - pool_size passed through from config/env to init_storage() in cli + server - Terraform: DB URL moved to Secrets Manager, auth enabled flag set, optional TLS listeners with certificate_arn, Redis transit encryption on - Docker entrypoint no longer suppresses migration output - Diagram fixes: removed StaticPool claim, removed non-existent migration ref - compose.yaml/README: clarified production profile requires DB env vars
63 lines
1.4 KiB
Terraform
63 lines
1.4 KiB
Terraform
variable "aws_region" {
|
|
description = "AWS region to deploy into."
|
|
type = string
|
|
default = "us-east-1"
|
|
}
|
|
|
|
variable "vpc_id" {
|
|
description = "ID of the VPC where all resources will be created."
|
|
type = string
|
|
}
|
|
|
|
variable "private_subnet_ids" {
|
|
description = "List of private subnet IDs for ECS tasks, RDS, and ElastiCache."
|
|
type = list(string)
|
|
}
|
|
|
|
variable "public_subnet_ids" {
|
|
description = "List of public subnet IDs for the Application Load Balancer."
|
|
type = list(string)
|
|
}
|
|
|
|
variable "image_repository" {
|
|
description = "Container image repository."
|
|
type = string
|
|
default = "ghcr.io/turnstonelabs/turnstone"
|
|
}
|
|
|
|
variable "image_tag" {
|
|
description = "Container image tag."
|
|
type = string
|
|
default = "latest"
|
|
}
|
|
|
|
variable "llm_base_url" {
|
|
description = "Base URL for the LLM provider API."
|
|
type = string
|
|
}
|
|
|
|
variable "openai_api_key" {
|
|
description = "API key for the LLM provider."
|
|
type = string
|
|
sensitive = true
|
|
}
|
|
|
|
variable "environment" {
|
|
description = "Deployment environment name."
|
|
type = string
|
|
default = "production"
|
|
}
|
|
|
|
variable "name_prefix" {
|
|
description = "Prefix for all resource names."
|
|
type = string
|
|
default = "turnstone"
|
|
}
|
|
|
|
variable "auth_token" {
|
|
description = "Optional authentication token for the Turnstone API."
|
|
type = string
|
|
sensitive = true
|
|
default = ""
|
|
}
|