marvel-nccr.aiida
Ansible Role: marvel-nccr.aiida
This Ansible role installs and sets up AiiDA on Ubuntu, RHEL, CentOS, and Fedora.
Role Features:
- Installs and starts PostgreSQL and RabbitMQ services
- Installs a specific Python version
- Creates a 'aiida' Python virtual environment to install aiida-core and plugins
- Creates another Python virtual environment called 'jupyter' to install Jupyter and Jupyter Lab, linking it as a kernel
- Adds virtualenwrapper for easy management of virtual environments
- Sets up an AiiDA profile and starts the daemon
- Starts the AiiDA REST API
- Configures localhost codes for AiiDA plugins
- Sets up pseudopotential families in the AiiDA profile
Installation
Run the following command to install:
ansible-galaxy install marvel-nccr.aiida
Role Variables
Check the defaults/main.yml
file for available variables.
Example Playbook
Here’s a simple example of how to use this role:
- hosts: servers
roles:
- role: marvel-nccr.aiida
For full JupyterLab functionality, install Node.js using geerlingguy.nodejs:
- hosts: servers
tasks:
- include_role:
name: geerlingguy.nodejs
vars:
nodejs_version: 12.x
nodejs_install_npm_user: root
- include_role:
name: marvel-nccr.aiida
Note: When creating a Docker container, set jupyter_ip: "0.0.0.0"
for aiida-jupyterlab
to expose the port correctly.
Usage
After running, you can "activate" the AiiDA environment in the terminal:
$ workon aiida
(aiida) $ verdi status
To start Jupyter Lab server:
$ aiida-jupyterlab
Open the provided URL in your browser to access the notebook.
Development and Testing
This role uses Molecule and Docker for testing.
After installing Docker, clone the repository:
git clone https://github.com/marvel-nccr/ansible-role-aiida marvel-nccr.aiida cd marvel-nccr.aiida
Install requirements and run tests:
pip install -r requirements.txt # Installs molecule molecule test # runs tests
Or use tox:
pip install tox tox
To manually test the Docker container:
tox converge
Use the VS Code Docker extension for easy interaction with the container.
Code Style
The code style is checked with pre-commit:
pip install pre-commit
pre-commit run --all
Deployment
Deployment to Ansible Galaxy is automated via GitHub Actions. Tag a release as vX.Y.Z
to start the CI and release process, which only completes if tests pass.
License
MIT License
Contact
For inquiries about Quantum Mobile and related Ansible roles, please reach out to the AiiDA mailing list.
An ansible role that installs and configures [AiiDA](http://www.aiida.net/) on Ubuntu, RHEL, CentOS and Fedora.
ansible-galaxy install marvel-nccr.aiida