Skip to content

BrainAPI is a knowledge graph–powered AI memory layer that transforms unstructured data into structured knowledge, enabling intelligent search, recommendations, and contextual memory for AI agents and applications.

chore(infra): removed tf code

Christianc4172b664641
diff --git a/deploy/terraform/infra/backend.tf b/deploy/terraform/infra/backend.tf
deleted file mode 100644
index b453881..0000000
--- a/deploy/terraform/infra/backend.tf
+++ /dev/null
@@ -1,6 +0,0 @@
-terraform {
- cloud {
- organization = "lumen-labs"
- workspaces { name = "brainapi-multi-tenant" }
- }
-}
diff --git a/deploy/terraform/infra/main.tf b/deploy/terraform/infra/main.tf
deleted file mode 100644
index 4f0e32b..0000000
--- a/deploy/terraform/infra/main.tf
+++ /dev/null
@@ -1,55 +0,0 @@
-locals {
- workspace = terraform.workspace # if you choose one-workspace-per-user
- app_name = "brainapi"
- machine = var.plan == "pro" ? var.machine_type_pro : var.machine_type_small
- fqdn = "${var.subdomain_prefix}-${var.user_slug}.${var.domain}"
- name_prefix= "${local.app_name}-${var.user_slug}"
- image_ref = "${var.base_image}:${var.version}"
-}
-
-module "network" {
- source = "./modules/network"
- name_prefix = local.name_prefix
- region = var.region
- labels = var.labels
-}
-
-module "secrets" {
- source = "./modules/secrets"
- name_prefix = local.name_prefix
- ghcr_user = var.ghcr_username
- ghcr_token = var.ghcr_token
-}
-
-module "vm" {
- source = "./modules/vm_docker"
- name_prefix = local.name_prefix
- region = var.region
- subnet_selflink = module.network.subnet_selflink
- machine_type = local.machine
- fqdn = local.fqdn
- image_ref = local.image_ref
- ghcr_user = var.ghcr_username
- ghcr_token = var.ghcr_token
- labels = var.labels
- enable_sql = var.enable_sql
- # If SQL enabled, provide connection info via metadata/env
- db_conn_str = var.enable_sql ? module.sql.conn_str : null
-}
-
-module "dns" {
- source = "./modules/dns_cloudflare"
- zone_id = var.zone_id
- name = "${var.subdomain_prefix}-${var.user_slug}"
- domain = var.domain
- target_ip= module.vm.public_ip
- ttl = 120
-}
-
-module "sql" {
- count = var.enable_sql ? 1 : 0
- source = "./modules/sql"
- name_prefix = local.name_prefix
- region = var.region
- labels = var.labels
-}
diff --git a/deploy/terraform/infra/modules/dns_cloudflare/main.tf b/deploy/terraform/infra/modules/dns_cloudflare/main.tf
deleted file mode 100644
index f5be573..0000000
--- a/deploy/terraform/infra/modules/dns_cloudflare/main.tf
+++ /dev/null
@@ -1,16 +0,0 @@
-variable "zone_id" { type = string }
-variable "name" { type = string }
-variable "domain" { type = string }
-variable "target_ip"{ type = string }
-variable "ttl" { type = number default = 120 }
-
-resource "cloudflare_record" "a" {
- zone_id = var.zone_id
- name = "${var.name}.${var.domain}"
- type = "A"
- value = var.target_ip
- ttl = var.ttl
- proxied = true
-}
-
-output "fqdn" { value = cloudflare_record.a.hostname }
diff --git a/deploy/terraform/infra/modules/network/main.tf b/deploy/terraform/infra/modules/network/main.tf
deleted file mode 100644
index a260d9f..0000000
--- a/deploy/terraform/infra/modules/network/main.tf
+++ /dev/null
@@ -1,21 +0,0 @@
-resource "google_compute_network" "vpc" {
- name = "${var.name_prefix}-vpc"
- auto_create_subnetworks = false
-}
-
-resource "google_compute_subnetwork" "subnet" {
- name = "${var.name_prefix}-subnet"
- ip_cidr_range = "10.42.0.0/24"
- region = var.region
- network = google_compute_network.vpc.id
-}
-
-resource "google_compute_firewall" "allow_http" {
- name = "${var.name_prefix}-allow-http"
- network = google_compute_network.vpc.name
-
- allow { protocol = "tcp", ports = ["80", "443", "8080", "22"] }
- source_ranges = ["0.0.0.0/0"]
-}
-
-output "subnet_selflink" { value = google_compute_subnetwork.subnet.self_link }
diff --git a/deploy/terraform/infra/modules/vm_docker/main.tf b/deploy/terraform/infra/modules/vm_docker/main.tf
deleted file mode 100644
index 79a7de1..0000000
--- a/deploy/terraform/infra/modules/vm_docker/main.tf
+++ /dev/null
@@ -1,35 +0,0 @@
-resource "google_compute_instance" "vm" {
- name = "${var.name_prefix}-vm"
- machine_type = var.machine_type
- zone = "${var.region}-a"
-
- boot_disk {
- initialize_params {
- image = "ubuntu-os-cloud/ubuntu-2204-jammy-v20241001"
- size = 30
- type = "pd-balanced"
- }
- }
-
- network_interface {
- subnetwork = var.subnet_selflink
- access_config {} # ephemeral public IP
- }
-
- metadata = {
- user-data = templatefile("${path.module}/templates/cloud-init.yaml.tftpl", {
- fqdn = var.fqdn
- image_ref = var.image_ref
- ghcr_user = var.ghcr_user
- ghcr_token = var.ghcr_token
- enable_sql = var.enable_sql
- db_conn_str = var.db_conn_str
- })
- }
-
- labels = var.labels
-}
-
-output "public_ip" {
- value = google_compute_instance.vm.network_interface[0].access_config[0].nat_ip
-}
diff --git a/deploy/terraform/infra/modules/vm_docker/templates/cloud-init.yaml.tftpl b/deploy/terraform/infra/modules/vm_docker/templates/cloud-init.yaml.tftpl
deleted file mode 100644
index 4430c3b..0000000
--- a/deploy/terraform/infra/modules/vm_docker/templates/cloud-init.yaml.tftpl
+++ /dev/null
@@ -1,31 +0,0 @@
-#cloud-config
-package_update: true
-packages:
- - docker.io
- - docker-compose
-runcmd:
- # GHCR login
- - echo "${ghcr_token}" | docker login ghcr.io -u "${ghcr_user}" --password-stdin
- # pull & run
- - docker pull ${image_ref}
- - mkdir -p /opt/brainapi
- - |
- cat >/opt/brainapi/.env <<'EOF'
- PORT=8080
- FQDN=${fqdn}
- %{ if enable_sql ~}
- DATABASE_URL=${db_conn_str}
- %{ endif ~}
- EOF
- - |
- cat >/opt/brainapi/docker-compose.yml <<'EOF'
- services:
- app:
- image: ${image_ref}
- env_file: /opt/brainapi/.env
- ports: ["8080:8080"]
- restart: always
- EOF
- - systemctl enable docker
- - systemctl start docker
- - docker compose -f /opt/brainapi/docker-compose.yml up -d
diff --git a/deploy/terraform/infra/modules/vm_docker/variables.tf b/deploy/terraform/infra/modules/vm_docker/variables.tf
deleted file mode 100644
index 2afe85e..0000000
--- a/deploy/terraform/infra/modules/vm_docker/variables.tf
+++ /dev/null
@@ -1,11 +0,0 @@
-variable "name_prefix" { type = string }
-variable "region" { type = string }
-variable "subnet_selflink" { type = string }
-variable "machine_type" { type = string }
-variable "fqdn" { type = string }
-variable "image_ref" { type = string }
-variable "ghcr_user" { type = string }
-variable "ghcr_token" { type = string }
-variable "labels" { type = map(string) default = {} }
-variable "enable_sql" { type = bool }
-variable "db_conn_str" { type = string, default = null }
diff --git a/deploy/terraform/infra/plans/pro.tfvars b/deploy/terraform/infra/plans/pro.tfvars
deleted file mode 100644
index a9d14c5..0000000
--- a/deploy/terraform/infra/plans/pro.tfvars
+++ /dev/null
@@ -1,2 +0,0 @@
-plan = "pro"
-enable_sql = true
diff --git a/deploy/terraform/infra/plans/small.tfvars b/deploy/terraform/infra/plans/small.tfvars
deleted file mode 100644
index a272762..0000000
--- a/deploy/terraform/infra/plans/small.tfvars
+++ /dev/null
@@ -1,2 +0,0 @@
-plan = "small"
-enable_sql = false
diff --git a/deploy/terraform/infra/providers.tf b/deploy/terraform/infra/providers.tf
deleted file mode 100644
index 2469090..0000000
--- a/deploy/terraform/infra/providers.tf
+++ /dev/null
@@ -1,8 +0,0 @@
-provider "google" {
- project = var.gcp_project
- region = var.region
-}
-
-provider "cloudflare" {
- api_token = var.cloudflare_api_token
-}
diff --git a/deploy/terraform/infra/user.auto.tfvars.json b/deploy/terraform/infra/user.auto.tfvars.json
deleted file mode 100644
index 8f88634..0000000
--- a/deploy/terraform/infra/user.auto.tfvars.json
+++ /dev/null
@@ -1,7 +0,0 @@
-{
- "gcp_project": "lumenlabs-prod",
- "domain": "example.com",
- "subdomain_prefix": "app",
- "base_image": "ghcr.io/lumen-labs/brainapi",
- "labels": { "service": "brainapi", "env": "prod" }
-}
diff --git a/deploy/terraform/infra/variables.tf b/deploy/terraform/infra/variables.tf
deleted file mode 100644
index af5d371..0000000
--- a/deploy/terraform/infra/variables.tf
+++ /dev/null
@@ -1,15 +0,0 @@
-variable "gcp_project" { type = string }
-variable "region" { type = string }
-variable "user_slug" { type = string } # e.g., "alice"
-variable "plan" { type = string } # "small" | "pro"
-variable "version" { type = string } # e.g., "v0.4.2"
-variable "domain" { type = string } # e.g., "example.com"
-variable "zone_id" { type = string } # Cloudflare zone id
-variable "ghcr_username" { type = string }
-variable "ghcr_token" { type = string } # GitHub PAT or fine-grained token
-variable "base_image" { type = string } # e.g., "ghcr.io/lumen-labs/brainapi"
-variable "enable_sql" { type = bool default = false }
-variable "machine_type_small" { type = string default = "e2-standard-2" }
-variable "machine_type_pro" { type = string default = "e2-standard-4" }
-variable "subdomain_prefix" { type = string default = "app" } # app-<user>
-variable "labels" { type = map(string) default = {} }
diff --git a/deploy/terraform/infra/versions.tf b/deploy/terraform/infra/versions.tf
deleted file mode 100644
index 54036f0..0000000
--- a/deploy/terraform/infra/versions.tf
+++ /dev/null
@@ -1,8 +0,0 @@
-terraform {
- required_version = ">= 1.8.0"
- required_providers {
- google = { source = "hashicorp/google", version = "~> 5.40" }
- cloudflare = { source = "cloudflare/cloudflare", version = "~> 4.40" }
- random = { source = "hashicorp/random", version = "~> 3.6" }
- }
-}
diff --git a/pyproject.toml b/pyproject.toml
index c916424..26154fa 100644
--- a/pyproject.toml
+++ b/pyproject.toml
@@ -1,6 +1,6 @@
[project]
name = "brainapi2"
-version = "1.3.1-dev"
+version = "1.4.0-dev"
description = "Version 1.x.x of the BrainAPI memory layer."
authors = [
{name = "Christian",email = "[email protected]"}