Tetap teratur dengan koleksi
Simpan dan kategorikan konten berdasarkan preferensi Anda.
Anda dapat menggunakan parameter failure_policy dari class aiplatform.PipelineJob untuk mengonfigurasi apakah pipeline akan langsung digagalkan jika salah satu tugas gagal.
Konfigurasi kebijakan kegagalan berikut ini didukung di Vertex AI Pipelines:
Fail fast (failure_policy = 'fast'): Pilih konfigurasi ini jika Anda ingin agar pipeline berhenti menjadwalkan tugas baru setelah tugas gagal. Tugas yang telah dijadwalkan akan terus berjalan hingga selesai.
Fail slow (failure_policy = 'slow'): Pilih konfigurasi ini jika Anda ingin agar pipeline terus berjalan meskipun tugas gagal. Pipeline terus berjalan sampai semua tugas selesai dijalankan.
Gunakan contoh kode berikut ini guna mengonfigurasi kebijakan kegagalan untuk pipeline menggunakan Vertex AI SDK untuk Python:
DISPLAY_NAME: Nama pipeline, ini akan muncul di konsol Google Cloud .
COMPILED_PIPELINE_PATH: Jalur ke file YAML pipeline yang telah dikompilasi. Ini dapat berupa jalur lokal atau Google Cloud URI Storage.
PIPELINE_ROOT: Tentukan Cloud Storage URI yang dapat diakses oleh akun layanan pipeline Anda. Artefak operasi pipeline Anda disimpan dalam root pipeline.
PROJECT_ID: Project Google Cloud tempat pipeline ini berjalan.
LOCATION: Region tempat pipeline dijalankan. Untuk informasi selengkapnya tentang region tempat Vertex AI Pipelines tersedia, lihat panduan lokasi Vertex AI. Jika Anda tidak menetapkan parameter ini, lokasi default yang ditetapkan di dalam aiplatform.init yang akan digunakan.
FAILURE_POLICY: Menentukan kebijakan kegagalan untuk seluruh pipeline. Konfigurasi berikut ini tersedia:
Untuk mengonfigurasi pipeline agar gagal setelah satu tugas gagal, masukkan fast.
Untuk mengonfigurasi pipeline agar dapat terus menjadwalkan tugas setelah satu tugas gagal, masukkan slow.
Jika Anda tidak menetapkan parameter ini, konfigurasi kebijakan kegagalan akan ditetapkan ke slow secara default.
[[["Mudah dipahami","easyToUnderstand","thumb-up"],["Memecahkan masalah saya","solvedMyProblem","thumb-up"],["Lainnya","otherUp","thumb-up"]],[["Sulit dipahami","hardToUnderstand","thumb-down"],["Informasi atau kode contoh salah","incorrectInformationOrSampleCode","thumb-down"],["Informasi/contoh yang saya butuhkan tidak ada","missingTheInformationSamplesINeed","thumb-down"],["Masalah terjemahan","translationIssue","thumb-down"],["Lainnya","otherDown","thumb-down"]],["Terakhir diperbarui pada 2025-09-02 UTC."],[],[],null,["# Configure failure policy\n\nYou can use the `failure_policy` parameter of the [`aiplatform.PipelineJob`](/python/docs/reference/aiplatform/latest/google.cloud.aiplatform.PipelineJob) class to configure whether a pipeline should fail immediately if one of the task fails.\n\nThe following failure policy configurations are supported in Vertex AI Pipelines:\n\n- **Fail fast** (`failure_policy = 'fast'`): Choose this configuration if you want the pipeline to stop scheduling new tasks after a task fails. Tasks that are already scheduled continue running until they are completed.\n\n- **Fail slow** (`failure_policy = 'slow'`): Choose this configuration if you want the pipeline to continue to run even after a task fails. The pipeline continues to run until all tasks have been executed.\n\n | **Note:** If you don't specify the `failure_policy` parameter for a pipeline, the failure policy configuration is set to `slow`, by default.\n\nUse the following code sample to configure the failure policy for a pipeline using the Vertex AI SDK for Python: \n\n\n job = aiplatform.PipelineJob(display_name = '\u003cvar translate=\"no\"\u003eDISPLAY_NAME\u003c/var\u003e',\n template_path = '\u003cvar translate=\"no\"\u003eCOMPILED_PIPELINE_PATH\u003c/var\u003e',\n pipeline_root = '\u003cvar translate=\"no\"\u003ePIPELINE_ROOT\u003c/var\u003e',\n project = '\u003cvar translate=\"no\"\u003ePROJECT_ID\u003c/var\u003e',\n location = '\u003cvar translate=\"no\"\u003eLOCATION\u003c/var\u003e',\n failure_policy = '\u003cvar translate=\"no\"\u003eFAILURE_POLICY\u003c/var\u003e')\n\nReplace the following:\n\n- \u003cvar translate=\"no\"\u003eDISPLAY_NAME\u003c/var\u003e: The name of the pipeline, this will show up in the Google Cloud console.\n\n- \u003cvar translate=\"no\"\u003eCOMPILED_PIPELINE_PATH\u003c/var\u003e: The path to your compiled pipeline YAML file. It can be a local path or a Google Cloud Storage URI.\n\n- \u003cvar translate=\"no\"\u003ePIPELINE_ROOT\u003c/var\u003e: Specify a Cloud Storage URI that your pipelines service account can access. The artifacts of your pipeline runs are stored within the pipeline root.\n\n- \u003cvar translate=\"no\"\u003ePROJECT_ID\u003c/var\u003e: The Google Cloud project that this pipeline runs in.\n\n- \u003cvar translate=\"no\"\u003eLOCATION\u003c/var\u003e: The region that the pipeline runs in. For more information about the regions that Vertex AI Pipelines is available in, see the [Vertex AI locations guide](/vertex-ai/docs/general/locations#feature-availability). If you don't set this parameter, the default location set in `aiplatform.init` is used.\n\n- \u003cvar translate=\"no\"\u003eFAILURE_POLICY\u003c/var\u003e: Specify the failure policy for the entire pipeline. The following configurations are available:\n\n - To configure the pipeline to fail after one task fails, enter `fast`.\n\n - To configure the pipeline to continue scheduling tasks after one task fails, enter `slow`.\n\n If you don't set this parameter, the failure policy configuration is set to `slow`, by default.\n\nWhat's next\n-----------\n\n- Learn how to [configure retries for failed pipeline tasks](/vertex-ai/docs/pipelines/configure-retries)."]]