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
Bedrock PolicyでAmazon Bedrock Guardrails利用を強制してみた
yuu551
0
220
Sansan Engineering Unit 紹介資料
sansan33
PRO
1
3.8k
Frontier Agents (Kiro autonomous agent / AWS Security Agent / AWS DevOps Agent) の紹介
msysh
3
170
Red Hat OpenStack Services on OpenShift
tamemiya
0
100
日本の85%が使う公共SaaSは、どう育ったのか
taketakekaho
1
150
データの整合性を保ちたいだけなんだ
shoheimitani
8
3.1k
仕様書駆動AI開発の実践: Issue→Skill→PRテンプレで 再現性を作る
knishioka
2
640
We Built for Predictability; The Workloads Didn’t Care
stahnma
0
140
Cosmos World Foundation Model Platform for Physical AI
takmin
0
870
10Xにおける品質保証活動の全体像と改善 #no_more_wait_for_test
nihonbuson
PRO
2
240
All About Sansan – for New Global Engineers
sansan33
PRO
1
1.3k
Amazon Bedrock Knowledge Basesチャンキング解説!
aoinoguchi
0
140
Featured
See All Featured
JavaScript: Past, Present, and Future - NDC Porto 2020
reverentgeek
52
5.8k
What the history of the web can teach us about the future of AI
inesmontani
PRO
1
430
Agile Actions for Facilitating Distributed Teams - ADO2019
mkilby
0
110
Cheating the UX When There Is Nothing More to Optimize - PixelPioneers
stephaniewalter
287
14k
Intergalactic Javascript Robots from Outer Space
tanoku
273
27k
Efficient Content Optimization with Google Search Console & Apps Script
katarinadahlin
PRO
0
320
Lessons Learnt from Crawling 1000+ Websites
charlesmeaden
PRO
1
1.1k
Build your cross-platform service in a week with App Engine
jlugia
234
18k
Keith and Marios Guide to Fast Websites
keithpitt
413
23k
Exploring anti-patterns in Rails
aemeredith
2
250
ラッコキーワード サービス紹介資料
rakko
1
2.3M
Leveraging Curiosity to Care for An Aging Population
cassininazir
1
160
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]