Skip to content

Commit

Permalink
SDK/DSL/Compiler - Fixed compilation when using ContainerOp.after
Browse files Browse the repository at this point in the history
  • Loading branch information
Ark-kun committed Mar 8, 2019
1 parent 8208510 commit 34c8b76
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 0 deletions.
2 changes: 2 additions & 0 deletions sdk/python/kfp/compiler/compiler.py
Original file line number Diff line number Diff line change
Expand Up @@ -551,6 +551,8 @@ def _compile(self, pipeline_func):
if op.output is not None:
op.output.name = K8sHelper.sanitize_k8s_name(op.output.name)
op.output.op_name = K8sHelper.sanitize_k8s_name(op.output.op_name)
if op.dependent_op_names:
op.dependent_op_names = [K8sHelper.sanitize_k8s_name(name) for name in op.dependent_op_names]
if op.file_outputs is not None:
sanitized_file_outputs = {}
for key in op.file_outputs.keys():
Expand Down
14 changes: 14 additions & 0 deletions sdk/python/tests/compiler/compiler_tests.py
Original file line number Diff line number Diff line change
Expand Up @@ -236,3 +236,17 @@ def test_py_retry(self):
def test_py_image_pull_secret(self):
"""Test pipeline imagepullsecret."""
self._test_py_compile('imagepullsecret')

def test_compile_pipeline_with_after(self):
def op():
return dsl.ContainerOp(
name='Some component name',
image='image'
)

@dsl.pipeline(name='Pipeline', description='')
def pipeline():
task1 = op()
task2 = op().after(task1)

compiler.Compiler()._compile(pipeline)

0 comments on commit 34c8b76

Please sign in to comment.