Jika project Anda berisi proses pipeline yang gagal atau dibatalkan, Anda dapat menghapusnya. Anda dapat menghapus maksimal 32 eksekusi pipeline dalam operasi penghapusan batch.
Saat Anda memulai penghapusan proses pipeline, status proses pipeline akan berubah menjadi Sedang dihapus. Setelah operasi pipeline tetap dalam status ini selama satu jam, Vertex AI Pipelines akan mengantrekannya untuk dihapus secara permanen. Selanjutnya, operasi terjadwal harian akan menghapus secara permanen semua proses pipeline yang diantrekan untuk dihapus permanen.
Menghapus proses pipeline
Untuk menghapus proses pipeline, gunakan Google Cloud konsol, REST API, atau Vertex AI SDK untuk Python.
Konsol
Gunakan petunjuk berikut untuk menghapus proses pipeline yang sedang berlangsung dari konsol Google Cloud :
- Di bagian Vertex AI, buka tab Runs di halaman Pipelines.
- Centang kotak di samping eksekusi pipeline yang dibatalkan atau gagal yang ingin Anda hapus.
- Klik Hapus. Opsi ini hanya tersedia jika pipeline berjalan dalam status Gagal atau Dibatalkan.
Setelah Anda mengklik Hapus, status eksekusi pipeline akan berubah menjadi Sedang dihapus, sebelum dihapus secara permanen.
REST
Untuk menghapus proses pipeline yang sedang berlangsung atau terjadwal, kirim permintaan DELETE
menggunakan metode pipelineJobs.delete.
Sebelum menggunakan salah satu data permintaan, lakukan penggantian berikut:
- LOCATION: Region tempat proses pipeline berada. Untuk mengetahui informasi selengkapnya tentang region yang menyediakan Vertex AI Pipelines, lihat panduan lokasi Vertex AI.
- PROJECT_ID: Google Cloud Project yang berisi eksekusi pipeline.
- PIPELINE_RUN_ID: ID unik dari eksekusi pipeline yang ingin Anda hapus. ID proses pipeline ditampilkan di tab Proses di halaman Pipeline di konsol Google Cloud .
Metode HTTP dan URL:
DELETE https://LOCATION-aiplatform.googleapis.com/v1/projects/PROJECT_ID/locations/LOCATION/pipelineJobs/PIPELINE_RUN_ID
Untuk mengirim permintaan Anda, pilih salah satu opsi berikut:
curl
Jalankan perintah berikut:
curl -X DELETE \
-H "Authorization: Bearer $(gcloud auth print-access-token)" \
"https://LOCATION-aiplatform.googleapis.com/v1/projects/PROJECT_ID/locations/LOCATION/pipelineJobs/PIPELINE_RUN_ID"
PowerShell
Jalankan perintah berikut:
$cred = gcloud auth print-access-token
$headers = @{ "Authorization" = "Bearer $cred" }
Invoke-WebRequest `
-Method DELETE `
-Headers $headers `
-Uri "https://LOCATION-aiplatform.googleapis.com/v1/projects/PROJECT_ID/locations/LOCATION/pipelineJobs/PIPELINE_RUN_ID" | Select-Object -Expand Content
Anda akan melihat respons JSON seperti berikut:
{ "name": "projects/PROJECT_NUMBER/locations/us-central1/operations/OPERATION_ID", "metadata": { "@type": "type.googleapis.com/google.cloud.aiplatform.v1.DeleteOperationMetadata", "genericMetadata": { "createTime": "2025-07-25T16:23:47.201943Z", "updateTime": "2025-07-25T16:23:47.201943Z" } }, "done": true, "response": { "@type": "type.googleapis.com/google.protobuf.Empty" } }
Python
Gunakan contoh berikut untuk menghapus proses pipeline yang gagal atau dibatalkan dengan menggunakan metode PipelineJob.delete
:
from google.cloud import aiplatform aiplatform.init(project="PROJECT_ID", location="LOCATION") pipeline_job = aiplatform.PipelineJob.get(resource_name="PIPELINE_RUN_ID") pipeline_job.delete()
Ganti kode berikut:
- PROJECT_ID: Google Cloud Project yang berisi eksekusi pipeline.
- LOCATION: Region tempat proses pipeline berada. Untuk mengetahui informasi selengkapnya tentang region yang menyediakan Vertex AI Pipelines, lihat panduan lokasi Vertex AI.
- PIPELINE_RUN_ID dengan ID unik proses pipeline yang ingin Anda hapus. ID ditampilkan di tab Runs pada halaman Pipelines di konsol Google Cloud .
Menghapus beberapa eksekusi pipeline
Untuk menghapus beberapa proses pipeline yang gagal atau dibatalkan secara bersamaan, gunakan Google Cloud konsol, REST API, atau Vertex AI SDK untuk Python. Anda dapat menghapus batch eksekusi pipeline yang berada dalam project dan region yang sama.
Konsol
Gunakan petunjuk berikut untuk menghapus beberapa operasi pipeline yang sedang berlangsung dari Google Cloud konsol:
- Di bagian Vertex AI, buka tab Runs di halaman Pipelines.
- Centang kotak di samping eksekusi pipeline yang dibatalkan atau gagal yang ingin Anda hapus.
- Klik Hapus. Opsi ini hanya tersedia jika semua proses alur yang dipilih berstatus Gagal atau Dibatalkan.
Setelah Anda mengklik Hapus, status operasi pipeline yang dipilih akan berubah menjadi Sedang dihapus, sebelum operasi dihapus secara permanen.
REST
Untuk menghapus beberapa proses pipeline yang sedang berlangsung atau terjadwal secara batch, kirim permintaan POST
menggunakan metode pipelineJobs.batchDelete.
Sebelum menggunakan salah satu data permintaan, lakukan penggantian berikut:
- LOCATION: Region tempat proses pipeline berada. Untuk mengetahui informasi selengkapnya tentang region yang menyediakan Vertex AI Pipelines, lihat panduan lokasi Vertex AI.
- PROJECT_ID: Google Cloud Project yang berisi eksekusi pipeline.
- PIPELINE_RUN_ID_1, PIPELINE_RUN_ID_2: ID tugas pipeline yang ingin Anda hapus. Anda dapat menemukan ID tugas di tab Runs di halaman Pipelines di konsol Google Cloud .
Metode HTTP dan URL:
POST https://LOCATION-aiplatform.googleapis.com/v1/projects/PROJECT_ID/locations/LOCATION/pipelineJobs:batchDelete
Isi JSON permintaan:
{ "names": [ "projects/PROJECT_ID/locations/LOCATION/pipelineJobs/PIPELINE_RUN_ID_1", "projects/PROJECT_ID/locations/LOCATION/pipelineJobs/PIPELINE_RUN_ID_2" ] }
Untuk mengirim permintaan Anda, pilih salah satu opsi berikut:
curl
Simpan isi permintaan dalam file bernama request.json
,
dan jalankan perintah berikut:
curl -X POST \
-H "Authorization: Bearer $(gcloud auth print-access-token)" \
-H "Content-Type: application/json; charset=utf-8" \
-d @request.json \
"https://LOCATION-aiplatform.googleapis.com/v1/projects/PROJECT_ID/locations/LOCATION/pipelineJobs:batchDelete"
PowerShell
Simpan isi permintaan dalam file bernama request.json
,
dan jalankan perintah berikut:
$cred = gcloud auth print-access-token
$headers = @{ "Authorization" = "Bearer $cred" }
Invoke-WebRequest `
-Method POST `
-Headers $headers `
-ContentType: "application/json; charset=utf-8" `
-InFile request.json `
-Uri "https://LOCATION-aiplatform.googleapis.com/v1/projects/PROJECT_ID/locations/LOCATION/pipelineJobs:batchDelete" | Select-Object -Expand Content
Anda akan melihat respons JSON seperti berikut:
{ "name": "projects/PROJECT_NUMBER/locations/LOCATION/operations/OPERATION_ID", "metadata": { "@type": "type.googleapis.com/google.cloud.aiplatform.v1.DeleteOperationMetadata", "genericMetadata": { "createTime": "2025-05-31T16:07:12.233655Z", "updateTime": "2025-05-31T16:07:12.233655Z" } }, "done": true, "response": { "@type": "type.googleapis.com/google.cloud.aiplatform.v1.BatchDeletePipelineJobsResponse", "pipelineJobs": [ { "name": "projects/PROJECT_ID/locations/LOCATION/pipelineJobs/PIPELINE_RUN_ID_1" }, { "name": "projects/PROJECT_ID/locations/LOCATION/pipelineJobs/PIPELINE_RUN_ID_2" } ] } }
Python
Gunakan contoh berikut untuk menghapus beberapa proses pipeline yang sedang berlangsung atau terjadwal
dengan menggunakan metode PipelineJob.batch_delete
:
from google.cloud import aiplatform_v1 from google.api_core.client_options import ClientOptions pipeline_run_ids_to_delete = ["PIPELINE_RUN_ID_1", "PIPELINE_RUN_ID_2", ] client_options = ClientOptions(api_endpoint=f"LOCATION-aiplatform.googleapis.com")
pipeline_job_client = aiplatform_v1.PipelineServiceClient(client_options=client_options) pipeline_resource_names_to_delete = [] for run_id in pipeline_run_ids_to_delete: full_resource_name = f"projects/PROJECT_NUMBER/locations/LOCATION/pipelineJobs/{run_id}" pipeline_resource_names_to_delete.append(full_resource_name) parent = f"projects/PROJECT_ID/locations/LOCATION"
pipeline_job_client.batch_delete_pipeline_jobs( parent=parent, names=pipeline_resource_names_to_delete )
Ganti kode berikut:
- PROJECT_ID: Project ID Anda.
- PROJECT_ID: Google Cloud Project yang berisi eksekusi pipeline.
- PROJECT_NUMBER: Nomor project untuk project Anda. Anda dapat menemukan nomor project ini di konsol Google Cloud . Untuk mengetahui informasi selengkapnya, lihat Menemukan nama, nomor, dan ID project.
- PIPELINE_RUN_ID_1, PIPELINE_RUN_ID_2: ID tugas pipeline yang ingin Anda hapus. ID proses pipeline ditampilkan di tab Runs di halaman Pipelines di konsol Google Cloud .