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

Operational options: add initfiles #155

Merged
merged 1 commit into from
Jul 10, 2020
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
1 change: 1 addition & 0 deletions AUTHORS.rst
Original file line number Diff line number Diff line change
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
Original file line number Diff line number Diff line change
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
Original file line number Diff line number Diff line change
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
Original file line number Diff line number Diff line change
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