Skip to content

Commit 3637c2f

Browse files
committed
Merge remote-tracking branch 'upstream/main' into docs/integrate-tutorials
2 parents a706c2c + 2068a7d commit 3637c2f

139 files changed

Lines changed: 9933 additions & 5553 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.docker/aiida-core-base/s6-assets/init/aiida-prepare.sh

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,8 +18,11 @@ verdi config set warnings.development_version False
1818
# If the environment variable `SETUP_DEFAULT_AIIDA_PROFILE` is not set, set it to `true`.
1919
if [[ ${SETUP_DEFAULT_AIIDA_PROFILE:-true} == true ]] && ! verdi profile show ${AIIDA_PROFILE_NAME} &> /dev/null; then
2020

21-
# Create AiiDA profile.
22-
verdi presto \
21+
# Create AiiDA profile. Set AIIDA_NO_DAEMON_AUTOSTART because the
22+
# Docker container manages the daemon lifecycle separately via
23+
# s6-overlay (aiida-daemon-start runs after this script and
24+
# run-before-daemon-start).
25+
AIIDA_NO_DAEMON_AUTOSTART=1 verdi presto \
2326
--verbosity info \
2427
--profile-name "${AIIDA_PROFILE_NAME:-default}" \
2528
--email "${AIIDA_USER_EMAIL:-aiida@localhost}" \

.github/workflows/ci-code.yml

Lines changed: 7 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -26,8 +26,9 @@ jobs:
2626
strategy:
2727
fail-fast: false
2828
matrix:
29-
python-version: ['3.9', '3.14']
29+
python-version: ['3.10', '3.14']
3030
database-backend: [psql]
31+
broker-backend: [rmq, zmq]
3132

3233
services:
3334
postgres:
@@ -72,7 +73,7 @@ jobs:
7273
AIIDA_TEST_PROFILE: test_aiida
7374
AIIDA_WARN_v3: 1
7475
run: |
75-
pytest -n auto --db-backend ${{ matrix.database-backend }} -m 'not nightly' tests/ ${{ matrix.python-version == '3.14' && '--cov aiida' || '' }}
76+
pytest -n auto --db-backend ${{ matrix.database-backend }} --broker-backend ${{ matrix.broker-backend }} -m 'not nightly' tests/ ${{ matrix.python-version == '3.14' && '--cov aiida' || '' }}
7677
7778
- name: Upload coverage report
7879
if: matrix.python-version == 3.14 && github.repository == 'aiidateam/aiida-core'
@@ -101,16 +102,9 @@ jobs:
101102
strategy:
102103
fail-fast: false
103104
matrix:
104-
python-version: ['3.9']
105+
python-version: ['3.10']
105106
database-backend: [sqlite]
106107

107-
services:
108-
rabbitmq:
109-
image: rabbitmq:3.8.14-management
110-
ports:
111-
- 5672:5672
112-
- 15672:15672
113-
114108
steps:
115109
- uses: actions/checkout@v6
116110

@@ -131,7 +125,7 @@ jobs:
131125
- name: Run test suite
132126
env:
133127
AIIDA_WARN_v3: 0
134-
run: pytest --disable-warnings -n auto --db-backend ${{ matrix.database-backend }} -m 'not nightly' tests/
128+
run: pytest --disable-warnings -n auto --db-backend ${{ matrix.database-backend }} --broker-backend zmq -m 'not nightly' tests/
135129

136130

137131
tests-presto:
@@ -156,7 +150,7 @@ jobs:
156150
- name: Run test suite
157151
env:
158152
AIIDA_WARN_v3: 0
159-
run: pytest -n auto -m 'presto' tests/
153+
run: pytest -n auto --broker-backend zmq -m 'presto' tests/
160154

161155

162156
verdi:
@@ -213,7 +207,7 @@ jobs:
213207
- name: Install aiida-core
214208
uses: ./.github/actions/install-aiida-core
215209
with:
216-
python-version: '3.9'
210+
python-version: '3.10'
217211
from-lock: 'true'
218212
extras: tests
219213

.github/workflows/docs-build.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ jobs:
2323
- name: Install aiida-core and docs deps
2424
uses: ./.github/actions/install-aiida-core
2525
with:
26-
python-version: '3.9'
26+
python-version: '3.10'
2727
extras: docs,tutorials,tests,rest,atomic_tools
2828
from-lock: 'false'
2929

.github/workflows/release.yml

Lines changed: 8 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
name: release
22

