Agenda
The problem
cloudlift, our solution
Learnings
Q & A
Slide 10
Slide 10 text
Simpl
Virtual CC
for users
make money simple, so that people can live well and do amazing things.
PG for
merchants
We enable payment without banks
Slide 11
Slide 11 text
Platform
Simpl
Merchant servers
to API
Merchant apps
SDKs
Merchant apps
Sim
pl user facing
Apps
Slide 12
Slide 12 text
Simpl architecture
Services
Streaming
Platform
Data
Pipeline
Dashboards
Analytics
ML models
Merchant
Apps
Simpl
Website
Different tech stacks
Scalability requirements Security requirements
services
Slide 13
Slide 13 text
So…
Four tech stacks (RoR, GoLang, Node, Python)
Five developers. No (Dev)Ops
Scaling needs are different
Security needs are different
Centralized logging
Centralized config management
Slide 14
Slide 14 text
We wanted a solution, that….
Multiple tech stacks
No (Dev)Ops. Easy to use
Standard stack across platform
Customizable standard
Config management tools
• Using Chef/puppet/Terraform etc.
• Heavy-weight. Highly customizable leading to complex
codebase.
• Platform architecture being reflected.
• Every change in service communications could require
change in DevOps platform
Slide 17
Slide 17 text
PaaS
• Easier to get started
• No way to customize
• Microservices: Internal vs external
• Costly
Slide 18
Slide 18 text
PaaS is force-fitting
IaaS is hard
What did we do…
Slide 19
Slide 19 text
Or something in-between
Cook or Buy
Slide 20
Slide 20 text
Build a PaaS on IaaS
Slide 21
Slide 21 text
Cloudformation
• Infra as code
• AWS specific
• Resources defined in template and applied
• Idempotent
Slide 22
Slide 22 text
Cloudformation template
Slide 23
Slide 23 text
ECS
• ECS: Elastic Container Service
• Orchestrator engine to run containers
• Runs on cluster of EC2 instances
• Exposes API to run/stop/scale containers
• Container repository to push images
Slide 24
Slide 24 text
Service
Task definition
✓ Network mode
✓ Constraints
Container definition
✓ ECR image version
✓ Env vars
✓ Port mapping
✓ Command to run
✓ Logs
✓ Cluster i.e. set of EC2 instances
✓ Number of tasks
✓ High availability deployment
✓ Task placement
✓ Load balancing (ELB/ALB)
✓ Autoscaling
ECS terms
✓ECR: EC2 Container registry
✓ELB: Elastic load balancer
✓ALB: Application load balancer
✓Port mapping
✓ Container port <-> Container instance port
✓ Can be dynamic
✓Task placement
✓ AZ Balanced spread
✓ One Task per Host
✓ BinPack
✓Constraints
✓ allow you to filter the instances
✓ using built-in or custom attributes
✓Network mode
✓ Bridge/Host etc.
✓Tasks run from Task definition
✓Containers run from Container definition
Slide 25
Slide 25 text
Demo
Creating a service
Deploying the service
Scaling it
Monitoring & logs
Slide 26
Slide 26 text
Cloudlift architecture
click library
(cli -> Python methods)
Boto
Python code to AWS api
Cloudformation
template
Slide 27
Slide 27 text
Cloudlift
• Built by two developers at Simpl & in production use
• Used in a heroku style. (Yeah. You can call it heroic style ;))
• Fully customizable
• Open sourced
Slide 28
Slide 28 text
What happens on deploy_service ?
Push local docker
image to ECR
Ensure S3 has all
required config
env.sample
Docker registry
ECR
Update the task definition with
image version & env vars
ECS runs new containers with updated version
Stops the old version once new are up
★ The service name is guessed from current dir
★ image name is same as repo name in
spinal case without simpl- prefix
★ latest version is picked to push
1
2
3
4
5
Slide 29
Slide 29 text
A solution
Multiple tech stacks
No (Dev)Ops. Easy to
use
Standard stack across
platform
Customizable standard
Docker
}Cloudformation
CLI
Slide 30
Slide 30 text
Show me code
Slide 31
Slide 31 text
Learnings
Slide 32
Slide 32 text
Microservices & DevOps
- Keep it lightweight
- Treat service creation/removal a frequent thing to do
- Empower developers
Slide 33
Slide 33 text
Microservices & DevOps
- Build time dependency => library
- Runtime dependency => another microservice
- Lifecycle dependency => DevOps
Slide 34
Slide 34 text
ECS is not batteries-included.
Simple and does the job. Well.
Slide 35
Slide 35 text
Never hand-code Cloudformation
template
Slide 36
Slide 36 text
Bake-in monitoring and alerts
Slide 37
Slide 37 text
Treat secrets and other configurations same.
Slide 38
Slide 38 text
12 factor apps
Env var config
Port binding
Dev/prod parity
Logs as event streams
Slide 39
Slide 39 text
Prefer CLI over GUI
Building CLI is easier
Easier to integrate in CI tools
Security