SDK/DSL/Compiler - Fixed compilation when using ContainerOp.after (#943)
Fixes https://github.com/kubeflow/pipelines/issues/941
This commit is contained in:
parent
55a35b7f98
commit
7ce03f07d4
|
|
@ -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():
|
||||
|
|
|
|||
|
|
@ -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)
|
||||
|
|
|
|||
Loading…
Reference in New Issue