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

Implementation for Unbounded Foreach #510

Closed
wants to merge 2 commits into from
Closed

Implementation for Unbounded Foreach #510

wants to merge 2 commits into from

Conversation

savingoyal
Copy link
Collaborator

@savingoyal savingoyal commented May 7, 2021

TODO:

  1. Integrate with decorator linter to simplify many of the decorator implementations.
  2. Introduce Batch array implementation - will be a follow-on PR.
  3. Make sure SFN doesn't break.

@savingoyal savingoyal changed the title [WIP] Implementation for Unbounded Foreach Implementation for Unbounded Foreach May 7, 2021
@savingoyal
Copy link
Collaborator Author

This PR is a step forward for #415. cc @corleyma, @dgerlanc, @seanv507, @rchui

self._top_kwargs = {}
self._step_kwargs = {}

def _set_step_kwargs(self, kwargs):
Copy link
Contributor

Choose a reason for hiding this comment

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

Is there a reason you didn't just use the setter/getter idiom for this?

@@ -220,6 +221,7 @@ def step_task_retry_count(self):
Returns a tuple of (user_code_retries, error_retries). Error retries
are attempts to run the process after the user code has failed all
its retries.
Return None, None to disable all retries by the (native) runtime.
Copy link
Contributor

Choose a reason for hiding this comment

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

Rephrase as: Typically, the runtime takes the maximum of retry counts across decorators and user specification to determine the task retry count. If you want to force no retries, return the special values (None, None).

or something similar.
I hadn't understood that from the original comment.

CondaStepDecorator], ext_plugins.STEP_DECORATORS, 'name')
CondaStepDecorator,
InternalUnboundedForeachDecorator],
ext_plugins.STEP_DECORATORS, 'name')
Copy link
Contributor

Choose a reason for hiding this comment

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

Nit: indentation.

yield '--%s' % k
if not isinstance(value, bool):
yield to_unicode(value)
# def options(mapping):
Copy link
Contributor

Choose a reason for hiding this comment

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

Can strip.

@@ -292,14 +292,13 @@ def dict_to_cli_options(params):
if k == 'decospecs':
k = 'with'
k = k.replace('_', '-')
if not isinstance(v, tuple):
v = [v]
v = v if isinstance(v, list) or isinstance(v, tuple) else [v]
Copy link
Contributor

Choose a reason for hiding this comment

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

can replace by isinstance(v, (list, tuple)) instead of both isinstance.

from . import MetaflowCheck, AssertArtifactFailed, AssertLogFailed, truncate
from . import AssertTagFailed
Copy link
Contributor

Choose a reason for hiding this comment

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

This assertion does not exist.

@@ -18,36 +17,29 @@ class CliCheck(MetaflowCheck):

def run_cli(self, args, capture_output=False):
cmd = [sys.executable, 'test_flow.py']
cmd.extend(self.cli_options)

Copy link
Contributor

Choose a reason for hiding this comment

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

is this part of the other diff (#521)?

@@ -25,7 +25,7 @@ def check_results(self, flow, checker):
for step in run:
for task in step:
if 'check' in task.data:
extype = 'metaflow.plugins.timeout_decorators.'\
extype = 'metaflow.plugins.timeout_decorator.'\
Copy link
Contributor

Choose a reason for hiding this comment

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

Ditto for this.

@romain-intel
Copy link
Contributor

Replaced by #554

@savingoyal savingoyal deleted the ubf-impl branch June 15, 2021 21:35
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.

2 participants