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
Ephemeral workloads with Docker.
Search
Sponsored
·
SiteGround - Reliable hosting with speed, security, and support you can count on.
→
pvergain
February 07, 2015
Technology
0
220
Ephemeral workloads with Docker.
Talk at PyTennessee on tmpnb, IPython, Jupyter, cloudpipe, and ephemeral workloads with Docker.
pvergain
February 07, 2015
Tweet
Share
More Decks by pvergain
See All by pvergain
Jupyter project
pvergain
0
44
Hitchhikers Guide to Free and Open Source Participation
pvergain
0
32
Six technologies that will change the web platform
pvergain
0
46
Other Decks in Technology
See All in Technology
Context Engineeringの取り組み
nutslove
0
340
インフラエンジニア必見!Kubernetesを用いたクラウドネイティブ設計ポイント大全
daitak
1
360
SREのプラクティスを用いた3領域同時 マネジメントへの挑戦 〜SRE・情シス・セキュリティを統合した チーム運営術〜
coconala_engineer
2
640
SREが向き合う大規模リアーキテクチャ 〜信頼性とアジリティの両立〜
zepprix
0
440
15 years with Rails and DDD (AI Edition)
andrzejkrzywda
0
190
StrandsとNeptuneを使ってナレッジグラフを構築する
yakumo
1
110
Introduction to Sansan for Engineers / エンジニア向け会社紹介
sansan33
PRO
6
68k
30万人の同時アクセスに耐えたい!新サービスの盤石なリリースを支える負荷試験 / SRE Kaigi 2026
genda
4
1.3k
Oracle Cloud Observability and Management Platform - OCI 運用監視サービス概要 -
oracle4engineer
PRO
2
14k
CDKで始めるTypeScript開発のススメ
tsukuboshi
1
390
制約が導く迷わない設計 〜 信頼性と運用性を両立するマイナンバー管理システムの実践 〜
bwkw
3
920
Codex 5.3 と Opus 4.6 にコーポレートサイトを作らせてみた / Codex 5.3 vs Opus 4.6
ama_ch
0
150
Featured
See All Featured
Lightning Talk: Beautiful Slides for Beginners
inesmontani
PRO
1
440
Building an army of robots
kneath
306
46k
Principles of Awesome APIs and How to Build Them.
keavy
128
17k
The Curse of the Amulet
leimatthew05
1
8.5k
16th Malabo Montpellier Forum Presentation
akademiya2063
PRO
0
49
Ten Tips & Tricks for a 🌱 transition
stuffmc
0
66
Hiding What from Whom? A Critical Review of the History of Programming languages for Music
tomoyanonymous
2
420
Sam Torres - BigQuery for SEOs
techseoconnect
PRO
0
180
RailsConf & Balkan Ruby 2019: The Past, Present, and Future of Rails at GitHub
eileencodes
141
34k
Being A Developer After 40
akosma
91
590k
The Director’s Chair: Orchestrating AI for Truly Effective Learning
tmiket
1
96
GraphQLとの向き合い方2022年版
quramy
50
14k
Transcript
DOCKER FOR EPHEMERAL WORKLOADS Kyle Kelley @ PyTennessee
Hi!
Good morning!
Kyle Kelley @rgbkrk
None
None
None
None
None
None
None
None
♥ I
None
Sharing
None
Deployment 㱺
None
FROM python:3-onbuild CMD [“python”, “./app.py”]
from flask import Flask app = Flask(__name__) ! @app.route('/') def
hello_pytn(): return 'Hello PyTennessee!' ! if __name__ == '__main__': app.run(‘0.0.0.0’)
$ docker build -t pytn .
$ docker build -t pytn . Sending build context to
Docker daemon 92.67 kB Sending build context to Docker daemon Step 0 : FROM python:3-onbuild # Executing 3 build triggers Trigger 0, COPY requirements.txt /usr/src/app/ Step 0 : COPY requirements.txt /usr/src/app/ Trigger 1, RUN pip install -r requirements.txt Step 0 : RUN pip install -r requirements.txt ---> Running in dea1149d79ba … Successfully installed Flask Werkzeug Jinja2 itsdangerous markupsafe Cleaning up...
$ docker build -t pytn . … Trigger 2, COPY
. /usr/src/app Step 0 : COPY . /usr/src/app ---> 6067170ab7fe Removing intermediate container 7ba25a7d8c3b Removing intermediate container dea1149d79ba Removing intermediate container 98f8579edc94 Step 1 : CMD python ./app.py ---> Running in 53031fa4ba6d ---> a7324c447943 Removing intermediate container 53031fa4ba6d Successfully built a7324c447943
$ docker build -t pytn .
$ docker run -p 5000:5000 pytn * Running on http://*:5000/
(Press CTRL+C to quit)
None
$ docker run ipython/scipystack
ipython/ipython ipython/scipystack ipython/notebook ipython/scipyserver
None
None
None
None
“Could we do a live demo for Nature?”
“Yes?”
None
JUPYTERHUB IN ACTION Kyle visits /user/rgbkrk/ to reach his
notebook server
CONFIGURABLE HTTP PROXY • Based on node-http-proxy • Proxy routes
to localhost, external IPs, etc. • /user/123/ → 127.0.0.1:56790 • Provides an administrative API for adding routes • POST /api/routes/[:path]
github.com/jupyter/ configurable-http-proxy
None
None
None
“Yes!”
github.com/jupyter/tmpnb
/user/reqz/ /user/asdf/ /user/uiop/ :59678 :59632 :59680 Configurable HTTP Proxy
None
tmpnb.org
bit.ly/inature
> 20,000 notebook servers
None
None
None
None
None
What else is ephemeral?
compute jobs
None
>>> import cloud >>> def add(x, y): ...
return x+y >>> add(1, 2) 3 >>> jid = cloud.call(add, ... 1, 2)
! >>> cloud.result(jid) 3
>>> import cloud >>> def scrape(x,y): ...
# Expensive operation >>> xs = [] # list of x’s >>> ys = [] # list of y’s >>> jids = cloud.map(scrape, ... xs, ys)
>>> cloud.result(jids)
PICLOUD • Chuck a python pickle to the cloud (f,
args, kwargs) = pickle.load(sys.stdin) res = f(*args, **kwargs) ! cloudpickle.dump(res, open("/tmp/.result", "wb"))
Acquisition
None
:(
None
?
github.com/cloudpipe
None
import multyvac ! # Connect to the cluster
multyvac.config.set_key( api_key=rackspace_user, api_secret_key=rackspace_api_key, api_url=‘https://api.cloudpi.pe/v1’) ! ! ! !
CLOUDPIPE • Docker Backed • Processes run as non-root •
API compatible with multyvac
CLOUDPIPE • Open Source • Want Need Python 3 binding,
new cloud pickler • Node library in the works
Where else can we take things?
Where else can we take things?
On Demand IPython kernels
github.com/ rgbkrk/kernels- service
bit.ly/oreillyjupyter
FRONTIER • Put kernels close to data stores, spin out
compute • IPython parallel on demand • Compute jobs on demand • Trigger jobs by events
None
JOIN MY TEAM
[email protected]
JOIN RACKSPACE
[email protected]