Skip to content

Commit a161ec8

Browse files
Bump for onecodex v0.9.1 (#27)
* Update notebook for v0.8.0, drops R support * Bump for onecodex 0.9.0 * Bump for v0.9.1 * Fix custom font install
1 parent 2a1762e commit a161ec8

File tree

3 files changed

+28
-135
lines changed

3 files changed

+28
-135
lines changed

Dockerfile

+28-88
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
# Extended from github.com/jupyter/docker-stacks
44
# See also http://blog.dscpl.com.au/2016/01/roundup-of-docker-issues-when-hosting.html
55

6-
FROM python:3.6.6-slim-stretch
6+
FROM python:3.8.3-slim-buster
77

88
LABEL maintainer="Nick Greenfield <[email protected]>"
99

@@ -65,48 +65,20 @@ RUN mkdir /home/$NB_USER/work && \
6565
# Update pip
6666
RUN pip install --upgrade pip
6767

68-
# Numpy must be installed first
69-
RUN pip install numpy==1.15.4
70-
71-
# Install Python 3 packages
72-
RUN pip install \
73-
awscli==1.16.81 \
74-
# beautifulsoup4==4.6 \
75-
biopython==1.72 \
76-
bokeh==1.0.3 \
77-
certifi==2018.10.15 \
78-
click==7.0 \
79-
# cloudpickle==0.2.2 \
80-
cython==0.29.2 \
81-
# dill==0.2 \
82-
# h5py==2.9.0 \
83-
ipywidgets==7.4.2 \
84-
jupyterthemes==0.20.0 \
85-
jupyter_contrib_nbextensions==0.5.1 \
86-
matplotlib==3.0.2 \
87-
numba==0.42.0 \
88-
numexpr==2.6.9 \
89-
openpyxl==2.6.1 \
90-
pandas==0.23.0 \
91-
# patsy==0.4.0 \
92-
# scikit-image==0.13.0 \
93-
scikit-learn==0.19.0 \
94-
scipy==1.1.0 \
95-
seaborn==0.9.0 \
96-
selenium==3.141.0 \
97-
statsmodels==0.10.1 \
98-
# sqlalchemy==1.1.0 \
99-
# statsmodels==0.8.0 \
100-
# sympy==1.1 \
101-
# vincent==0.4.0 \
102-
weasyprint==47 \
103-
xlrd==1.2.0
68+
# Install numpy
69+
RUN pip install numpy==1.18.4
10470

105-
# Jupyter notebook should have already been installed above, but here we force a particular version
106-
RUN pip install notebook==5.7.4
71+
# Install Jupyter extensions
72+
RUN pip install ipywidgets jupyter_contrib_nbextensions
73+
74+
# Install other helpful modules
75+
RUN pip install openpyxl==3.0.3 xlrd==1.2.0 statsmodels==0.11.1
10776

108-
# Pin tornado version, as 6.0.0 apparently breaks jupyter notebook
109-
RUN pip install tornado==5.1.1
77+
# Install weasyprint
78+
RUN pip install WeasyPrint==51
79+
80+
# Jupyter notebook should have already been installed above, but here we force a particular version
81+
RUN pip install onecodex[all,reports]==0.9.1
11082

11183
# Activate ipywidgets extension in the environment that runs the notebook server
11284
RUN jupyter nbextension enable --py widgetsnbextension --sys-prefix
@@ -122,40 +94,11 @@ RUN wget https://ftp.samba.org/pub/cwrap/nss_wrapper-1.1.2.tar.gz && \
12294
rm nss_wrapper-1.1.2.tar.gz && \
12395
mkdir nss_wrapper/obj && \
12496
(cd nss_wrapper/obj && \
125-
cmake -DCMAKE_INSTALL_PREFIX=/usr/local -DLIB_SUFFIX=64 .. && \
126-
make && \
127-
make install) && \
97+
cmake -DCMAKE_INSTALL_PREFIX=/usr/local -DLIB_SUFFIX=64 .. && \
98+
make && \
99+
make install) && \
128100
rm -rf nss_wrapper
129101

