Skip to content
Snippets Groups Projects
Commit 8464719b authored by Luigi Sbailo's avatar Luigi Sbailo
Browse files

Add fix permissions $CONDA_DIR after tests

parent 77af4857
No related branches found
No related tags found
1 merge request!109Change permissions positions in dockerfile and change tutorial template
......@@ -217,9 +217,6 @@ RUN pip install numpy==1.17
USER root
RUN fix-permissions /opt/tutorials \
&& fix-permissions $CONDA_DIR
# Trick to stop caching
ARG CACHE_DATE=2021-1-26
......@@ -229,9 +226,21 @@ COPY files files
RUN pip install Pillow
RUN python generate_headers.py
# Customize jupyter
WORKDIR $HOME
COPY files/custom.css custom.css
COPY files/logo.png logo.png
COPY files/Titillium Titillium
RUN mkdir .jupyter/custom
RUN mv custom.css .jupyter/custom \
&& mv logo.png .jupyter/custom \
&& mv Titillium .jupyter/custom
ARG TUTORIALS_HOME=$HOME/tutorials
RUN fix-permissions /opt/tutorials \
&& fix-permissions $CONDA_DIR
# Linking all the notebooks of the tutorials
WORKDIR $TUTORIALS_HOME
RUN ln -s /opt/tutorials/*/*.ipynb . \
......@@ -241,55 +250,47 @@ RUN ln -s /opt/tutorials/*/*.ipynb . \
WORKDIR $TUTORIALS_HOME/assets
RUN ln -s /opt/tutorials/*/assets/* .
# Linking data may required by the tutorials
# Linking data may be required by the tutorials
WORKDIR $TUTORIALS_HOME/data
RUN mkdir data && ln -s /opt/tutorials/*/data/* .
# Customize jupyter
WORKDIR $HOME
COPY files/custom.css custom.css
COPY files/logo.png logo.png
COPY files/Titillium Titillium
RUN mkdir .jupyter/custom
RUN mv custom.css .jupyter/custom \
&& mv logo.png .jupyter/custom \
&& mv Titillium .jupyter/custom
# Testing tutorials
#RUN cp -r tutorials test_tutorials
#RUN jupyter nbconvert --ExecutePreprocessor.timeout=1000 --to notebook --execute "test_tutorials/ARISE.ipynb"
#RUN jupyter nbconvert --ExecutePreprocessor.timeout=1000 --to notebook --execute "test_tutorials/atomic_features.ipynb"
#RUN jupyter nbconvert --ExecutePreprocessor.timeout=1000 --to notebook --execute "test_tutorials/clustering_tutorial.ipynb"
#RUN jupyter nbconvert --ExecutePreprocessor.timeout=1000 --to notebook --execute "test_tutorials/cmlkit.ipynb"
## RUN jupyter nbconvert --ExecutePreprocessor.timeout=1000 --to notebook --execute "test_tutorials/CO2_SGD.ipynb"
#RUN jupyter nbconvert --ExecutePreprocessor.timeout=1000 --to notebook --execute "test_tutorials/compressed_sensing.ipynb"
#RUN jupyter nbconvert --ExecutePreprocessor.timeout=1000 --to notebook --execute "test_tutorials/convolutional_nn.ipynb"
#RUN jupyter nbconvert --ExecutePreprocessor.timeout=1000 --to notebook --execute "test_tutorials/decision_tree.ipynb"
#RUN jupyter nbconvert --ExecutePreprocessor.timeout=1000 --to notebook --execute "test_tutorials/descriptor_role.ipynb"
## RUN jupyter nbconvert --ExecutePreprocessor.timeout=1000 --to notebook --execute "test_tutorials/error_estimates.ipynb"
## RUN jupyter nbconvert --ExecutePreprocessor.timeout=1000 --to notebook --execute "test_tutorials/exploratory_analysis.ipynb"
#RUN jupyter nbconvert --ExecutePreprocessor.timeout=1000 --to notebook --execute "test_tutorials/gap_si_surface.ipynb"
#RUN jupyter nbconvert --ExecutePreprocessor.timeout=1000 --to notebook --execute "test_tutorials/grain_boundaries.ipynb"
## RUN jupyter nbconvert --ExecutePreprocessor.timeout=1000 --to notebook --execute "test_tutorials/kaggle_competition.ipynb"
#RUN jupyter nbconvert --ExecutePreprocessor.timeout=1000 --to notebook --execute "test_tutorials/krr4mat.ipynb"
#RUN jupyter nbconvert --ExecutePreprocessor.timeout=1000 --to notebook --execute "test_tutorials/nn_regression.ipynb"
#RUN jupyter nbconvert --ExecutePreprocessor.timeout=1000 --to notebook --execute "test_tutorials/perovskites_tolerance_factor.ipynb"
#RUN jupyter nbconvert --ExecutePreprocessor.timeout=5000 --to notebook --execute "test_tutorials/query_nomad_archive.ipynb"
#RUN jupyter nbconvert --ExecutePreprocessor.timeout=1000 --to notebook --execute "test_tutorials/sgd_alloys_oxygen_reduction_evolution.ipynb"
#RUN jupyter nbconvert --ExecutePreprocessor.timeout=1000 --to notebook --execute "test_tutorials/soap_atomic_charges.ipynb"
#RUN jupyter nbconvert --ExecutePreprocessor.timeout=1000 --to notebook --execute "test_tutorials/tcmi.ipynb"
#RUN jupyter nbconvert --ExecutePreprocessor.timeout=1000 --to notebook --execute "test_tutorials/tetradymite_PRM2020.ipynb"
## Remove following tutorial because test is too long
## RUN jupyter nbconvert --ExecutePreprocessor.timeout=20000 --to notebook --execute "test_tutorials/domain_of_applicability.ipynb"
#RUN rm -r test_tutorials
RUN cp -r tutorials test_tutorials
RUN jupyter nbconvert --ExecutePreprocessor.timeout=1000 --to notebook --execute "test_tutorials/ARISE.ipynb"
RUN jupyter nbconvert --ExecutePreprocessor.timeout=1000 --to notebook --execute "test_tutorials/atomic_features.ipynb"
RUN jupyter nbconvert --ExecutePreprocessor.timeout=1000 --to notebook --execute "test_tutorials/clustering_tutorial.ipynb"
RUN jupyter nbconvert --ExecutePreprocessor.timeout=1000 --to notebook --execute "test_tutorials/cmlkit.ipynb"
# RUN jupyter nbconvert --ExecutePreprocessor.timeout=1000 --to notebook --execute "test_tutorials/CO2_SGD.ipynb"
RUN jupyter nbconvert --ExecutePreprocessor.timeout=1000 --to notebook --execute "test_tutorials/compressed_sensing.ipynb"
RUN jupyter nbconvert --ExecutePreprocessor.timeout=1000 --to notebook --execute "test_tutorials/convolutional_nn.ipynb"
RUN jupyter nbconvert --ExecutePreprocessor.timeout=1000 --to notebook --execute "test_tutorials/decision_tree.ipynb"
RUN jupyter nbconvert --ExecutePreprocessor.timeout=1000 --to notebook --execute "test_tutorials/descriptor_role.ipynb"
# RUN jupyter nbconvert --ExecutePreprocessor.timeout=1000 --to notebook --execute "test_tutorials/error_estimates.ipynb"
# RUN jupyter nbconvert --ExecutePreprocessor.timeout=1000 --to notebook --execute "test_tutorials/exploratory_analysis.ipynb"
RUN jupyter nbconvert --ExecutePreprocessor.timeout=1000 --to notebook --execute "test_tutorials/gap_si_surface.ipynb"
RUN jupyter nbconvert --ExecutePreprocessor.timeout=1000 --to notebook --execute "test_tutorials/grain_boundaries.ipynb"
# RUN jupyter nbconvert --ExecutePreprocessor.timeout=1000 --to notebook --execute "test_tutorials/kaggle_competition.ipynb"
RUN jupyter nbconvert --ExecutePreprocessor.timeout=1000 --to notebook --execute "test_tutorials/krr4mat.ipynb"
RUN jupyter nbconvert --ExecutePreprocessor.timeout=1000 --to notebook --execute "test_tutorials/nn_regression.ipynb"
RUN jupyter nbconvert --ExecutePreprocessor.timeout=1000 --to notebook --execute "test_tutorials/perovskites_tolerance_factor.ipynb"
RUN jupyter nbconvert --ExecutePreprocessor.timeout=5000 --to notebook --execute "test_tutorials/query_nomad_archive.ipynb"
RUN jupyter nbconvert --ExecutePreprocessor.timeout=1000 --to notebook --execute "test_tutorials/sgd_alloys_oxygen_reduction_evolution.ipynb"
RUN jupyter nbconvert --ExecutePreprocessor.timeout=1000 --to notebook --execute "test_tutorials/soap_atomic_charges.ipynb"
RUN jupyter nbconvert --ExecutePreprocessor.timeout=1000 --to notebook --execute "test_tutorials/tcmi.ipynb"
RUN jupyter nbconvert --ExecutePreprocessor.timeout=1000 --to notebook --execute "test_tutorials/tetradymite_PRM2020.ipynb"
# Remove following tutorial because test is too long
# RUN jupyter nbconvert --ExecutePreprocessor.timeout=20000 --to notebook --execute "test_tutorials/domain_of_applicability.ipynb"
RUN rm -r test_tutorials
# ================================================================================
# Switch back to jovyan to avoid accidental container runs as root
# ================================================================================
WORKDIR $HOME
RUN fix-permissions $TUTORIALS_HOME \
&& fix-permissions $HOME/.local/share/jupyter
&& fix-permissions $HOME/.local/share/jupyter \
&& fix-permissions $CONDA_DIR
USER $NB_UID
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment