From fbf1967ed5258625c45b98a1b3e77b4cdfe911ee Mon Sep 17 00:00:00 2001 From: Alexey Volkov Date: Tue, 8 Oct 2019 22:13:53 -0700 Subject: [PATCH] SDK - DSL - Deprecated output_artifact_paths parameter in ContainerOp constructor The users should switch to file_outputs instead. Previously `file_outputs` only supported small data outputs, but now it supports big files. --- sdk/python/kfp/compiler/_op_to_template.py | 3 +-- sdk/python/kfp/dsl/_container_op.py | 15 ++++++++------- 2 files changed, 9 insertions(+), 9 deletions(-) diff --git a/sdk/python/kfp/compiler/_op_to_template.py b/sdk/python/kfp/compiler/_op_to_template.py index 45a69b88848..113338d7f43 100644 --- a/sdk/python/kfp/compiler/_op_to_template.py +++ b/sdk/python/kfp/compiler/_op_to_template.py @@ -181,8 +181,7 @@ def _op_to_template(op: BaseOp): processed_op = _process_base_ops(op) if isinstance(op, dsl.ContainerOp): - # default output artifacts - output_artifact_paths = OrderedDict(op.output_artifact_paths) + output_artifact_paths = OrderedDict() # This should have been as easy as output_artifact_paths.update(op.file_outputs), but the _outputs_to_json function changes the output names and we must do the same here, so that the names are the same output_artifact_paths.update(sorted(((param.full_name, processed_op.file_outputs[param.name]) for param in processed_op.outputs.values()), key=lambda x: x[0])) diff --git a/sdk/python/kfp/dsl/_container_op.py b/sdk/python/kfp/dsl/_container_op.py index 3fb7e6a0d63..f1d6cdcaee8 100644 --- a/sdk/python/kfp/dsl/_container_op.py +++ b/sdk/python/kfp/dsl/_container_op.py @@ -996,13 +996,11 @@ def __init__( At pipeline run time, the value of the artifact argument is saved to a local file with specified path. This parameter is only needed when the input file paths are hard-coded in the program. Otherwise it's better to pass input artifact placement paths by including artifact arguments in the command-line using the InputArgumentPath class instances. - file_outputs: Maps output labels to local file paths. At pipeline run time, - the value of a PipelineParam is saved to its corresponding local file. It's - one way for outside world to receive outputs of the container. - output_artifact_paths: Maps output artifact labels to local artifact file paths. - It has the following default artifact paths during compile time. - {'mlpipeline-ui-metadata': '/mlpipeline-ui-metadata.json', - 'mlpipeline-metrics': '/mlpipeline-metrics.json'} + file_outputs: Maps output names to container local output file paths. + The system will take the data from those files and will make it available for passing to downstream tasks. + For each output in the file_outputs map there will be a corresponding output reference available in the task.outputs dictionary. + These output references can be passed to the other tasks as arguments. + output_artifact_paths: Deprecated. Maps output artifact labels to local artifact file paths. Deprecated: Use file_outputs instead. It now supports big data outputs. is_exit_handler: Deprecated. This is no longer needed. pvolumes: Dictionary for the user to match a path on the op's fs with a V1Volume or it inherited type. @@ -1085,6 +1083,9 @@ def _decorated(*args, **kwargs): self.artifact_arguments = artifact_arguments self.file_outputs = file_outputs self.output_artifact_paths = output_artifact_paths or {} + if output_artifact_paths: + file_outputs.update(output_artifact_paths) + warnings.warn('The output_artifact_paths parameter is deprecated since SDK v0.1.32. Use the file_outputs parameter instead. file_outputs now supports outputting big data.', DeprecationWarning) self._metadata = None