Coder Social home page Coder Social logo

siesta-project / ansible-role-aiida Goto Github PK

View Code? Open in Web Editor NEW

This project forked from marvel-nccr/ansible-role-aiida

0.0 1.0 0.0 337 KB

An ansible role that installs and configures AiiDA on Ubuntu.

License: Other

Shell 23.04% Python 62.83% Jinja 14.13%

ansible-role-aiida's Introduction

CI (debian) CI (redhat) Ansible Role Release

Ansible Role: marvel-nccr.aiida

An ansible role that installs and configures AiiDA on Ubuntu, RHEL, CentOS and Fedora.

The role:

  • Installs and starts the PostgreSQL and RabbitMQ services
  • Installs a designated Python version
  • Creates an 'aiida' Python virtual environment and installs aiida-core and plugins into it
  • Creates a 'jupyter' Python virtual environment and installs Jupyter and Jupyter Lab into it, then links the virtual environment as a kernel.
  • Adds virtualenwrapper for managing the virtual environments.
  • Creates an AiiDA profile and starts the daemon
  • Starts the AiiDA REST API
  • Sets up localhost codes for the AiiDA plugins (where code paths are defined)
  • Sets up pseudopotential families in the AiiDA profile

Installation

ansible-galaxy install marvel-nccr.aiida

Role Variables

See defaults/main.yml

Example Playbook

- hosts: servers
  roles:
  - role: marvel-nccr.aiida

For full use of JupyterLab, install nodejs, e.g. 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 building a Docker container, the variable jupyter_ip: "0.0.0.0" should be set, for aiida-jupyterlab to correctly expose the port.

Usage

Once run, the user can "activate" the aiida environment in the terminal using:

$ workon aiida
(aiida) $ verdi status
verdi status
 ✔ config dir:  /root/.aiida
 ✔ profile:     On profile name-with-dashes
 ✔ repository:  /root/.aiida/repository/name-with-dashes
 ✔ postgres:    Connected as aiida@localhost:5432
 ✔ rabbitmq:    Connected as amqp://guest:[email protected]:5672?heartbeat=600
 ✔ daemon:      Daemon is running as PID 9484 since 2020-11-30 21:51:30

To start a jupyter lab server:

$ aiida-jupyterlab
...
    To access the notebook, open this file in a browser:
        file:///root/.local/share/jupyter/runtime/nbserver-14617-open.html
    Or copy and paste one of these URLs:
        http://localhost:8890/?token=a7086764cda7aba8488a767386d57121429958771a8bccb2
     or http://127.0.0.1:8890/?token=a7086764cda7aba8488a767386d57121429958771a8bccb2

Development and testing

This role uses Molecule and Docker for tests.

After installing Docker:

Clone the repository into a package named marvel-nccr.aiida (the folder must be named the same as the Ansible Galaxy name)

git clone https://github.com/marvel-nccr/ansible-role-aiida marvel-nccr.aiida
cd marvel-nccr.aiida

Then run:

pip install -r requirements.txt  # Installs molecule
molecule test  # runs tests

or use tox (see tox.ini):

pip install tox
tox

To manually test the created docker container, first run:

tox converge

This will run the ansible role, leaving the container running. The recommended way to interact with the container is then to use the VS Code Docker extension. Using this you can then attach a visual studio code instance:

VS Code Docker extension

Inside the container run aiida-jupyterlab, and you will be able to access the supplied URL from your local browser.

When you are finished with the container, destroy the container with:

tox destroy

Code style

Code style is formatted and linted with pre-commit.

pip install pre-commit
pre-commit run -all

Deployment

Deployment to Ansible Galaxy is automated via GitHub Actions. Simply tag a release vX.Y.Z to initiate the CI and release workflow. Note, the release will only complete if the CI tests pass.

License

MIT

Contact

Please direct inquiries regarding Quantum Mobile and associated ansible roles to the AiiDA mailinglist.

ansible-role-aiida's People

Contributors

borellim avatar bosonie avatar chrisjsewell avatar ltalirz avatar sphuber avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.