Skip to content

Commit

Permalink
Restructure aiida_conda_code_plugins
Browse files Browse the repository at this point in the history
  • Loading branch information
chrisjsewell committed Jul 25, 2022
1 parent 972abb7 commit 0957b4c
Show file tree
Hide file tree
Showing 5 changed files with 137 additions and 125 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
*.swp
__pycache__/
.DS_Store
.galaxy_install_info
.vscode/
Expand Down
228 changes: 116 additions & 112 deletions defaults/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -62,12 +62,6 @@ aiida_conda_add_packages:
- aiida-orca=0.5.1
- aiida-vasp=2.1.1
- aiida-wannier90_workflows=1.0.2
- mendeleev<0.10.0 # for aiida-fleur 1.3.1, only when using aiida 1.6 -> sqlalchemy != 1.4
# abipy is required by aiida-abinit but is not listed as a dependency in v0.2.0,
# also the abipy recipe does not pin dependencies, so we have to do it specifically
- abipy=0.8 # we can't use 0.9 because the pymatgen version is incomatible with aiida-common-workflows
- pymatgen<2021.3.3 # required by abipy 0.8
- apscheduler=2.1.0 # required by abipy 0.8, note this is sourced from the cjs14 channel

# these are requirements which are not yet on conda
# we use --no-deps though, so that we don't clobber any conda packages
Expand Down Expand Up @@ -130,109 +124,119 @@ aiida_pseudos_dojo:
aiida_conda_code_computer: local_direct_conda # the computer to use, by label
aiida_conda_code_plugins:

- plugin_package: aiida-abinit
plugin_version: "0.2.0a1"
conda_env: "abinit"
code_packages:
# - aiida-abinit.code=0.2.0a1 # TODO
- abinit=9
doc_packages: abinit
codes:
- label: abinit.main
plugin: abinit
exec: abinit

- plugin_package: aiida-cp2k
plugin_version: "1.5.0"
conda_env: "cp2k"
code_packages:
# - aiida-cp2k.code=1.5.0 # TODO
- "cp2k=7.*=*openmpi*" # ensure the mpi version is installed
doc_packages: cp2k
codes:
- label: cp2k.main
plugin: cp2k
exec: cp2k.psmp

- plugin_package: aiida-fleur
plugin_version: "1.3.1"
conda_env: "fleur"
code_packages:
- aiida-fleur.code=1.3.1
doc_packages: fleur
codes:
- label: fleur.main
plugin: fleur.fleur
exec: fleur_MPI
- label: fleur.inpgen
plugin: fleur.inpgen
exec: inpgen

- plugin_package: aiida-nwchem
plugin_version: "2.1.0"
conda_env: "nwchem"
code_packages:
- aiida-nwchem.code=2.1.0
doc_packages: nwchem
codes:
- label: nwchem.main
plugin: nwchem.nwchem
exec: nwchem

- plugin_package: aiida-quantumespresso
plugin_version: "3.5.2"
conda_env: "qe"
code_packages:
- aiida-quantumespresso.code=3.5.2
doc_packages: qe
codes:
- label: qe.cp
plugin: quantumespresso.cp
exec: cp.x
- label: qe.neb
plugin: quantumespresso.neb
exec: neb.x
- label: qe.ph
plugin: quantumespresso.ph
exec: ph.x
- label: qe.pp
plugin: quantumespresso.pp
exec: pp.x
- label: qe.pw
plugin: quantumespresso.pw
exec: pw.x

- plugin_package: aiida-siesta
plugin_version: "1.3.0"
conda_env: "siesta"
code_packages:
- aiida-siesta.code=1.3.0
- siesta=*=mpi* # ensure the mpi version is installed
doc_packages: siesta
codes:
- label: siesta.main
plugin: siesta.siesta
exec: siesta

- plugin_package: aiida-wannier90
plugin_version: "2.0.1"
conda_env: "wannier90"
code_packages:
- aiida-wannier90.code=2.0.1
doc_packages: wannier90
codes:
- label: wannier90.main
plugin: wannier90.wannier90
exec: wannier90.x

- plugin_package: aiida-yambo
plugin_version: "1.3.0"
conda_env: "yambo"
code_packages:
# - aiida-yambo.code=1.3.0 # TODO
- yambo=5
doc_packages: yambo
codes:
- label: yambo.main
plugin: yambo.yambo
exec: yambo
abinit:
aiida_packages:
- aiida-abinit=0.2.0a1
# abipy is required by aiida-abinit but is not listed as a dependency in v0.2.0,
# also the abipy recipe does not pin dependencies, so we have to do it specifically
- abipy=0.8 # we can't use 0.9 because the pymatgen version is incomatible with aiida-common-workflows
- pymatgen<2021.3.3 # required by abipy 0.8
- apscheduler=2.1.0 # required by abipy 0.8, note this is sourced from the cjs14 channel
conda_env: "abinit"
code_packages:
# - aiida-abinit.code=0.2.0a1 # TODO
- abinit=9
doc_packages: abinit
codes:
- label: abinit.main
plugin: abinit
exec: abinit

