Skip to content
This repository was archived by the owner on Sep 3, 2022. It is now read-only.

Commit 1ee12c2

Browse files
authored
Update Jupyter config to new Cloud Shell domain. (#2172)
Tests passed https://travis-ci.org/github/googledatalab/datalab/builds/723936424
1 parent d6ddeac commit 1ee12c2

5 files changed

Lines changed: 36 additions & 25 deletions

File tree

containers/base/Dockerfile

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,8 @@ ENV PYTHON_3_ENV py3env
3333
SHELL ["/bin/bash", "-c"]
3434

3535
# Setup OS and core packages
36-
RUN echo "deb-src http://ftp.us.debian.org/debian testing main" >> /etc/apt/sources.list && \
36+
RUN echo "deb-src http://ftp.us.debian.org/debian stretch main" >> /etc/apt/sources.list && \
37+
apt-key adv --keyserver keyserver.ubuntu.com --recv-keys EF0F382A1A7B6500 04EE7237B7D453EC && \
3738
apt-get update -y && \
3839
apt-get install -y -q debian-archive-keyring debian-keyring && \
3940
apt-get update -y && \
@@ -94,7 +95,7 @@ RUN echo "deb-src http://ftp.us.debian.org/debian testing main" >> /etc/apt/sour
9495
plotly==1.12.5 \
9596
psutil==4.3.0 \
9697
pygments==2.1.3 \
97-
python-dateutil==2.5.0 \
98+
python-dateutil==2.8.1 \
9899
python-snappy==0.5.1 \
99100
pytz==2018.4 \
100101
pyyaml==3.13 \
@@ -103,10 +104,10 @@ RUN echo "deb-src http://ftp.us.debian.org/debian testing main" >> /etc/apt/sour
103104
scikit-image==0.13.0 \
104105
scikit-learn==0.19.1 \
105106
scipy==1.0.0 \
106-
seaborn==0.7.0 \
107+
seaborn==0.9.0 \
107108
six==1.11.0 \
108109
statsmodels==0.8.0 \
109-
sympy==0.7.6.1 \
110+
sympy==1.1.1 \
110111
tornado==4.5.1 \
111112
widgetsnbextension==3.2.1 \
112113
xgboost==0.6a2 && \
@@ -148,23 +149,24 @@ RUN echo "deb-src http://ftp.us.debian.org/debian testing main" >> /etc/apt/sour
148149
pandas-gbq==0.3.0 \
149150
pandas==0.22.0 \
150151
pandocfilters==1.4.2 \
152+
parso==0.7.0 \
151153
pillow==5.0.0 \
152154
pip==18.0 \
153155
plotly==1.12.5 \
154156
psutil==4.3.0 \
155157
pygments==2.1.3 \
156-
python-dateutil==2.5.0 \
158+
python-dateutil==2.8.1 \
157159
python-snappy==0.5.1 \
158160
pytz==2018.4 \
159161
pyzmq==17.1.0 \
160162
requests==2.18.4 \
161163
scikit-image==0.13.0 \
162164
scikit-learn==0.19.1 \
163165
scipy==1.0.0 \
164-
seaborn==0.7.0 \
166+
seaborn==0.9.0 \
165167
six==1.11.0 \
166168
statsmodels==0.8.0 \
167-
sympy==0.7.6.1 \
169+
sympy==1.1.1 \
168170
tornado==4.5.1 \
169171
widgetsnbextension==3.2.1 \
170172
xgboost==0.6a2 && \

containers/base/license.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ do
6060
if [[ " ${INSTALLED_PACKAGES[@]} " =~ " ${col1} " ]]; then
6161
wget -O $2/$col1.LICENSE $col2
6262
if [[ "${col3}" == *GPL* ]]; then
63-
pip install -t "$2/source/${col1}" ${col1}
63+
pip download -d "$2/source/${col1}" ${col1}
6464
fi
6565
fi
6666
done < $1

containers/base/third_party_licenses.csv

Lines changed: 21 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -7,11 +7,11 @@ python-editor,https://raw.githubusercontent.com/fmoo/python-editor/master/LICENS
77
tzlocal,https://raw.githubusercontent.com/regebro/tzlocal/master/LICENSE.txt,MIT
88
itsdangerous,https://raw.githubusercontent.com/pallets/itsdangerous/master/LICENSE.rst,3-Clause BSD
99
Werkzeug,https://raw.githubusercontent.com/pallets/werkzeug/master/LICENSE.rst,3-Clause BSD
10-
click,https://raw.githubusercontent.com/pallets/click/master/LICENSE,3-Clause BSD
10+
click,https://raw.githubusercontent.com/pallets/click/master/LICENSE.rst,3-Clause BSD
1111
alembic,https://raw.githubusercontent.com/zzzeek/alembic/master/LICENSE,MIT
1212
sqlalchemy,https://raw.githubusercontent.com/zzzeek/sqlalchemy/master/LICENSE,MIT
1313
APScheduler,https://raw.githubusercontent.com/agronholm/apscheduler/master/LICENSE.txt,MIT
14-
Flask,https://raw.githubusercontent.com/pallets/flask/master/LICENSE,3-Clause BSD
14+
Flask,https://raw.githubusercontent.com/pallets/flask/master/LICENSE.rst,3-Clause BSD
1515
chainerui,https://raw.githubusercontent.com/chainer/chainerui/master/LICENSE,MIT
1616
chainercv,https://raw.githubusercontent.com/chainer/chainercv/master/LICENSE,MIT
1717
pyglet,https://raw.githubusercontent.com/adamlwgriffiths/Pyglet/master/LICENSE,3-Clause BSD
@@ -40,7 +40,7 @@ pexpect,https://raw.githubusercontent.com/pexpect/pexpect/ab7d99a670794fc2b03654
4040
setuptools,https://raw.githubusercontent.com/pypa/setuptools/master/LICENSE,MIT
4141
tornado,https://raw.githubusercontent.com/tornadoweb/tornado/stable/LICENSE,Apache Software License 2.0
4242
traitlets,https://raw.githubusercontent.com/ipython/traitlets/master/COPYING.md,BSD
43-
subprocess32,https://raw.githubusercontent.com/google/python-subprocess32/master/LICENSE,Python Software Foundation License
43+
subprocess32,https://raw.githubusercontent.com/google/python-subprocess32/main/LICENSE,Python Software Foundation License
4444
jinja2,https://raw.githubusercontent.com/pallets/jinja/master/LICENSE,BSD
4545
html5lib,https://raw.githubusercontent.com/html5lib/html5lib-python/master/LICENSE,MIT
4646
opencv-python,https://raw.githubusercontent.com/skvark/opencv-python/master/LICENSE.txt,MIT
@@ -87,14 +87,14 @@ funcsigs,https://raw.githubusercontent.com/aliles/funcsigs/master/LICENSE,Apache
8787
gapic-google-cloud-pubsub-v1,https://raw.githubusercontent.com/googleapis/api-client-staging/master/generated/python/gapic-google-cloud-pubsub-v1/LICENSE,Apache 2.0
8888
google-apitools,https://raw.githubusercontent.com/google/apitools/master/LICENSE,Apache 2.0
8989
google-auth-library-python-httplib2,https://raw.githubusercontent.com/GoogleCloudPlatform/google-auth-library-python-httplib2/master/LICENSE,Apache 2.0
90-
google-cloud-bigquery,https://raw.githubusercontent.com/GoogleCloudPlatform/google-cloud-python/master/bigquery/LICENSE,Apache 2.0
91-
google-cloud-core,https://raw.githubusercontent.com/GoogleCloudPlatform/google-cloud-python/master/core/LICENSE,Apache 2.0
92-
google-cloud-pubsub,https://raw.githubusercontent.com/GoogleCloudPlatform/google-cloud-python/master/pubsub/LICENSE,Apache 2.0
90+
google-cloud-bigquery,https://raw.githubusercontent.com/googleapis/google-cloud-python/master/LICENSE,Apache 2.0
91+
google-cloud-core,https://raw.githubusercontent.com/googleapis/google-cloud-python/master/LICENSE,Apache 2.0
92+
google-cloud-pubsub,https://raw.githubusercontent.com/googleapis/google-cloud-python/master/LICENSE,Apache 2.0
9393
google-gax,https://raw.githubusercontent.com/googleapis/gax-python/master/LICENSE,Apache 2.0
9494
googleapis-common-protos,https://raw.githubusercontent.com/googleapis/api-common-protos/master/LICENSE,Apache 2.0
95-
googledatastore,https://raw.githubusercontent.com/GoogleCloudPlatform/google-cloud-datastore/master/LICENSE,Apache 2.0
95+
googledatastore,https://raw.githubusercontent.com/googleapis/google-cloud-python/master/LICENSE,Apache 2.0
9696
hdfs,https://github.com/mtth/hdfs/blob/master/LICENSE,MIT
97-
idna,https://raw.githubusercontent.com/kjd/idna/master/LICENSE.rst,BSD-like
97+
idna,https://raw.githubusercontent.com/kjd/idna/master/LICENSE.md,BSD-like
9898
Markdown,https://raw.githubusercontent.com/Python-Markdown/markdown/master/LICENSE.md,BSD
9999
monotonic,https://raw.githubusercontent.com/atdt/monotonic/master/LICENSE,Apache 2.0
100100
oauth2client,https://raw.githubusercontent.com/google/oauth2client/master/LICENSE,Apache 2.0
@@ -121,11 +121,11 @@ PyJWT,https://raw.githubusercontent.com/jpadilla/pyjwt/master/LICENSE,MIT
121121
requests-oauthlib,https://raw.githubusercontent.com/requests/requests-oauthlib/master/LICENSE,BSD
122122
retrying,https://raw.githubusercontent.com/rholder/retrying/master/LICENSE,Apache 2.0
123123
websocket-client,https://raw.githubusercontent.com/websocket-client/websocket-client/master/LICENSE,LGPL
124-
enum34,https://bitbucket.org/stoneleaf/enum34/raw/f24487b45cd041fc9406d67441d2186ac70772b7/enum/LICENSE,BSD
124+
enum34,https://raw.githubusercontent.com/GoodRx/enum34/master/enum/LICENSE,BSD
125125
futures,https://raw.githubusercontent.com/agronholm/pythonfutures/master/LICENSE,PSF
126126
backports-abc,https://raw.githubusercontent.com/cython/backports_abc/master/LICENSE,PSF
127127
backports.shutil-get-terminal-size,https://raw.githubusercontent.com/chrippa/backports.shutil_get_terminal_size/master/LICENSE,MIT
128-
configparser,https://bitbucket.org/ambv/configparser/raw/78998f2ded2e840376adc712337545014fa9b622/README.rst,MIT
128+
configparser,https://raw.githubusercontent.com/jaraco/configparser/master/LICENSE,MIT
129129
crcmod,https://raw.githubusercontent.com/gsutil-mirrors/crcmod/master/LICENSE,MIT
130130
decorator,https://raw.githubusercontent.com/micheles/decorator/master/LICENSE.txt,2-Clause BSD
131131
entrypoints,https://raw.githubusercontent.com/takluyver/entrypoints/master/LICENSE,MIT
@@ -134,10 +134,10 @@ functools32,https://raw.githubusercontent.com/michilu/python-functools32/master/
134134
grpc-google-iam-v1,https://raw.githubusercontent.com/googleapis/googleapis/master/LICENSE,Apache 2.0
135135
ipython-genutils,https://raw.githubusercontent.com/ipython/ipython_genutils/master/COPYING.md,BSD
136136
ipywidgets,https://raw.githubusercontent.com/jupyter-widgets/ipywidgets/master/LICENSE,3-Clause BSD
137-
Jinja2,https://raw.githubusercontent.com/pallets/jinja/master/LICENSE,BSD
137+
Jinja2,https://raw.githubusercontent.com/pallets/jinja/master/LICENSE.rst,BSD
138138
jsonschema,https://raw.githubusercontent.com/Julian/jsonschema/master/COPYING,MIT
139-
jupyter,https://raw.githubusercontent.com/jupyter/notebook/master/COPYING.md,BSD
140-
notebook,https://raw.githubusercontent.com/jupyter/notebook/master/COPYING.md,BSD
139+
jupyter,https://raw.githubusercontent.com/jupyter/notebook/master/LICENSE,BSD
140+
notebook,https://raw.githubusercontent.com/jupyter/notebook/master/LICENSE,BSD
141141
jupyter-client,https://raw.githubusercontent.com/jupyter/jupyter_client/master/COPYING.md,BSD
142142
jupyter-console,https://raw.githubusercontent.com/jupyter/jupyter_console/master/COPYING.md,BSD
143143
jupyter-core,https://raw.githubusercontent.com/jupyter/jupyter_core/master/COPYING.md,BSD
@@ -160,7 +160,7 @@ simplegeneric,https://opensource.org/licenses/ZPL-2.0,ZPL 2.1
160160
singledispatch,https://opensource.org/licenses/MIT,MIT
161161
tensorflow-model-analysis,https://github.com/tensorflow/model-analysis/blob/master/LICENSE,Apache 2.0
162162
terminado,https://raw.githubusercontent.com/jupyter/terminado/master/LICENSE,BSD
163-
wcwidth,https://raw.githubusercontent.com/jquast/wcwidth/master/LICENSE.txt,MIT
163+
wcwidth,https://raw.githubusercontent.com/jquast/wcwidth/master/LICENSE,MIT
164164
widgetsnbextension,https://raw.githubusercontent.com/jupyter-widgets/ipywidgets/master/widgetsnbextension/LICENSE,BSD
165165
pandas,https://raw.githubusercontent.com/pandas-dev/pandas/master/LICENSE,3-Clause BSD
166166
scikit-learn,https://raw.githubusercontent.com/scikit-learn/scikit-learn/master/COPYING,BSD
@@ -178,10 +178,10 @@ PySocks,https://raw.githubusercontent.com/Anorov/PySocks/master/LICENSE,BSD
178178
ruamel-yaml,https://bitbucket.org/ruamel/yaml/raw/1364db82e3ad5680351e8a96323fa74ef9e662da/LICENSE,MIT
179179
apache-airflow,https://raw.githubusercontent.com/apache/incubator-airflow/master/LICENSE,Apache 2.0
180180
backports.functools-lru-cache,https://raw.githubusercontent.com/jaraco/backports.functools_lru_cache/master/LICENSE,MIT
181-
backports.ssl-match-hostname,https://bitbucket.org/brandon/backports.ssl_match_hostname/raw/76440258eb5e2aaac7c6f3d0b0a5afdbe335a502/LICENSE.txt,PSF
181+
backports.ssl-match-hostname,https://raw.githubusercontent.com/exoscale/pkg-backports.ssl-match-hostname/precise/debian/copyright,PSF
182182
beautifulsoup4,https://bazaar.launchpad.net/~leonardr/beautifulsoup/bs4/download/head:/copying-20110228012957-7ptf6yxua0sj3vhn-1/LICENSE,MIT
183183
blinker,https://raw.githubusercontent.com/jek/blinker/master/LICENSE,MIT
184-
bokeh,https://raw.githubusercontent.com/bokeh/bokeh/master/LICENSE.txt,3-Clause BSD
184+
bokeh,https://raw.githubusercontent.com/bokeh/bokeh/main/LICENSE.txt,3-Clause BSD
185185
brewer2mpl,https://raw.githubusercontent.com/jiffyclub/palettable/master/license.txt,MIT
186186
bs4,https://bazaar.launchpad.net/~leonardr/beautifulsoup/bs4/download/head:/copying-20110228012957-7ptf6yxua0sj3vhn-1/LICENSE,MIT
187187
Click,https://raw.githubusercontent.com/pallets/click/master/LICENSE.rst,BSD
@@ -252,3 +252,8 @@ zict,https://raw.githubusercontent.com/dask/zict/master/LICENSE.txt,BSD
252252
zope.deprecation,https://raw.githubusercontent.com/zopefoundation/zope.deprecation/master/LICENSE.txt,ZPL
253253
google-cloud-dataflow,https://raw.githubusercontent.com/apache/beam/master/LICENSE,Apache 2.0
254254
soupsieve,https://raw.githubusercontent.com/facelessuser/soupsieve/master/LICENSE.md,MIT
255+
gmpy2,https://raw.githubusercontent.com/aleaxit/gmpy/master/COPYING,LGPL
256+
HeapDict,https://raw.githubusercontent.com/DanielStutzbach/heapdict/master/LICENSE,BSD
257+
mpmath,https://raw.githubusercontent.com/fredrik-johansson/mpmath/master/LICENSE,BSD
258+
natsort,https://raw.githubusercontent.com/SethMMorton/natsort/master/LICENSE,MIT
259+
smmap,https://raw.githubusercontent.com/gitpython-developers/smmap/master/LICENSE,BSD

sources/web/datalab/config/settings.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919
"--no-browser",
2020
"--log-level=DEBUG",
2121
"--debug",
22-
"--NotebookApp.allow_origin_pat=\".*-dot-devshell.appspot.com$\"",
22+
"--NotebookApp.allow_origin_pat=\"(.*-dot-devshell[.]appspot[.]com$)|(.*[.]cloudshell[.]dev$)\"",
2323
"--NotebookApp.log_format=\"%(message)s\"",
2424
"--NotebookApp.token=",
2525
"--Session.key=b'\"\"'",

sources/web/datalab/server.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -300,6 +300,10 @@ function stopVmHandler(request: http.ServerRequest, response: http.ServerRespons
300300

301301
function requestIsCrossOrigin(request: http.ServerRequest) {
302302
if (request.headers.origin) {
303+
// Explicitly whitelist Cloud Shell's domain for cross-origin requests.
304+
if (url.parse(request.headers.origin).host.endsWith('.cloudshell.dev')) {
305+
return false;
306+
}
303307
return url.parse(request.headers.origin).host !== request.headers.host;
304308
} else if (request.headers.referer) {
305309
return url.parse(request.headers.referer).host !== request.headers.host;

0 commit comments

Comments
 (0)