Jump to content
Main menu
Main menu
move to sidebar
hide
Navigation
Main page
Recent changes
Random page
freem
Search
Search
Appearance
Create account
Log in
Personal tools
Create account
Log in
Pages for logged out editors
learn more
Contributions
Talk
Editing
Openai/694ab010-3e7c-8000-b0e8-b98c22b7a063
(section)
Add languages
Page
Discussion
English
Read
Edit
Edit source
View history
Tools
Tools
move to sidebar
hide
Actions
Read
Edit
Edit source
View history
General
What links here
Related changes
Special pages
Page information
Appearance
move to sidebar
hide
Warning:
You are not logged in. Your IP address will be publicly visible if you make any edits. If you
log in
or
create an account
, your edits will be attributed to your username, along with other benefits.
Anti-spam check. Do
not
fill this in!
==== There are two ECS “compute” modes: ==== * ECS on EC2: you manage worker EC2 instances inside your cluster * ECS on Fargate: AWS runs the worker machines for you (simpler) For a beginner: use Fargate. ===== AWS Console: ===== * ECS → Clusters → Create cluster * “Networking only (Fargate)” or equivalent * Name: ml-chatbot-cluster ===== ECS → Task Definitions → Create ===== * Launch type: Fargate * CPU/Memory: start small (e.g., 0.25 vCPU / 0.5GB or 1GB) * Container: - Image URI: 123456789012.dkr.ecr.us-east-1.amazonaws.com/ml-chatbot:latest - Container port: 8501 - Environment variables: - OPENAI_API_KEY = your key (for demo) Important security note: For real deployments, you should NOT store secrets in plain env vars in the task definition. Use AWS Secrets Manager. For learning, env var is acceptable. ===== In the cluster: ===== * Create Service * Launch type: Fargate * Task definition: select your task def * Desired tasks: 1 * Networking: - VPC: default is fine for demo - Subnets: 2+ subnets recommended - Security group inbound: - allow port 8501 from your IP (or from ALB if you attach one) ===== If you expose Fargate tasks directly, you end up with awkward networking and changing IPs. The standard is: ===== ALB (public) → Target Group → ECS Service tasks In the service creation wizard, enable Load Balancer: * Create ALB * Listener: HTTP 80 (or HTTPS 443 later) * Target group: port 8501 * Health check path: / (Streamlit returns 200 on /) Then you access: <syntaxhighlight>http://ALB_DNS_NAME </syntaxhighlight> ===== ECS → Tasks → select running task → Logs ===== If you configured CloudWatch logs in the task definition, you will see Streamlit output there.
Summary:
Please note that all contributions to freem are considered to be released under the Creative Commons Attribution-ShareAlike 4.0 (see
Freem:Copyrights
for details). If you do not want your writing to be edited mercilessly and redistributed at will, then do not submit it here.
You are also promising us that you wrote this yourself, or copied it from a public domain or similar free resource.
Do not submit copyrighted work without permission!
Cancel
Editing help
(opens in new window)