Kurzanleitung: Cloud de Confiance by S3NS-Pipelinekomponenten

Diese Kurzanleitung führt Sie durch die Installation des Cloud de Confiance by S3NS Pipeline Components SDK (GCPC).

Neuesten Release installieren

Verwenden Sie den folgenden Befehl, um das Cloud de Confiance by S3NS SDK aus dem Python Package Index (PyPI) zu installieren:

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

Vordefinierte Komponente mit dem Cloud de Confiance by S3NS SDK importieren

Nachdem Sie das Cloud de Confiance by S3NS SDK installiert haben, können Sie es zum Importieren einer vordefinierten Komponente verwenden.

Informationen zu SDK-Referenzen für unterstützte Komponenten finden Sie unter der Cloud de Confiance by S3NS SDK-Dokumentation.

Sie können beispielsweise den folgenden Code verwenden, um die Dataflow-Komponente in eine Pipeline zu importieren und zu verwenden.

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],
    )

Nächste Schritte