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

fix: continue_on_success_ratio without slice raise error #852

Draft
wants to merge 1 commit into
base: master
Choose a base branch
from
Draft
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
12 changes: 8 additions & 4 deletions src/dflow/step.py
Original file line number Diff line number Diff line change
Expand Up @@ -588,7 +588,7 @@ def merge_output_artifact(art, parent, layer=0):
else:
for name in sliced_input_artifact:
self.inputs.parameters["dflow_%s_sub_path" %
name].value = "{{item.%s}}" % name
name].value = "{{item.%s}}" % name
v = self.inputs.artifacts[name].source
if isinstance(v, S3Artifact):
self.prepare_step.set_artifacts({
Expand Down Expand Up @@ -702,7 +702,8 @@ def merge_output_artifact(art, parent, layer=0):
self.template.set_slices(self.template.slices)
self.with_param = argo_range(if_expression(
"%s %% %s > 0" % (nslices, group_size),
"%s/%s + 1" % (nslices, group_size),
"(%s - %s %% %s) / %s + 1" % (nslices,
nslices, group_size, group_size),
"%s/%s" % (nslices, group_size)))
elif self.with_param is not None:
self.template.inputs.parameters["dflow_with_param"] = \
Expand All @@ -725,7 +726,8 @@ def merge_output_artifact(art, parent, layer=0):
self.template.set_slices(self.template.slices)
self.with_param = argo_range(if_expression(
"%s %% %s > 0" % (nslices, group_size),
"%s/%s + 1" % (nslices, group_size),
"(%s - %s %% %s) / %s + 1" % (nslices,
nslices, group_size, group_size),
"%s/%s" % (nslices, group_size)))
if self.with_sequence is not None:
self.template.inputs.parameters["dflow_sequence_start"] = \
Expand Down Expand Up @@ -779,7 +781,8 @@ def merge_output_artifact(art, parent, layer=0):
self.with_sequence = argo_sequence(
count=if_expression(
"%s %% %s > 0" % (nslices, group_size),
"%s/%s + 1" % (nslices, group_size),
"(%s - %s %% %s) / %s + 1" % (nslices,
nslices, group_size, group_size),
"%s/%s" % (nslices, group_size)), format=format)

self.inputs.parameters["dflow_nslices"] = InputParameter(
Expand Down Expand Up @@ -912,6 +915,7 @@ def add_success_tag(templ):
}
)
elif self.continue_on_success_ratio is not None:
total = 1
if "dflow_nslices" in self.inputs.parameters:
total = self.inputs.parameters["dflow_nslices"].value
elif self.with_param is not None:
Expand Down
Loading