Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Features
Speaker Deck
PRO
Sign in
Sign up for free
Search
Search
DIY: your own PaaS using Python
Search
SysFera
October 17, 2012
Programming
1
410
DIY: your own PaaS using Python
Talk presented during OSDC.fr 2012 (OpenWorld Forum).
Don't do that, just use an existing PaaS ;)
SysFera
October 17, 2012
Tweet
Share
More Decks by SysFera
See All by SysFera
SysFera-DS @ ROMEO-CRIHAN
sysfera
0
67
Le développement SaaSvite fait, bien fait
sysfera
2
100
API : point-clé du succès de votre application en SaaS
sysfera
2
89
Comment bien mettre en place son Business Model SaaS
sysfera
1
680
Webinar : Développement d'Applications, les enjeux technologiques du SaaS #2
sysfera
0
160
Webinar : Développement d'Applications, les enjeux technologiques du SaaS
sysfera
0
52
SysFera-DS: Platform for HPCaaS
sysfera
1
140
ZeroMQ: Scale Up !
sysfera
1
420
The Decrypthon Project : Helping Cure Muscular Distrophy Through Grid And Volunteer Computing
sysfera
0
67
Other Decks in Programming
See All in Programming
Workers を定期実行する方法は一つじゃない
rokuosan
0
130
Understanding Kotlin Multiplatform
l2hyunwoo
0
240
テスターからテストエンジニアへ ~新米テストエンジニアが歩んだ9ヶ月振り返り~
non0113
2
250
Git Sync を超える!OSS で実現する CDK Pull 型デプロイ / Deploying CDK with PipeCD in Pull-style
tkikuc
4
490
オンコール⼊⾨〜ページャーが鳴る前に、あなたが備えられること〜 / Before The Pager Rings
yktakaha4
2
1.2k
JetBrainsのAI機能の紹介 #jjug
yusuke
0
160
TypeScriptでDXを上げろ! Hono編
yusukebe
4
890
decksh - a little language for decks
ajstarks
4
21k
型で語るカタ
irof
1
880
DynamoDBは怖くない!〜テーブル設計の勘所とテスト戦略〜
hyamazaki
0
100
DataformでPythonする / dataform-de-python
snhryt
0
110
[SRE NEXT] 複雑なシステムにおけるUser Journey SLOの導入
yakenji
1
860
Featured
See All Featured
Git: the NoSQL Database
bkeepers
PRO
431
65k
For a Future-Friendly Web
brad_frost
179
9.8k
Side Projects
sachag
455
43k
Evolution of real-time – Irina Nazarova, EuRuKo, 2024
irinanazarova
8
860
CSS Pre-Processors: Stylus, Less & Sass
bermonpainter
357
30k
Chrome DevTools: State of the Union 2024 - Debugging React & Beyond
addyosmani
7
770
Creating an realtime collaboration tool: Agile Flush - .NET Oxford
marcduiker
30
2.2k
What's in a price? How to price your products and services
michaelherold
246
12k
Measuring & Analyzing Core Web Vitals
bluesmoon
7
530
[Rails World 2023 - Day 1 Closing Keynote] - The Magic of Rails
eileencodes
35
2.5k
CoffeeScript is Beautiful & I Never Want to Write Plain JavaScript Again
sstephenson
161
15k
Speed Design
sergeychernyshev
32
1k
Transcript
Do It Yourself: Your Own PaaS in Python whoami
Wuts teh PaaS ting ?
Dis ar teh Clown Computin U sign ? U haz
providerz ?
Y mak ur pwn PaaS ? self-hosting ! better understanding
of PaaS platforms It's fun !
PaaS architecture Teh devlopment workflow 1. write code 2. test
code 3. commit code 4. push code 5. QA test 6. tag release (production)
Y U LIE ? Points 2. & 5. from previous
slides are obvious lies because it looks good and it pleases managers ! Wat do u ned ? machines applicative stack DNS server orchestration framework SCM API
Git Ur Toolbox RDY !
DNS Server Bind dynamic DNS nsupdate update delete <my_app>.<my_domain> A
update add <my_app>.<my_domain> 180 A <node_ip>
SCM git gitolite Gitolite ? SSH proxy no real user,
no shell access fine-grained control access to repository
Applicative stack virtualenv pip WSGI ! virtualenv --no-site-packages <my_app> source
bin/activate pip -r requirements.txt gunicorn <my_app>:app
Orchestration install/remove/update packages edit configuration files upload/download files start/stop/monitor services
etc ... many choices CFEngine/Puppet/Chef/Salt/Ansible etc. Fabric !
Fabric Wut Wut ? Python module command-line tool: fab SSH-based
Principels tasks hosts
I CAN HAZ ? from fabric.api import * def update():
""" update machine using yum """ with settings(hide('running', 'stdout', 'stderr', 'warnings'), warn_only=True): sudo("yum -y update") fab -H <use>@<my_node> update
RLY Thaz all ? Awsome ! can be used with
command-line (auto-documented !) can be used in Python code Web API !
Web API ! REST CRUD Twisted event-based network engine Easy
to create web services ! a sample CRUD application
a sample CRUD application import sys from twisted.internet import reactor,
server, resource, http class Persona(resource.Resource): def __init__(): pass def render_GET(self, request): # request contains all parameters # you crunch it and return res return res def render_PUT(self, request): pass a sample CRUD application def render_DELETE(self, request): pass def render_POST(self, request): pass def render_UPDATE(self, request): pass if __name__ == "__main___"": root = resource.Resource() persona = Persona() root.putChild('persona', persona) reactor.listenTCP(80, server.Site(root) U no machines ?
U no machines ? erm ... IaaS is in da
place Boto fire new cloud instances very eazy
very eazy import boto import boto.ec2 conn = boto.conn_ec2() reservations
= conn.run_instances(**<dict_of_conf>) conn.terminate_instances(<list_of_ids>) Conclusion