[SDK-compiler] Refactor Compiler to expose an API to write out yaml spec of pipeline. (#2146)
[SDK-compiler] Refactor Compiler to expose an API to write out yaml spec of pipeline. (#2146)

* Refactor.

* Remove redundant code.

* Fix.

* Move the implementation of create_workflow into a private api.

* Change write_workflow to private.

* deprecation warning

kubeflow/pipelines,kubeflow/pipelines,kubeflow/pipelines,kubeflow/pipelines,kubeflow/pipelines,kubeflow/pipelines