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
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
プロダクト成長を支える開発基盤とスケールに伴う課題
yuu26
4
1.3k
Ruby版 JSXのRuxが気になる
sansantech
PRO
0
150
CDK対応したAWS DevOps Agentを試そう_20260201
masakiokuda
1
270
今日から始めるAmazon Bedrock AgentCore
har1101
4
410
仕様書駆動AI開発の実践: Issue→Skill→PRテンプレで 再現性を作る
knishioka
2
640
配列に見る bash と zsh の違い
kazzpapa3
1
140
AI駆動PjMの理想像 と現在地 -実践例を添えて-
masahiro_okamura
1
110
Digitization部 紹介資料
sansan33
PRO
1
6.8k
Contract One Engineering Unit 紹介資料
sansan33
PRO
0
13k
Agile Leadership Summit Keynote 2026
m_seki
1
610
Claude_CodeでSEOを最適化する_AI_Ops_Community_Vol.2__マーケティングx_AIはここまで進化した.pdf
riku_423
2
560
AzureでのIaC - Bicep? Terraform? それ早く言ってよ会議
torumakabe
1
530
Featured
See All Featured
Test your architecture with Archunit
thirion
1
2.2k
Statistics for Hackers
jakevdp
799
230k
Breaking role norms: Why Content Design is so much more than writing copy - Taylor Woolridge
uxyall
0
160
Navigating the moral maze — ethical principles for Al-driven product design
skipperchong
2
240
RailsConf 2023
tenderlove
30
1.3k
Visualization
eitanlees
150
17k
The Language of Interfaces
destraynor
162
26k
Evolving SEO for Evolving Search Engines
ryanjones
0
120
SEO Brein meetup: CTRL+C is not how to scale international SEO
lindahogenes
0
2.3k
Leadership Guide Workshop - DevTernity 2021
reverentgeek
1
200
Color Theory Basics | Prateek | Gurzu
gurzu
0
200
30 Presentation Tips
portentint
PRO
1
210
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]