Skip to content

Commit

Permalink
operational options: add initfiles
Browse files Browse the repository at this point in the history
  • Loading branch information
alintulu committed Jul 10, 2020
1 parent 64fb637 commit 31e0912
Show file tree
Hide file tree
Showing 4 changed files with 17 additions and 1 deletion.
1 change: 1 addition & 0 deletions AUTHORS.rst
Expand Up @@ -3,6 +3,7 @@ Authors

The list of contributors in alphabetical order:

- `Adelina Lintuluoto <https://orcid.org/0000-0002-0726-1452>`_
- `Daniel Prelipcean <https://orcid.org/0000-0002-4855-194X>`_
- `Diego Rodriguez <https://orcid.org/0000-0003-0649-2002>`_
- `Dinos Kousidis <https://orcid.org/0000-0002-4914-4289>`_
Expand Down
1 change: 1 addition & 0 deletions CHANGES.rst
Expand Up @@ -10,6 +10,7 @@ Version master (UNRELEASED)
- Performs workflow specification load logic. Before in ``reana-client``.
- Adds VOMS proxy support as a new authentication method.
- Add Black formatter support.
- Adds initfiles as an operational option for Yadage.

Version 0.6.1 (2020-05-25)
--------------------------
Expand Down
15 changes: 14 additions & 1 deletion reana_workflow_engine_yadage/cli.py
Expand Up @@ -13,6 +13,7 @@
import json
import logging
import os
import yaml

import click
import yadageschemas
Expand Down Expand Up @@ -53,6 +54,12 @@ def load_yadage_operational_options(ctx, param, operational_options):
operational_options["initdir"] = os.path.join(
workflow_workspace, operational_options.get("initdir", "")
)

operational_options["initfiles"] = [
os.path.join(workflow_workspace, initfile)
for initfile in operational_options.get("initfiles", [])
]

return operational_options


Expand Down Expand Up @@ -123,12 +130,18 @@ def run_yadage_workflow(
)
workflow_kwargs = dict(workflow_json=workflow_json)
dataopts = {"initdir": operational_options["initdir"]}

initdata = {}
for initfile in operational_options["initfiles"]:
initdata.update(**yaml.safe_load(open(initfile)))
initdata.update(workflow_parameters)

check_connection_to_job_controller()

with steering_ctx(
dataarg=workflow_workspace,
dataopts=dataopts,
initdata=workflow_parameters if workflow_parameters else {},
initdata=initdata,
visualize=True,
updateinterval=5,
loginterval=5,
Expand Down
1 change: 1 addition & 0 deletions setup.py
Expand Up @@ -59,6 +59,7 @@
"yadage==0.20.1",
"yadage-schemas==0.10.6",
"webcolors==1.9.1", # FIXME remove once yadage-schemas solves yadage deps.
"checksumdir>=1.1.4,<1.2",
]

packages = find_packages()
Expand Down

0 comments on commit 31e0912

Please sign in to comment.