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
400
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
66
Le développement SaaSvite fait, bien fait
sysfera
2
100
API : point-clé du succès de votre application en SaaS
sysfera
2
86
Comment bien mettre en place son Business Model SaaS
sysfera
1
630
Webinar : Développement d'Applications, les enjeux technologiques du SaaS #2
sysfera
0
150
Webinar : Développement d'Applications, les enjeux technologiques du SaaS
sysfera
0
47
SysFera-DS: Platform for HPCaaS
sysfera
1
140
ZeroMQ: Scale Up !
sysfera
1
410
The Decrypthon Project : Helping Cure Muscular Distrophy Through Grid And Volunteer Computing
sysfera
0
64
Other Decks in Programming
See All in Programming
TypeScript Graph でコードレビューの心理的障壁を乗り越える
ysk8hori
2
1.1k
CSC509 Lecture 09
javiergs
PRO
0
140
Macとオーディオ再生 2024/11/02
yusukeito
0
370
RubyLSPのマルチバイト文字対応
notfounds
0
120
EMになってからチームの成果を最大化するために取り組んだこと/ Maximize team performance as EM
nashiusagi
0
100
受け取る人から提供する人になるということ
little_rubyist
0
230
CSC509 Lecture 11
javiergs
PRO
0
180
役立つログに取り組もう
irof
28
9.6k
LLM生成文章の精度評価自動化とプロンプトチューニングの効率化について
layerx
PRO
2
190
Jakarta EE meets AI
ivargrimstad
0
110
CSC509 Lecture 13
javiergs
PRO
0
110
Jakarta EE meets AI
ivargrimstad
0
650
Featured
See All Featured
Bash Introduction
62gerente
608
210k
ピンチをチャンスに:未来をつくるプロダクトロードマップ #pmconf2020
aki_iinuma
109
49k
Large-scale JavaScript Application Architecture
addyosmani
510
110k
How to Think Like a Performance Engineer
csswizardry
20
1.1k
Fontdeck: Realign not Redesign
paulrobertlloyd
82
5.2k
StorybookのUI Testing Handbookを読んだ
zakiyama
27
5.3k
個人開発の失敗を避けるイケてる考え方 / tips for indie hackers
panda_program
93
16k
Design and Strategy: How to Deal with People Who Don’t "Get" Design
morganepeng
126
18k
Docker and Python
trallard
40
3.1k
Fashionably flexible responsive web design (full day workshop)
malarkey
405
65k
We Have a Design System, Now What?
morganepeng
50
7.2k
Rebuilding a faster, lazier Slack
samanthasiow
79
8.7k
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