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
200
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
38
Hitchhikers Guide to Free and Open Source Participation
pvergain
0
24
Six technologies that will change the web platform
pvergain
0
37
Other Decks in Technology
See All in Technology
Babylon.jsと色々なものを組み合わせる:ブラウザのAPIやガジェットや2D描画ライブラリなど / Babylon.js 勉強会 vol.3
you
PRO
0
160
Azure Container Apps + Bicep 〜 こんな感じで運用しています
kaz29
3
620
web-application-security
matsuihidetoshi
1
190
Handling focus in 2024
tahia910
0
220
成長をサポートするピープルマネジメントのやり方
sioncojp
8
1.1k
ゼロから始めるVue.jsコミュニティ貢献 / first-vuejs-community-contribution-link-and-motivation
lmi
1
150
VSCodeの拡張機能を作っている話
ebarakazuhiro
1
800
推しは推せるときに推せ! プロダクトにフィードバックしていこう
nakasho
0
460
M5stackで使用できるpHセンサの開発
shinrinakamura
0
120
Babylon.js JAPAN活動紹介 (2024/4)
limes2018
1
110
生産性向上チームの紹介
cybozuinsideout
PRO
1
910
Autonomous Database Cloud 技術詳細 / adb-s_technical_detail_jp
oracle4engineer
PRO
15
35k
Featured
See All Featured
How To Stay Up To Date on Web Technology
chriscoyier
782
250k
Become a Pro
speakerdeck
PRO
13
4.6k
The Illustrated Children's Guide to Kubernetes
chrisshort
32
46k
Pencils Down: Stop Designing & Start Developing
hursman
117
11k
What the flash - Photography Introduction
edds
64
11k
Writing Fast Ruby
sferik
622
60k
Let's Do A Bunch of Simple Stuff to Make Websites Faster
chriscoyier
501
140k
Keith and Marios Guide to Fast Websites
keithpitt
408
22k
The Cost Of JavaScript in 2023
addyosmani
21
3.9k
Large-scale JavaScript Application Architecture
addyosmani
504
110k
Principles of Awesome APIs and How to Build Them.
keavy
121
16k
Refactoring Trust on Your Teams (GOTO; Chicago 2020)
rmw
26
2.3k
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]