Conversation
Adds an ECS-on-EC2 fleet for the gateway beside the Fargate one, selected by MAPLE_INGEST_FLEETS (fargate | ec2 | fargate,ec2; unset = fargate). - c7gd.large (Graviton3, 118 GB NVMe) in an ASG behind an ECS capacity provider with managed scaling and managed draining. userData mounts the instance store at /mnt/wal and only then joins the cluster. - Host networking, one task per instance: an awsvpc task on EC2 cannot take a public IP, and this VPC has no NAT by design. The ALB targets instances; the instance SG admits only the ALB on the gateway port. - The WAL dir is a bind mount of the NVMe, so per-frame fsync no longer goes to network-backed Fargate storage. - alchemy patch: ECS.Service omits awsvpcConfiguration and uses an instance target group for non-awsvpc tasks; an ASG update with no desiredCapacity leaves the live value to ECS managed scaling. - Previews opt in with the preview:ingest-ec2 label.
|
Important Draft PR not reviewedDraft PRs are not automatically reviewed by default.
To automatically review draft PRs, update your CodeRabbit configuration: reviews:
auto_review:
drafts: trueComment |
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.
Depends on #936. Instance-store NVMe is wiped when an instance is replaced, so the WAL's S3 tier has to work before anything runs here.
What
An ECS-on-EC2 fleet for the ingest gateway, beside the Fargate one.
MAPLE_INGEST_FLEETSpicks which fleets run:fargate,ec2, orfargate,ec2. Unset meansfargate, so merging this changes nothing in prd.c7gd.large(Graviton3, 2 vCPU / 4 GiB, 118 GB NVMe instance store), ECS-optimized AL2023 arm64 AMI, in an ASG behind an ECS capacity provider with managed scaling and managed draining. Access is through Session Manager, with no key pair and no port 22./mnt/wal, and only then writesECS_CLUSTER. A host whose disk didn't come up never gets a task. The task bind-mounts it at the gateway's default WAL dir.awsvpctask on EC2 can't take a public IP, and this VPC has no NAT gateway by design. With host networking the task uses the instance's public IP. The ALB targets instances, and the instance security group admits only the ALB on 3474. A rolling deploy puts the new task on a fresh host (the old task holds the port) and drains the old one through the existing SIGTERM WAL drain. New AMIs roll out with deploys the same way.alchemy patch (
patches/alchemy@2.0.0-beta.77.patch)ECS.Service: for tasks that aren'tawsvpc, omitnetworkConfiguration(ECS rejects it) and create aninstancetarget group instead ofip.AutoScalingGroup: an update with nodesiredCapacityleaves the live value alone. Before, every deploy reset it tominSize, which would undo ECS managed scaling.Cutover plan
preview+preview:collector+preview:ingest-ec2.ingest-preview-verify.shtargets the EC2 service when that label is set.MAPLE_INGEST_FLEETS=fargate,ec2in Infisical prd and deploy. The EC2 ALB comes out as theingestEc2ServiceUrloutput.ingest.maple.devCNAME at the EC2 ALB. Cloudflare flips it instantly, and pointing it back is the rollback.MAPLE_INGEST_FLEETS=ec2to delete the Fargate service and its ALB.Not verified
alchemy planor deploy has run yet; the local AWS session can't reach the deploy account. Step 2 is the first real check.AWS_DEPLOY_ROLE_ARNhasautoscaling:*,ec2:CreateLaunchTemplate*,iam:PassRoleon the instance role, andecs:CreateCapacityProvider.ecs.config) relies on the AL2023 ECS AMI startingecs.serviceafter cloud-init runs user data. That's the documented pattern, but it hasn't been run here yet.Follow-ups
Need help on this PR? Tag
@codesmith-botwith what you need. Autofix is disabled.