cp2k:
aiida_packages: [aiida-cp2k=1.5.0"]
conda_env: "cp2k"
code_packages:
# - aiida-cp2k.code=1.5.0 # TODO
- "cp2k=7.*=*openmpi*" # ensure the mpi version is installed
doc_packages: cp2k
codes:
- label: cp2k.main
plugin: cp2k
exec: cp2k.psmp

fleur:
aiida_packages:
- aiida-fleur=1.3.1
# for aiida-fleur 1.3.1, only when using aiida 1.6 -> sqlalchemy != 1.4
# since mendeleev does not pin dependencies, but pypi dist 0.10 requires sqlalchemy 1.4
- mendeleev<0.10.0
conda_env: "fleur"
code_packages:
- aiida-fleur.code=1.3.1
doc_packages: fleur
codes:
- label: fleur.main
plugin: fleur.fleur
exec: fleur_MPI
- label: fleur.inpgen
plugin: fleur.inpgen
exec: inpgen

nwchem:
aiida_packages: [aiida-nwchem=2.1.0]
conda_env: "nwchem"
code_packages:
- aiida-nwchem.code=2.1.0
doc_packages: nwchem
codes:
- label: nwchem.main
plugin: nwchem.nwchem
exec: nwchem

quantumespresso:
aiida_packages: [aiida-quantumespresso=3.5.2]
conda_env: "qe"
code_packages:
- aiida-quantumespresso.code=3.5.2
doc_packages: qe
codes:
- label: qe.cp
plugin: quantumespresso.cp
exec: cp.x
- label: qe.neb
plugin: quantumespresso.neb
exec: neb.x
- label: qe.ph
plugin: quantumespresso.ph
exec: ph.x
- label: qe.pp
plugin: quantumespresso.pp
exec: pp.x
- label: qe.pw
plugin: quantumespresso.pw
exec: pw.x

siesta:
aiida_packages: [aiida-siesta=1.3.0]
conda_env: "siesta"
code_packages:
- aiida-siesta.code=1.3.0
- siesta=*=mpi* # ensure the mpi version is installed
doc_packages: siesta
codes:
- label: siesta.main
plugin: siesta.siesta
exec: siesta

wannier90:
aiida_packages: [aiida-wannier90=2.0.1]
conda_env: "wannier90"
code_packages:
- aiida-wannier90.code=2.0.1
doc_packages: wannier90
codes:
- label: wannier90.main
plugin: wannier90.wannier90
exec: wannier90.x

yambo:
aiida_packages: [aiida-yambo=1.3.0]
conda_env: "yambo"
code_packages:
# - aiida-yambo.code=1.3.0 # TODO
- yambo=5
doc_packages: yambo
codes:
- label: yambo.main
plugin: yambo.yambo
exec: yambo
Binary file removed filter_plugins/__pycache__/main.cpython-310.pyc
Binary file not shown.
26 changes: 16 additions & 10 deletions filter_plugins/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,29 +6,35 @@ def aiida_conda_packages(python_version, core_version, code_plugins, add_package
:param python_version: The python version to use.
:param core_version: The aiida-core version to use.
:param code_plugins: A list of code plugin dictionaries,
each should contain 'plugin_package' and 'plugin_version'.
:param code_plugins: A dict of code plugin dictionaries, each should contain 'aiida_packages'.
:param add_packages: A list of additional packages to install.
"""
_var_name = "aiida_conda_code_plugins"
output = [
"python={}".format(python_version),
"aiida-core={}".format(core_version),
]
if not isinstance(code_plugins, list):
if not isinstance(code_plugins, dict):
raise AnsibleFilterError(
"aiida_code_plugins_list requires a list, got %s" % type(code_plugins)
"%s requires a dict, got %s" % (_var_name, type(code_plugins))
)
for plugin in code_plugins:
for name, plugin in code_plugins.items():
if not isinstance(plugin, dict):
raise AnsibleFilterError(
"aiida_code_plugins_list requires a list of dicts, got item %s" % plugin
"%s requires a dict of dicts, got item %s: %s"
% (_var_name, name, plugin)
)
if not ("plugin_package" in plugin and "plugin_version" in plugin):
if not ("aiida_packages" in plugin):
raise AnsibleFilterError(
"aiida_code_plugins_list requires items containing 'plugin_package' and 'plugin_version', got item %s"
% plugin
"%s requires items containing 'aiida_packages', got item %s: %s"
% (_var_name, name, plugin)
)
output.append("%s=%s" % (plugin["plugin_package"], plugin["plugin_version"]))
if not isinstance(plugin["aiida_packages"], list):
raise AnsibleFilterError(
"%s requires key aiida_packages to be a list, for %s got: %s"
% (_var_name, name, plugin["aiida_packages"])
)
output.extend(plugin["aiida_packages"])
return output + add_packages


Expand Down
7 changes: 4 additions & 3 deletions tasks/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -34,10 +34,11 @@

- name: Create aiida codes for the available plugins
include_tasks: aiida-code.yml
loop: "{{ aiida_conda_code_plugins }}"
loop: "{{ aiida_conda_code_plugins | dict2items }}"
loop_control:
loop_var: aiida_code
label: "{{ aiida_code.plugin_package }}"
label: "{{ item.key }}"
vars:
aiida_code: "{{ item.value }}"
tags: [aiida_cws, aiida_cws_code]

- name: Download an install pseudo-potential families
Expand Down

0 comments on commit 0957b4c

Please sign in to comment.