Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

RabbitMQ debug tools #5718

Merged
merged 5 commits into from
Nov 4, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 3 additions & 4 deletions .github/workflows/ci-code.yml
Original file line number Diff line number Diff line change
Expand Up @@ -66,9 +66,10 @@ jobs:
ports:
- 5432:5432
rabbitmq:
image: rabbitmq:latest
image: rabbitmq:3.8.14-management
ports:
- 5672:5672
- 15672:15672
slurm:
image: xenonmiddleware/slurm:17
ports:
Expand All @@ -83,9 +84,7 @@ jobs:
python-version: ${{ matrix.python-version }}

- name: Install system dependencies
run: |
sudo apt update
sudo apt install postgresql graphviz
run: sudo apt update && sudo apt install postgresql graphviz

- name: Upgrade pip and setuptools
run: |
Expand Down
3 changes: 2 additions & 1 deletion .github/workflows/nightly.yml
Original file line number Diff line number Diff line change
Expand Up @@ -38,9 +38,10 @@ jobs:
ports:
- 5432:5432
rabbitmq:
image: rabbitmq:latest
image: rabbitmq:3.8.14-management
ports:
- 5672:5672
- 15672:15672

steps:
- uses: actions/checkout@v2
Expand Down
9 changes: 4 additions & 5 deletions .github/workflows/rabbitmq.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ jobs:
strategy:
fail-fast: false
matrix:
rabbitmq: ['3.5', '3.6', '3.7', '3.8']
rabbitmq: ['3.6', '3.7', '3.8']

services:
postgres:
Expand All @@ -34,9 +34,10 @@ jobs:
ports:
- 5432:5432
rabbitmq:
image: rabbitmq:${{ matrix.rabbitmq }}
image: rabbitmq:${{ matrix.rabbitmq }}-management
ports:
- 5672:5672
- 15672:15672

steps:
- uses: actions/checkout@v2
Expand All @@ -47,9 +48,7 @@ jobs:
python-version: '3.8'

- name: Install system dependencies
run: |
sudo apt update
sudo apt install postgresql
run: sudo apt update && sudo apt install postgresql

- name: Upgrade pip
run: |
Expand Down
3 changes: 2 additions & 1 deletion .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -72,9 +72,10 @@ jobs:
ports:
- 5432:5432
rabbitmq:
image: rabbitmq:latest
image: rabbitmq:3.8.14-management
ports:
- 5672:5672
- 15672:15672

steps:
- uses: actions/checkout@v2
Expand Down
7 changes: 3 additions & 4 deletions .github/workflows/test-install.yml
Original file line number Diff line number Diff line change
Expand Up @@ -207,9 +207,10 @@ jobs:
ports:
- 5432:5432
rabbitmq:
image: rabbitmq:latest
image: rabbitmq:3.8.14-management
ports:
- 5672:5672
- 15672:15672
slurm:
image: xenonmiddleware/slurm:17
ports:
Expand All @@ -224,9 +225,7 @@ jobs:
python-version: ${{ matrix.python-version }}

- name: Install system dependencies
run: |
sudo apt update
sudo apt install postgresql graphviz
run: sudo apt update && sudo apt install postgresql graphviz

- name: Upgrade pip and setuptools
# It is crucial to update `setuptools` or the installation of `pymatgen` can break
Expand Down
1 change: 1 addition & 0 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,7 @@ repos:
pass_filenames: true
files: >-
(?x)^(
aiida/cmdline/commands/cmd_rabbitmq.py|
aiida/common/timezone.py|
aiida/common/progress_reporter.py|
aiida/engine/.*py|
Expand Down
1 change: 1 addition & 0 deletions aiida/cmdline/commands/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@
cmd_plugin,
cmd_process,
cmd_profile,
cmd_rabbitmq,
cmd_restapi,
cmd_run,
cmd_setup,
Expand Down
30 changes: 1 addition & 29 deletions aiida/cmdline/commands/cmd_devel.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@

from aiida import get_profile
from aiida.cmdline.commands.cmd_verdi import verdi
from aiida.cmdline.params import arguments, options, types
from aiida.cmdline.params import options, types
from aiida.cmdline.utils import decorators, echo
from aiida.common import exceptions

Expand All @@ -24,34 +24,6 @@ def verdi_devel():
"""Commands for developers."""


@verdi_devel.command('revive')
@arguments.PROCESSES()
@options.FORCE()
@decorators.only_if_daemon_running(message='The daemon has to be running for this command to work.')
def devel_revive(processes, force):
"""Revive processes that seem stuck and are no longer reachable.

Warning: Use only as a last resort after you've gone through the checklist below.

\b
1. Does ``verdi status`` indicate that both daemon and RabbitMQ are running properly?
If not, restart the daemon with ``verdi daemon restart --reset`` and restart RabbitMQ.
2. Try ``verdi process play <PID>``.
If you receive a message that the process is no longer reachable, use ``verdi devel revive <PID>``.

Details: When RabbitMQ loses the process task before the process has completed, the process is never picked up by
the daemon and will remain "stuck". ``verdi devel revive`` recreates the task, which can lead to multiple instances
of the task being executed and should thus be used with caution.
"""
from aiida.engine.processes.control import revive_processes

if not force:
echo.echo_warning('This command should only be used if you are absolutely sure the process task was lost.')
click.confirm(text='Do you want to continue?', abort=True)

revive_processes(processes)


@verdi_devel.command('check-load-time')
def devel_check_load_time():
"""Check for common indicators that slowdown `verdi`.
Expand Down
Loading