3-
# Automate plubishing to PyPI and TestPyPI. When pushing a release tag vX.Y.Z,
3+
# Automate publishing to PyPI and TestPyPI. When pushing a release tag vX.Y.Z,
44
# the workflow will publish to PyPI. When the 'test-release' label is active on
55
# a PR, the workflow will publish to TestPyPI on each update. In both cases it
66
# is checked if pre-commit and the tests pass. When a release tag is pushed it
@@ -30,10 +30,10 @@ jobs:
3030
- name: Checkout repo
3131
uses: actions/checkout@v6
3232

33-
- name: Set up Python 3.9
33+
- name: Set up Python 3.10
3434
uses: actions/setup-python@v6
3535
with:
36-
python-version: '3.9'
36+
python-version: '3.10'
3737

3838
- name: Check tag
3939
run: python .github/workflows/check_release_tag.py $GITHUB_REF
@@ -63,21 +63,14 @@ jobs:
6363
runs-on: ubuntu-24.04
6464
timeout-minutes: 30
6565

66-
services:
67-
rabbitmq:
68-
image: rabbitmq:3.8.14-management
69-
ports:
70-
- 5672:5672
71-
- 15672:15672
72-
7366
steps:
7467
- uses: actions/checkout@v6
7568

7669
- name: Install aiida-core
7770
uses: ./.github/actions/install-aiida-core
7871

7972
- name: Run sub-set of test suite
80-
run: pytest -s -m requires_rmq --db-backend=sqlite tests/
73+
run: pytest -s -m requires_broker --broker-backend zmq --db-backend=sqlite tests/
8174

8275
publish-pypi:
8376
if: startsWith(github.ref, 'refs/tags/')
@@ -95,10 +88,10 @@ jobs:
9588
steps:
9689
- name: Checkout source
9790
uses: actions/checkout@v6
98-
- name: Set up Python 3.9
91+
- name: Set up Python 3.10
9992
uses: actions/setup-python@v6
10093
with:
101-
python-version: '3.9'
94+
python-version: '3.10'
10295
- name: Install flit
10396
run: pip install flit~=3.4
10497
- name: Build
@@ -123,10 +116,10 @@ jobs:
123116
steps:
124117
- name: Checkout source
125118
uses: actions/checkout@v6
126-
- name: Set up Python 3.9
119+
- name: Set up Python 3.10
127120
uses: actions/setup-python@v6
128121
with:
129-
python-version: '3.9'
122+
python-version: '3.10'
130123
- name: Install flit
131124
run: pip install flit~=3.4
132125
- name: Build

.github/workflows/test-install.yml

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
name: test-install
22

33
on:
4+
workflow_dispatch:
45
pull_request:
56
paths:
67
- environment.yml
@@ -84,10 +85,10 @@ jobs:
8485
steps:
8586
- uses: actions/checkout@v6
8687

87-
- name: Set up Python 3.9
88+
- name: Set up Python 3.10
8889
uses: actions/setup-python@v6
8990
with:
90-
python-version: '3.9'
91+
python-version: '3.10'
9192

9293
- name: Pip install
9394
id: pip_install
@@ -111,7 +112,7 @@ jobs:
111112
fail-fast: false
112113
matrix:
113114

114-
python-version: ['3.9', '3.10', '3.11', '3.12', '3.13', '3.14']
115+
python-version: ['3.10', '3.11', '3.12', '3.13', '3.14']
115116

116117
# Not being able to install with conda on a specific Python version is
117118
# not sufficient to fail the run, but something we want to be aware of.
@@ -165,7 +166,7 @@ jobs:
165166
strategy:
166167
fail-fast: false
167168
matrix:
168-
python-version: ['3.9', '3.10', '3.11', '3.12', '3.13', '3.14']
169+
python-version: ['3.10', '3.11', '3.12', '3.13', '3.14']
169170

170171
services:
171172
postgres:

CHANGELOG.md

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,14 @@
11
# Changelog
22

