快速入門導覽課程:Cloud de Confiance by S3NS Pipeline Components

本快速入門導覽課程會逐步說明如何安裝Cloud de Confiance by S3NS Pipeline Components (GCPC) SDK。

安裝最新版本

使用下列指令,從 Python 套件索引 (PyPI) 安裝 SDK: Cloud de Confiance by S3NS

pip install --upgrade google-cloud-pipeline-components

使用 Cloud de Confiance by S3NS SDK 匯入預先建構的元件

安裝 Cloud de Confiance by S3NS SDK 後,即可匯入預先建構的元件。

如需支援元件的 SDK 參考資訊,請參閱 Cloud de Confiance by S3NS SDK 說明文件。

舉例來說,您可以使用下列程式碼,在管道中匯入及使用 Dataflow 元件。

from google_cloud_pipeline_components.v1.dataflow import DataflowPythonJobOp
from kfp import dsl

@dsl.pipeline(
    name=PIPELINE_NAME,
    description='Dataflow launch python pipeline'
)
def pipeline(
    python_file_path:str = 'gs://ml-pipeline-playground/samples/dataflow/wc/wc.py',
    project_id:str = PROJECT_ID,
    location:str = LOCATION,
    staging_dir:str = PIPELINE_ROOT,
    requirements_file_path:str = 'gs://ml-pipeline-playground/samples/dataflow/wc/requirements.txt',
):
    dataflow_python_op = DataflowPythonJobOp(
        project=project_id,
        location=location,
        python_module_path=python_file_path,
        temp_location = staging_dir,
        requirements_file_path = requirements_file_path,
        args = ['--output', OUTPUT_FILE],
    )

後續步驟