Skip to content

Commit f721947

Browse files
authored
Updates: Move quantum-espresso to conda, add aiida-plugins, add aiida example scripts (#212
- Update build tool to VirtualBox version 7 (https://www.virtualbox.org/wiki/Changelog-7.0) - Install quantum-espresso via Conda (rather than direct compilation) - Add more AiiDA plugins/codes, compatible with aiida-core v2, see #211 - Add `verdi code test` run, after code creation, to test it is working correctly - Add `aiida-examples` scripts, these run a basic calculation example (with MPI), and test it completes correctly - currently only qe and nwchem, then more will be added later
1 parent 77fc9b7 commit f721947

File tree

14 files changed

+495
-69
lines changed

14 files changed

+495
-69
lines changed

.pre-commit-config.yaml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,3 +18,8 @@ repos:
1818
hooks:
1919
- id: ansible-lint
2020
args: [--exclude, roles/]
21+
22+
- repo: https://github.com/psf/black
23+
rev: 23.1.0
24+
hooks:
25+
- id: black

docs/conf.py

Lines changed: 16 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,14 @@
2020

2121
# -- General configuration ---------------------------------------------------
2222

23-
extensions = ["myst_parser", "sphinx_design", "ablog", "sphinx.ext.intersphinx", "sphinxext.rediraffe", "sphinx_subfigure"]
23+
extensions = [
24+
"myst_parser",
25+
"sphinx_design",
26+
"ablog",
27+
"sphinx.ext.intersphinx",
28+
"sphinxext.rediraffe",
29+
"sphinx_subfigure",
30+
]
2431

2532
myst_enable_extensions = ["colon_fence", "deflist", "html_image"]
2633

@@ -30,7 +37,13 @@
3037
post_redirect_refresh = 1
3138
post_auto_excerpt = 2
3239
fontawesome_included = True
33-
html_sidebars = {"releases/index": ['ablog/tagcloud.html', 'ablog/archives.html', 'sbt-sidebar-nav.html']}
40+
html_sidebars = {
41+
"releases/index": [
42+
"ablog/tagcloud.html",
43+
"ablog/archives.html",
44+
"sbt-sidebar-nav.html",
45+
]
46+
}
3447

3548
# The master toctree document.
3649
master_doc = "index"
@@ -63,4 +76,4 @@
6376
"use_edit_page_button": True,
6477
}
6578

66-
rediraffe_redirects = 'redirects.txt'
79+
rediraffe_redirects = "redirects.txt"

docs/maintainers/release.md

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -61,14 +61,18 @@ tox -e update-vagrant
6161
Follow the [desktop build instructions](../developers/build-vagrant.md).
6262

6363
:::{note}
64-
Manual modifications required, as of QM 20.03.1:
64+
Manual modifications required, as of QM 23.04.01, desktop shortcuts mut be manually enabled:
6565

66-
* Double-click on the Desktop symbols to show the icons (see [#150](https://github.com/marvel-nccr/quantum-mobile/issues/150)) or just run in the VM terminal (press F5 after to refresh):
66+
- First install the file with <https://manpages.ubuntu.com/manpages/focal/en/man1/desktop-file-edit.1.html>:
6767

68-
```bash
69-
for FILE in ${HOME}/Desktop/*.desktop; do gio set "$FILE" "metadata::trusted" yes; done
68+
```console
69+
$ sudo desktop-file-install --delete-original ~/Desktop/homepage.desktop
70+
$ sudo desktop-file-install --delete-original ~/Desktop/jupyterlab.desktop
7071
```
7172

73+
- Now navigate to the `/usr/share/applications` in the folder app, find the files and drag/drop them to the Desktop
74+
- Right click on the file on the Desktop and select `Allow Launching`
75+
7276
:::
7377

7478
### Cloud Edition
@@ -77,7 +81,7 @@ Follow the [cloud build instructions](../developers/build-cloud.md).
7781

7882
* For the server to build the VM, choose e.g. 2 CPUs with 4GB of RAM, with at least 16GB of storage.
7983
* Your configuration may also be the standard configuration shown to users creating a VM using your image
80-
* Currently Ubuntu Server 18.04 LTS
84+
* Currently Ubuntu Server 20.04 LTS
8185
* Expose ports as listed in instructions
8286
* You won't need it for long, so price for CPU/RAM is of no concern
8387
* Exemplary metadata:

docs/releases/versions/23.04.03.md

Lines changed: 138 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,138 @@
1+
---
2+
blogpost: true
3+
author: Quantum Mobile
4+
date: 2023-04-03
5+
category: Full
6+
tags: desktop,docker
7+
---
8+
9+
# v23.04.03
10+
11+
A Virtual Machine for Computational Materials Science
12+
13+
## Installation instructions
14+
15+
Get Quantum Mobile running on your computer in three simple steps:
16+
17+
1. Download virtual machine image (5.9 GB)
18+
- URL: <https://drive.google.com/file/d/1dhBANfO7KdaFWu_rwkBduKYNjofu8k33/view?usp=sharing>
19+
- Filename: `quantum_mobile_23.04.03.ova`
20+
- MD5 hash: `3d489840c77b27afe1d2367abb5ac44d`
21+
2. Install Virtual Box 6.1.6 or later (see <https://www.virtualbox.org>)
22+
3. Import virtual machine image into Virtualbox (15.7 GB)
23+
File => Import Appliance
24+
25+
Login credentials: username: `max`, password: `moritz`.
26+
The default configuration of `2` cores and `1536` MB RAM can be adjusted in the VM settings.
27+
28+
Alternatively, this Quantum Mobile is available as a Docker image: <https://hub.docker.com/r/marvelnccr/quantum-mobile>
29+
30+
## Contact
31+
32+
For issues encountered during installation, please first consult the [FAQ page](https://github.com/marvel-nccr/quantum-mobile/wiki/Frequently-Asked-Questions#virtualbox-installationstartup-issues).
33+
34+
Please direct inquiries regarding Quantum Mobile to the [AiiDA mailinglist](http://www.aiida.net/mailing-list/)
35+
36+
## Changelog
37+
38+
- Update build tool to VirtualBox version 7 (https://www.virtualbox.org/wiki/Changelog-7.0)
39+
- Install quantum-espresso via Conda (rather than direct compilation)
40+
- Add more AiiDA plugins/codes, compatible with aiida-core v2 (see <https://github.com/marvel-nccr/quantum-mobile/issues/211>)
41+
- Add `verdi code test` run, after code creation, to test it is working correctly
42+
- Add `aiida-examples` scripts folder, these run a basic calculation example (with MPI), and test it completes correctly
43+
44+
### Build Process
45+
46+
- OS: `MacOSX`
47+
- Ansible: `2.10.17`
48+
- Vagrant: `2.3.4`
49+
- Virtualbox: `7.0.6r155176`
50+
- Base VM Image: `bento/ubuntu-20.04`
51+
52+
### Software Summary
53+
54+
```ini
55+
[Quantum Mobile]
56+
version = 23.04.03
57+
Operating System = Ubuntu 20.04.6 LTS
58+
Login credentials = max / moritz
59+
60+
[Apt packages]
61+
grace = 1:5.1.25-7build1
62+
xcrysden = 1.6.2-3build1
63+
default-jre = 2:1.11-72
64+
rabbitmq-server = 3.8.2-0ubuntu1.4
65+
postgresql-client = 12+214ubuntu0.1
66+
67+
[Conda 'aiida' environment]
68+
aiida-abinit = 0.4.0-pyhd8ed1ab_0@conda-forge
69+
aiida-core = 2.2.2-pyh1a96a4e_1@conda-forge
70+
aiida-core.notebook = 2.2.2-pyh1a96a4e_1@conda-forge
71+
aiida-cp2k = 2.0.0-pyhd8ed1ab_1@conda-forge
72+
aiida-nwchem = 2.1.0-pyhd8ed1ab_0@conda-forge
73+
aiida-pseudo = 1.0.0-pyhd8ed1ab_0@conda-forge
74+
aiida-quantumespresso = 4.2.0-pyhd8ed1ab_0@conda-forge
75+
aiida-siesta = 2.0.0-pyhd8ed1ab_0@conda-forge
76+
ipykernel = 6.22.0-pyh210e3f2_0@conda-forge
77+
jupyterlab = 3.5.3-pyhd8ed1ab_0@conda-forge
78+
jupyterlab-spellchecker = 0.7.3-pyhd8ed1ab_0@conda-forge
79+
jupyterlab-tour = 3.1.4-pyhd8ed1ab_0@conda-forge
80+
mamba_gator = 5.2.0-pyhd8ed1ab_0@conda-forge
81+
pip = 23.0.1-pyhd8ed1ab_0@conda-forge
82+
python = 3.9.16-h2782a2a_0_cpython@conda-forge
83+
84+
[Conda 'abinit' environment]
85+
abinit = 9.8.3-hd1b6b71_2@conda-forge
86+
libxc = 4.3.4-h86c2bf4_2@conda-forge
87+
mpich = 4.0.3-h846660c_100@conda-forge
88+
89+
[Conda 'bigdft' environment]
90+
bigdft-suite = 1.9.3-mpi_mpich_py311h71b1498_0@conda-forge
91+
libxc = 4.3.4-h86c2bf4_2@conda-forge
92+
mpich = 4.0.3-h846660c_100@conda-forge
93+
94+
[Conda 'cp2k' environment]
95+
cp2k = 9.1.0-py39_openmpi_0@conda-forge
96+
libxc = 5.2.3-py311h9e0c992_2@conda-forge
97+
openmpi = 4.1.2-hbfc84c5_0@conda-forge
98+
99+
[Conda 'fleur' environment]
100+
fleur = 6.1-h005d346_1@conda-forge
101+
libxc = 5.2.3-py311h9e0c992_2@conda-forge
102+
openmpi = 4.1.2-hbfc84c5_0@conda-forge
103+
104+
[Conda 'nwchem' environment]
105+
libxc = 5.2.3-py39hea1df8f_2@conda-forge
106+
nwchem = 7.0.2-py39hea0d9f8_3@conda-forge
107+
openmpi = 4.1.2-hbfc84c5_0@conda-forge
108+
109+
[Conda 'qespresso' environment]
110+
libxc = 5.2.3-py311h9e0c992_2@conda-forge
111+
openmpi = 4.1.2-hbfc84c5_0@conda-forge
112+
qe = 7.0-he8a42d8_1@conda-forge
113+
114+
[Conda 'siesta' environment]
115+
libxc = 5.2.3-py311h9e0c992_2@conda-forge
116+
openmpi = 4.1.2-hbfc84c5_0@conda-forge
117+
siesta = 4.1.5-mpi_openmpi_hfab99a0_2@conda-forge
118+
119+
[Conda 'yambo' environment]
120+
libxc = 5.2.3-py311h9e0c992_2@conda-forge
121+
openmpi = 4.1.2-hbfc84c5_0@conda-forge
122+
yambo = 5.0.4-h6b7a505_1@conda-forge
123+
124+
[Conda 'wannier90' environment]
125+
libxc = 5.2.3-py311h9e0c992_2@conda-forge
126+
openmpi = 4.1.2-hbfc84c5_0@conda-forge
127+
wannier90 = 3.1.0-hb97063f_2@conda-forge
128+
129+
[Conda 'visualise' environment]
130+
cif2cell = 2.0.0a3-pyhd8ed1ab_0@conda-forge
131+
gnuplot = 5.4.5-h142138f_1@conda-forge
132+
jmol = 14.32.10-ha770c72_0@conda-forge
133+
python = 3.9.16-h2782a2a_0_cpython@conda-forge
134+
135+
[Pseudopotentials]
136+
SSSP/PBE/efficiency/1.1 = /usr/local/share/pseudo_sssp_PBE_efficiency_1.1
137+
DOJO/PBE/FR/standard/0.4/psml = /usr/local/share/pseudo_dojo_PBE_FR_standard_0.4_psml
138+
```

inventory.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ all:
1111
vars:
1212
# VM Metadata
1313
vm_name: "Quantum Mobile"
14-
vm_version: "23.03.01"
14+
vm_version: "23.04.03"
1515
vm_description: "A Virtual Machine for Computational Materials Science"
1616
vm_url: "https://github.com/marvel-nccr/marvel-virtualmachine"
1717
vm_author: "MARVEL NCCR and MaX CoE"

local/modules/apt_show.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,9 @@ def _main():
5454
module = AnsibleModule(argument_spec={"name": {"required": True, "type": "str"}})
5555
if not module.params["name"]:
5656
module.fail_json(msg="Package name is empty")
57-
_, stdout, _ = module.run_command(["apt", "show"] + module.params["name"].split(), check_rc=True)
57+
_, stdout, _ = module.run_command(
58+
["apt", "show"] + module.params["name"].split(), check_rc=True
59+
)
5860
data = {}
5961
lines = stdout.splitlines()
6062
index = 0

local/modules/verdi_code.py

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,9 @@
3434
append_text:
3535
description: The append text
3636
required: false
37+
run_test:
38+
description: Whether to run verdi code test after creating the code (default: true)
39+
required: false
3740
"""
3841

3942
EXAMPLES = """
@@ -66,6 +69,7 @@ def _main():
6669
"description": {"required": False, "type": "str"},
6770
"prepend_text": {"required": False, "type": "str"},
6871
"append_text": {"required": False, "type": "str"},
72+
"run_test": {"required": False, "type": "bool", "default": True},
6973
},
7074
)
7175
verdi = module.params["verdi"].split() + ["--profile", module.params["profile"]]
@@ -93,6 +97,26 @@ def _main():
9397

9498
_, stdout, _ = module.run_command(command, check_rc=True)
9599

100+
if "run_test" in module.params and not module.params["run_test"]:
101+
# if not running test, then just exit
102+
module.exit_json(changed=True, stdout=stdout)
103+
104+
# test the code actually works, e.g. that the executable exists
105+
# otherwise delete
106+
test_rc, test_stdout, test_stderr = module.run_command(
107+
verdi + ["code", "test", module.params["label"]]
108+
)
109+
if test_rc != 0:
110+
module.run_command(
111+
verdi + ["code", "delete", "--force", module.params["label"]]
112+
)
113+
module.fail_json(
114+
msg="verdi code test failed",
115+
rc=test_rc,
116+
stdout=test_stdout,
117+
stderr=test_stderr,
118+
)
119+
96120
module.exit_json(changed=True, stdout=stdout)
97121

98122

local/tasks/aiida-example-run.yml

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
- name: "Copy aiida script: {{ aiida_script }}"
2+
ansible.builtin.copy:
3+
src: aiida_run_scripts/{{ aiida_script }}
4+
dest: "{{ aiida_script_path }}"
5+
owner: "{{ vm_user }}"
6+
group: "{{ vm_user }}"
7+
register: aiida_script_copy
8+
9+
- name: "Run aiida script: {{ aiida_script }}"
10+
when: aiida_script_copy.changed
11+
shell: |
12+
{{ aiida_verdi_cmd }} run {{ aiida_script_path }}
13+
14+
# TODO handle failures (delete the script?)

local/tasks/aiida-examples.yml

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
- name: "Expand {{ aiida_examples_folder }}"
2+
become: true
3+
become_user: "{{ vm_user }}"
4+
chrisjsewell.conda.expandpath:
5+
path: "{{ aiida_examples_folder }}"
6+
register: aiida_examples_dir
7+
8+
- name: "Create {{ aiida_examples_dir.path }} folder"
9+
ansible.builtin.file:
10+
path: "{{ aiida_examples_dir.path }}"
11+
state: directory
12+
13+
# TODO get list of all files in aiida_run_scripts
14+
15+
- name: "Copy and run aiida script"
16+
include_tasks: aiida-example-run.yml
17+
vars:
18+
aiida_script_path: "{{ aiida_examples_dir.path }}/{{ aiida_script }}"
19+
loop:
20+
- qe_pw.py
21+
- nwchem.py
22+
loop_control:
23+
loop_var: aiida_script

local/tasks/aiida-pseudo-dojo.yml

Lines changed: 53 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,53 @@
1+
# download pseudopotials and install them in aiida
2+
3+
- set_fact:
4+
pseudo_folder: "{{ aiida_pseudo_base_folder }}/pseudo_dojo_{{ aiida_pseudo_functional }}_{{ aiida_pseudo_relativistic }}_{{ aiida_pseudo_protocol }}_{{ aiida_pseudo_version }}_{{ aiida_pseudo_format }}"
5+
6+
- name: create the folder to download
7+
become: true
8+
become_user: "{{ root_user }}"
9+
file:
10+
path: "{{ pseudo_folder }}"
11+
state: directory
12+
owner: "{{ vm_user }}"
13+
group: "{{ vm_user }}"
14+
mode: 0755
15+
16+
- name: Download the archive to the download location
17+
become: true
18+
become_user: "{{ vm_user }}"
19+
shell: |
20+
{{ aiida_pseudo_cmd }} \
21+
install pseudo-dojo --traceback --download-only \
22+
--version {{ aiida_pseudo_version | quote }} \
23+
--functional {{ aiida_pseudo_functional | quote }} \
24+
--protocol {{ aiida_pseudo_protocol | quote }} \
25+
--relativistic {{ aiida_pseudo_relativistic | quote }} \
26+
--pseudo-format {{ aiida_pseudo_format | quote }} \
27+
args:
28+
chdir: "{{ pseudo_folder }}"
29+
creates: "archive.tar.gz"
30+
31+
- name: Add the archive to the AiiDA profile
32+
become: true
33+
become_user: "{{ vm_user }}"
34+
shell: |
35+
{{ aiida_pseudo_cmd }} \
36+
--profile {{ aiida_pseudo_profile | quote }} \
37+
install pseudo-dojo --traceback \
38+
--version {{ aiida_pseudo_version | quote }} \
39+
--functional {{ aiida_pseudo_functional | quote }} \
40+
--protocol {{ aiida_pseudo_protocol | quote }} \
41+
--relativistic {{ aiida_pseudo_relativistic | quote }} \
42+
--pseudo-format {{ aiida_pseudo_format | quote }} \
43+
register: result
44+
failed_when: result.rc != 0 and "already installed" not in result.stderr
45+
changed_when: '"already installed" not in result.stderr'
46+
47+
- name: Document potential
48+
include_role:
49+
name: release_notes
50+
vars:
51+
section: "Pseudopotentials"
52+
option: "DOJO/{{ aiida_pseudo_functional }}/{{ aiida_pseudo_relativistic }}/{{ aiida_pseudo_protocol }}/{{ aiida_pseudo_version }}/{{ aiida_pseudo_format }}"
53+
value: "{{ pseudo_folder }}"

0 commit comments

Comments
 (0)