3+
## Unreleased
4+
5+
### Behavior changes
6+
7+
**`verdi presto`: auto-starts the daemon** ([#7351](https://github.com/aiidateam/aiida-core/pull/7351))
8+
9+
`verdi presto` now starts the daemon automatically after creating the profile, when a broker is configured.
10+
Scripts that previously ran `verdi daemon start` after `verdi presto` continue to work; the daemon-start invocation is idempotent.
11+
312
## v2.8.0 - 2026-03-16
413

514
This release brings important improvements to the `BaseRestartWorkChain`, the engine, stashing, typing coverage, and dependency updates.

docs/source/howto/include/scripts/performance_benchmark_base.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ def main(code, number, daemon):
5050
computer_created = False
5151
code_created = False
5252

53-
echo.echo(f'Running on profile {get_manager().get_profile().name}')
53+
echo.echo(f'Running on profile `{get_manager().get_profile().name}`')
5454

5555
if not code:
5656
label = f'benchmark-{uuid.uuid4().hex[:8]}'

docs/source/howto/index.rst

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@ How-To Guides
2222
archive_profile
2323
visualising_graphs
2424
installation
25+
tune_performance
2526
plugins_develop
2627
cookbook
2728
tricks_real_world_runs

docs/source/howto/installation.rst

Lines changed: 1 addition & 136 deletions
Original file line numberDiff line numberDiff line change
@@ -158,7 +158,7 @@ To view all configuration options set for the current profile:
158158
logging.paramiko_loglevel default WARNING
159159
logging.plumpy_loglevel default WARNING
160160
logging.sqlalchemy_loglevel default WARNING
161-
rmq.task_timeout default 10
161+
broker.task_timeout default 10
162162
runner.poll.interval profile 50
163163
transport.task_maximum_attempts global 6
164164
transport.task_retry_initial_interval default 20
@@ -367,141 +367,6 @@ How to do this, is operating system specific.
367367
For Ubuntu, here is `a template for the service file <https://github.com/marvel-nccr/ansible-role-aiida/blob/c709088dff74d1e1ae4d8379e740aba35fb2ef97/templates/aiida-daemon%40.service>`_ and `ansible instructions to install the service <https://github.com/marvel-nccr/ansible-role-aiida/blob/c709088dff74d1e1ae4d8379e740aba35fb2ef97/tasks/aiida-daemon.yml>`_.
368368

369369

370-
.. _how-to:installation:performance:
371-
372-
Tuning performance
373-
==================
374-
375-
AiiDA supports running hundreds of thousands of calculations and graphs with millions of nodes.
376-
However, optimal performance at that scale can require tweaking the AiiDA configuration to balance the CPU and disk load.
377-
378-
Below, we share a few practical tips for assessing and tuning AiiDA performance.
379-
Further in-depth information is available in the dedicated :ref:`topic on performance<topics:performance>`.
380-
381-
.. dropdown:: Benchmark workflow engine performance
382-
383-
Download the :download:`benchmark script <include/scripts/performance_benchmark_base.py>` :fa:`download`, and run it in your AiiDA environment.
384-
385-
.. code:: console
386-
387-
sph@citadel:~/$ python performance_benchmark_base.py -n 100
388-
Success: Created and configured temporary `Computer` benchmark-e73b8647 for localhost.
389-
Success: Created temporary `Code` bash for localhost.
390-
Running 100 calculations. [####################################] 100%
391-
Success: All calculations finished successfully.
392-
Elapsed time: 24.90 seconds.
393-
Cleaning up...
394-
12/19/2022 10:57:43 AM <12625> aiida.delete: [REPORT] 400 Node(s) marked for deletion
395-
12/19/2022 10:57:43 AM <12625> aiida.delete: [REPORT] Starting node deletion...
396-
12/19/2022 10:57:43 AM <12625> aiida.delete: [REPORT] Deletion of nodes completed.
397-
Success: Deleted all calculations.
398-
Success: Deleted the created code bash@benchmark-e73b8647.
399-
Success: Deleted the created computer benchmark-e73b8647.
400-
Performance: 0.25 s / process
401-
402-
The output above was generated on an AMD Ryzen 5 3600 6-Core processor (3.6 GHz, 4.2 GHz turbo boost) using AiiDA v2.2.0, and RabbitMQ and PostgreSQL running on the same machine.
403-
Here, 100 ``ArithmeticAddCalculation`` processes completed in ~25s, corresponding to 0.25 seconds per process.
404-
405-
If you observe a significantly higher runtime, you may want to check whether any relevant component (CPU, disk, postgresql, rabbitmq) is congested.
406-
407-
.. dropdown:: Increase the number of daemon workers
408-
409-
By default, the AiiDA daemon only uses a single worker, i.e. a single operating system process.
410-
If ``verdi daemon status`` shows the daemon worker constantly at high CPU usage, you can use ``verdi daemon incr X`` to add ``X`` parallel daemon workers.
411-
412-
Keep in mind that other processes need to run on your computer (e.g. rabbitmq, the PostgreSQL database, ...), i.e. it's a good idea to stop increasing the number of workers before you reach the number of cores of your CPU.
413-
414-
To make the change permanent, set
415-
::
416-
417-
verdi config set daemon.default_workers 4
418-
419-
.. dropdown:: Increase the number of daemon worker slots
420-
421-
Each daemon worker accepts only a limited number of tasks at a time.
422-
If ``verdi daemon status`` constantly warns about a high percentage of the available daemon worker slots being used, you can increase the number of tasks handled by each daemon worker (thus increasing the workload per worker).
423-
Increasing it to 1000 should typically work.
424-
425-
Set the corresponding config variable and restart the daemon
426-
::
427-
428-
verdi config set daemon.worker_process_slots 1000
429-
430-
.. dropdown:: Prevent your operating system from indexing the file repository.
431-
432-
Many Linux distributions include the ``locate`` command to quickly find files and folders, and run a daily cron job ``updatedb.mlocate`` to create the corresponding index.
433-
A large file repository can take a long time to index, up to the point where the hard drive is constantly indexing.
434-
435-
In order to exclude the repository folder from indexing, add its path to the ``PRUNEPATH`` variable in the ``/etc/updatedb.conf`` configuration file (use ``sudo``).
436-
437-
.. dropdown:: Move the Postgresql database to a fast disk (SSD), ideally on a large partition.
438-
439-
1. Stop the AiiDA daemon and :ref:`back up your database <how-to:installation:backup>`.
440-
441-
2. Find the data directory of your postgres installation (something like ``/var/lib/postgresql/9.6/main``, ``/scratch/postgres/9.6/main``, ...).
442-
443-
The best way is to become the postgres UNIX user and enter the postgres shell::
444-
445-
psql
446-
SHOW data_directory;
447-
\q
448-
449-
If you are unable to enter the postgres shell, try looking for the ``data_directory`` variable in a file ``/etc/postgresql/9.6/main/postgresql.conf`` or similar.
450-
451-
3. Stop the postgres database service::
452-
453-
service postgresql stop
454-
455-
4. Copy all files and folders from the postgres ``data_directory`` to the new location::
456-
457-
cp -a SOURCE_DIRECTORY DESTINATION_DIRECTORY
458-
459-
.. note:: Flag ``-a`` will create a directory within ``DESTINATION_DIRECTORY``, e.g.::
460-
461-
cp -a OLD_DIR/main/ NEW_DIR/
462-
463-
creates ``NEW_DIR/main``.
464-
It will also keep the file permissions (necessary).
465-
466-
The file permissions of the new and old directory need to be identical (including subdirectories).
467-
In particular, the owner and group should be both ``postgres`` (except for symbolic links in ``server.crt`` and ``server.key`` that may or may not be present).
468-
469-
.. note::
470-
471-
If the permissions of these links need to be changed, use the ``-h`` option of ``chown`` to avoid changing the permissions of the destination of the links.
472-
In case you have changed the permission of the links destination by mistake, they should typically be (beware that this might depend on your actual distribution!)::
473-
474-
-rw-r--r-- 1 root root 989 Mar 1 2012 /etc/ssl/certs/ssl-cert-snakeoil.pem
475-
-rw-r----- 1 root ssl-cert 1704 Mar 1 2012 /etc/ssl/private/ssl-cert-snakeoil.key
476-
477-
5. Point the ``data_directory`` variable in your postgres configuration file (e.g. ``/etc/postgresql/9.6/main/postgresql.conf``) to the new directory.
478-
479-
6. Restart the database daemon::
480-
481-
service postgresql start
482-
483-
Finally, check that the data directory has indeed changed::
484-
485-
psql
486-
SHOW data_directory;
487-
\q
488-
489-
and try a simple AiiDA query with the new database.
490-
If everything went fine, you can delete the old database location.
491-
492-
If you're still encountering performance issues, the following tips can help with pinpointing performance bottlenecks.
493-
494-
.. dropdown:: Analyze the RabbitMQ message rate
495-
496-
If you're observing slow performance of the AiiDA engine, the `RabbitMQ management plugin <https://www.rabbitmq.com/management.html>`_ provides an intuitive dashboard that lets you monitor the message rate and check on what the AiiDA engine is up to.
497-
498-
Enable the management plugin via something like::
499-
500-
sudo rabbitmq-plugins enable rabbitmq_management
501-
502-
Then, navigate to http://localhost:15672/ and log in with ``guest``/``guest``.
503-
504-
505370
.. _how-to:installation:update:
506371

507372
Updating your installation

0 commit comments

Comments
 (0)