Commit d1ea73e3 authored by Luigi Sbailo's avatar Luigi Sbailo
Browse files

:Merge branch 'staging'

parents aa20fc3c e8274f63
......@@ -18,9 +18,8 @@ build to staging:
- echo $CI_REGISTRY_PASSWORD | docker login -u $CI_REGISTRY_USER $CI_REGISTRY --password-stdin
- docker info
script:
# Use cache --cache-from ${CI_REGISTRY_IMAGE}:${CI_MERGE_REQUEST_SOURCE_BRANCH_NAME}$ to speed up the build process
- docker pull ${CI_REGISTRY_IMAGE}:${CI_MERGE_REQUEST_SOURCE_BRANCH_NAME} || true
- docker build --tag ${CI_REGISTRY_IMAGE}:${CI_MERGE_REQUEST_SOURCE_BRANCH_NAME}${CI_COMMIT_SHORT_SHA} --tag ${CI_REGISTRY_IMAGE}:${CI_MERGE_REQUEST_SOURCE_BRANCH_NAME} --build-arg CACHE_DATE=${CI_PIPELINE_CREATED_AT} .
- docker pull ${CI_REGISTRY_IMAGE}:staging || true
- docker build --cache-from ${CI_REGISTRY_IMAGE}:staging --tag ${CI_REGISTRY_IMAGE}:${CI_MERGE_REQUEST_SOURCE_BRANCH_NAME}${CI_COMMIT_SHORT_SHA} --tag ${CI_REGISTRY_IMAGE}:${CI_MERGE_REQUEST_SOURCE_BRANCH_NAME} --build-arg CACHE_DATE=${CI_PIPELINE_CREATED_AT} .
- docker push ${CI_REGISTRY_IMAGE}:${CI_MERGE_REQUEST_SOURCE_BRANCH_NAME}${CI_COMMIT_SHORT_SHA}
- docker push ${CI_REGISTRY_IMAGE}:${CI_MERGE_REQUEST_SOURCE_BRANCH_NAME}
rules:
......@@ -35,7 +34,6 @@ build to production:
- docker login -u ai_toolkit -p ${AI_TOOLKIT_TOKEN} gitlab-registry.mpcdf.mpg.de
- docker info
script:
- docker pull ${CI_REGISTRY_IMAGE}:latest || true
- docker build --tag ${CI_REGISTRY_IMAGE}:production${CI_COMMIT_SHORT_SHA} --tag ${APP_REGISTRY}:analytics --tag ${APP_REGISTRY}:analytics${CI_COMMIT_SHORT_SHA} --tag ${CI_REGISTRY_IMAGE}:latest .
- docker push ${CI_REGISTRY_IMAGE}:production${CI_COMMIT_SHORT_SHA}
- docker push ${APP_REGISTRY}:analytics${CI_COMMIT_SHORT_SHA}
......
......@@ -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,68 +226,76 @@ 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
# Linking all the notebooks of the tutorials
RUN fix-permissions /opt/tutorials \
&& fix-permissions $CONDA_DIR
# Copy all the notebooks of the tutorials
WORKDIR $TUTORIALS_HOME
RUN ln -s /opt/tutorials/*/*.ipynb . \
RUN cp /opt/tutorials/*/*.ipynb . \
&& jupyter-trust -y *.ipynb
# Linking images or other assets may required by the tutorials
# Copy images or other assets may required by the tutorials
WORKDIR $TUTORIALS_HOME/assets
RUN ln -s /opt/tutorials/*/assets/* .
RUN cp -r /opt/tutorials/*/assets/* .
# Linking data may required by the tutorials
# Copy data may be required by the tutorials
WORKDIR $TUTORIALS_HOME/data
RUN mkdir data && ln -s /opt/tutorials/*/data/* .
RUN fix-permissions $TUTORIALS_HOME \
&& fix-permissions $HOME/.local/share/jupyter
RUN cp -r /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"
WORKDIR $HOME/test_tutorials
RUN jupyter nbconvert --ExecutePreprocessor.timeout=1000 --to notebook --execute "ARISE.ipynb"
RUN jupyter nbconvert --ExecutePreprocessor.timeout=1000 --to notebook --execute "atomic_features.ipynb"
RUN jupyter nbconvert --ExecutePreprocessor.timeout=1000 --to notebook --execute "clustering_tutorial.ipynb"
RUN jupyter nbconvert --ExecutePreprocessor.timeout=1000 --to notebook --execute "cmlkit.ipynb"
# RUN jupyter nbconvert --ExecutePreprocessor.timeout=1000 --to notebook --execute "CO2_SGD.ipynb"
RUN jupyter nbconvert --ExecutePreprocessor.timeout=1000 --to notebook --execute "compressed_sensing.ipynb"
RUN jupyter nbconvert --ExecutePreprocessor.timeout=1000 --to notebook --execute "convolutional_nn.ipynb"
RUN jupyter nbconvert --ExecutePreprocessor.timeout=1000 --to notebook --execute "decision_tree.ipynb"
RUN jupyter nbconvert --ExecutePreprocessor.timeout=1000 --to notebook --execute "descriptor_role.ipynb"
# RUN jupyter nbconvert --ExecutePreprocessor.timeout=1000 --to notebook --execute "error_estimates.ipynb"
# RUN jupyter nbconvert --ExecutePreprocessor.timeout=1000 --to notebook --execute "exploratory_analysis.ipynb"
RUN jupyter nbconvert --ExecutePreprocessor.timeout=1000 --to notebook --execute "gap_si_surface.ipynb"
RUN jupyter nbconvert --ExecutePreprocessor.timeout=1000 --to notebook --execute "grain_boundaries.ipynb"
# RUN jupyter nbconvert --ExecutePreprocessor.timeout=1000 --to notebook --execute "kaggle_competition.ipynb"
RUN jupyter nbconvert --ExecutePreprocessor.timeout=1000 --to notebook --execute "krr4mat.ipynb"
RUN jupyter nbconvert --ExecutePreprocessor.timeout=1000 --to notebook --execute "nn_regression.ipynb"
RUN jupyter nbconvert --ExecutePreprocessor.timeout=1000 --to notebook --execute "perovskites_tolerance_factor.ipynb"
RUN jupyter nbconvert --ExecutePreprocessor.timeout=5000 --to notebook --execute "query_nomad_archive.ipynb"
RUN jupyter nbconvert --ExecutePreprocessor.timeout=1000 --to notebook --execute "sgd_alloys_oxygen_reduction_evolution.ipynb"
RUN jupyter nbconvert --ExecutePreprocessor.timeout=1000 --to notebook --execute "soap_atomic_charges.ipynb"
RUN jupyter nbconvert --ExecutePreprocessor.timeout=1000 --to notebook --execute "tcmi.ipynb"
RUN jupyter nbconvert --ExecutePreprocessor.timeout=1000 --to notebook --execute "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 jupyter nbconvert --ExecutePreprocessor.timeout=20000 --to notebook --execute "domain_of_applicability.ipynb"
WORKDIR $HOME
RUN rm -r test_tutorials
# Fix permissions
RUN fix-permissions $TUTORIALS_HOME \
&& fix-permissions $HOME/.local/share/jupyter \
&& fix-permissions $CONDA_DIR
# ================================================================================
# Switch back to jovyan to avoid accidental container runs as root
# ================================================================================
WORKDIR $HOME
USER $NB_UID
\ No newline at end of file
USER $NB_UID
# Ignore everything in this directory
*
# Except this file
!.gitignore
\ No newline at end of file
# Ignore everything in this directory
*
# Except this file
!.gitignore
\ No newline at end of file
.idea
# Byte-compiled / optimized / DLL files
__pycache__/
*.py[cod]
*$py.class
# C extensions
*.so
# Distribution / packaging
.Python
build/
develop-eggs/
dist/
downloads/
eggs/
.eggs/
lib/
lib64/
parts/
sdist/
var/
wheels/
*.egg-info/
.installed.cfg
*.egg
MANIFEST
# PyInstaller
# Usually these files are written by a python script from a template
# before PyInstaller builds the exe, so as to inject date/other infos into it.
*.manifest
*.spec
# Installer logs
pip-log.txt
pip-delete-this-directory.txt
# Unit test / coverage reports
htmlcov/
.tox/
.coverage
.coverage.*
.cache
nosetests.xml
coverage.xml
*.cover
.hypothesis/
.pytest_cache/
# Translations
*.mo
*.pot
# Django stuff:
*.log
local_settings.py
db.sqlite3
# Flask stuff:
instance/
.webassets-cache
# Scrapy stuff:
.scrapy
# Sphinx documentation
docs/_build/
# PyBuilder
target/
# Jupyter Notebook
.ipynb_checkpoints
# pyenv
.python-version
# celery beat schedule file
celerybeat-schedule
# SageMath parsed files
*.sage.py
# Environments
.env
.venv
env/
venv/
ENV/
env.bak/
venv.bak/
# Spyder project settings
.spyderproject
.spyproject
# Rope project settings
.ropeproject
# mkdocs documentation
/site
# mypy
.mypy_cache/
{
"authors": [
"Surname, First names",
"Surname, First names"
"Surname, First name",
"Surname, First name",
"Surname, First name"
],
"email": "user@domain.com",
"title": "Title of the tutorial",
"description": "In this tutorial we will ...",
"notebook_name": "tutorial_template.ipynb",
"url": "https://gitlab.mpcdf.mpg.de/nomad-lab/analytics-tutorial-template",
"link": "https://analytics-toolkit.nomad-coe.eu/hub/user-redirect/notebooks/tutorials/{tutorial}.ipynb",
"link_public": "https://analytics-toolkit.nomad-coe.eu/public/user-redirect/notebooks/tutorials/{tutorial}.ipynb",
"link": "https://analytics-toolkit.nomad-coe.eu/hub/user-redirect/notebooks/tutorials/tutorial_template.ipynb",
"link_public": "https://analytics-toolkit.nomad-coe.eu/public/user-redirect/notebooks/tutorials/tutorial_template.ipynb",
"link_paper": "https://.../.pdf",
"link_doi_paper": "https://www.nature.com/articles/...",
"updated": "2020-04-09",
"flags":{
"featured": true,
"top_of_list": false
"top_of_list": false,
"paper": true
},
"labels": {
"application_keyword": [
"keyword1",
"keyword2"
],
"application_section": [
"Materials property prediction"
"Keyword",
],
"application_system": [
"System"
"System_property_1",
"System_property_2",
"System_property_n"
],
"category": [
"Tutorial"
"keyword"
],
"data_analytics_method": [
"Clustering"
"ai_methods": [
"AI_method_1",
"AI_method_2",
"AI_method_n"
],
"platform": [
"jupyter"
......
......@@ -5,7 +5,7 @@ with open('metainfo.json') as file:
metainfo = json.load(file)
setup(
name='{tutorial}',
name='tutorial_template',
version='1.0',
author=', '.join(metainfo['authors']),
author_email=metainfo['email'],
......
......@@ -4,16 +4,15 @@
"cell_type": "markdown",
"metadata": {},
"source": [
"***\n",
"\n",
"<img width=\"25%\" style=\"float: right;\" src=https://nomad-coe.eu/uploads/nomad/images/NOMAD_Logo2.png>\n",
"\n",
"# The title of the tutorial \n",
"created by: ... Matthias Scheffler<sup>1</sup> and Luca Ghiringhelli<sup> 1</sup>\n",
"***\n",
"\n",
"<sup>1</sup> Fritz Haber Institute of the Max Planck Society, Faradayweg 4-6, D-14195 Berlin, Germany\n",
"***\n"
"<img src=\"assets/tutorial_template/header.jpg\" width=\"900\"> "
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"<img style=\"float: left;\" src=\"assets/tutorial_template/logo_NOMAD.png\" width=300>\n",
"<img style=\"float: right;\" src=\"assets/tutorial_template/logo_MPG.png\" width=170> "
]
},
{
......@@ -138,7 +137,7 @@
"metadata": {
"hide_input": false,
"kernelspec": {
"display_name": "Python 3",
"display_name": "Python 3 (ipykernel)",
"language": "python",
"name": "python3"
},
......@@ -152,7 +151,7 @@
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.7.3"
"version": "3.9.7"
},
"toc": {
"base_numbering": "0",
......
%% Cell type:markdown id: tags:
***
<img width="25%" style="float: right;" src=https://nomad-coe.eu/uploads/nomad/images/NOMAD_Logo2.png>
<img src="assets/tutorial_template/header.jpg" width="900">
# The title of the tutorial
created by: ... Matthias Scheffler<sup>1</sup> and Luca Ghiringhelli<sup> 1</sup>
***
%% Cell type:markdown id: tags:
<sup>1</sup> Fritz Haber Institute of the Max Planck Society, Faradayweg 4-6, D-14195 Berlin, Germany
***
<img style="float: left;" src="assets/tutorial_template/logo_NOMAD.png" width=300>
<img style="float: right;" src="assets/tutorial_template/logo_MPG.png" width=170>
%% Cell type:markdown id: tags:
This interactive notebook ...
%% Cell type:markdown id: tags:
# Markdown cheatsheet
## Headings
```
# Heading 1
# Heading 2
## Heading 2.1
## Heading 2.2
```
## Emphasis
- Bold: __string__ or **string**
- Italic: _string_ or *string*
- Indented quoting:
> Hello world!
## Bullets/Numbered lists
- item1
- item2
- subitem1
- subitem2
1. item1
2. item2
1. subitem1
2. subitem2
## Links
- Internal: [section title](#Import-modules)
- External: [Nomad Analytics](https://www.nomad-coe.eu/index.php?page=bigdata-analyticstoolkit)
## Graphics
<img width="25%" src="https://nomad-coe.eu/uploads/nomad/images/NOMAD_Logo2.png" title="Title text" >
## Mathematical symbols:
- Inline: $e^{i\pi} + 1 = 0$ or
$$e^x=\sum_{i=0}^\infty \frac{1}{i!}x^i$$
## Emeded code
```python
def f(x):
"""a docstring"""
return x**2
```
or refering to a `function`.
## Table
| This | is |
|------|------|
| a | table|
## Horizontal lines
***
or
---
%% Cell type:markdown id: tags:
## Import modules
%% Cell type:code id: tags:
``` python
import numpy as np
import matplotlib.pyplot as plt
```
%% Cell type:code id: tags:
``` python
```
......
Supports Markdown
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