From 79eec78279c5e9dc35a0ad62d3d28dd9d5ca5801 Mon Sep 17 00:00:00 2001 From: Andy Miles Date: Thu, 5 Dec 2024 17:11:27 -0800 Subject: [PATCH] added chromadb --- pyproject.toml | 1 + terraform/main.tf | 61 ++++++++++++++++++++++++----------------------- 2 files changed, 32 insertions(+), 30 deletions(-) diff --git a/pyproject.toml b/pyproject.toml index 75f2124..fcdbec9 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -10,6 +10,7 @@ packages = [{include = "tfgha", from = "src"}] python = "^3.10" duckdb = "^1.1.3" flask = "^3.1.0" +chromadb = "^0.5.23" [build-system] requires = ["poetry-core"] diff --git a/terraform/main.tf b/terraform/main.tf index 9eba27f..67ab534 100644 --- a/terraform/main.tf +++ b/terraform/main.tf @@ -2,35 +2,35 @@ provider "aws" { region = "us-west-2" } - resource "aws_key_pair" "deployer" { - key_name = "deployer-key" - public_key = file("id_rsa.pub") - } +resource "aws_key_pair" "deployer" { + key_name = "deployer-key" + public_key = file("id_rsa.pub") +} - resource "aws_security_group" "allow_ssh" { - name = "allow_ssh" - description = "Allow SSH inbound traffic" +resource "aws_security_group" "allow_ssh" { + name = "allow_ssh" + description = "Allow SSH inbound traffic" - ingress { - from_port = 22 - to_port = 22 - protocol = "tcp" - cidr_blocks = ["0.0.0.0/0"] - } + ingress { + from_port = 22 + to_port = 22 + protocol = "tcp" + cidr_blocks = ["0.0.0.0/0"] + } - egress { - from_port = 0 - to_port = 0 - protocol = "-1" - cidr_blocks = ["0.0.0.0/0"] - } - } + egress { + from_port = 0 + to_port = 0 + protocol = "-1" + cidr_blocks = ["0.0.0.0/0"] + } +} resource "aws_instance" "py_server" { ami = "ami-06946f6c9b153d494" instance_type = "t2.micro" - key_name = aws_key_pair.deployer.key_name - user_data = <<-EOF + key_name = aws_key_pair.deployer.key_name + user_data = <<-EOF #!/bin/bash PROJ=tfgha sudo apt-get update @@ -53,8 +53,9 @@ resource "aws_instance" "py_server" { Name = "FlaskAppInstance" } - vpc_security_group_ids = [aws_security_group.allow_http.id, - aws_security_group.allow_ssh.id] + vpc_security_group_ids = [ + aws_security_group.allow_http.id, aws_security_group.allow_ssh.id + ] } resource "aws_security_group" "allow_http" { @@ -62,16 +63,16 @@ resource "aws_security_group" "allow_http" { description = "Allow inbound HTTP traffic" ingress { - from_port = 5000 - to_port = 5000 - protocol = "tcp" + from_port = 5000 + to_port = 5000 + protocol = "tcp" cidr_blocks = ["0.0.0.0/0"] } egress { - from_port = 0 - to_port = 0 - protocol = "-1" + from_port = 0 + to_port = 0 + protocol = "-1" cidr_blocks = ["0.0.0.0/0"] } }