Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

docker: new build for new XClim and to get Dask dashboard and Panel server app to work #105

Merged
merged 38 commits into from May 5, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
38 commits
Select commit Hold shift + click to select a range
84313e8
release: update to use image pavics/workflow-tests:220407
tlvu Apr 7, 2022
3a0b90e
docker: get dask dashboard and "panel serve" to work
tlvu Apr 8, 2022
68d7c4d
release: update to use image pavics/workflow-tests:220407.1
tlvu Apr 8, 2022
ef0bf06
release: update to use image pavics/workflow-tests:220412
tlvu Apr 12, 2022
b812f37
docker: add jupyter-panel-proxy to hopefully able to customize panel …
tlvu Apr 14, 2022
3a25387
release: update to use image pavics/workflow-tests:220414
tlvu Apr 14, 2022
088bc96
binder: add TEST-panel.ipynb for testing
tlvu Apr 22, 2022
2365bcb
binder: disable other notebooks and add TEST-panel-servable.ipynb for…
tlvu Apr 22, 2022
4f15b1c
binder: fix notebook dir not writable
tlvu Apr 22, 2022
47ef7b0
binder: test Panel launcher subdir support
tlvu Apr 22, 2022
9b176c0
docker: try to fix jupyter-panel-proxy launcher blank page
tlvu Apr 22, 2022
bb7a1b7
release: update to use image pavics/workflow-tests:220422
tlvu Apr 22, 2022
0137007
binder: commit test notebooks to avoid external dependencies and guar…
tlvu Apr 26, 2022
b74662d
binder: test whether Panel launcher requires writable perm at current…
tlvu Apr 26, 2022
1157981
binder: confirmed Panel launcher do not need writable perm at current…
tlvu Apr 26, 2022
4a3f00a
binder: try to fix conda install on cli
tlvu Apr 26, 2022
5219e06
binder: get latest jupyter-panel-proxy, the current one is 2 years old
tlvu Apr 27, 2022
6f09cd7
docker: fix conda install cli permission error
tlvu Apr 27, 2022
e687e3a
docker: get dev version of jupyter-panel-proxy, current ver 0.1.0 is …
tlvu Apr 27, 2022
4be15cc
docker: fix everything executable under /opt/conda for all, wanted ex…
tlvu Apr 27, 2022
cce6c9d
release: update to use image pavics/workflow-tests:220426
tlvu Apr 27, 2022
6b2bc4c
Merge remote-tracking branch 'origin/new-docker-build' into lvu-test
tlvu Apr 27, 2022
79552ea
binder: new base image has the steps already integrated
tlvu Apr 27, 2022
6c65cb3
docker: use devel version of panel to hopefully fix Panel preview pro…
tlvu Apr 27, 2022
dc67451
release: update to use image pavics/workflow-tests:220427
tlvu Apr 27, 2022
52d8222
Merge remote-tracking branch 'origin/new-docker-build' into lvu-test
tlvu Apr 27, 2022
38cce45
docker: manual force newer clisops, mamba somehow choose an older ver
tlvu Apr 27, 2022
2c9c67f
docker: unpin cf_xarray for clisops 0.9.0 need cf_xarray >= 0.7.0
tlvu Apr 28, 2022
856a871
release: update to use image pavics/workflow-tests:220428
tlvu Apr 28, 2022
4e94f42
docker: remove handcals as it seems to interfere with Panel preview b…
tlvu Apr 28, 2022
864b735
release: update to use image pavics/workflow-tests:220428.1
tlvu Apr 28, 2022
cc7bf59
Merge remote-tracking branch 'origin/new-docker-build' into lvu-test
tlvu Apr 28, 2022
7011c86
docker: patch Panel for 'Render with Panel' button regression fix
tlvu May 3, 2022
9f1863c
release: update to use image pavics/workflow-tests:220502
tlvu May 3, 2022
518e51c
Merge remote-tracking branch 'origin/new-docker-build' into lvu-test
tlvu May 4, 2022
e42ad29
binder: undo temporary changes for testing Holoviz Panel
tlvu May 4, 2022
c0a3157
docker: remove Holoviz Panel patch, new dev release v0.13.1a3 contain…
tlvu May 4, 2022
0977f44
docker: bump panel to devel ver 0.13.1a3 for 'Render with Panel' butt…
tlvu May 4, 2022
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
2 changes: 1 addition & 1 deletion Jenkinsfile
Expand Up @@ -10,7 +10,7 @@ pipeline {
// https://jenkins.io/doc/book/pipeline/syntax/
agent {
docker {
image "pavics/workflow-tests:220401"
image "pavics/workflow-tests:220502"
label 'linux && docker'
}
}
Expand Down
10 changes: 8 additions & 2 deletions binder/Dockerfile
@@ -1,4 +1,4 @@
FROM pavics/workflow-tests:220401
FROM pavics/workflow-tests:220502

USER root

Expand All @@ -12,6 +12,12 @@ WORKDIR /notebooks

RUN ./downloadrepos; DEPLOY_PAVICS_LANDING_NB=1 ./reorg-notebooks; rm -rfv downloadrepos default_build_params reorg-notebooks; chown -R jenkins:jenkins .

RUN pip install https://github.com/Ouranosinc/xclim/archive/master.tar.gz
#COPY binder/test-notebooks /notebooks

#RUN mkdir -p subdir1/subdir2; cp TEST-panel-servable.ipynb subdir1/servable1.ipynb; cp TEST-panel-servable.ipynb subdir1/subdir2/servable2.ipynb; cp TEST-panel-servable.ipynb TEST-panel-servable-Copy.ipynb

#RUN chown jenkins:jenkins -R .

# RUN pip install https://github.com/Ouranosinc/xclim/archive/master.tar.gz

USER jenkins
85 changes: 85 additions & 0 deletions binder/test-notebooks/TEST-panel-binder.ipynb
@@ -0,0 +1,85 @@
{
"cells": [
{
"cell_type": "code",
"execution_count": 1,
"id": "d79b1053-3144-47d4-824f-49a3666d68e6",
"metadata": {},
"outputs": [
{
"name": "stderr",
"output_type": "stream",
"text": [
"WARNING:bokeh.server.util:Host wildcard '*' will allow connections originating from multiple (or possibly all) hostnames or IPs. Use non-wildcard values to restrict access explicitly\n"
]
},
{
"name": "stdout",
"output_type": "stream",
"text": [
"Launching server at http://localhost:5007\n"
]
}
],
"source": [
"import panel as pn\n",
"srv = pn.panel(\n",
" pn.widgets.FloatInput(name='an input')\n",
").show(port=5007, websocket_origin=\"*\")"
]
},
{
"cell_type": "markdown",
"id": "8f18de16-80bd-40dc-9438-ca176fc8c169",
"metadata": {},
"source": [
"Your current URL should look something like:\n",
"\n",
"https://hub.gke2.mybinder.org/user/ouranosinc-pavi--workflow-tests-9jerf8qk/lab/tree/TEST-panel-binder.ipynb\n",
"\n",
"Open a new browser tab, then to go to something like this URL (replace `lab/tree/TEST-panel-binder.ipynb` with `proxy/5007/`):\n",
"\n",
"https://hub.gke2.mybinder.org/user/ouranosinc-pavi--workflow-tests-9jerf8qk/proxy/5007/"
]
},
{
"cell_type": "code",
"execution_count": null,
"id": "2d39a37c-8df6-4f27-9aeb-54181f35c295",
"metadata": {},
"outputs": [],
"source": [
"srv.stop() # To stop the server."
]
},
{
"cell_type": "code",
"execution_count": null,
"id": "fb898f21-f543-40b4-8bf4-b701559b842f",
"metadata": {},
"outputs": [],
"source": []
}
],
"metadata": {
"kernelspec": {
"display_name": "Python 3 (ipykernel)",
"language": "python",
"name": "python3"
},
"language_info": {
"codemirror_mode": {
"name": "ipython",
"version": 3
},
"file_extension": ".py",
"mimetype": "text/x-python",
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.8.13"
}
},
"nbformat": 4,
"nbformat_minor": 5
}
36 changes: 36 additions & 0 deletions binder/test-notebooks/TEST-panel-servable.ipynb
@@ -0,0 +1,36 @@
{
"cells": [
{
"cell_type": "code",
"execution_count": null,
"id": "7acdd82a-bc2d-443c-8fa8-e432de9cfa30",
"metadata": {},
"outputs": [],
"source": [
"import panel as pn\n",
"pn.panel('# Ceci est un test').servable()"
]
}
],
"metadata": {
"kernelspec": {
"display_name": "Python 3 (ipykernel)",
"language": "python",
"name": "python3"
},
"language_info": {
"codemirror_mode": {
"name": "ipython",
"version": 3
},
"file_extension": ".py",
"mimetype": "text/x-python",
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.8.13"
}
},
"nbformat": 4,
"nbformat_minor": 5
}
12 changes: 9 additions & 3 deletions docker/Dockerfile
Expand Up @@ -17,7 +17,7 @@ RUN apt-get update && \
# Change /opt/conda folder permissions for jupyter-conda extension.
RUN groupadd --gid 1000 jenkins \
&& useradd --uid 1000 --gid jenkins --create-home jenkins && \
chmod -R a+rwx /opt/conda
chmod -R a+rwX /opt/conda

COPY environment.yml /environment.yml

Expand Down Expand Up @@ -70,7 +70,9 @@ RUN python -m ipykernel install --name birdy
# https://github.com/plotly/jupyter-dash/issues/49
RUN jupyter lab build

RUN jupyter serverextension enable voila --sys-prefix
RUN jupyter serverextension enable voila --sys-prefix \
&& jupyter serverextension enable panel.io.jupyter_server_extension --sys-prefix \
&& jupyter serverextension list
# && jupyter labextension install jupyterlab-clipboard

# This should be "master" but commit
Expand All @@ -94,7 +96,11 @@ RUN wget https://raw.githubusercontent.com/jupyter/docker-stacks/$DOCKER_STACKS_
chmod a+rx /usr/local/bin/start.sh /usr/local/bin/start-singleuser.sh /usr/local/bin/start-notebook.sh /usr/local/bin/fix-permissions && \
chmod a+r /etc/jupyter/jupyter_notebook_config.py && \
mkdir /notebook_dir && chown jenkins /notebook_dir && \
chmod a+rwX -R /opt/conda/envs/birdy/fonts
chmod a+rwX -R /opt/conda/envs/birdy/fonts && \
chmod a+rwX -R /opt/conda/pkgs/cache

# For jupyter-panel-proxy launcher.
ENV BOKEH_ALLOW_WS_ORIGIN "*"

# problem running start-notebook.sh when being root
# the jupyter/base-notebook image also do not default to root user so we do the same here
Expand Down
18 changes: 12 additions & 6 deletions docker/environment.yml
Expand Up @@ -5,6 +5,7 @@ channels:
- cdat
- bokeh
- plotly # for jupyter-dash
- pyviz/label/dev # for jupyter-panel-proxy, panel
- defaults

dependencies:
Expand All @@ -27,9 +28,6 @@ dependencies:
- dask <= 2022.1.0
- distributed <= 2022.1.0

# Pin cf_xarray for slow WPS_example.ipynb.
- cf_xarray<=0.6.3

- matplotlib
# - xarray # from xclim and ravenpy
# - numpy # from xclim and ravenpy
Expand Down Expand Up @@ -57,7 +55,7 @@ dependencies:
- jupyter_bokeh
- pscript
- h5netcdf
- panel
- panel >= 0.13.1a3
# https://github.com/holoviz/panel
- pyviz_comms # (was labextension pyviz/jupyterlab_pyviz in jupyterlab v2)
- holoviews
Expand Down Expand Up @@ -119,7 +117,7 @@ dependencies:
# warnings.warn(f'Downloading: {url}', DownloadWarning)
- shapely <= 1.7.1
# https://github.com/roocs/clisops
- clisops >= 0.8.0
- clisops >= 0.9.0
# Universal Regridder for Geospatial Data
# https://github.com/pangeo-data/xESMF
# xesmf-0.6.2 requires clisops>=0.8.0
Expand Down Expand Up @@ -170,6 +168,12 @@ dependencies:
# xeus-python: back-end kernel implementing the Jupyter Debug Protocol
- xeus-python
- jupyter-dash
# https:://github.com/jupyterhub/jupyter-server-proxy
- jupyter-server-proxy
# https://github.com/dask/dask-labextension
- dask-labextension
# https://github.com/holoviz/jupyter-panel-proxy
- jupyter-panel-proxy >= 0.2.0a2
# Force newer nodejs for 'jupyter lab build' issue
# https://github.com/jupyterlab/jupyterlab/issues/11726#issuecomment-998901247
# TODO: remove nodejs once all extensions move to prebuilt extensions, see comment
Expand Down Expand Up @@ -197,7 +201,9 @@ dependencies:
# Mimics how one might format their calculation if it were written with a
# pencil: write the symbolic formula, followed by numeric substitutions,
# and then the result.
- handcalcs
# DISABLE handcalcs, interfere with "Panel preview" button
# See comment https://github.com/holoviz/panel/issues/3440#issuecomment-1112182170
# - handcalcs
# https://github.com/ShopRunner/jupyter-notify
# Jupyter Magic For Browser Notifications of Cell Completion.
- jupyternotify
Expand Down
2 changes: 1 addition & 1 deletion launchcontainer
@@ -1,7 +1,7 @@
#!/bin/sh -x

if [ -z "$DOCKER_IMAGE" ]; then
DOCKER_IMAGE="pavics/workflow-tests:220401"
DOCKER_IMAGE="pavics/workflow-tests:220502"
fi

if [ -z "$CONTAINER_NAME" ]; then
Expand Down
2 changes: 1 addition & 1 deletion launchnotebook
Expand Up @@ -7,7 +7,7 @@ if [ -z "$PORT" ]; then
fi

if [ -z "$DOCKER_IMAGE" ]; then
DOCKER_IMAGE="pavics/workflow-tests:220401"
DOCKER_IMAGE="pavics/workflow-tests:220502"
fi

if [ -z "$CONTAINER_NAME" ]; then
Expand Down