130-
# Allows rendering of Vega images in headless chrome browser
131-
RUN curl -sSL https://dl.google.com/linux/linux_signing_key.pub | apt-key add - \
132-
&& echo "deb [arch=amd64] https://dl.google.com/linux/chrome/deb/ stable main" > /etc/apt/sources.list.d/google-chrome.list
133-
RUN apt-get update && apt-get install -yq --no-install-recommends google-chrome-stable
134-
COPY notebook/chromedriver.sh /root/chromedriver.sh
135-
RUN chmod +x /root/chromedriver.sh && /root/chromedriver.sh
136-
137-
# Install R and some basic packages
138-
RUN apt-get update && apt-get install -yq --no-install-recommends \
139-
r-base \
140-
r-cran-dplyr \
141-
r-cran-plyr \
142-
r-cran-ggplot2 \
143-
r-cran-tidyr \
144-
r-cran-shiny \
145-
r-cran-stringr \
146-
r-cran-rsqlite \
147-
r-cran-reshape2 \
148-
r-cran-caret \
149-
r-cran-rcurl \
150-
r-cran-crayon \
151-
r-cran-randomforest \
152-
&& apt-get clean \
153-
&& rm -rf /var/lib/apt/lists/*
154-
155-
# This lets us select R from inside the notebook
156-
RUN echo "install.packages(\"IRkernel\", repos=\"https://cran.rstudio.com\")" | R --no-save
157-
RUN echo "IRkernel::installspec()" | R --no-save
158-
159102
# Dependencies for weasyprint. Known bugs on libcairo < 1.15.4. Must pull from debian-buster to get 1.16
160103
RUN echo "deb http://deb.debian.org/debian buster main" >> /etc/apt/sources.list \
161104
&& apt-get update \
@@ -167,6 +110,14 @@ RUN echo "deb http://deb.debian.org/debian buster main" >> /etc/apt/sources.list
167110
&& apt-get clean \
168111
&& rm -rf /var/lib/apt/lists/*
169112

113+
# Copy `onecodex` installed fonts to local directory
114+
RUN cp /usr/local/lib/python3.8/site-packages/onecodex/assets/fonts/*.otf /usr/local/share/fonts && fc-cache
115+
116+
# Install Node and vega-cli for server-side image rendering
117+
RUN curl -sL https://deb.nodesource.com/setup_14.x | bash -
118+
RUN apt-get -y install nodejs
119+
120+
170121
# Configure container startup
171122
EXPOSE 8888
172123
COPY notebook/entrypoint.sh /usr/local/bin/entrypoint.sh
@@ -176,9 +127,8 @@ CMD ["jupyter", "notebook"]
176127

177128
# Add assets
178129
RUN mkdir /opt/onecodex/
179-
# COPY install/* /opt/onecodex/
180-
COPY notebook/notebook.html /usr/local/lib/python3.6/site-packages/notebook/templates
181-
COPY notebook/override.css /usr/local/lib/python3.6/site-packages/notebook/static/notebook/css
130+
COPY notebook/notebook.html /usr/local/lib/python3.8/site-packages/notebook/templates
131+
COPY notebook/override.css /usr/local/lib/python3.8/site-packages/notebook/static/notebook/css
182132
COPY notebook/onecodex.js /home/$NB_USER/.jupyter/custom/
183133
COPY notebook/one-codex-spinner.svg /home/$NB_USER/.jupyter/custom/
184134

@@ -188,20 +138,10 @@ COPY notebook/token_notebook.py /usr/local/bin/token_notebook.py
188138
RUN chmod +x /usr/local/bin/token_notebook.py
189139

190140
# Add patch to jupyter notebook for export to One Codex document portal
191-
COPY notebook/notebook.patch /usr/local/lib/python3.6/site-packages/notebook
192-
RUN cd /usr/local/lib/python3.6/site-packages/notebook \
141+
COPY notebook/notebook.patch /usr/local/lib/python3.8/site-packages/notebook
142+
RUN cd /usr/local/lib/python3.8/site-packages/notebook \
193143
&& patch -p0 < notebook.patch
194144

195-
# Install Node and vega-cli for server-side image rendering
196-
RUN curl -sL https://deb.nodesource.com/setup_12.x | bash -
197-
RUN apt-get -y install nodejs
198-
RUN npm install -g --unsafe-perm [email protected] [email protected]
199-
COPY notebook/vega-cli.patch /usr/lib/node_modules
200-
RUN cd /usr/lib/node_modules && patch -p0 < vega-cli.patch
201-
202-
# Install One Codex Python lib
203-
RUN pip install --no-cache onecodex[all]==0.7.2
204-
205145
# Finally fix permissions on everything
206146
# See https://github.com/jupyter/docker-stacks/issues/188
207147
RUN chown -R $NB_USER:root /home/$NB_USER && chmod -R u+w,g+w /home/$NB_USER

notebook/chromedriver.sh

-12
This file was deleted.

notebook/vega-cli.patch

-35
This file was deleted.

0 commit comments

Comments
 (0)