Skip to content

Commit

Permalink
Remove QE school stuff and improve REST API part
Browse files Browse the repository at this point in the history
  • Loading branch information
mbercx committed May 29, 2021
1 parent 57321f5 commit c07b748
Show file tree
Hide file tree
Showing 5 changed files with 78 additions and 88 deletions.
2 changes: 1 addition & 1 deletion .rstcheck.cfg
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
[rstcheck]
ignore_directives=panels,dropdown,tabs
ignore_roles=doi,nb-download
ignore_roles=doi,nb-download, download
ignore_messages=(.*is not referenced.)
70 changes: 26 additions & 44 deletions docs/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -8,57 +8,16 @@ This tutorial is a short introduction to some of the features of AiiDA where you
Setup
-----

The hands-on for the `"MaX School on Advanced Materials and Molecular Modelling with Quantum ESPRESSO" <http://indico.ictp.it/event/9616/>`_ will be run on a dedicated JupyterHub cluster that can be accessed via the following link:

https://qe-school.aiida-tutorials.net/

Simply log in with a username and password of your choosing, your account will be created automatically.
The first log in might take a few minutes, but subsequent logins will be much faster.

.. important::

Note down your password so that you can login again in case you get inadvertently logged out. In case you forgot your password, the admin can make a new account, **but you will lose your progress!**

This cluster will be taken down on **Saturday 29 May at 12:00 CEST**.
Be sure to download any data you want to keep before this time.

Afterwards, the material can still be run on the `Quantum Mobile <https://quantum-mobile.readthedocs.io/en/latest/>`_ virtual machine.
You could also use the AiiDAlab demo cluster, but since it can only handle a limited number of simultaneous users, the Quantum Mobile can offer a more reliable experience.

The tutorial can be run in the `Quantum Mobile <https://quantum-mobile.readthedocs.io/en/latest/>`_ virtual machine or on the |AiiDAlab demo cluster|.
Note that since the latter can only handle a limited number of simultaneous users, the Quantum Mobile can offer a more reliable experience.

.. note::

Some of the procedures might be slightly different depending on whether you are using the "Quantum Mobile" virtual machine or the "AiiDAlab cluster".
We have included the instructions for both, so at certain points in the hands-on you will find boxes like the one below, with different tabs for each case.

When running the hands-on via the link above, you need to follow the instructions in the "**AiiDAlab cluster**" tab.

We have included the instructions for both, so at certain points in the hands-on you will find boxes like the one below, with different tabs for each system.

.. tabs::

.. tab:: AiiDAlab cluster

+-----------------+-----------------------------------------------------------------------------------------------------------+
| Related resources |
+=================+===========================================================================================================+
| AiiDAlab | `AiiDAlab docker stack 21.02.1`_, `AiiDAlab k8s deployment`_ |
+-----------------+-----------------------------------------------------------------------------------------------------------+
| python packages | `aiida-core 1.5.2`_, `aiida-quantumespresso 3.3.0`_ |
+-----------------+-----------------------------------------------------------------------------------------------------------+
| codes | `Quantum ESPRESSO 6.0.0`_ |
+-----------------+-----------------------------------------------------------------------------------------------------------+

The |AiiDAlab demo cluster| is a Jupyter-based web platform installed on a cluster that can run some basic calculations for demonstration and tutorial purposes.
Simply click the link and log in with the EGI check-in.

The first part of the tutorial will be run in the terminal.
Just click on the "Terminal" icon in the header to open one in a new tab.

.. figure:: source/images/AiiDAlab_header-terminal.png
:width: 100%

Once the terminal is opened, you're all set to get started with the tutorial!

.. tab:: Quantum Mobile

+-----------------+-----------------------------------------------------------------------------------------------------------+
Expand Down Expand Up @@ -99,6 +58,29 @@ You could also use the AiiDAlab demo cluster, but since it can only handle a lim
If you see all green check marks, you're ready to start with the tutorial!

.. tab:: AiiDAlab cluster

+-----------------+-----------------------------------------------------------------------------------------------------------+
| Related resources |
+=================+===========================================================================================================+
| AiiDAlab | `AiiDAlab docker stack 21.02.1`_, `AiiDAlab k8s deployment`_ |
+-----------------+-----------------------------------------------------------------------------------------------------------+
| python packages | `aiida-core 1.5.2`_, `aiida-quantumespresso 3.3.0`_ |
+-----------------+-----------------------------------------------------------------------------------------------------------+
| codes | `Quantum ESPRESSO 6.0.0`_ |
+-----------------+-----------------------------------------------------------------------------------------------------------+

The |AiiDAlab demo cluster| is a Jupyter-based web platform installed on a cluster that can run some basic calculations for demonstration and tutorial purposes.
Simply click the link and log in with the EGI check-in.

The first part of the tutorial will be run in the terminal.
Just click on the "Terminal" icon in the header to open one in a new tab.

.. figure:: source/images/AiiDAlab_header-terminal.png
:width: 100%

Once the terminal is opened, you're all set to get started with the tutorial!

Hands-on materials
------------------

Expand Down
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
94 changes: 51 additions & 43 deletions docs/source/sections/qe.rst
Original file line number Diff line number Diff line change
Expand Up @@ -92,6 +92,30 @@ This will depend on whether you are running the tutorial in the Quantum Mobile o

.. tabs::

.. tab:: Quantum Mobile

Let's have a look at the codes in our database with the ``verdi shell``:

