파이프라인을 Kubeflow YAML 파일로 내보내기

Python code에서의 Link 파이프라인을 Kubeflow에서 사용할 수 있는 YAML 파일로 변환하여 저장합니다.

📘

  • 해당 파이프라인의 모든 컴포넌트가 성공적으로 실행된 다음에 해당 기능을 이용할 수 있습니다.
pipeline.convert_to_kfp(file="str")
  • Parameters
    • file(str): 변환하여 저장하고자 하는 Kubeflow yaml 파일의 경로 및 이름
  • Troubleshooting
    • RuntimeError: Please try again after running the pipeline successfully
      • 모든 파이프라인 컴포넌트가 성공적으로 실행된 상태가 아닐 경우 발생합니다.
    • NameError: It must not be blank
      • file이 공백일 경우 발생합니다.
    • NameError: It must not include [:, *, ", ?, <, >, |]
      • file: * " ? < > | 중 하나가 추가되어 있을 때 발생합니다.
    • NameError: The file name must end with .yaml or .yml
      • file 이름이 .yaml 또는 .yml로 끝나지 않을 경우 발생합니다.

Example

from mrx_link.sdk.utils import *

# 코드 셀
code1 = """
x = 1
"""
code2 = """
print(f"{x=}, {y=}")
"""

if __name__ == "__main__":
    # 컴포넌트 생성
    component1 = create_link_component(identifier="111-1", name="test", code=code1)
    component2 = create_link_component(identifier="111-2", name="test2", code=code2)
    components = [component1, component2]

    # Edge 생성
    edge1 = create_link_edge(parent_id="111-1", child_id="111-2")
    edges = [edge1]

    # 파이프라인 파라미터 생성
    parameter1 = create_link_parameter(name="x", value="123")
    parameter2 = create_link_parameter(name="y", value="baregasdv")

    parameters = [parameter1, parameter2]

    # 파이프라인 생성
    pipeline = create_link_pipeline(components=components, parameters=parameters, edges=edges)

    # `sample.yaml` 파일 생성
    pipeline.convert_to_kfp(file="sample.yaml")