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

feat(core): add workflow execute subcommand #2273

Merged
merged 16 commits into from Sep 23, 2021
Merged

Conversation

vigsterkr
Copy link
Contributor

@vigsterkr vigsterkr commented Aug 18, 2021

Description

Fixes #2130

this PR only includes the following features:

  • add subcommand workflow execute based on the specs
  • use pluggy to implement a plugin based workflow provider/executor framework
  • create a default cwltool based workflow provider
  • fix cwl exporter to use parameter's actual_value property instead of default_value this way user-defined parameter overrides will be reflected in the exported cwl file

@vigsterkr vigsterkr force-pushed the 2130-workflow-execute branch 2 times, most recently from da4f321 to b21264c Compare August 22, 2021 15:51
@vigsterkr vigsterkr marked this pull request as ready for review August 23, 2021 13:38
@vigsterkr vigsterkr requested a review from a team as a code owner August 23, 2021 13:38
@vigsterkr vigsterkr force-pushed the 2130-workflow-execute branch 2 times, most recently from 4db047d to 9eef65c Compare August 23, 2021 16:16
renku/core/commands/workflow.py Outdated Show resolved Hide resolved
renku/core/commands/workflow.py Outdated Show resolved Hide resolved
renku/core/models/workflow/provider.py Outdated Show resolved Hide resolved
renku/core/models/workflow/provider.py Outdated Show resolved Hide resolved
renku/core/plugins/provider.py Outdated Show resolved Hide resolved
tests/cli/test_workflow.py Outdated Show resolved Hide resolved
tests/cli/test_workflow.py Outdated Show resolved Hide resolved
@vigsterkr vigsterkr force-pushed the 2130-workflow-execute branch 2 times, most recently from f5f4b06 to 0b63e15 Compare August 30, 2021 13:18
@vigsterkr vigsterkr force-pushed the 2130-workflow-execute branch 2 times, most recently from dcc6570 to 0b46f54 Compare September 2, 2021 21:52
@vigsterkr
Copy link
Contributor Author

@Panaetius ready for (re)review. thanks!

@Panaetius
Copy link
Member

You should enjoy your vacation 😉

Don't worry, we can take care of this PR while you're gone. And thanks for the changes

@@ -143,7 +146,9 @@ def execute_workflow(

started_at_time = local_now()

modified_outputs = _execute_workflow_helper(plans=plans, client=client)
# NOTE: Create a ``CompositePlan`` because ``workflow_covert`` expects it
workflow = CompositePlan(id=CompositePlan.generate_id(), plans=plans, name=f"plan-collection-{uuid.uuid4().hex}")
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

i dont like this as there's a CompositePlan -> List[Plan] -> CompositePlan cycle going on here. but for the sake of having the execute feature in master i'd merge this and the toil PR in the meanwhile i'll finish the refactor of handling list of plans in the workflow execute/converter plugins

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Me and Mohammad discussed this in the past, and it is unfortunate but a bit of a necessary feature to allow the same executor to be used with workflow execute, rerun and update. In the rerun and update case, there is only a list of plans as the source, not a CompositePlan, and we didn't want to modify execute_workflow as you're still working on that part.

But we should consider not building a CompositePlan in the execute_workflow method as it's not really needed.

Copy link
Contributor

@m-alisafaee m-alisafaee left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks Viktor! This looks very good. I've made a few comments; feel free to address them in a coming refactoring PR if you are doing one atm.

renku/core/models/workflow/provider.py Show resolved Hide resolved
renku/core/models/workflow/provider.py Show resolved Hide resolved
renku/core/management/workflow/value_resolution.py Outdated Show resolved Hide resolved
renku/core/management/workflow/value_resolution.py Outdated Show resolved Hide resolved
renku/core/management/workflow/value_resolution.py Outdated Show resolved Hide resolved
renku/core/management/workflow/value_resolution.py Outdated Show resolved Hide resolved

return jsonld.read_yaml(file)
except Exception as e:
raise errors.ParameterError(e)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's probably good to write a message here to say that something was wrong with the values file.

renku/core/commands/workflow.py Outdated Show resolved Hide resolved
"-s",
"--set",
multiple=True,
metavar="<parameter>=<value>",
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

How does this work with CompositePlanValueResolver? In there we look for a parameters or a steps keys. It's also probably good to add a test which uses this flag.

Viktor Gal and others added 14 commits September 22, 2021 15:28
make sure that cwl export uses the actual_value of a parameter
refactor workflow_execute plugin interface
Co-authored-by: Ralf Grubenmann <ralf.grubenmann@sdsc.ethz.ch>
transform exception from jsonld.read_yaml to RenkuException
this class does a values resolution for a given AbstractPlan using user
supplied values as well as holds information regarding none effective
settings.
Co-authored-by: Ralf Grubenmann <ralf.grubenmann@sdsc.ethz.ch>
add documentation for cwltool provider implementation
@m-alisafaee m-alisafaee self-requested a review September 23, 2021 10:43
Copy link
Contributor

@m-alisafaee m-alisafaee left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you!

@vigsterkr vigsterkr merged commit 34297be into master Sep 23, 2021
@vigsterkr vigsterkr deleted the 2130-workflow-execute branch September 23, 2021 13:26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

add renku workflow execute command
3 participants