.. code-block:: console
$ verdi code list
# List of configured codes:
# (use 'verdi code show CODEID' to see the details)
* pk 1 - qe-3.4.0-pw@localhost
* pk 2 - qe-3.4.0-cp@localhost
* pk 3 - qe-3.4.0-pp@localhost
* pk 4 - qe-3.4.0-ph@localhost
* pk 5 - qe-3.4.0-neb@localhost
* pk 6 - qe-3.4.0-projwfc@localhost
* pk 7 - qe-3.4.0-pw2wannier90@localhost
* pk 8 - qe-3.4.0-q2r@localhost
* pk 9 - qe-3.4.0-dos@localhost
* pk 10 - qe-3.4.0-matdyn@localhost
As you can see, this Quantum Mobile virtual machine already comes with all of the Quantum ESPRESSO codes set up in the AiiDA database.
The code we will be running is the ``pw.x`` code, set up under the label ``qe-3.4.0-pw`` on the ``localhost`` computer.
Make a note of the PK or label of the code, since you'll need to replace it in code snippets later in this tutorial.

.. tab:: AiiDAlab cluster

Let's have a look at the codes in our database with the ``verdi shell``:
Expand Down Expand Up @@ -122,30 +146,6 @@ This will depend on whether you are running the tutorial in the Quantum Mobile o
Make a note of the PK or label of the code, since you'll need to replace it in code snippets later in this tutorial.

.. tab:: Quantum Mobile

Let's have a look at the codes in our database with the ``verdi shell``:

.. code-block:: console
$ verdi code list
# List of configured codes:
# (use 'verdi code show CODEID' to see the details)
* pk 1 - qe-3.4.0-pw@localhost
* pk 2 - qe-3.4.0-cp@localhost
* pk 3 - qe-3.4.0-pp@localhost
* pk 4 - qe-3.4.0-ph@localhost
* pk 5 - qe-3.4.0-neb@localhost
* pk 6 - qe-3.4.0-projwfc@localhost
* pk 7 - qe-3.4.0-pw2wannier90@localhost
* pk 8 - qe-3.4.0-q2r@localhost
* pk 9 - qe-3.4.0-dos@localhost
* pk 10 - qe-3.4.0-matdyn@localhost
As you can see, this Quantum Mobile virtual machine already comes with all of the Quantum ESPRESSO codes set up in the AiiDA database.
The code we will be running is the ``pw.x`` code, set up under the label ``qe-3.4.0-pw`` on the ``localhost`` computer.
Make a note of the PK or label of the code, since you'll need to replace it in code snippets later in this tutorial.

To run the SCF calculation, we'll also need to provide the family of pseudopotentials.
These can be installed easily using the ``aiida-pseudo`` package:

Expand Down Expand Up @@ -421,6 +421,14 @@ How you can open this file will depend on the platform you are running the tutor

.. tabs::

.. tab:: Quantum Mobile

You can simply use the ``evince`` command to open the ``.pdf`` that contains the provenance graph:

.. code-block::
$ evince <PK>.dot.pdf
.. tab:: AiiDAlab cluster

If you open a *file manager* on the starting page of the AiiDA JupyterHub:
Expand All @@ -430,14 +438,6 @@ How you can open this file will depend on the platform you are running the tutor

You should be able to use the file manager to navigate to and open the PDF.

.. tab:: Quantum Mobile

You can simply use the ``evince`` command to open the ``.pdf`` that contains the provenance graph:

.. code-block::
$ evince <PK>.dot.pdf
Let's have a look at one of the outputs, i.e. the ``output_parameters``.
You can get the contents of this dictionary easily using the ``verdi shell``:

Expand Down Expand Up @@ -561,16 +561,29 @@ How you can access the REST API web-interface will depend on where you are execu

.. tabs::

.. tab:: Quantum Mobile

Open the |provenance browser| **in a browser inside the virtual machine** and copy the following URL into the text box:

.. code-block::
http://127.0.0.1:5000/api/v4
.. figure:: include/images/matcloud_explore_quantum.png
:width: 100%

Then simply click "Go!" to start exploring your data!

.. tab:: AiiDAlab cluster

Since this AiiDAlab instance is running on a remote machine, we need to expose the REST API to a public URL.
Open a **new** terminal from the starting page and run `ngrok`_, a tool that allows us to do exactly this:
**Open a new terminal** from the starting page and run `ngrok`_, a tool that allows us to do exactly this:

.. code-block:: console
$ ngrok http 5000 --region eu --bind-tls true
Now you will be able to open the |provenance browser| and enter the public URL that ``ngrok`` is using, i.e. if the following is the output in your terminal:
Now you will be able to open the |provenance browser| (click the link to open the page) and enter the public URL that ``ngrok`` is using, i.e. if the following is the output in your terminal:

.. code-block:: console
Expand All @@ -584,17 +597,12 @@ How you can access the REST API web-interface will depend on where you are execu
Forwarding https://bb84d27809e0.eu.ngrok.io -> http://localhost:5000
then the URL you should provide the provenance browser is ``https://bb84d27809e0.eu.ngrok.io/api/v4`` (see the last ``Forwarding`` line).
Then simply click "Go!" to start exploring your data!

.. tab:: Quantum Mobile

Open the |provenance browser| **in a browser inside the virtual machine** and copy the following URL into the text box:
Right click on the URL and select "Copy", then paste it in the |provenance browser| in the "Connect to your AiiDA REST API" box:

.. code-block::
http://127.0.0.1:5000/api/v4
.. figure:: include/images/matcloud_explore_aiidalab.png
:width: 100%

Then simply click "Go!" to start exploring your data!
Next, add ``/api/v4`` to the end of the link and then simply click "Go!" to start exploring your data!

.. |provenance browser| raw:: html

Expand Down

0 comments on commit c07b748

Please sign in to comment.