Skip to content

Commit

Permalink
SDK/DSL/Compiler - Fixed compilation when using ContainerOp.after (#943)
Browse files Browse the repository at this point in the history
Fixes #941
  • Loading branch information
Ark-kun authored and k8s-ci-robot committed Mar 8, 2019
1 parent 55a35b7 commit 7ce03f0
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
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
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 7ce03f0

Please sign in to comment.