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

Add "set_retry()" on ContainerOp. #723

Merged
merged 5 commits into from
Jan 24, 2019
Merged

Conversation

qimingj
Copy link
Contributor

@qimingj qimingj commented Jan 23, 2019

This change is Reviewable

@hongye-sun
Copy link
Contributor

/lgtm

@@ -62,6 +62,7 @@ def __init__(self, name: str, image: str, command: str=None, arguments: str=None
self.env_variables = []
self.pod_annotations = {}
self.pod_labels = {}
self.num_retry = 0
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
self.num_retry = 0
self.num_retries = 0

Copy link
Contributor Author

Choose a reason for hiding this comment

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

done.

@@ -288,5 +288,15 @@ def add_pod_label(self, name: str, value: str):
self.pod_labels[name] = value
return self

def set_retry(self, num_retry: int):
Copy link
Contributor

@Ark-kun Ark-kun Jan 23, 2019

Choose a reason for hiding this comment

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

Suggested change
def set_retry(self, num_retry: int):
def set_retries(self, num_retries: int):

Generally, it's nice to name the properties the same way as the underlying structure, but set_retry_strategy_limit is probably too long.

Copy link
Contributor

Choose a reason for hiding this comment

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

BTW, the reason Argo has retryStrategy.limit property instead of just numRetries is probably because they want to add more ways to do the retries (e.g. exponential backoff). If that feature is added, what's our plan on supporting it?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

We can decide once argo has more. For example, we can add set_retry_strategy or even deprecate the simple retry. But usually I am in favor of simplicity, especially we don't know argo's plan.

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 am slightly in favor of set_retry because it is more discoverable. For example, people will probably search the APIs with "retry" but not "retries". Users should understand it is not "enable or disable" because the" num_retries" parameter is pretty clear.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

btw, changed num_retry --> num_retries.

@@ -288,5 +288,15 @@ def add_pod_label(self, name: str, value: str):
self.pod_labels[name] = value
return self

def set_retry(self, num_retry: int):
"""Sets retry times.
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
"""Sets retry times.
"""Sets the number of times the task is retried until it's declared failed.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

done.

"""Sets retry times.

Args:
num_retry: Number of times to retry on failures.
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
num_retry: Number of times to retry on failures.
num_retries: Number of times to retry on failures.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

done.

num_retry: Number of times to retry on failures.
"""

self.num_retry = num_retry
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
self.num_retry = num_retry
self.num_retries = num_retries

Copy link
Contributor Author

Choose a reason for hiding this comment

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

done.

@k8s-ci-robot k8s-ci-robot removed the lgtm label Jan 23, 2019
key: secretkey
name: mlpipeline-minio-artifact
retryStrategy:
limit: 5
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
limit: 5
limit: 50

key: secretkey
name: mlpipeline-minio-artifact
retryStrategy:
limit: 10
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
limit: 10
limit: 100

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yeah! Nice catch. Fixed.

@Ark-kun
Copy link
Contributor

Ark-kun commented Jan 24, 2019

/lgtm

@Ark-kun
Copy link
Contributor

Ark-kun commented Jan 24, 2019

/approve

@k8s-ci-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: Ark-kun

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@k8s-ci-robot k8s-ci-robot merged commit 3b3a15e into kubeflow:master Jan 24, 2019
Linchin pushed a commit to Linchin/pipelines that referenced this pull request Apr 11, 2023
magdalenakuhn17 pushed a commit to magdalenakuhn17/pipelines that referenced this pull request Oct 22, 2023
…w#723)

* deploy custom img using client sdk

* Clean readme

* update notebook

* restructure

* fix typo

* Clean outputs

* Add notebook checkpoints to top level gitignore
HumairAK pushed a commit to red-hat-data-services/data-science-pipelines that referenced this pull request Mar 11, 2024
…tible mode (kubeflow#723)

* remove argo template reference

* address the suggestions
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants