- Notifications
You must be signed in to change notification settings - Fork 633
/
Copy pathjupyter_app.py
33 lines (23 loc) · 892 Bytes
/
jupyter_app.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
importsky
defmake_application():
"""A simple application: jupyter notebook on current workspace."""
withsky.Dag() asdag:
setup='pip install --upgrade pip && \
conda init bash && \
conda activate jupyter || \
(conda create -n jupyter python=3.9 -y && \
conda activate jupyter && \
pip install jupyter)'
run=f'jupyter notebook --port 8888'
# Use 'ssh -L 8888:localhost:8888 <cluster_name>' to forward port to local.
# 'ssh -L 8888:localhost:8888 sky-12345'
jupyter=sky.Task('jupyter',
run=run,
setup=setup,
workdir='~/local/workspace')
jupyter.set_resources({
sky.Resources(accelerators='K80', use_spot=True),
})
returndag
dag=make_application()
sky.launch(dag)