-
Notifications
You must be signed in to change notification settings - Fork 40
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #87 from darribas/mono_restructure
Mono restructure
- Loading branch information
Showing
47 changed files
with
277 additions
and
52 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,133 @@ | ||
FROM quay.io/jupyter/minimal-notebook | ||
|
||
LABEL maintainer="Dani Arribas-Bel <D.Arribas-Bel@liverpool.ac.uk>" | ||
|
||
# Set version | ||
ENV GDS_ENV_VERSION "11.0alpha" | ||
|
||
# https://github.com/ContinuumIO/docker-images/blob/master/miniconda3/Dockerfile | ||
ENV LANG=C.UTF-8 LC_ALL=C.UTF-8 | ||
|
||
ADD ./*/*.sh $HOME/scripts/ | ||
USER root | ||
RUN chmod +x $HOME/scripts/*.sh | ||
USER $NB_UID | ||
|
||
############## | ||
### Python ### | ||
############## | ||
|
||
#--- Jupyter Dev ---# | ||
RUN $HOME/scripts/install_jupyter_dev.sh | ||
|
||
#--- Python ---# | ||
|
||
ADD ./py/gds_py.yml /home/${NB_USER}/ | ||
RUN $HOME/scripts/install_py_stack.sh | ||
ENV PATH="/opt/conda/envs/gds/bin/:${PATH}" | ||
|
||
#--- Clean up ---# | ||
|
||
USER root | ||
|
||
# Clean cache up | ||
RUN jupyter lab clean -y \ | ||
&& conda clean --yes --all --force-pkgs-dirs \ | ||
&& npm cache clean --force \ | ||
&& rm -rf $CONDA_DIR/share/jupyter/lab/staging \ | ||
&& rm -rf "/home/${NB_USER}/.node-gyp" \ | ||
&& rm -rf /home/$NB_USER/.cache/yarn \ | ||
&& fix-permissions "${CONDA_DIR}" \ | ||
&& fix-permissions "/home/${NB_USER}" | ||
# Build mpl font cache | ||
# https://github.com/jupyter/docker-stacks/blob/c3d5df67c8b158b0aded401a647ea97ada1dd085/scipy-notebook/Dockerfile#L59 | ||
USER $NB_UID | ||
ENV XDG_CACHE_HOME="/home/${NB_USER}/.cache/" | ||
RUN source activate gds \ | ||
&& MPLBACKEND=Agg python -c "import matplotlib.pyplot" | ||
|
||
######### | ||
### R ### | ||
######### | ||
|
||
USER root | ||
|
||
# Remove Conda from path to not interfere with R install | ||
RUN echo ${PATH} | ||
ENV PATH="/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin" | ||
RUN echo ${PATH} | ||
|
||
# install R | ||
RUN $HOME/scripts/install_R.sh | ||
|
||
# Install Tidyverse + Geospatial | ||
RUN $HOME/scripts/install_R_stack.sh | ||
|
||
# install R GDS stack | ||
RUN $HOME/scripts/install_R_gds.sh | ||
|
||
# re-attach conda to path | ||
ENV PATH="/opt/conda/envs/gds/bin/:/opt/conda/condabin:/opt/conda/envs/gds/bin:/opt/conda/bin:${PATH}" | ||
|
||
#--- R/Python ---# | ||
|
||
RUN $HOME/scripts/setup_py-r.sh | ||
|
||
#--- Quarto ---# | ||
RUN $HOME/scripts/install_quarto.sh | ||
|
||
########### | ||
### Dev ### | ||
########### | ||
|
||
#--- jekyll ---# | ||
RUN $HOME/scripts/install_jekyll.sh | ||
|
||
#--- tippecanoe ---# | ||
RUN $HOME/scripts/install_tippecanoe.sh | ||
|
||
#--- htop ---# | ||
RUN apt-get update \ | ||
&& apt-get install -y --no-install-recommends htop | ||
|
||
#--- Decktape ---# | ||
RUN $HOME/scripts/install_decktape.sh | ||
|
||
#--- LaTeX tools ---# | ||
ADD ./dev/texBuild.py $HOME/ | ||
ADD ./dev/install_texbuild.py $HOME/ | ||
RUN $HOME/scripts/install_latex_tools.sh | ||
|
||
#--- Vim ---# | ||
ADD ./dev/vimrc $HOME/.vimrc | ||
RUN $HOME/scripts/install_vim.sh | ||
|
||
#--- GPQ ---# | ||
RUN $HOME/scripts/install_gpq.sh | ||
|
||
#--- Clean up ---# | ||
RUN fix-permissions $HOME \ | ||
&& fix-permissions $CONDA_DIR | ||
|
||
USER $NB_UID | ||
|
||
RUN find /opt/conda/ -follow -type f -name '*.a' -delete \ | ||
&& find /opt/conda/ -follow -type f -name '*.pyc' -delete \ | ||
&& find /opt/conda/ -follow -type f -name '*.js.map' -delete \ | ||
&& find /opt/conda/envs/gds//lib/python*/site-packages/bokeh/server/static \ | ||
-follow -type f -name '*.js' ! -name '*.min.js' -delete \ | ||
&& pip cache purge \ | ||
&& rm -rf $HOME/.cache/pip | ||
|
||
USER root | ||
RUN cd $NB_HOME \ | ||
&& rm -rf /tmp/downloaded_packages/ /tmp/*.rds \ | ||
&& rm -rf $GEM_HOME/cache \ | ||
&& rm -rf /usr/local/bundle/cache \ | ||
&& apt-get autoclean \ | ||
&& apt-get autoremove \ | ||
&& apt-get clean \ | ||
&& rm -rf /var/lib/apt/lists/* \ | ||
&& rm -rf $HOME/scripts | ||
|
||
USER $NB_UID |
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
#!/bin/bash | ||
|
||
apt-get update \ | ||
&& apt-get install -y --no-install-recommends \ | ||
ruby-full \ | ||
build-essential \ | ||
zlib1g-dev | ||
# https://github.com/sass-contrib/sass-embedded-host-ruby/issues/130#issuecomment-1588245011 | ||
gem install sass-embedded | ||
gem install sass --force sass-embedded | ||
gem install jekyll bundler github-pages jekyll-scholar just-the-docs | ||
|
||
rm -rf /var/lib/gems/3.0.0/cache/* | ||
rm -rf /var/lib/apt/lists/* \ | ||
&& apt-get autoclean \ | ||
&& apt-get autoremove \ | ||
&& apt-get clean | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
#!/bin/bash | ||
|
||
################# | ||
### Vim setup ### | ||
################# | ||
|
||
apt-get update \ | ||
&& apt-get install -y --no-install-recommends vim \ | ||
&& curl -fLo $HOME/.vim/autoload/plug.vim --create-dirs \ | ||
https://raw.githubusercontent.com/junegunn/vim-plug/master/plug.vim \ | ||
&& vim +PlugInstall +qall \ | ||
&& rm -rf /var/lib/apt/lists/* \ | ||
&& apt-get autoclean \ | ||
&& apt-get autoremove \ | ||
&& apt-get clean | ||
|
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
#!/bin/bash | ||
|
||
#--- [Run under $NB_USER] ---# | ||
|
||
#--- Text editor / default Vim ---# | ||
# https://github.com/jupyterlab/jupyterlab/issues/14599 | ||
mkdir -p /home/$NB_USER/.jupyter/lab/user-settings/\@jupyterlab/fileeditor-extension/ \ | ||
&& echo '{"editorConfig": {"codeFolding": true, "highlightActiveLine": true, "highlightTrailingWhitespace": true}}' \ | ||
>> /home/$NB_USER/.jupyter/lab/user-settings/\@jupyterlab/fileeditor-extension/plugin.jupyterlab-settings | ||
|
||
#--- JupyterLab extensions & Bash kernel ---# | ||
|
||
jupyter labextension disable "@jupyterlab/apputils-extension:announcements" \ | ||
&& pip install \ | ||
bash_kernel \ | ||
jupyterlab-geojson \ | ||
jupyterlab_myst \ | ||
jupyterlab-quarto \ | ||
jupyterlab_vim \ | ||
jupyterlab_widgets \ | ||
jupytext | ||
# Bash kernel | ||
python -m bash_kernel.install | ||
# Required for dask extension | ||
mamba install python-graphviz | ||
# Clean | ||
pip cache purge \ | ||
&& conda clean --all --yes --force-pkgs-dirs \ | ||
&& jupyter lab clean -y \ | ||
&& npm cache clean --force | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
#!/bin/bash | ||
|
||
#--- [Run under $NB_USER] ---# | ||
|
||
# Install GDS conda environment | ||
mamba env create -f gds_py.yml \ | ||
&& source activate gds \ | ||
&& python -m ipykernel install --user --name gds --display-name "GDS-$GDS_ENV_VERSION" \ | ||
&& conda deactivate \ | ||
&& rm ./gds_py.yml \ | ||
&& conda clean --yes --all --force-pkgs-dirs \ | ||
&& find /opt/conda/ -follow -type f -name '*.a' -delete \ | ||
&& find /opt/conda/ -follow -type f -name '*.pyc' -delete \ | ||
&& find /opt/conda/ -follow -type f -name '*.js.map' -delete \ | ||
&& find /opt/conda/envs/gds//lib/python*/site-packages/bokeh/server/static \ | ||
-follow -type f -name '*.js' ! -name '*.min.js' -delete \ | ||
&& pip cache purge \ | ||
&& rm -rf $HOME/.cache/pip | ||
|
||
# Pypeteer | ||
pyppeteer-install | ||
|
||
# Make GDS default | ||
# https://github.com/jupyter/notebook/issues/3674#issuecomment-397212982 | ||
jupyter lab --generate-config \ | ||
&& echo "c.MultiKernelManager.default_kernel_name='gds'" >> \ | ||
/home/${NB_USER}/.jupyter/jupyter_lab_config.py \ | ||
&& echo "conda activate gds" >> /home/${NB_USER}/.bashrc \ | ||
&& echo "c.KernelSpecManager.ensure_native_kernel = False" >> \ | ||
/home/${NB_USER}/.jupyter/jupyter_lab_config.py \ | ||
&& echo "c.KernelSpecManager.whitelist = {'gds', 'bash'}" >> \ | ||
/home/${NB_USER}/.jupyter/jupyter_lab_config.py | ||
jupyter kernelspec remove -y python3 | ||
|
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
File renamed without changes.
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
FROM darribas/gds_dev:10.0 | ||
FROM gds:11.0alpha | ||
|
||
USER root | ||
|
||
|
Oops, something went wrong.