Repository navigation
rag-ide: EC2 and local Docker platforms - #5
Merged
Merged
Conversation
…per learner) --param platform=ec2 launches a single instance with a pinned lab image built from a verified git commit, a container per learner (unprivileged, capped, capabilities dropped), Caddy for HTTPS on an sslip.io name, a security group with only 80/443, IMDSv2 with hop limit 1, no instance profile, a hard time cap and self-shutdown when no learner is left. The account must be on the labagent allow list. Not yet run against a real AWS account. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
…uilder) The classic Docker builder (Ubuntu's docker.io has no BuildKit) creates WORKDIR as root even after USER, so 'labagent rag init' failed with a PermissionError on the first real EC2 boot. Create and chown the directory before switching user. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
…n resume platform=local runs the same one-container-per-learner lab on this machine through Docker (loopback ports, same credentials file and destroy), for demos and tests. Two bugs found by the first real EC2 run: - readiness check verified the certificate, so tls=internal could never become ready - passwords lived only in memory until the last step, so a failure after the instance started lost them; the credentials file is now written as soon as learners exist Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
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.
What this adds
labagent launch rag-idegains two platforms next to Modal (--param platform=modal|ec2|local):ec2: ONE shared instance per cohort, one container per learner, a fraction of the cost of per-learner serverless sandboxes.ref, 40-hex SHA).no-new-privileges.https://<ip>.sslip.io/<learner>/(Let's Encrypt, ortls=internal). Only ports 80/443 are open: no SSH, no instance profile, IMDSv2 with hop limit 1.hours, and self-shutdown when no learner container is running. Instances terminate on shutdown.DescribeImages.destroyterminates the instance (also orphans by tag) and removes the security group.local: the same lab on this machine through Docker, loopback ports only, same steps/credentials/destroy. For demos and tests.Found and fixed by the first real EC2 runs
Dockerfile.lab: the classic Docker builder (Ubuntudocker.io, no BuildKit) createsWORKDIRas root even afterUSER, solabagent rag initfailed on the box. Directory is now chowned beforeUSER. Reproduced locally withDOCKER_BUILDKIT=0; regression test added.tls=internalcould never become ready.scripts/check_no_pii.py: one scoped exception for Canonical's public AMI publisher id (the scanner still flags every other 12-digit number).Verified
ps, clean destroy.tls=internal): booted in ~6 min, image built, both learner IDEs reachable at their path, login accepted/rejected correctly, HTTP redirects to HTTPS, workbench page and assets served through the path prefix.bash -n; generated Caddyfile passescaddy validate.NOT verified yet
sslip.io(shared-name rate limits are a risk); onlytls=internalran on EC2.The lab image pin (
PINNED_REF) points at commit 737a284 in this PR; merging with a merge commit keeps that SHA inmainhistory.🤖 Generated with Claude Code