Repository navigation
daytrader-go: infra - #3
Open
devin-ai-integration[bot] wants to merge 1 commit into
Open
devin-ai-integration[bot] wants to merge 1 commit into
devin-ai-integration[bot] wants to merge 1 commit into
Conversation
Author
|
I'll fix CI failures and address comments from users with write access. I'll skip comments containing "(aside)".
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Infra workstream for the Go + PostgreSQL target: container image, a compose override that runs it next to PostgreSQL, and Terraform for ECS Fargate. No Go code and no shared scaffold file is touched.
Container
daytrader-go/Dockerfile:golang:1.27-alpinebuild stage (matchesgo.mod),CGO_ENABLED=0static binary; runtimegcr.io/distroless/static-debian12:nonroot,USER 65532:65532,EXPOSE 8080,ENTRYPOINT ["/daytrader"],CMD ["serve"].daytrader-go/compose.app.yaml: addsapp(built from the Dockerfile,DATABASE_URLpointing atpostgres:5432,8080:8080,depends_onpostgres healthy).Terraform (
infra/terraform/, thin root +network,alb,ecs,rds)network: VPC, public and private subnets over 2 AZs, one NAT gateway, three security groups chained internet -> alb -> app (8080) -> database (5432). The database group has no egress; the default group is emptied.alb: target group (ip targets) with health check/daytrader/healthandlb_cookiestickiness (sessions are in process memory). HTTP on 80 by default; settingcertificateArnswitches to HTTPS on 443 with an HTTP redirect.ecs: ECR repository, Fargate cluster, task definition (port 8080,awslogs,user = 65532:65532, read-only root filesystem), service in private subnets.DATABASE_URLis a task secret from Secrets Manager; every TradeConfig variable indaytrader-go/README.mdis an SSM parameter injected throughsecrets. SQS queue plus dead-letter queue forORDER_QUEUE_URL;ORDER_PROCESSING_MODEdefaults tosync.rds: Aurora PostgreSQL Serverless v2 in private subnets, encrypted, and the Secrets Manager secret holding the fullDATABASE_URL.AmazonECSTaskExecutionRolePolicy); the task role only reaches the order queue.Observed
docker compose ... up -d --build --waitapphealthyGET /daytrader/healthon the container{"database":"UP","orderProcessingMode":"sync","status":"UP"}docker inspect:User=65532:65532;docker top: process uid 65532buildDBTables200,buildDB200; 15000 accounts, 10000 quotesterraform fmt -check -recursive,init -backend=false,validatedocs/TERRAFORM_VALIDATE.txtgofmt -l .,go vet ./...,go test ./...(ingolang:1.27-alpine)Parity scenarios that PASS: none. This workstream has no target scenarios.
make parityagainst the container built from this branch alone (scaffold, no feature handlers) printed DIFF or ERROR for all 13, as expected. It was not run combined with sibling branches, and the Liberty baseline was not started.Nothing was planned or applied, and no AWS credentials or backend were used.
Differences on purpose and things to review
docs/TARGET_STATE.md: modules sit atinfra/terraform/{network,alb,ecs,rds}, not undermodules/.random_password, so it and the composedDATABASE_URLlive in Terraform state. An encrypted remote backend is needed before any real use. RDS-managed master credentials were not used because that secret is JSON and the binary reads a single URL.desiredCountdefaults to 1 because sessions are in memory..terraform.lock.hclis committed (aws 5.100.0, random 3.9.1).Scaffold requests
None.
Link to Devin session: https://partner-workshops.devinenterprise.com/sessions/b9c6d6fd68b84392b4833e57d2645532
Open in Devin Desktop: https://partner-workshops.devinenterprise.com/desktop/session/b9c6d6fd68b84392b4833e57d2645532?variant=devin
Requested by: @sumitshatwara