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
87
Comment bien mettre en place son Business Model SaaS
sysfera
1
640
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
66
Other Decks in Programming
See All in Programming
サーバーゆる勉強会 DBMS の仕組み編
kj455
1
300
ecspresso, ecschedule, lambroll を PipeCDプラグインとして動かしてみた (プロトタイプ) / Running ecspresso, ecschedule, and lambroll as PipeCD Plugins (prototype)
tkikuc
2
1.9k
為你自己學 Python
eddie
0
520
ATDDで素早く安定した デリバリを実現しよう!
tonnsama
1
1.9k
Оптимизируем производительность блока Казначейство
lamodatech
0
960
php-conference-japan-2024
tasuku43
0
430
ゼロからの、レトロゲームエンジンの作り方
tokujiros
3
1.1k
Androidアプリのモジュール分割における:x:commonを考える
okuzawats
1
280
asdf-ecspresso作って 友達が増えた話 / Fujiwara Tech Conference 2025
koluku
0
1.4k
ESLintプラグインを使用してCDKのセオリーを適用する
yamanashi_ren01
2
240
Amazon Nova Reelの可能性
hideg
0
200
EC2からECSへ 念願のコンテナ移行と巨大レガシーPHPアプリケーションの再構築
sumiyae
3
590
Featured
See All Featured
Embracing the Ebb and Flow
colly
84
4.5k
Producing Creativity
orderedlist
PRO
343
39k
Making the Leap to Tech Lead
cromwellryan
133
9k
Practical Tips for Bootstrapping Information Extraction Pipelines
honnibal
PRO
10
870
Templates, Plugins, & Blocks: Oh My! Creating the theme that thinks of everything
marktimemedia
28
2.2k
GitHub's CSS Performance
jonrohan
1030
460k
How STYLIGHT went responsive
nonsquared
96
5.3k
The Pragmatic Product Professional
lauravandoore
32
6.4k
Optimising Largest Contentful Paint
csswizardry
33
3k
A Modern Web Designer's Workflow
chriscoyier
693
190k
How to Create Impact in a Changing Tech Landscape [PerfNow 2023]
tammyeverts
49
2.2k
VelocityConf: Rendering Performance Case Studies
addyosmani
327
24k
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