Commit ea2bea3f authored by Daniel Webster's avatar Daniel Webster
Browse files

Add jupyter_notebook_config for CORS

parent a05bef0a
Pipeline #733 failed with stages
in 18 seconds
......@@ -25,6 +25,8 @@ variables:
IMAGE: $REGISTRY/$PROJECT/$APP
NOTEBOOK: notebook
NOTEBOOK_IMAGE: $PROJECT/s2i-minimal-notebook:3.6
NOTEBOOK_CFG: jupyter_notebook_config
CFG_DIR: /opt/app-root/etc/
PVCNAME: h5-data
PVSIZE: 5Gi
DATADIR: /opt/app-root/src/data
......@@ -37,8 +39,11 @@ build-app:
- oc project $PROJECT
- oc delete all -lapp=${APP} --ignore-not-found=true
- oc delete all -lapp=${NOTEBOOK} --ignore-not-found=true
- oc delete cm $NOTEBOOK_CFG --ignore-not-found=true
- oc create cm $NOTEBOOK_CFG --from-file=jupyter/jupyter_notebook_config.py
- oc new-app --name $APP python~${GITREPO} --as-deployment-config=true -e NOTEBOOK_TOKEN=${NOTEBOOK_TOKEN}
- oc new-app --name $NOTEBOOK -i $NOTEBOOK_IMAGE --as-deployment-config=true -e JUPYTER_NOTEBOOK_PASSWORD=${NOTEBOOK_TOKEN}
- oc set volume dc/${NOTEBOOK} --add --name $NOTEBOOK_CFG --configmap-name $NOTEBOOK_CFG -m ${CFG_DIR}/${NOTEBOOK_CFG}.py --sub-path ${NOTEBOOK_CFG}.py --overwrite || true
- oc set volume dc/${NOTEBOOK} --add --name $PVCNAME -t pvc --claim-mode ReadWriteMany --claim-name $PVCNAME --overwrite --claim-class $STORAGECLASS --claim-size $PVSIZE -m ${DATADIR} || true
- sleep 30
......
Caching blobs under "/var/cache/blobs".
Getting image source signatures
Copying blob sha256:f659c5c779ac4373302bfe3dc7d713c59cf9ec9f179a71e9b26336a51043fad2
Copying blob sha256:e7021e0589e97471d99c4265b7c8e64da328e48f116b5f260353b2e0a2adb373
Copying blob sha256:9e7a6dc796f0a75c560158a9f9e30fb8b5a90cb53edce9ffbdf5778406e4de39
Copying blob sha256:fc5b206e9329a1674dd9e8efbee45c9be28d0d0dcbabba3c6bb67a2f22cfcf2a
Copying blob sha256:d7f79a2be1b92fe228308ea7366e3af2d2fb89daa7f6a931cdeee6470cd28a1b
Copying config sha256:d6475ea2d5437707897c294151eea79a8109de374c4957db69ed99d8e50fe475
Writing manifest to image destination
Storing signatures
Generating dockerfile with builder image image-registry.openshift-image-registry.svc:5000/openshift/python@sha256:63334573c5cf09a02f9a42f73fb830392209579938877b6a4cb799dcd3a2196a
STEP 1: FROM image-registry.openshift-image-registry.svc:5000/openshift/python@sha256:63334573c5cf09a02f9a42f73fb830392209579938877b6a4cb799dcd3a2196a
STEP 2: LABEL "io.openshift.build.image"="image-registry.openshift-image-registry.svc:5000/openshift/python@sha256:63334573c5cf09a02f9a42f73fb830392209579938877b6a4cb799dcd3a2196a" "io.openshift.build.commit.author"="Andrea Lorenzon <andrea.lorenzon@ceric-eric.eu>" "io.openshift.build.commit.date"="Wed Sep 9 09:41:51 2020 +0200" "io.openshift.build.commit.id"="d619193a4c5924ff1ff5690141a4d426154484f6" "io.openshift.build.commit.ref"="master" "io.openshift.build.commit.message"="updated requirements.txt" "io.openshift.build.source-location"="https://gitlab.elettra.eu/andrea.lorenzon/h5nuvola2.git"
STEP 3: ENV OPENSHIFT_BUILD_NAME="h5nuvola2-1" OPENSHIFT_BUILD_NAMESPACE="h5nuvola" OPENSHIFT_BUILD_SOURCE="https://gitlab.elettra.eu/andrea.lorenzon/h5nuvola2.git" OPENSHIFT_BUILD_COMMIT="d619193a4c5924ff1ff5690141a4d426154484f6"
STEP 4: USER root
STEP 5: COPY upload/src /tmp/src
STEP 6: RUN chown -R 1001:0 /tmp/src
STEP 7: USER 1001
STEP 8: RUN /usr/libexec/s2i/assemble
---> Installing application source ...
---> Upgrading pip to version 19.3.1 ...
Collecting pip==19.3.1
Downloading https://files.pythonhosted.org/packages/00/b6/9cfa56b4081ad13874b0c6f96af8ce16cfbc1cb06bedf8e9164ce5551ec1/pip-19.3.1-py2.py3-none-any.whl (1.4MB)
Installing collected packages: pip
Found existing installation: pip 9.0.1
Uninstalling pip-9.0.1:
Successfully uninstalled pip-9.0.1
Successfully installed pip-19.3.1
---> Installing dependencies ...
Collecting numpy==1.15.0
Downloading https://files.pythonhosted.org/packages/88/29/f4c845648ed23264e986cdc5fbab5f8eace1be5e62144ef69ccc7189461d/numpy-1.15.0-cp36-cp36m-manylinux1_x86_64.whl (13.9MB)
Collecting holoviews==1.13.3
Downloading https://files.pythonhosted.org/packages/72/67/3bce8a00b2a2de26e7d1bb09dec2b6b7395ffc31f5d1d3cf91e59b3ff99d/holoviews-1.13.3-py2.py3-none-any.whl (4.2MB)
Collecting h5py==2.10.0
Downloading https://files.pythonhosted.org/packages/60/06/cafdd44889200e5438b897388f3075b52a8ef01f28a17366d91de0fa2d05/h5py-2.10.0-cp36-cp36m-manylinux1_x86_64.whl (2.9MB)
Collecting Flask==1.1.1
Downloading https://files.pythonhosted.org/packages/9b/93/628509b8d5dc749656a9641f4caf13540e2cdec85276964ff8f43bbb1d3b/Flask-1.1.1-py2.py3-none-any.whl (94kB)
Collecting bokeh==2.0.0
Downloading https://files.pythonhosted.org/packages/e0/a7/875aad223b211951a043bf7b0eddcecb8b2afd5131c08945ff07ac968c7f/bokeh-2.0.0.tar.gz (8.5MB)
Collecting param<2.0,>=1.9.3
Downloading https://files.pythonhosted.org/packages/f8/47/d5e2b64b3edc260f3ec3001ab5a46291b75911f7f3e7aeeacd8d7823e13b/param-1.9.3-py2.py3-none-any.whl (70kB)
Collecting panel>=0.8.0
Downloading https://files.pythonhosted.org/packages/cd/c6/a40d4f407dcd9c029a0c0922c595db39a21f9dce9c7eca4b32a95c87bdcb/panel-0.9.7-py2.py3-none-any.whl (1.3MB)
Collecting pyviz-comms>=0.7.3
Downloading https://files.pythonhosted.org/packages/03/63/44ba2e156c33a8693e7d256dc48a03de604f7319b21e08aa2de3e97a2681/pyviz_comms-0.7.6-py2.py3-none-any.whl
Collecting pandas
Downloading https://files.pythonhosted.org/packages/1c/11/e1f53db0614f2721027aab297c8afd2eaf58d33d566441a97ea454541c5e/pandas-1.1.2-cp36-cp36m-manylinux1_x86_64.whl (10.5MB)
Collecting six
Downloading https://files.pythonhosted.org/packages/ee/ff/48bde5c0f013094d729fe4b0316ba2a24774b3ff1c52d924a8a4cb04078a/six-1.15.0-py2.py3-none-any.whl
Collecting Werkzeug>=0.15
Downloading https://files.pythonhosted.org/packages/cc/94/5f7079a0e00bd6863ef8f1da638721e9da21e5bacee597595b318f71d62e/Werkzeug-1.0.1-py2.py3-none-any.whl (298kB)
Collecting click>=5.1
Downloading https://files.pythonhosted.org/packages/d2/3d/fa76db83bf75c4f8d338c2fd15c8d33fdd7ad23a9b5e57eb6c5de26b430e/click-7.1.2-py2.py3-none-any.whl (82kB)
Collecting Jinja2>=2.10.1
Downloading https://files.pythonhosted.org/packages/30/9e/f663a2aa66a09d838042ae1a2c5659828bb9b41ea3a6efa20a20fd92b121/Jinja2-2.11.2-py2.py3-none-any.whl (125kB)
Collecting itsdangerous>=0.24
Downloading https://files.pythonhosted.org/packages/76/ae/44b03b253d6fade317f32c24d100b3b35c2239807046a4c953c7b89fa49e/itsdangerous-1.1.0-py2.py3-none-any.whl
Collecting PyYAML>=3.10
Downloading https://files.pythonhosted.org/packages/64/c2/b80047c7ac2478f9501676c988a5411ed5572f35d1beff9cae07d321512c/PyYAML-5.3.1.tar.gz (269kB)
Collecting python-dateutil>=2.1
Downloading https://files.pythonhosted.org/packages/d4/70/d60450c3dd48ef87586924207ae8907090de0b306af2bce5d134d78615cb/python_dateutil-2.8.1-py2.py3-none-any.whl (227kB)
Collecting pillow>=4.0
Downloading https://files.pythonhosted.org/packages/30/bf/92385b4262178ca22b34f82e0e09c2922eb351fe39f3cc7b8ba9ea555b41/Pillow-7.2.0-cp36-cp36m-manylinux1_x86_64.whl (2.2MB)
Collecting packaging>=16.8
Downloading https://files.pythonhosted.org/packages/46/19/c5ab91b1b05cfe63cccd5cfc971db9214c6dd6ced54e33c30d5af1d2bc43/packaging-20.4-py2.py3-none-any.whl
Collecting tornado>=5
Downloading https://files.pythonhosted.org/packages/95/84/119a46d494f008969bf0c775cb2c6b3579d3c4cc1bb1b41a022aa93ee242/tornado-6.0.4.tar.gz (496kB)
Collecting typing_extensions>=3.7.4
Downloading https://files.pythonhosted.org/packages/60/7a/e881b5abb54db0e6e671ab088d079c57ce54e8a01a3ca443f561ccadb37e/typing_extensions-3.7.4.3-py3-none-any.whl
Collecting pyct>=0.4.4
Downloading https://files.pythonhosted.org/packages/71/76/52ce7aec26b0171939d3b3843acd011f8eb297b2a569e992691bb2964185/pyct-0.4.8-py2.py3-none-any.whl
Collecting tqdm
Downloading https://files.pythonhosted.org/packages/73/d5/f220e0c69b2f346b5649b66abebb391df1a00a59997a7ccf823325bd7a3e/tqdm-4.49.0-py2.py3-none-any.whl (69kB)
Collecting markdown
Downloading https://files.pythonhosted.org/packages/a4/63/eaec2bd025ab48c754b55e8819af0f6a69e2b1e187611dd40cbbe101ee7f/Markdown-3.2.2-py3-none-any.whl (88kB)
Collecting pytz>=2017.2
Downloading https://files.pythonhosted.org/packages/4f/a4/879454d49688e2fad93e59d7d4efda580b783c745fd2ec2a3adf87b0808d/pytz-2020.1-py2.py3-none-any.whl (510kB)
Collecting MarkupSafe>=0.23
Downloading https://files.pythonhosted.org/packages/b2/5f/23e0023be6bb885d00ffbefad2942bc51a620328ee910f64abe5a8d18dd1/MarkupSafe-1.1.1-cp36-cp36m-manylinux1_x86_64.whl
Collecting pyparsing>=2.0.2
Downloading https://files.pythonhosted.org/packages/8a/bb/488841f56197b13700afd5658fc279a2025a39e22449b7cf29864669b15d/pyparsing-2.4.7-py2.py3-none-any.whl (67kB)
Collecting importlib-metadata; python_version < "3.8"
Downloading https://files.pythonhosted.org/packages/6d/6d/f4bb28424bc677bce1210bc19f69a43efe823e294325606ead595211f93e/importlib_metadata-2.0.0-py2.py3-none-any.whl
Collecting zipp>=0.5
Downloading https://files.pythonhosted.org/packages/c4/79/3b770d51254a31bb85ba56ea70d7428d0c2c659a233cc9722352e028b539/zipp-3.2.0-py3-none-any.whl
Building wheels for collected packages: bokeh, PyYAML, tornado
Building wheel for bokeh (setup.py): started
Building wheel for bokeh (setup.py): finished with status 'done'
Created wheel for bokeh: filename=bokeh-2.0.0-cp36-none-any.whl size=8985252 sha256=360303c61e26b2f2b81ae63088f04e5b682457e260a159c9d14914531172bb59
Stored in directory: /tmp/pip-ephem-wheel-cache-a9v6mcy9/wheels/17/75/72/3bc53765dfe425579a658ef8e9f3b7142e9a56d3fe492c983a
Building wheel for PyYAML (setup.py): started
Building wheel for PyYAML (setup.py): finished with status 'done'
Created wheel for PyYAML: filename=PyYAML-5.3.1-cp36-cp36m-linux_x86_64.whl size=45922 sha256=bcb3be4ee3d9593f5873edec18934f46ba42eeda613e58191bbd1bec304e20af
Stored in directory: /tmp/pip-ephem-wheel-cache-a9v6mcy9/wheels/a7/c1/ea/cf5bd31012e735dc1dfea3131a2d5eae7978b251083d6247bd
Building wheel for tornado (setup.py): started
Building wheel for tornado (setup.py): finished with status 'done'
Created wheel for tornado: filename=tornado-6.0.4-cp36-cp36m-linux_x86_64.whl size=424649 sha256=0da8e26886ffbb5f16810bb253f297a40fd6e79dc720c1c1b331dec3e7d7ca38
Stored in directory: /tmp/pip-ephem-wheel-cache-a9v6mcy9/wheels/93/84/2f/409c7b2bb3afc3aa727f7ee8787975e0793f74d1165f4d0104
Successfully built bokeh PyYAML tornado
ERROR: panel 0.9.7 has requirement bokeh>=2.1, but you'll have bokeh 2.0.0 which is incompatible.
ERROR: pandas 1.1.2 has requirement numpy>=1.15.4, but you'll have numpy 1.15.0 which is incompatible.
Installing collected packages: numpy, param, pyviz-comms, PyYAML, six, python-dateutil, MarkupSafe, Jinja2, pillow, pyparsing, packaging, tornado, typing-extensions, bokeh, pyct, tqdm, zipp, importlib-metadata, markdown, panel, pytz, pandas, holoviews, h5py, Werkzeug, click, itsdangerous, Flask
Successfully installed Flask-1.1.1 Jinja2-2.11.2 MarkupSafe-1.1.1 PyYAML-5.3.1 Werkzeug-1.0.1 bokeh-2.0.0 click-7.1.2 h5py-2.10.0 holoviews-1.13.3 importlib-metadata-2.0.0 itsdangerous-1.1.0 markdown-3.2.2 numpy-1.15.0 packaging-20.4 pandas-1.1.2 panel-0.9.7 param-1.9.3 pillow-7.2.0 pyct-0.4.8 pyparsing-2.4.7 python-dateutil-2.8.1 pytz-2020.1 pyviz-comms-0.7.6 six-1.15.0 tornado-6.0.4 tqdm-4.49.0 typing-extensions-3.7.4.3 zipp-3.2.0
WARNING: You are using pip version 19.3.1; however, version 20.2.3 is available.
You should consider upgrading via the 'pip install --upgrade pip' command.
STEP 9: CMD /usr/libexec/s2i/run
STEP 10: COMMIT temp.builder.openshift.io/h5nuvola/h5nuvola2-1:0bc83bde
Getting image source signatures
Copying blob sha256:abc8c32bad762f509f729872b552e8366b9c71a863dc5e9e648dda04a7896e50
Copying blob sha256:b9e30d7689db4040323cb65632888c37d96cbd60d0f05c4dd37e78b9b8a0566a
Copying blob sha256:8b0dba9179a6a0d5de65c6b001c8c9c83eaa169ce526b22a33845ede8f74568c
Copying blob sha256:bda7ec697f579121100fed608753105e2150894241b011af8b12fea98296f8f7
Copying blob sha256:c21017d273a0949940bb50403d5908fd7c17e8fc5f17d8efdcf1da6f618441bb
Copying blob sha256:7d8746edbd91550b9e746520122db8b87abddf93db4179b1928f99314d2648fd
Copying config sha256:43306b5ef7a953b496181ba4105cc918009f28a33b74fac034ce5916f1755a9d
Writing manifest to image destination
Storing signatures
--> 43306b5ef7a
43306b5ef7a953b496181ba4105cc918009f28a33b74fac034ce5916f1755a9d
Pushing image image-registry.openshift-image-registry.svc:5000/h5nuvola/h5nuvola2:latest ...
Getting image source signatures
Copying blob sha256:7d8746edbd91550b9e746520122db8b87abddf93db4179b1928f99314d2648fd
Copying blob sha256:f659c5c779ac4373302bfe3dc7d713c59cf9ec9f179a71e9b26336a51043fad2
Copying blob sha256:fc5b206e9329a1674dd9e8efbee45c9be28d0d0dcbabba3c6bb67a2f22cfcf2a
Copying blob sha256:e7021e0589e97471d99c4265b7c8e64da328e48f116b5f260353b2e0a2adb373
Copying blob sha256:d7f79a2be1b92fe228308ea7366e3af2d2fb89daa7f6a931cdeee6470cd28a1b
Copying blob sha256:9e7a6dc796f0a75c560158a9f9e30fb8b5a90cb53edce9ffbdf5778406e4de39
Copying config sha256:43306b5ef7a953b496181ba4105cc918009f28a33b74fac034ce5916f1755a9d
Writing manifest to image destination
Storing signatures
Successfully pushed image-registry.openshift-image-registry.svc:5000/h5nuvola/h5nuvola2@sha256:41655835d4e985f4d758c830234c7b237816c54db03bc38b37da2936dff74072
Push successful
import os
port = int(os.environ.get('JUPYTER_NOTEBOOK_PORT', '8080'))
c.NotebookApp.ip = '0.0.0.0'
c.NotebookApp.port = port
c.NotebookApp.open_browser = False
c.NotebookApp.quit_button = False
c.NotebookApp.tornado_settings = { 'headers': { 'Content-Security-Policy': "frame-ancestors 'self' *" } }
if os.environ.get('JUPYTERHUB_SERVICE_PREFIX'):
c.NotebookApp.base_url = os.environ.get('JUPYTERHUB_SERVICE_PREFIX')
password = os.environ.get('JUPYTER_NOTEBOOK_PASSWORD')
if password:
import notebook.auth
c.NotebookApp.password = notebook.auth.passwd(password)
del password
del os.environ['JUPYTER_NOTEBOOK_PASSWORD']
image_config_file = '/opt/app-root/src/.jupyter/jupyter_notebook_config.py'
if os.path.exists(image_config_file):
with open(image_config_file) as fp:
exec(compile(fp.read(), image_config_file, 'exec'), globals())
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment