SDK/DSL/Compiler - Fixed compilation when using ContainerOp.after (#943)

Fixes https://github.com/kubeflow/pipelines/issues/941
This commit is contained in:
Alexey Volkov 2019-03-07 18:47:30 -08:00 committed by Kubernetes Prow Robot
parent 55a35b7f98
commit 7ce03f07d4
2 changed files with 16 additions and 0 deletions

View File

@ -551,6 +551,8 @@ class Compiler(object):
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():

View File

@ -236,3 +236,17 @@ class TestCompiler(unittest.TestCase):
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)