From 36bb44bfe742e6c38de314bc29b79d075e90e10c Mon Sep 17 00:00:00 2001 From: johnpccd Date: Sat, 24 May 2025 19:12:06 +0200 Subject: [PATCH] cp --- deployment/cloud-run/service.yaml | 10 + deployment/terraform/terraform.tfstate | 271 +--- deployment/terraform/terraform.tfstate.backup | 1180 +---------------- deployment/terraform/terraform.tfvars.example | 8 +- 4 files changed, 84 insertions(+), 1385 deletions(-) diff --git a/deployment/cloud-run/service.yaml b/deployment/cloud-run/service.yaml index fbdbaf1..261d360 100644 --- a/deployment/cloud-run/service.yaml +++ b/deployment/cloud-run/service.yaml @@ -43,6 +43,16 @@ spec: value: "image-embeddings" - name: LOG_LEVEL value: "INFO" + - name: CORS_ORIGINS + value: "*" + - name: CORS_METHODS + value: "GET,POST,PUT,DELETE,OPTIONS" + - name: CORS_HEADERS + value: "Content-Type,Authorization,X-Requested-With" + - name: CORS_EXPOSE_HEADERS + value: "Content-Length,Content-Range" + - name: CORS_MAX_AGE + value: "3600" volumeMounts: - name: gcp-sa-key mountPath: /var/secrets/google diff --git a/deployment/terraform/terraform.tfstate b/deployment/terraform/terraform.tfstate index e1e0ef8..9d7be7a 100644 --- a/deployment/terraform/terraform.tfstate +++ b/deployment/terraform/terraform.tfstate @@ -1,42 +1,17 @@ { "version": 4, "terraform_version": "1.10.1", - "serial": 112, + "serial": 202, "lineage": "a183cd95-f987-8698-c6dd-84e933c394a5", "outputs": { "cloud_run_qdrant_host": { - "value": "34.171.134.17", - "type": "string" - }, - "cloud_run_url": { - "value": "https://sereact-p64zpdtkta-uc.a.run.app", + "value": "104.197.36.94", "type": "string" }, "container_registry_url": { "value": "gcr.io/gen-lang-client-0424120530/sereact", "type": "string" }, - "deployment_summary": { - "value": { - "cloud_run_url": "https://sereact-p64zpdtkta-uc.a.run.app", - "firestore_database": "sereact-imagedb", - "qdrant_endpoint": "http://34.171.134.17:6333", - "storage_bucket": "sereact-images" - }, - "type": [ - "object", - { - "cloud_run_url": "string", - "firestore_database": "string", - "qdrant_endpoint": "string", - "storage_bucket": "string" - } - ] - }, - "firestore_database_id": { - "value": "projects/gen-lang-client-0424120530/databases/sereact-imagedb", - "type": "string" - }, "pubsub_dlq_topic_name": { "value": "image-processing-topic-dlq", "type": "string" @@ -50,11 +25,11 @@ "type": "string" }, "qdrant_grpc_endpoint": { - "value": "http://34.171.134.17:6334", + "value": "http://104.197.36.94:6334", "type": "string" }, "qdrant_http_endpoint": { - "value": "http://34.171.134.17:6333", + "value": "http://104.197.36.94:6333", "type": "string" }, "storage_bucket_name": { @@ -62,11 +37,11 @@ "type": "string" }, "vector_db_vm_external_ip": { - "value": "34.171.134.17", + "value": "104.197.36.94", "type": "string" }, "vector_db_vm_internal_ip": { - "value": "10.128.0.2", + "value": "10.128.0.3", "type": "string" }, "vector_db_vm_name": { @@ -115,6 +90,7 @@ "provider": "provider[\"registry.terraform.io/hashicorp/google\"]", "instances": [ { + "status": "tainted", "schema_version": 2, "attributes": { "autogenerate_revision_name": false, @@ -126,67 +102,25 @@ "run.googleapis.com/ingress": "all" }, "effective_annotations": { - "run.googleapis.com/ingress": "all", - "run.googleapis.com/ingress-status": "all", - "run.googleapis.com/operation-id": "c24190ff-2746-46ef-a1e0-ad57d23a041c", - "run.googleapis.com/urls": "[\"https://sereact-761163285547.us-central1.run.app\",\"https://sereact-p64zpdtkta-uc.a.run.app\"]", - "serving.knative.dev/creator": "johnpccd3@gmail.com", - "serving.knative.dev/lastModifier": "johnpccd3@gmail.com" + "run.googleapis.com/ingress": "all" }, "effective_labels": { - "cloud.googleapis.com/location": "us-central1", "goog-terraform-provisioned": "true" }, - "generation": 1, - "labels": {}, - "namespace": "gen-lang-client-0424120530", - "resource_version": "AAY15HPUh+Y", - "self_link": "/apis/serving.knative.dev/v1/namespaces/761163285547/services/sereact", + "generation": 0, + "labels": null, + "namespace": "", + "resource_version": "", + "self_link": "", "terraform_labels": { "goog-terraform-provisioned": "true" }, - "uid": "8d376071-2aed-4903-80df-4ea8a4ce8708" + "uid": "" } ], "name": "sereact", "project": "gen-lang-client-0424120530", - "status": [ - { - "conditions": [ - { - "message": "", - "reason": "", - "status": "True", - "type": "Ready" - }, - { - "message": "", - "reason": "", - "status": "True", - "type": "ConfigurationsReady" - }, - { - "message": "", - "reason": "", - "status": "True", - "type": "RoutesReady" - } - ], - "latest_created_revision_name": "sereact-00001-lvg", - "latest_ready_revision_name": "sereact-00001-lvg", - "observed_generation": 1, - "traffic": [ - { - "latest_revision": true, - "percent": 100, - "revision_name": "sereact-00001-lvg", - "tag": "", - "url": "" - } - ], - "url": "https://sereact-p64zpdtkta-uc.a.run.app" - } - ], + "status": null, "template": [ { "metadata": [ @@ -195,9 +129,7 @@ "autoscaling.knative.dev/maxScale": "10" }, "generation": 0, - "labels": { - "run.googleapis.com/startupProbeType": "Default" - }, + "labels": {}, "name": "", "namespace": "", "resource_version": "", @@ -207,11 +139,11 @@ ], "spec": [ { - "container_concurrency": 80, + "container_concurrency": 0, "containers": [ { - "args": [], - "command": [], + "args": null, + "command": null, "env": [ { "name": "FIRESTORE_DATABASE_NAME", @@ -240,7 +172,7 @@ }, { "name": "QDRANT_HOST", - "value": "34.171.134.17", + "value": "104.197.36.94", "value_from": [] }, { @@ -266,7 +198,7 @@ "ports": [ { "container_port": 8000, - "name": "http1", + "name": "", "protocol": "" } ], @@ -276,32 +208,18 @@ "cpu": "1", "memory": "1Gi" }, - "requests": {} - } - ], - "startup_probe": [ - { - "failure_threshold": 1, - "grpc": [], - "http_get": [], - "initial_delay_seconds": 0, - "period_seconds": 240, - "tcp_socket": [ - { - "port": 8000 - } - ], - "timeout_seconds": 240 + "requests": null } ], + "startup_probe": [], "volume_mounts": [], "working_dir": "" } ], - "node_selector": {}, - "service_account_name": "761163285547-compute@developer.gserviceaccount.com", + "node_selector": null, + "service_account_name": "", "serving_state": "", - "timeout_seconds": 300, + "timeout_seconds": 0, "volumes": [] } ] @@ -369,36 +287,6 @@ } ] }, - { - "mode": "managed", - "type": "google_cloud_run_service_iam_member", - "name": "public_access", - "provider": "provider[\"registry.terraform.io/hashicorp/google\"]", - "instances": [ - { - "schema_version": 0, - "attributes": { - "condition": [], - "etag": "BwY15HR3kyI=", - "id": "v1/projects/gen-lang-client-0424120530/locations/us-central1/services/sereact/roles/run.invoker/allUsers", - "location": "us-central1", - "member": "allUsers", - "project": "gen-lang-client-0424120530", - "role": "roles/run.invoker", - "service": "v1/projects/gen-lang-client-0424120530/locations/us-central1/services/sereact" - }, - "sensitive_attributes": [], - "private": "bnVsbA==", - "dependencies": [ - "google_cloud_run_service.sereact", - "google_compute_address.vector_db_static_ip", - "google_compute_instance.vector_db_vm", - "google_project_service.services", - "google_service_account.vector_db_sa" - ] - } - ] - }, { "mode": "managed", "type": "google_compute_address", @@ -408,9 +296,9 @@ { "schema_version": 0, "attributes": { - "address": "34.9.243.202", + "address": "34.171.134.17", "address_type": "EXTERNAL", - "creation_timestamp": "2025-05-24T09:00:37.835-07:00", + "creation_timestamp": "2025-05-24T10:10:23.021-07:00", "description": "", "effective_labels": { "goog-terraform-provisioned": "true" @@ -419,7 +307,7 @@ "ip_version": "", "ipv6_endpoint_type": "", "label_fingerprint": "vezUS-42LLM=", - "labels": {}, + "labels": null, "name": "vector-db-static-ip", "network": "", "network_tier": "PREMIUM", @@ -458,7 +346,7 @@ "protocol": "tcp" } ], - "creation_timestamp": "2025-05-24T09:00:37.141-07:00", + "creation_timestamp": "2025-05-24T10:10:23.267-07:00", "deny": [], "description": "", "destination_ranges": [], @@ -476,9 +364,9 @@ "0.0.0.0/0", "10.0.0.0/8" ], - "source_service_accounts": [], - "source_tags": [], - "target_service_accounts": [], + "source_service_accounts": null, + "source_tags": null, + "target_service_accounts": null, "target_tags": [ "qdrant" ], @@ -529,7 +417,7 @@ "labels": {}, "provisioned_iops": 0, "provisioned_throughput": 0, - "resource_manager_tags": {}, + "resource_manager_tags": null, "resource_policies": [], "size": 50, "snapshot": "", @@ -548,7 +436,7 @@ "can_ip_forward": false, "confidential_instance_config": [], "cpu_platform": "Intel Broadwell", - "creation_timestamp": "2025-05-24T09:00:52.634-07:00", + "creation_timestamp": "2025-05-24T10:10:36.440-07:00", "current_status": "RUNNING", "deletion_protection": false, "description": "", @@ -561,12 +449,12 @@ "hostname": "", "id": "projects/gen-lang-client-0424120530/zones/us-central1-a/instances/sereact-vector-db", "instance_encryption_key": [], - "instance_id": "6080267328633459675", + "instance_id": "670961443312255843", "key_revocation_action_type": "", "label_fingerprint": "vezUS-42LLM=", - "labels": {}, + "labels": null, "machine_type": "e2-standard-2", - "metadata": {}, + "metadata": null, "metadata_fingerprint": "cE8FbgySELs=", "metadata_startup_script": "#!/bin/bash\n\n# Qdrant Vector Database Installation Script\n# This script installs and configures Qdrant on Ubuntu 22.04\n\nset -e\n\n# Update system packages\napt-get update\napt-get upgrade -y\n\n# Install required packages\napt-get install -y curl wget gnupg2 software-properties-common apt-transport-https ca-certificates\n\n# Install Docker\ncurl -fsSL https://download.docker.com/linux/ubuntu/gpg | gpg --dearmor -o /usr/share/keyrings/docker-archive-keyring.gpg\necho \"deb [arch=amd64 signed-by=/usr/share/keyrings/docker-archive-keyring.gpg] https://download.docker.com/linux/ubuntu $(lsb_release -cs) stable\" | tee /etc/apt/sources.list.d/docker.list \u003e /dev/null\napt-get update\napt-get install -y docker-ce docker-ce-cli containerd.io\n\n# Start and enable Docker\nsystemctl start docker\nsystemctl enable docker\n\n# Create qdrant user and directories\nuseradd -r -s /bin/false qdrant || true\nmkdir -p /opt/qdrant/storage\nmkdir -p /opt/qdrant/config\nchown -R qdrant:qdrant /opt/qdrant\n\n# Create Qdrant configuration file\ncat \u003e /opt/qdrant/config/config.yaml \u003c\u003c EOF\nservice:\n host: 0.0.0.0\n http_port: 6333\n grpc_port: 6334\n enable_cors: true\n\nstorage:\n storage_path: /qdrant/storage\n snapshots_path: /qdrant/snapshots\n on_disk_payload: true\n\ncluster:\n enabled: false\n\ntelemetry:\n disabled: true\n\nlog_level: INFO\nEOF\n\n# Create API key configuration if provided\nif [ -n \"\" ] \u0026\u0026 [ \"\" != \"\" ]; then\ncat \u003e\u003e /opt/qdrant/config/config.yaml \u003c\u003c EOF\n\nservice:\n api_key: \"\"\nEOF\nfi\n\n# Create systemd service for Qdrant\ncat \u003e /etc/systemd/system/qdrant.service \u003c\u003c EOF\n[Unit]\nDescription=Qdrant Vector Database\nAfter=docker.service\nRequires=docker.service\n\n[Service]\nType=simple\nUser=root\nExecStartPre=-/usr/bin/docker stop qdrant\nExecStartPre=-/usr/bin/docker rm qdrant\nExecStart=/usr/bin/docker run --name qdrant \\\n -p 6333:6333 \\\n -p 6334:6334 \\\n -v /opt/qdrant/storage:/qdrant/storage:z \\\n -v /opt/qdrant/config/config.yaml:/qdrant/config/production.yaml:z \\\n qdrant/qdrant:latest\nExecStop=/usr/bin/docker stop qdrant\nRestart=always\nRestartSec=10\n\n[Install]\nWantedBy=multi-user.target\nEOF\n\n# Pull Qdrant Docker image\ndocker pull qdrant/qdrant:latest\n\n# Enable and start Qdrant service\nsystemctl daemon-reload\nsystemctl enable qdrant\nsystemctl start qdrant\n\n# Install monitoring tools\napt-get install -y htop iotop nethogs\n\n# Create a simple health check script\ncat \u003e /opt/qdrant/health_check.sh \u003c\u003c 'EOF'\n#!/bin/bash\nresponse=$(curl -s -o /dev/null -w \"%{http_code}\" http://localhost:6333/health)\nif [ \"$response\" = \"200\" ]; then\n echo \"Qdrant is healthy\"\n exit 0\nelse\n echo \"Qdrant is not responding properly (HTTP $response)\"\n exit 1\nfi\nEOF\n\nchmod +x /opt/qdrant/health_check.sh\n\n# Set up log rotation for Docker logs\ncat \u003e /etc/logrotate.d/docker \u003c\u003c EOF\n/var/lib/docker/containers/*/*.log {\n rotate 7\n daily\n compress\n size=1M\n missingok\n delaycompress\n copytruncate\n}\nEOF\n\n# Configure firewall (ufw)\nufw --force enable\nufw allow ssh\nufw allow 6333/tcp # Qdrant HTTP API\nufw allow 6334/tcp # Qdrant gRPC API\n\n# Create a simple backup script\ncat \u003e /opt/qdrant/backup.sh \u003c\u003c 'EOF'\n#!/bin/bash\nBACKUP_DIR=\"/opt/qdrant/backups\"\nDATE=$(date +%Y%m%d_%H%M%S)\nmkdir -p $BACKUP_DIR\n\n# Create snapshot via API\ncurl -X POST \"http://localhost:6333/snapshots\" \\\n -H \"Content-Type: application/json\" \\\n -d '{\"snapshot_name\": \"backup_'$DATE'\"}'\n\n# Copy storage directory\ntar -czf $BACKUP_DIR/qdrant_storage_$DATE.tar.gz -C /opt/qdrant storage/\n\n# Keep only last 7 backups\nfind $BACKUP_DIR -name \"*.tar.gz\" -mtime +7 -delete\n\necho \"Backup completed: $DATE\"\nEOF\n\nchmod +x /opt/qdrant/backup.sh\n\n# Set up daily backup cron job\necho \"0 2 * * * root /opt/qdrant/backup.sh \u003e\u003e /var/log/qdrant_backup.log 2\u003e\u00261\" \u003e\u003e /etc/crontab\n\n# Wait for Qdrant to be ready\necho \"Waiting for Qdrant to start...\"\nfor i in {1..30}; do\n if curl -s http://localhost:6333/health \u003e /dev/null; then\n echo \"Qdrant is ready!\"\n break\n fi\n echo \"Waiting... ($i/30)\"\n sleep 10\ndone\n\n# Create a default collection for image vectors\ncurl -X PUT \"http://localhost:6333/collections/image_vectors\" \\\n -H \"Content-Type: application/json\" \\\n -d '{\n \"vectors\": {\n \"size\": 512,\n \"distance\": \"Cosine\"\n },\n \"optimizers_config\": {\n \"default_segment_number\": 2\n },\n \"replication_factor\": 1\n }'\n\necho \"Qdrant installation and configuration completed!\"\necho \"Qdrant is accessible at:\"\necho \" HTTP API: http://$(curl -s ifconfig.me):6333\"\necho \" gRPC API: http://$(curl -s ifconfig.me):6334\"\necho \"Health check: /opt/qdrant/health_check.sh\"\necho \"Backup script: /opt/qdrant/backup.sh\" ", "min_cpu_platform": "", @@ -575,7 +463,7 @@ { "access_config": [ { - "nat_ip": "34.171.134.17", + "nat_ip": "104.197.36.94", "network_tier": "PREMIUM", "public_ptr_domain_name": "" } @@ -588,7 +476,7 @@ "name": "nic0", "network": "https://www.googleapis.com/compute/v1/projects/gen-lang-client-0424120530/global/networks/default", "network_attachment": "", - "network_ip": "10.128.0.2", + "network_ip": "10.128.0.3", "nic_type": "", "queue_count": 0, "stack_type": "IPV4_ONLY", @@ -600,7 +488,7 @@ "params": [], "project": "gen-lang-client-0424120530", "reservation_affinity": [], - "resource_policies": [], + "resource_policies": null, "scheduling": [ { "automatic_restart": true, @@ -649,7 +537,18 @@ [ { "type": "get_attr", - "value": "metadata_startup_script" + "value": "boot_disk" + }, + { + "type": "index", + "value": { + "value": 0, + "type": "number" + } + }, + { + "type": "get_attr", + "value": "disk_encryption_key_rsa" } ], [ @@ -672,18 +571,7 @@ [ { "type": "get_attr", - "value": "boot_disk" - }, - { - "type": "index", - "value": { - "value": 0, - "type": "number" - } - }, - { - "type": "get_attr", - "value": "disk_encryption_key_rsa" + "value": "metadata_startup_script" } ] ], @@ -697,41 +585,10 @@ }, { "mode": "managed", - "type": "google_firestore_database", - "name": "database", + "type": "google_compute_instance", + "name": "vector_db_vm_with_static_ip", "provider": "provider[\"registry.terraform.io/hashicorp/google\"]", - "instances": [ - { - "schema_version": 0, - "attributes": { - "app_engine_integration_mode": "DISABLED", - "cmek_config": [], - "concurrency_mode": "PESSIMISTIC", - "create_time": "", - "database_edition": "STANDARD", - "delete_protection_state": "DELETE_PROTECTION_DISABLED", - "deletion_policy": "ABANDON", - "earliest_version_time": "2025-05-24T16:11:39.875416Z", - "etag": "INqrga/HvI0DMNiAssK/vI0D", - "id": "projects/gen-lang-client-0424120530/databases/sereact-imagedb", - "key_prefix": "", - "location_id": "us-central1", - "name": "sereact-imagedb", - "point_in_time_recovery_enablement": "POINT_IN_TIME_RECOVERY_DISABLED", - "project": "gen-lang-client-0424120530", - "timeouts": null, - "type": "FIRESTORE_NATIVE", - "uid": "30634721-c8c7-4673-b605-c1a91dff3eab", - "update_time": "", - "version_retention_period": "3600s" - }, - "sensitive_attributes": [], - "private": "eyJlMmJmYjczMC1lY2FhLTExZTYtOGY4OC0zNDM2M2JjN2M0YzAiOnsiY3JlYXRlIjoxMjAwMDAwMDAwMDAwLCJkZWxldGUiOjEyMDAwMDAwMDAwMDAsInVwZGF0ZSI6MTIwMDAwMDAwMDAwMH19", - "dependencies": [ - "google_project_service.services" - ] - } - ] + "instances": [] }, { "mode": "managed", @@ -958,7 +815,7 @@ "schema_version": 0, "attributes": { "condition": [], - "etag": "BwY149eEFPY=", + "etag": "BwY15MsDMxU=", "id": "projects/gen-lang-client-0424120530/subscriptions/image-processing-topic-subscription/roles/pubsub.subscriber", "members": [ "serviceAccount:761163285547-compute@developer.gserviceaccount.com" @@ -1070,7 +927,7 @@ "schema_version": 0, "attributes": { "condition": [], - "etag": "BwY149EL9pk=", + "etag": "BwY15MqTytg=", "id": "projects/gen-lang-client-0424120530/topics/image-processing-topic/roles/pubsub.publisher", "members": [ "serviceAccount:761163285547-compute@developer.gserviceaccount.com" @@ -1108,7 +965,7 @@ "name": "projects/gen-lang-client-0424120530/serviceAccounts/vector-db-sa@gen-lang-client-0424120530.iam.gserviceaccount.com", "project": "gen-lang-client-0424120530", "timeouts": null, - "unique_id": "115427142677021446795" + "unique_id": "104051055732001951756" }, "sensitive_attributes": [], "private": "eyJlMmJmYjczMC1lY2FhLTExZTYtOGY4OC0zNDM2M2JjN2M0YzAiOnsiY3JlYXRlIjozMDAwMDAwMDAwMDB9fQ==" @@ -1140,7 +997,7 @@ } ], "id": "sereact-images", - "labels": {}, + "labels": null, "lifecycle_rule": [], "location": "US-CENTRAL1", "logging": [], @@ -1154,7 +1011,7 @@ "self_link": "https://www.googleapis.com/storage/v1/b/sereact-images", "soft_delete_policy": [ { - "effective_time": "2025-05-24T16:00:44.092Z", + "effective_time": "2025-05-24T17:10:27.332Z", "retention_duration_seconds": 604800 } ], @@ -1162,10 +1019,10 @@ "terraform_labels": { "goog-terraform-provisioned": "true" }, - "time_created": "2025-05-24T16:00:44.092Z", + "time_created": "2025-05-24T17:10:27.332Z", "timeouts": null, "uniform_bucket_level_access": true, - "updated": "2025-05-24T16:00:44.092Z", + "updated": "2025-05-24T17:10:27.332Z", "url": "gs://sereact-images", "versioning": [], "website": [] diff --git a/deployment/terraform/terraform.tfstate.backup b/deployment/terraform/terraform.tfstate.backup index a0f1ea0..f7290dc 100644 --- a/deployment/terraform/terraform.tfstate.backup +++ b/deployment/terraform/terraform.tfstate.backup @@ -1,1183 +1,9 @@ { "version": 4, "terraform_version": "1.10.1", - "serial": 111, + "serial": 182, "lineage": "a183cd95-f987-8698-c6dd-84e933c394a5", - "outputs": { - "cloud_run_qdrant_host": { - "value": "34.171.134.17", - "type": "string" - }, - "cloud_run_url": { - "value": "https://sereact-p64zpdtkta-uc.a.run.app", - "type": "string" - }, - "container_registry_url": { - "value": "gcr.io/gen-lang-client-0424120530/sereact", - "type": "string" - }, - "deployment_summary": { - "value": { - "cloud_run_url": "https://sereact-p64zpdtkta-uc.a.run.app", - "firestore_database": "sereact-imagedb", - "qdrant_endpoint": "http://34.171.134.17:6333", - "storage_bucket": "sereact-images" - }, - "type": [ - "object", - { - "cloud_run_url": "string", - "firestore_database": "string", - "qdrant_endpoint": "string", - "storage_bucket": "string" - } - ] - }, - "firestore_database_id": { - "value": "projects/gen-lang-client-0424120530/databases/sereact-imagedb", - "type": "string" - }, - "pubsub_dlq_topic_name": { - "value": "image-processing-topic-dlq", - "type": "string" - }, - "pubsub_subscription_name": { - "value": "image-processing-topic-subscription", - "type": "string" - }, - "pubsub_topic_name": { - "value": "image-processing-topic", - "type": "string" - }, - "qdrant_grpc_endpoint": { - "value": "http://34.171.134.17:6334", - "type": "string" - }, - "qdrant_http_endpoint": { - "value": "http://34.171.134.17:6333", - "type": "string" - }, - "storage_bucket_name": { - "value": "sereact-images", - "type": "string" - }, - "vector_db_vm_external_ip": { - "value": "34.171.134.17", - "type": "string" - }, - "vector_db_vm_internal_ip": { - "value": "10.128.0.2", - "type": "string" - }, - "vector_db_vm_name": { - "value": "sereact-vector-db", - "type": "string" - } - }, - "resources": [ - { - "mode": "data", - "type": "google_project", - "name": "current", - "provider": "provider[\"registry.terraform.io/hashicorp/google\"]", - "instances": [ - { - "schema_version": 0, - "attributes": { - "auto_create_network": null, - "billing_account": "00CA97-62E5BD-4A62B5", - "deletion_policy": "PREVENT", - "effective_labels": { - "generative-language": "enabled" - }, - "folder_id": null, - "id": "projects/gen-lang-client-0424120530", - "labels": { - "generative-language": "enabled" - }, - "name": "Gemini API", - "number": "761163285547", - "org_id": null, - "project_id": "gen-lang-client-0424120530", - "tags": null, - "terraform_labels": { - "generative-language": "enabled" - } - }, - "sensitive_attributes": [] - } - ] - }, - { - "mode": "managed", - "type": "google_cloud_run_service", - "name": "sereact", - "provider": "provider[\"registry.terraform.io/hashicorp/google\"]", - "instances": [ - { - "schema_version": 2, - "attributes": { - "autogenerate_revision_name": false, - "id": "locations/us-central1/namespaces/gen-lang-client-0424120530/services/sereact", - "location": "us-central1", - "metadata": [ - { - "annotations": { - "run.googleapis.com/ingress": "all" - }, - "effective_annotations": { - "run.googleapis.com/ingress": "all", - "run.googleapis.com/ingress-status": "all", - "run.googleapis.com/operation-id": "c24190ff-2746-46ef-a1e0-ad57d23a041c", - "run.googleapis.com/urls": "[\"https://sereact-761163285547.us-central1.run.app\",\"https://sereact-p64zpdtkta-uc.a.run.app\"]", - "serving.knative.dev/creator": "johnpccd3@gmail.com", - "serving.knative.dev/lastModifier": "johnpccd3@gmail.com" - }, - "effective_labels": { - "cloud.googleapis.com/location": "us-central1", - "goog-terraform-provisioned": "true" - }, - "generation": 1, - "labels": null, - "namespace": "gen-lang-client-0424120530", - "resource_version": "AAY15HPUh+Y", - "self_link": "/apis/serving.knative.dev/v1/namespaces/761163285547/services/sereact", - "terraform_labels": { - "goog-terraform-provisioned": "true" - }, - "uid": "8d376071-2aed-4903-80df-4ea8a4ce8708" - } - ], - "name": "sereact", - "project": "gen-lang-client-0424120530", - "status": [ - { - "conditions": [ - { - "message": "", - "reason": "", - "status": "True", - "type": "Ready" - }, - { - "message": "", - "reason": "", - "status": "True", - "type": "ConfigurationsReady" - }, - { - "message": "", - "reason": "", - "status": "True", - "type": "RoutesReady" - } - ], - "latest_created_revision_name": "sereact-00001-lvg", - "latest_ready_revision_name": "sereact-00001-lvg", - "observed_generation": 1, - "traffic": [ - { - "latest_revision": true, - "percent": 100, - "revision_name": "sereact-00001-lvg", - "tag": "", - "url": "" - } - ], - "url": "https://sereact-p64zpdtkta-uc.a.run.app" - } - ], - "template": [ - { - "metadata": [ - { - "annotations": { - "autoscaling.knative.dev/maxScale": "10" - }, - "generation": 0, - "labels": { - "run.googleapis.com/startupProbeType": "Default" - }, - "name": "", - "namespace": "", - "resource_version": "", - "self_link": "", - "uid": "" - } - ], - "spec": [ - { - "container_concurrency": 80, - "containers": [ - { - "args": null, - "command": null, - "env": [ - { - "name": "FIRESTORE_DATABASE_NAME", - "value": "sereact-imagedb", - "value_from": [] - }, - { - "name": "FIRESTORE_PROJECT_ID", - "value": "gen-lang-client-0424120530", - "value_from": [] - }, - { - "name": "GCS_BUCKET_NAME", - "value": "sereact-images", - "value_from": [] - }, - { - "name": "LOG_LEVEL", - "value": "INFO", - "value_from": [] - }, - { - "name": "QDRANT_API_KEY", - "value": "", - "value_from": [] - }, - { - "name": "QDRANT_HOST", - "value": "34.171.134.17", - "value_from": [] - }, - { - "name": "QDRANT_PORT", - "value": "6333", - "value_from": [] - }, - { - "name": "VECTOR_DB_ENVIRONMENT", - "value": "gcp-starter", - "value_from": [] - }, - { - "name": "VECTOR_DB_INDEX_NAME", - "value": "image-embeddings", - "value_from": [] - } - ], - "env_from": [], - "image": "gcr.io/gen-lang-client-0424120530/sereact-api:latest", - "liveness_probe": [], - "name": "", - "ports": [ - { - "container_port": 8000, - "name": "http1", - "protocol": "" - } - ], - "resources": [ - { - "limits": { - "cpu": "1", - "memory": "1Gi" - }, - "requests": null - } - ], - "startup_probe": [ - { - "failure_threshold": 1, - "grpc": [], - "http_get": [], - "initial_delay_seconds": 0, - "period_seconds": 240, - "tcp_socket": [ - { - "port": 8000 - } - ], - "timeout_seconds": 240 - } - ], - "volume_mounts": [], - "working_dir": "" - } - ], - "node_selector": null, - "service_account_name": "761163285547-compute@developer.gserviceaccount.com", - "serving_state": "", - "timeout_seconds": 300, - "volumes": [] - } - ] - } - ], - "timeouts": null, - "traffic": [ - { - "latest_revision": true, - "percent": 100, - "revision_name": "", - "tag": "", - "url": "" - } - ] - }, - "sensitive_attributes": [ - [ - { - "type": "get_attr", - "value": "template" - }, - { - "type": "index", - "value": { - "value": 0, - "type": "number" - } - }, - { - "type": "get_attr", - "value": "spec" - }, - { - "type": "index", - "value": { - "value": 0, - "type": "number" - } - }, - { - "type": "get_attr", - "value": "containers" - }, - { - "type": "index", - "value": { - "value": 0, - "type": "number" - } - }, - { - "type": "get_attr", - "value": "env" - } - ] - ], - "private": "eyJlMmJmYjczMC1lY2FhLTExZTYtOGY4OC0zNDM2M2JjN2M0YzAiOnsiY3JlYXRlIjoxMjAwMDAwMDAwMDAwLCJkZWxldGUiOjEyMDAwMDAwMDAwMDAsInVwZGF0ZSI6MTIwMDAwMDAwMDAwMH0sInNjaGVtYV92ZXJzaW9uIjoiMiJ9", - "dependencies": [ - "google_compute_address.vector_db_static_ip", - "google_compute_instance.vector_db_vm", - "google_project_service.services", - "google_service_account.vector_db_sa" - ] - } - ] - }, - { - "mode": "managed", - "type": "google_cloud_run_service_iam_member", - "name": "public_access", - "provider": "provider[\"registry.terraform.io/hashicorp/google\"]", - "instances": [ - { - "schema_version": 0, - "attributes": { - "condition": [], - "etag": "BwY15HR3kyI=", - "id": "v1/projects/gen-lang-client-0424120530/locations/us-central1/services/sereact/roles/run.invoker/allUsers", - "location": "us-central1", - "member": "allUsers", - "project": "gen-lang-client-0424120530", - "role": "roles/run.invoker", - "service": "v1/projects/gen-lang-client-0424120530/locations/us-central1/services/sereact" - }, - "sensitive_attributes": [], - "private": "bnVsbA==", - "dependencies": [ - "google_cloud_run_service.sereact", - "google_compute_address.vector_db_static_ip", - "google_compute_instance.vector_db_vm", - "google_project_service.services", - "google_service_account.vector_db_sa" - ] - } - ] - }, - { - "mode": "managed", - "type": "google_compute_address", - "name": "vector_db_static_ip", - "provider": "provider[\"registry.terraform.io/hashicorp/google\"]", - "instances": [ - { - "schema_version": 0, - "attributes": { - "address": "34.9.243.202", - "address_type": "EXTERNAL", - "creation_timestamp": "2025-05-24T09:00:37.835-07:00", - "description": "", - "effective_labels": { - "goog-terraform-provisioned": "true" - }, - "id": "projects/gen-lang-client-0424120530/regions/us-central1/addresses/vector-db-static-ip", - "ip_version": "", - "ipv6_endpoint_type": "", - "label_fingerprint": "vezUS-42LLM=", - "labels": {}, - "name": "vector-db-static-ip", - "network": "", - "network_tier": "PREMIUM", - "prefix_length": 0, - "project": "gen-lang-client-0424120530", - "purpose": "", - "region": "us-central1", - "self_link": "https://www.googleapis.com/compute/v1/projects/gen-lang-client-0424120530/regions/us-central1/addresses/vector-db-static-ip", - "subnetwork": "", - "terraform_labels": { - "goog-terraform-provisioned": "true" - }, - "timeouts": null, - "users": [] - }, - "sensitive_attributes": [], - "private": "eyJlMmJmYjczMC1lY2FhLTExZTYtOGY4OC0zNDM2M2JjN2M0YzAiOnsiY3JlYXRlIjoxMjAwMDAwMDAwMDAwLCJkZWxldGUiOjEyMDAwMDAwMDAwMDAsInVwZGF0ZSI6MTIwMDAwMDAwMDAwMH19" - } - ] - }, - { - "mode": "managed", - "type": "google_compute_firewall", - "name": "qdrant_firewall", - "provider": "provider[\"registry.terraform.io/hashicorp/google\"]", - "instances": [ - { - "schema_version": 1, - "attributes": { - "allow": [ - { - "ports": [ - "6333", - "6334" - ], - "protocol": "tcp" - } - ], - "creation_timestamp": "2025-05-24T09:00:37.141-07:00", - "deny": [], - "description": "", - "destination_ranges": [], - "direction": "INGRESS", - "disabled": false, - "enable_logging": null, - "id": "projects/gen-lang-client-0424120530/global/firewalls/allow-qdrant", - "log_config": [], - "name": "allow-qdrant", - "network": "https://www.googleapis.com/compute/v1/projects/gen-lang-client-0424120530/global/networks/default", - "priority": 1000, - "project": "gen-lang-client-0424120530", - "self_link": "https://www.googleapis.com/compute/v1/projects/gen-lang-client-0424120530/global/firewalls/allow-qdrant", - "source_ranges": [ - "0.0.0.0/0", - "10.0.0.0/8" - ], - "source_service_accounts": [], - "source_tags": [], - "target_service_accounts": [], - "target_tags": [ - "qdrant" - ], - "timeouts": null - }, - "sensitive_attributes": [], - "private": "eyJlMmJmYjczMC1lY2FhLTExZTYtOGY4OC0zNDM2M2JjN2M0YzAiOnsiY3JlYXRlIjoxMjAwMDAwMDAwMDAwLCJkZWxldGUiOjEyMDAwMDAwMDAwMDAsInVwZGF0ZSI6MTIwMDAwMDAwMDAwMH0sInNjaGVtYV92ZXJzaW9uIjoiMSJ9" - } - ] - }, - { - "mode": "managed", - "type": "google_compute_instance", - "name": "vector_db_vm", - "provider": "provider[\"registry.terraform.io/hashicorp/google\"]", - "instances": [ - { - "schema_version": 6, - "attributes": { - "advanced_machine_features": [], - "allow_stopping_for_update": null, - "attached_disk": [], - "boot_disk": [ - { - "auto_delete": true, - "device_name": "persistent-disk-0", - "disk_encryption_key_raw": "", - "disk_encryption_key_rsa": "", - "disk_encryption_key_sha256": "", - "disk_encryption_service_account": "", - "force_attach": false, - "guest_os_features": [ - "VIRTIO_SCSI_MULTIQUEUE", - "SEV_CAPABLE", - "SEV_SNP_CAPABLE", - "SEV_LIVE_MIGRATABLE", - "SEV_LIVE_MIGRATABLE_V2", - "IDPF", - "TDX_CAPABLE", - "UEFI_COMPATIBLE", - "GVNIC" - ], - "initialize_params": [ - { - "architecture": "X86_64", - "enable_confidential_compute": false, - "image": "https://www.googleapis.com/compute/v1/projects/ubuntu-os-cloud/global/images/ubuntu-2204-jammy-v20250523", - "labels": {}, - "provisioned_iops": 0, - "provisioned_throughput": 0, - "resource_manager_tags": {}, - "resource_policies": [], - "size": 50, - "snapshot": "", - "source_image_encryption_key": [], - "source_snapshot_encryption_key": [], - "storage_pool": "", - "type": "pd-standard" - } - ], - "interface": "", - "kms_key_self_link": "", - "mode": "READ_WRITE", - "source": "https://www.googleapis.com/compute/v1/projects/gen-lang-client-0424120530/zones/us-central1-a/disks/sereact-vector-db" - } - ], - "can_ip_forward": false, - "confidential_instance_config": [], - "cpu_platform": "Intel Broadwell", - "creation_timestamp": "2025-05-24T09:00:52.634-07:00", - "current_status": "RUNNING", - "deletion_protection": false, - "description": "", - "desired_status": null, - "effective_labels": { - "goog-terraform-provisioned": "true" - }, - "enable_display": false, - "guest_accelerator": [], - "hostname": "", - "id": "projects/gen-lang-client-0424120530/zones/us-central1-a/instances/sereact-vector-db", - "instance_encryption_key": [], - "instance_id": "6080267328633459675", - "key_revocation_action_type": "", - "label_fingerprint": "vezUS-42LLM=", - "labels": {}, - "machine_type": "e2-standard-2", - "metadata": {}, - "metadata_fingerprint": "cE8FbgySELs=", - "metadata_startup_script": "#!/bin/bash\n\n# Qdrant Vector Database Installation Script\n# This script installs and configures Qdrant on Ubuntu 22.04\n\nset -e\n\n# Update system packages\napt-get update\napt-get upgrade -y\n\n# Install required packages\napt-get install -y curl wget gnupg2 software-properties-common apt-transport-https ca-certificates\n\n# Install Docker\ncurl -fsSL https://download.docker.com/linux/ubuntu/gpg | gpg --dearmor -o /usr/share/keyrings/docker-archive-keyring.gpg\necho \"deb [arch=amd64 signed-by=/usr/share/keyrings/docker-archive-keyring.gpg] https://download.docker.com/linux/ubuntu $(lsb_release -cs) stable\" | tee /etc/apt/sources.list.d/docker.list \u003e /dev/null\napt-get update\napt-get install -y docker-ce docker-ce-cli containerd.io\n\n# Start and enable Docker\nsystemctl start docker\nsystemctl enable docker\n\n# Create qdrant user and directories\nuseradd -r -s /bin/false qdrant || true\nmkdir -p /opt/qdrant/storage\nmkdir -p /opt/qdrant/config\nchown -R qdrant:qdrant /opt/qdrant\n\n# Create Qdrant configuration file\ncat \u003e /opt/qdrant/config/config.yaml \u003c\u003c EOF\nservice:\n host: 0.0.0.0\n http_port: 6333\n grpc_port: 6334\n enable_cors: true\n\nstorage:\n storage_path: /qdrant/storage\n snapshots_path: /qdrant/snapshots\n on_disk_payload: true\n\ncluster:\n enabled: false\n\ntelemetry:\n disabled: true\n\nlog_level: INFO\nEOF\n\n# Create API key configuration if provided\nif [ -n \"\" ] \u0026\u0026 [ \"\" != \"\" ]; then\ncat \u003e\u003e /opt/qdrant/config/config.yaml \u003c\u003c EOF\n\nservice:\n api_key: \"\"\nEOF\nfi\n\n# Create systemd service for Qdrant\ncat \u003e /etc/systemd/system/qdrant.service \u003c\u003c EOF\n[Unit]\nDescription=Qdrant Vector Database\nAfter=docker.service\nRequires=docker.service\n\n[Service]\nType=simple\nUser=root\nExecStartPre=-/usr/bin/docker stop qdrant\nExecStartPre=-/usr/bin/docker rm qdrant\nExecStart=/usr/bin/docker run --name qdrant \\\n -p 6333:6333 \\\n -p 6334:6334 \\\n -v /opt/qdrant/storage:/qdrant/storage:z \\\n -v /opt/qdrant/config/config.yaml:/qdrant/config/production.yaml:z \\\n qdrant/qdrant:latest\nExecStop=/usr/bin/docker stop qdrant\nRestart=always\nRestartSec=10\n\n[Install]\nWantedBy=multi-user.target\nEOF\n\n# Pull Qdrant Docker image\ndocker pull qdrant/qdrant:latest\n\n# Enable and start Qdrant service\nsystemctl daemon-reload\nsystemctl enable qdrant\nsystemctl start qdrant\n\n# Install monitoring tools\napt-get install -y htop iotop nethogs\n\n# Create a simple health check script\ncat \u003e /opt/qdrant/health_check.sh \u003c\u003c 'EOF'\n#!/bin/bash\nresponse=$(curl -s -o /dev/null -w \"%{http_code}\" http://localhost:6333/health)\nif [ \"$response\" = \"200\" ]; then\n echo \"Qdrant is healthy\"\n exit 0\nelse\n echo \"Qdrant is not responding properly (HTTP $response)\"\n exit 1\nfi\nEOF\n\nchmod +x /opt/qdrant/health_check.sh\n\n# Set up log rotation for Docker logs\ncat \u003e /etc/logrotate.d/docker \u003c\u003c EOF\n/var/lib/docker/containers/*/*.log {\n rotate 7\n daily\n compress\n size=1M\n missingok\n delaycompress\n copytruncate\n}\nEOF\n\n# Configure firewall (ufw)\nufw --force enable\nufw allow ssh\nufw allow 6333/tcp # Qdrant HTTP API\nufw allow 6334/tcp # Qdrant gRPC API\n\n# Create a simple backup script\ncat \u003e /opt/qdrant/backup.sh \u003c\u003c 'EOF'\n#!/bin/bash\nBACKUP_DIR=\"/opt/qdrant/backups\"\nDATE=$(date +%Y%m%d_%H%M%S)\nmkdir -p $BACKUP_DIR\n\n# Create snapshot via API\ncurl -X POST \"http://localhost:6333/snapshots\" \\\n -H \"Content-Type: application/json\" \\\n -d '{\"snapshot_name\": \"backup_'$DATE'\"}'\n\n# Copy storage directory\ntar -czf $BACKUP_DIR/qdrant_storage_$DATE.tar.gz -C /opt/qdrant storage/\n\n# Keep only last 7 backups\nfind $BACKUP_DIR -name \"*.tar.gz\" -mtime +7 -delete\n\necho \"Backup completed: $DATE\"\nEOF\n\nchmod +x /opt/qdrant/backup.sh\n\n# Set up daily backup cron job\necho \"0 2 * * * root /opt/qdrant/backup.sh \u003e\u003e /var/log/qdrant_backup.log 2\u003e\u00261\" \u003e\u003e /etc/crontab\n\n# Wait for Qdrant to be ready\necho \"Waiting for Qdrant to start...\"\nfor i in {1..30}; do\n if curl -s http://localhost:6333/health \u003e /dev/null; then\n echo \"Qdrant is ready!\"\n break\n fi\n echo \"Waiting... ($i/30)\"\n sleep 10\ndone\n\n# Create a default collection for image vectors\ncurl -X PUT \"http://localhost:6333/collections/image_vectors\" \\\n -H \"Content-Type: application/json\" \\\n -d '{\n \"vectors\": {\n \"size\": 512,\n \"distance\": \"Cosine\"\n },\n \"optimizers_config\": {\n \"default_segment_number\": 2\n },\n \"replication_factor\": 1\n }'\n\necho \"Qdrant installation and configuration completed!\"\necho \"Qdrant is accessible at:\"\necho \" HTTP API: http://$(curl -s ifconfig.me):6333\"\necho \" gRPC API: http://$(curl -s ifconfig.me):6334\"\necho \"Health check: /opt/qdrant/health_check.sh\"\necho \"Backup script: /opt/qdrant/backup.sh\" ", - "min_cpu_platform": "", - "name": "sereact-vector-db", - "network_interface": [ - { - "access_config": [ - { - "nat_ip": "34.171.134.17", - "network_tier": "PREMIUM", - "public_ptr_domain_name": "" - } - ], - "alias_ip_range": [], - "internal_ipv6_prefix_length": 0, - "ipv6_access_config": [], - "ipv6_access_type": "", - "ipv6_address": "", - "name": "nic0", - "network": "https://www.googleapis.com/compute/v1/projects/gen-lang-client-0424120530/global/networks/default", - "network_attachment": "", - "network_ip": "10.128.0.2", - "nic_type": "", - "queue_count": 0, - "stack_type": "IPV4_ONLY", - "subnetwork": "https://www.googleapis.com/compute/v1/projects/gen-lang-client-0424120530/regions/us-central1/subnetworks/default", - "subnetwork_project": "gen-lang-client-0424120530" - } - ], - "network_performance_config": [], - "params": [], - "project": "gen-lang-client-0424120530", - "reservation_affinity": [], - "resource_policies": [], - "scheduling": [ - { - "automatic_restart": true, - "availability_domain": 0, - "instance_termination_action": "", - "local_ssd_recovery_timeout": [], - "max_run_duration": [], - "min_node_cpus": 0, - "node_affinities": [], - "on_host_maintenance": "MIGRATE", - "on_instance_stop_action": [], - "preemptible": false, - "provisioning_model": "STANDARD", - "termination_time": "" - } - ], - "scratch_disk": [], - "self_link": "https://www.googleapis.com/compute/v1/projects/gen-lang-client-0424120530/zones/us-central1-a/instances/sereact-vector-db", - "service_account": [ - { - "email": "vector-db-sa@gen-lang-client-0424120530.iam.gserviceaccount.com", - "scopes": [ - "https://www.googleapis.com/auth/cloud-platform" - ] - } - ], - "shielded_instance_config": [ - { - "enable_integrity_monitoring": true, - "enable_secure_boot": false, - "enable_vtpm": true - } - ], - "tags": [ - "qdrant", - "vector-db" - ], - "tags_fingerprint": "SoSixaaHMG4=", - "terraform_labels": { - "goog-terraform-provisioned": "true" - }, - "timeouts": null, - "zone": "us-central1-a" - }, - "sensitive_attributes": [ - [ - { - "type": "get_attr", - "value": "boot_disk" - }, - { - "type": "index", - "value": { - "value": 0, - "type": "number" - } - }, - { - "type": "get_attr", - "value": "disk_encryption_key_raw" - } - ], - [ - { - "type": "get_attr", - "value": "boot_disk" - }, - { - "type": "index", - "value": { - "value": 0, - "type": "number" - } - }, - { - "type": "get_attr", - "value": "disk_encryption_key_rsa" - } - ], - [ - { - "type": "get_attr", - "value": "metadata_startup_script" - } - ] - ], - "private": "eyJlMmJmYjczMC1lY2FhLTExZTYtOGY4OC0zNDM2M2JjN2M0YzAiOnsiY3JlYXRlIjoxMjAwMDAwMDAwMDAwLCJkZWxldGUiOjEyMDAwMDAwMDAwMDAsInVwZGF0ZSI6MTIwMDAwMDAwMDAwMH0sInNjaGVtYV92ZXJzaW9uIjoiNiJ9", - "dependencies": [ - "google_project_service.services", - "google_service_account.vector_db_sa" - ] - } - ] - }, - { - "mode": "managed", - "type": "google_firestore_database", - "name": "database", - "provider": "provider[\"registry.terraform.io/hashicorp/google\"]", - "instances": [ - { - "schema_version": 0, - "attributes": { - "app_engine_integration_mode": "DISABLED", - "cmek_config": [], - "concurrency_mode": "PESSIMISTIC", - "create_time": "", - "database_edition": "STANDARD", - "delete_protection_state": "DELETE_PROTECTION_DISABLED", - "deletion_policy": "ABANDON", - "earliest_version_time": "2025-05-24T16:11:39.875416Z", - "etag": "II+lnpPHvI0DMNiAssK/vI0D", - "id": "projects/gen-lang-client-0424120530/databases/sereact-imagedb", - "key_prefix": "", - "location_id": "us-central1", - "name": "sereact-imagedb", - "point_in_time_recovery_enablement": "POINT_IN_TIME_RECOVERY_DISABLED", - "project": "gen-lang-client-0424120530", - "timeouts": null, - "type": "FIRESTORE_NATIVE", - "uid": "30634721-c8c7-4673-b605-c1a91dff3eab", - "update_time": "", - "version_retention_period": "3600s" - }, - "sensitive_attributes": [], - "private": "eyJlMmJmYjczMC1lY2FhLTExZTYtOGY4OC0zNDM2M2JjN2M0YzAiOnsiY3JlYXRlIjoxMjAwMDAwMDAwMDAwLCJkZWxldGUiOjEyMDAwMDAwMDAwMDAsInVwZGF0ZSI6MTIwMDAwMDAwMDAwMH19", - "dependencies": [ - "google_project_service.services" - ] - } - ] - }, - { - "mode": "managed", - "type": "google_project_service", - "name": "services", - "provider": "provider[\"registry.terraform.io/hashicorp/google\"]", - "instances": [ - { - "index_key": "cloudresourcemanager.googleapis.com", - "schema_version": 0, - "attributes": { - "disable_dependent_services": null, - "disable_on_destroy": false, - "id": "gen-lang-client-0424120530/cloudresourcemanager.googleapis.com", - "project": "gen-lang-client-0424120530", - "service": "cloudresourcemanager.googleapis.com", - "timeouts": null - }, - "sensitive_attributes": [], - "private": "eyJlMmJmYjczMC1lY2FhLTExZTYtOGY4OC0zNDM2M2JjN2M0YzAiOnsiY3JlYXRlIjoxMjAwMDAwMDAwMDAwLCJkZWxldGUiOjEyMDAwMDAwMDAwMDAsInJlYWQiOjYwMDAwMDAwMDAwMCwidXBkYXRlIjoxMjAwMDAwMDAwMDAwfX0=" - }, - { - "index_key": "compute.googleapis.com", - "schema_version": 0, - "attributes": { - "disable_dependent_services": null, - "disable_on_destroy": false, - "id": "gen-lang-client-0424120530/compute.googleapis.com", - "project": "gen-lang-client-0424120530", - "service": "compute.googleapis.com", - "timeouts": null - }, - "sensitive_attributes": [], - "private": "eyJlMmJmYjczMC1lY2FhLTExZTYtOGY4OC0zNDM2M2JjN2M0YzAiOnsiY3JlYXRlIjoxMjAwMDAwMDAwMDAwLCJkZWxldGUiOjEyMDAwMDAwMDAwMDAsInJlYWQiOjYwMDAwMDAwMDAwMCwidXBkYXRlIjoxMjAwMDAwMDAwMDAwfX0=" - }, - { - "index_key": "containerregistry.googleapis.com", - "schema_version": 0, - "attributes": { - "disable_dependent_services": null, - "disable_on_destroy": false, - "id": "gen-lang-client-0424120530/containerregistry.googleapis.com", - "project": "gen-lang-client-0424120530", - "service": "containerregistry.googleapis.com", - "timeouts": null - }, - "sensitive_attributes": [], - "private": "eyJlMmJmYjczMC1lY2FhLTExZTYtOGY4OC0zNDM2M2JjN2M0YzAiOnsiY3JlYXRlIjoxMjAwMDAwMDAwMDAwLCJkZWxldGUiOjEyMDAwMDAwMDAwMDAsInJlYWQiOjYwMDAwMDAwMDAwMCwidXBkYXRlIjoxMjAwMDAwMDAwMDAwfX0=" - }, - { - "index_key": "firestore.googleapis.com", - "schema_version": 0, - "attributes": { - "disable_dependent_services": null, - "disable_on_destroy": false, - "id": "gen-lang-client-0424120530/firestore.googleapis.com", - "project": "gen-lang-client-0424120530", - "service": "firestore.googleapis.com", - "timeouts": null - }, - "sensitive_attributes": [], - "private": "eyJlMmJmYjczMC1lY2FhLTExZTYtOGY4OC0zNDM2M2JjN2M0YzAiOnsiY3JlYXRlIjoxMjAwMDAwMDAwMDAwLCJkZWxldGUiOjEyMDAwMDAwMDAwMDAsInJlYWQiOjYwMDAwMDAwMDAwMCwidXBkYXRlIjoxMjAwMDAwMDAwMDAwfX0=" - }, - { - "index_key": "run.googleapis.com", - "schema_version": 0, - "attributes": { - "disable_dependent_services": null, - "disable_on_destroy": false, - "id": "gen-lang-client-0424120530/run.googleapis.com", - "project": "gen-lang-client-0424120530", - "service": "run.googleapis.com", - "timeouts": null - }, - "sensitive_attributes": [], - "private": "eyJlMmJmYjczMC1lY2FhLTExZTYtOGY4OC0zNDM2M2JjN2M0YzAiOnsiY3JlYXRlIjoxMjAwMDAwMDAwMDAwLCJkZWxldGUiOjEyMDAwMDAwMDAwMDAsInJlYWQiOjYwMDAwMDAwMDAwMCwidXBkYXRlIjoxMjAwMDAwMDAwMDAwfX0=" - }, - { - "index_key": "storage.googleapis.com", - "schema_version": 0, - "attributes": { - "disable_dependent_services": null, - "disable_on_destroy": false, - "id": "gen-lang-client-0424120530/storage.googleapis.com", - "project": "gen-lang-client-0424120530", - "service": "storage.googleapis.com", - "timeouts": null - }, - "sensitive_attributes": [], - "private": "eyJlMmJmYjczMC1lY2FhLTExZTYtOGY4OC0zNDM2M2JjN2M0YzAiOnsiY3JlYXRlIjoxMjAwMDAwMDAwMDAwLCJkZWxldGUiOjEyMDAwMDAwMDAwMDAsInJlYWQiOjYwMDAwMDAwMDAwMCwidXBkYXRlIjoxMjAwMDAwMDAwMDAwfX0=" - } - ] - }, - { - "mode": "managed", - "type": "google_pubsub_subscription", - "name": "image_processing", - "provider": "provider[\"registry.terraform.io/hashicorp/google\"]", - "instances": [ - { - "schema_version": 0, - "attributes": { - "ack_deadline_seconds": 600, - "bigquery_config": [], - "cloud_storage_config": [], - "dead_letter_policy": [ - { - "dead_letter_topic": "projects/gen-lang-client-0424120530/topics/image-processing-topic-dlq", - "max_delivery_attempts": 5 - } - ], - "effective_labels": { - "component": "image-processing", - "environment": "dev", - "goog-terraform-provisioned": "true", - "service": "sereact" - }, - "enable_exactly_once_delivery": false, - "enable_message_ordering": false, - "expiration_policy": [ - { - "ttl": "2678400s" - } - ], - "filter": "", - "id": "projects/gen-lang-client-0424120530/subscriptions/image-processing-topic-subscription", - "labels": { - "component": "image-processing", - "environment": "dev", - "service": "sereact" - }, - "message_retention_duration": "604800s", - "name": "image-processing-topic-subscription", - "project": "gen-lang-client-0424120530", - "push_config": [], - "retain_acked_messages": false, - "retry_policy": [ - { - "maximum_backoff": "600s", - "minimum_backoff": "10s" - } - ], - "terraform_labels": { - "component": "image-processing", - "environment": "dev", - "goog-terraform-provisioned": "true", - "service": "sereact" - }, - "timeouts": null, - "topic": "projects/gen-lang-client-0424120530/topics/image-processing-topic" - }, - "sensitive_attributes": [], - "private": "eyJlMmJmYjczMC1lY2FhLTExZTYtOGY4OC0zNDM2M2JjN2M0YzAiOnsiY3JlYXRlIjoxMjAwMDAwMDAwMDAwLCJkZWxldGUiOjEyMDAwMDAwMDAwMDAsInVwZGF0ZSI6MTIwMDAwMDAwMDAwMH19", - "dependencies": [ - "google_pubsub_topic.image_processing", - "google_pubsub_topic.image_processing_dlq" - ] - } - ] - }, - { - "mode": "managed", - "type": "google_pubsub_subscription", - "name": "image_processing_dlq", - "provider": "provider[\"registry.terraform.io/hashicorp/google\"]", - "instances": [ - { - "schema_version": 0, - "attributes": { - "ack_deadline_seconds": 10, - "bigquery_config": [], - "cloud_storage_config": [], - "dead_letter_policy": [], - "effective_labels": { - "component": "image-processing-dlq", - "environment": "dev", - "goog-terraform-provisioned": "true", - "service": "sereact" - }, - "enable_exactly_once_delivery": false, - "enable_message_ordering": false, - "expiration_policy": [ - { - "ttl": "2678400s" - } - ], - "filter": "", - "id": "projects/gen-lang-client-0424120530/subscriptions/image-processing-topic-dlq-subscription", - "labels": { - "component": "image-processing-dlq", - "environment": "dev", - "service": "sereact" - }, - "message_retention_duration": "2592000s", - "name": "image-processing-topic-dlq-subscription", - "project": "gen-lang-client-0424120530", - "push_config": [], - "retain_acked_messages": true, - "retry_policy": [], - "terraform_labels": { - "component": "image-processing-dlq", - "environment": "dev", - "goog-terraform-provisioned": "true", - "service": "sereact" - }, - "timeouts": null, - "topic": "projects/gen-lang-client-0424120530/topics/image-processing-topic-dlq" - }, - "sensitive_attributes": [], - "private": "eyJlMmJmYjczMC1lY2FhLTExZTYtOGY4OC0zNDM2M2JjN2M0YzAiOnsiY3JlYXRlIjoxMjAwMDAwMDAwMDAwLCJkZWxldGUiOjEyMDAwMDAwMDAwMDAsInVwZGF0ZSI6MTIwMDAwMDAwMDAwMH19", - "dependencies": [ - "google_pubsub_topic.image_processing_dlq" - ] - } - ] - }, - { - "mode": "managed", - "type": "google_pubsub_subscription_iam_binding", - "name": "image_processing_subscriber", - "provider": "provider[\"registry.terraform.io/hashicorp/google\"]", - "instances": [ - { - "schema_version": 0, - "attributes": { - "condition": [], - "etag": "BwY149eEFPY=", - "id": "projects/gen-lang-client-0424120530/subscriptions/image-processing-topic-subscription/roles/pubsub.subscriber", - "members": [ - "serviceAccount:761163285547-compute@developer.gserviceaccount.com" - ], - "project": null, - "role": "roles/pubsub.subscriber", - "subscription": "image-processing-topic-subscription" - }, - "sensitive_attributes": [], - "private": "bnVsbA==", - "dependencies": [ - "data.google_project.current", - "google_pubsub_subscription.image_processing", - "google_pubsub_topic.image_processing", - "google_pubsub_topic.image_processing_dlq" - ] - } - ] - }, - { - "mode": "managed", - "type": "google_pubsub_topic", - "name": "image_processing", - "provider": "provider[\"registry.terraform.io/hashicorp/google\"]", - "instances": [ - { - "schema_version": 0, - "attributes": { - "effective_labels": { - "component": "image-processing", - "environment": "dev", - "goog-terraform-provisioned": "true", - "service": "sereact" - }, - "id": "projects/gen-lang-client-0424120530/topics/image-processing-topic", - "ingestion_data_source_settings": [], - "kms_key_name": "", - "labels": { - "component": "image-processing", - "environment": "dev", - "service": "sereact" - }, - "message_retention_duration": "", - "message_storage_policy": [], - "name": "image-processing-topic", - "project": "gen-lang-client-0424120530", - "schema_settings": [], - "terraform_labels": { - "component": "image-processing", - "environment": "dev", - "goog-terraform-provisioned": "true", - "service": "sereact" - }, - "timeouts": null - }, - "sensitive_attributes": [], - "private": "eyJlMmJmYjczMC1lY2FhLTExZTYtOGY4OC0zNDM2M2JjN2M0YzAiOnsiY3JlYXRlIjoxMjAwMDAwMDAwMDAwLCJkZWxldGUiOjEyMDAwMDAwMDAwMDAsInVwZGF0ZSI6MTIwMDAwMDAwMDAwMH19" - } - ] - }, - { - "mode": "managed", - "type": "google_pubsub_topic", - "name": "image_processing_dlq", - "provider": "provider[\"registry.terraform.io/hashicorp/google\"]", - "instances": [ - { - "schema_version": 0, - "attributes": { - "effective_labels": { - "component": "image-processing-dlq", - "environment": "dev", - "goog-terraform-provisioned": "true", - "service": "sereact" - }, - "id": "projects/gen-lang-client-0424120530/topics/image-processing-topic-dlq", - "ingestion_data_source_settings": [], - "kms_key_name": "", - "labels": { - "component": "image-processing-dlq", - "environment": "dev", - "service": "sereact" - }, - "message_retention_duration": "", - "message_storage_policy": [], - "name": "image-processing-topic-dlq", - "project": "gen-lang-client-0424120530", - "schema_settings": [], - "terraform_labels": { - "component": "image-processing-dlq", - "environment": "dev", - "goog-terraform-provisioned": "true", - "service": "sereact" - }, - "timeouts": null - }, - "sensitive_attributes": [], - "private": "eyJlMmJmYjczMC1lY2FhLTExZTYtOGY4OC0zNDM2M2JjN2M0YzAiOnsiY3JlYXRlIjoxMjAwMDAwMDAwMDAwLCJkZWxldGUiOjEyMDAwMDAwMDAwMDAsInVwZGF0ZSI6MTIwMDAwMDAwMDAwMH19" - } - ] - }, - { - "mode": "managed", - "type": "google_pubsub_topic_iam_binding", - "name": "image_processing_publisher", - "provider": "provider[\"registry.terraform.io/hashicorp/google\"]", - "instances": [ - { - "schema_version": 0, - "attributes": { - "condition": [], - "etag": "BwY149EL9pk=", - "id": "projects/gen-lang-client-0424120530/topics/image-processing-topic/roles/pubsub.publisher", - "members": [ - "serviceAccount:761163285547-compute@developer.gserviceaccount.com" - ], - "project": "gen-lang-client-0424120530", - "role": "roles/pubsub.publisher", - "topic": "projects/gen-lang-client-0424120530/topics/image-processing-topic" - }, - "sensitive_attributes": [], - "private": "bnVsbA==", - "dependencies": [ - "data.google_project.current", - "google_pubsub_topic.image_processing" - ] - } - ] - }, - { - "mode": "managed", - "type": "google_service_account", - "name": "vector_db_sa", - "provider": "provider[\"registry.terraform.io/hashicorp/google\"]", - "instances": [ - { - "schema_version": 0, - "attributes": { - "account_id": "vector-db-sa", - "create_ignore_already_exists": null, - "description": "Service account for the vector database VM", - "disabled": false, - "display_name": "Vector Database Service Account", - "email": "vector-db-sa@gen-lang-client-0424120530.iam.gserviceaccount.com", - "id": "projects/gen-lang-client-0424120530/serviceAccounts/vector-db-sa@gen-lang-client-0424120530.iam.gserviceaccount.com", - "member": "serviceAccount:vector-db-sa@gen-lang-client-0424120530.iam.gserviceaccount.com", - "name": "projects/gen-lang-client-0424120530/serviceAccounts/vector-db-sa@gen-lang-client-0424120530.iam.gserviceaccount.com", - "project": "gen-lang-client-0424120530", - "timeouts": null, - "unique_id": "115427142677021446795" - }, - "sensitive_attributes": [], - "private": "eyJlMmJmYjczMC1lY2FhLTExZTYtOGY4OC0zNDM2M2JjN2M0YzAiOnsiY3JlYXRlIjozMDAwMDAwMDAwMDB9fQ==" - } - ] - }, - { - "mode": "managed", - "type": "google_storage_bucket", - "name": "app_bucket", - "provider": "provider[\"registry.terraform.io/hashicorp/google\"]", - "instances": [ - { - "schema_version": 3, - "attributes": { - "autoclass": [], - "cors": [], - "custom_placement_config": [], - "default_event_based_hold": false, - "effective_labels": { - "goog-terraform-provisioned": "true" - }, - "enable_object_retention": false, - "encryption": [], - "force_destroy": false, - "hierarchical_namespace": [ - { - "enabled": false - } - ], - "id": "sereact-images", - "labels": {}, - "lifecycle_rule": [], - "location": "US-CENTRAL1", - "logging": [], - "name": "sereact-images", - "project": "gen-lang-client-0424120530", - "project_number": 761163285547, - "public_access_prevention": "inherited", - "requester_pays": false, - "retention_policy": [], - "rpo": null, - "self_link": "https://www.googleapis.com/storage/v1/b/sereact-images", - "soft_delete_policy": [ - { - "effective_time": "2025-05-24T16:00:44.092Z", - "retention_duration_seconds": 604800 - } - ], - "storage_class": "STANDARD", - "terraform_labels": { - "goog-terraform-provisioned": "true" - }, - "time_created": "2025-05-24T16:00:44.092Z", - "timeouts": null, - "uniform_bucket_level_access": true, - "updated": "2025-05-24T16:00:44.092Z", - "url": "gs://sereact-images", - "versioning": [], - "website": [] - }, - "sensitive_attributes": [], - "private": "eyJlMmJmYjczMC1lY2FhLTExZTYtOGY4OC0zNDM2M2JjN2M0YzAiOnsiY3JlYXRlIjo2MDAwMDAwMDAwMDAsInJlYWQiOjI0MDAwMDAwMDAwMCwidXBkYXRlIjoyNDAwMDAwMDAwMDB9LCJzY2hlbWFfdmVyc2lvbiI6IjMifQ==", - "dependencies": [ - "google_project_service.services" - ] - } - ] - } - ], + "outputs": {}, + "resources": [], "check_results": null } diff --git a/deployment/terraform/terraform.tfvars.example b/deployment/terraform/terraform.tfvars.example index d8f81d6..fc73105 100644 --- a/deployment/terraform/terraform.tfvars.example +++ b/deployment/terraform/terraform.tfvars.example @@ -7,4 +7,10 @@ firestore_db_name = "sereact-imagedb" # Vector Database Configuration qdrant_api_key = "your-secure-api-key-here" # Optional: leave empty for no authentication allowed_cidr_blocks = "YOUR_IP_ADDRESS/32" # Replace with your IP or network range -use_static_ip = false # Set to true if you want a static IP \ No newline at end of file +use_static_ip = false # Set to true if you want a static IP + +# Secret Configuration (all optional - random values will be generated if not provided) +api_key_secret = "" # Optional: will generate random key if empty +vector_db_api_key = "" # Optional: for external vector DB like Pinecone +gcs_credentials_json = "" # Optional: JSON content of GCS service account key +firestore_credentials_json = "" # Optional: JSON content of Firestore service account key \ No newline at end of file