xref: /aosp_15_r20/external/googleapis/google/cloud/aiplatform/v1/pipeline_job.proto (revision d5c09012810ac0c9f33fe448fb6da8260d444cc9)
1// Copyright 2023 Google LLC
2//
3// Licensed under the Apache License, Version 2.0 (the "License");
4// you may not use this file except in compliance with the License.
5// You may obtain a copy of the License at
6//
7//     http://www.apache.org/licenses/LICENSE-2.0
8//
9// Unless required by applicable law or agreed to in writing, software
10// distributed under the License is distributed on an "AS IS" BASIS,
11// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12// See the License for the specific language governing permissions and
13// limitations under the License.
14
15syntax = "proto3";
16
17package google.cloud.aiplatform.v1;
18
19import "google/api/field_behavior.proto";
20import "google/api/resource.proto";
21import "google/cloud/aiplatform/v1/artifact.proto";
22import "google/cloud/aiplatform/v1/context.proto";
23import "google/cloud/aiplatform/v1/encryption_spec.proto";
24import "google/cloud/aiplatform/v1/execution.proto";
25import "google/cloud/aiplatform/v1/pipeline_failure_policy.proto";
26import "google/cloud/aiplatform/v1/pipeline_state.proto";
27import "google/cloud/aiplatform/v1/value.proto";
28import "google/protobuf/struct.proto";
29import "google/protobuf/timestamp.proto";
30import "google/rpc/status.proto";
31
32option csharp_namespace = "Google.Cloud.AIPlatform.V1";
33option go_package = "cloud.google.com/go/aiplatform/apiv1/aiplatformpb;aiplatformpb";
34option java_multiple_files = true;
35option java_outer_classname = "Pipeline";
36option java_package = "com.google.cloud.aiplatform.v1";
37option php_namespace = "Google\\Cloud\\AIPlatform\\V1";
38option ruby_package = "Google::Cloud::AIPlatform::V1";
39option (google.api.resource_definition) = {
40  type: "compute.googleapis.com/Network"
41  pattern: "projects/{project}/global/networks/{network}"
42};
43
44// An instance of a machine learning PipelineJob.
45message PipelineJob {
46  option (google.api.resource) = {
47    type: "aiplatform.googleapis.com/PipelineJob"
48    pattern: "projects/{project}/locations/{location}/pipelineJobs/{pipeline_job}"
49  };
50
51  // The runtime config of a PipelineJob.
52  message RuntimeConfig {
53    // The type of an input artifact.
54    message InputArtifact {
55      oneof kind {
56        // Artifact resource id from MLMD. Which is the last portion of an
57        // artifact resource name:
58        // `projects/{project}/locations/{location}/metadataStores/default/artifacts/{artifact_id}`.
59        // The artifact must stay within the same project, location and default
60        // metadatastore as the pipeline.
61        string artifact_id = 1;
62      }
63    }
64
65    // Deprecated. Use
66    // [RuntimeConfig.parameter_values][google.cloud.aiplatform.v1.PipelineJob.RuntimeConfig.parameter_values]
67    // instead. The runtime parameters of the PipelineJob. The parameters will
68    // be passed into
69    // [PipelineJob.pipeline_spec][google.cloud.aiplatform.v1.PipelineJob.pipeline_spec]
70    // to replace the placeholders at runtime. This field is used by pipelines
71    // built using `PipelineJob.pipeline_spec.schema_version` 2.0.0 or lower,
72    // such as pipelines built using Kubeflow Pipelines SDK 1.8 or lower.
73    map<string, Value> parameters = 1 [deprecated = true];
74
75    // Required. A path in a Cloud Storage bucket, which will be treated as the
76    // root output directory of the pipeline. It is used by the system to
77    // generate the paths of output artifacts. The artifact paths are generated
78    // with a sub-path pattern `{job_id}/{task_id}/{output_key}` under the
79    // specified output directory. The service account specified in this
80    // pipeline must have the `storage.objects.get` and `storage.objects.create`
81    // permissions for this bucket.
82    string gcs_output_directory = 2 [(google.api.field_behavior) = REQUIRED];
83
84    // The runtime parameters of the PipelineJob. The parameters will be
85    // passed into
86    // [PipelineJob.pipeline_spec][google.cloud.aiplatform.v1.PipelineJob.pipeline_spec]
87    // to replace the placeholders at runtime. This field is used by pipelines
88    // built using `PipelineJob.pipeline_spec.schema_version` 2.1.0, such as
89    // pipelines built using Kubeflow Pipelines SDK 1.9 or higher and the v2
90    // DSL.
91    map<string, google.protobuf.Value> parameter_values = 3;
92
93    // Represents the failure policy of a pipeline. Currently, the default of a
94    // pipeline is that the pipeline will continue to run until no more tasks
95    // can be executed, also known as PIPELINE_FAILURE_POLICY_FAIL_SLOW.
96    // However, if a pipeline is set to PIPELINE_FAILURE_POLICY_FAIL_FAST, it
97    // will stop scheduling any new tasks when a task has failed. Any scheduled
98    // tasks will continue to completion.
99    PipelineFailurePolicy failure_policy = 4;
100
101    // The runtime artifacts of the PipelineJob. The key will be the input
102    // artifact name and the value would be one of the InputArtifact.
103    map<string, InputArtifact> input_artifacts = 5;
104  }
105
106  // Output only. The resource name of the PipelineJob.
107  string name = 1 [(google.api.field_behavior) = OUTPUT_ONLY];
108
109  // The display name of the Pipeline.
110  // The name can be up to 128 characters long and can consist of any UTF-8
111  // characters.
112  string display_name = 2;
113
114  // Output only. Pipeline creation time.
115  google.protobuf.Timestamp create_time = 3
116      [(google.api.field_behavior) = OUTPUT_ONLY];
117
118  // Output only. Pipeline start time.
119  google.protobuf.Timestamp start_time = 4
120      [(google.api.field_behavior) = OUTPUT_ONLY];
121
122  // Output only. Pipeline end time.
123  google.protobuf.Timestamp end_time = 5
124      [(google.api.field_behavior) = OUTPUT_ONLY];
125
126  // Output only. Timestamp when this PipelineJob was most recently updated.
127  google.protobuf.Timestamp update_time = 6
128      [(google.api.field_behavior) = OUTPUT_ONLY];
129
130  // The spec of the pipeline.
131  google.protobuf.Struct pipeline_spec = 7;
132
133  // Output only. The detailed state of the job.
134  PipelineState state = 8 [(google.api.field_behavior) = OUTPUT_ONLY];
135
136  // Output only. The details of pipeline run. Not available in the list view.
137  PipelineJobDetail job_detail = 9 [(google.api.field_behavior) = OUTPUT_ONLY];
138
139  // Output only. The error that occurred during pipeline execution.
140  // Only populated when the pipeline's state is FAILED or CANCELLED.
141  google.rpc.Status error = 10 [(google.api.field_behavior) = OUTPUT_ONLY];
142
143  // The labels with user-defined metadata to organize PipelineJob.
144  //
145  // Label keys and values can be no longer than 64 characters
146  // (Unicode codepoints), can only contain lowercase letters, numeric
147  // characters, underscores and dashes. International characters are allowed.
148  //
149  // See https://goo.gl/xmQnxf for more information and examples of labels.
150  //
151  // Note there is some reserved label key for Vertex AI Pipelines.
152  // - `vertex-ai-pipelines-run-billing-id`, user set value will get overrided.
153  map<string, string> labels = 11;
154
155  // Runtime config of the pipeline.
156  RuntimeConfig runtime_config = 12;
157
158  // Customer-managed encryption key spec for a pipelineJob. If set, this
159  // PipelineJob and all of its sub-resources will be secured by this key.
160  EncryptionSpec encryption_spec = 16;
161
162  // The service account that the pipeline workload runs as.
163  // If not specified, the Compute Engine default service account in the project
164  // will be used.
165  // See
166  // https://cloud.google.com/compute/docs/access/service-accounts#default_service_account
167  //
168  // Users starting the pipeline must have the `iam.serviceAccounts.actAs`
169  // permission on this service account.
170  string service_account = 17;
171
172  // The full name of the Compute Engine
173  // [network](/compute/docs/networks-and-firewalls#networks) to which the
174  // Pipeline Job's workload should be peered. For example,
175  // `projects/12345/global/networks/myVPC`.
176  // [Format](/compute/docs/reference/rest/v1/networks/insert)
177  // is of the form `projects/{project}/global/networks/{network}`.
178  // Where {project} is a project number, as in `12345`, and {network} is a
179  // network name.
180  //
181  // Private services access must already be configured for the network.
182  // Pipeline job will apply the network configuration to the Google Cloud
183  // resources being launched, if applied, such as Vertex AI
184  // Training or Dataflow job. If left unspecified, the workload is not peered
185  // with any network.
186  string network = 18 [
187    (google.api.resource_reference) = { type: "compute.googleapis.com/Network" }
188  ];
189
190  // A list of names for the reserved ip ranges under the VPC network
191  // that can be used for this Pipeline Job's workload.
192  //
193  // If set, we will deploy the Pipeline Job's workload within the provided ip
194  // ranges. Otherwise, the job will be deployed to any ip ranges under the
195  // provided VPC network.
196  //
197  // Example: ['vertex-ai-ip-range'].
198  repeated string reserved_ip_ranges = 25;
199
200  // A template uri from where the
201  // [PipelineJob.pipeline_spec][google.cloud.aiplatform.v1.PipelineJob.pipeline_spec],
202  // if empty, will be downloaded. Currently, only uri from Vertex Template
203  // Registry & Gallery is supported. Reference to
204  // https://cloud.google.com/vertex-ai/docs/pipelines/create-pipeline-template.
205  string template_uri = 19;
206
207  // Output only. Pipeline template metadata. Will fill up fields if
208  // [PipelineJob.template_uri][google.cloud.aiplatform.v1.PipelineJob.template_uri]
209  // is from supported template registry.
210  PipelineTemplateMetadata template_metadata = 20
211      [(google.api.field_behavior) = OUTPUT_ONLY];
212
213  // Output only. The schedule resource name.
214  // Only returned if the Pipeline is created by Schedule API.
215  string schedule_name = 22 [(google.api.field_behavior) = OUTPUT_ONLY];
216}
217
218// Pipeline template metadata if
219// [PipelineJob.template_uri][google.cloud.aiplatform.v1.PipelineJob.template_uri]
220// is from supported template registry. Currently, the only supported registry
221// is Artifact Registry.
222message PipelineTemplateMetadata {
223  // The version_name in artifact registry.
224  //
225  // Will always be presented in output if the
226  // [PipelineJob.template_uri][google.cloud.aiplatform.v1.PipelineJob.template_uri]
227  // is from supported template registry.
228  //
229  // Format is "sha256:abcdef123456...".
230  string version = 3;
231}
232
233// The runtime detail of PipelineJob.
234message PipelineJobDetail {
235  // Output only. The context of the pipeline.
236  Context pipeline_context = 1 [(google.api.field_behavior) = OUTPUT_ONLY];
237
238  // Output only. The context of the current pipeline run.
239  Context pipeline_run_context = 2 [(google.api.field_behavior) = OUTPUT_ONLY];
240
241  // Output only. The runtime details of the tasks under the pipeline.
242  repeated PipelineTaskDetail task_details = 3
243      [(google.api.field_behavior) = OUTPUT_ONLY];
244}
245
246// The runtime detail of a task execution.
247message PipelineTaskDetail {
248  // A single record of the task status.
249  message PipelineTaskStatus {
250    // Output only. Update time of this status.
251    google.protobuf.Timestamp update_time = 1
252        [(google.api.field_behavior) = OUTPUT_ONLY];
253
254    // Output only. The state of the task.
255    State state = 2 [(google.api.field_behavior) = OUTPUT_ONLY];
256
257    // Output only. The error that occurred during the state. May be set when
258    // the state is any of the non-final state (PENDING/RUNNING/CANCELLING) or
259    // FAILED state. If the state is FAILED, the error here is final and not
260    // going to be retried. If the state is a non-final state, the error
261    // indicates a system-error being retried.
262    google.rpc.Status error = 3 [(google.api.field_behavior) = OUTPUT_ONLY];
263  }
264
265  // A list of artifact metadata.
266  message ArtifactList {
267    // Output only. A list of artifact metadata.
268    repeated Artifact artifacts = 1 [(google.api.field_behavior) = OUTPUT_ONLY];
269  }
270
271  // Specifies state of TaskExecution
272  enum State {
273    // Unspecified.
274    STATE_UNSPECIFIED = 0;
275
276    // Specifies pending state for the task.
277    PENDING = 1;
278
279    // Specifies task is being executed.
280    RUNNING = 2;
281
282    // Specifies task completed successfully.
283    SUCCEEDED = 3;
284
285    // Specifies Task cancel is in pending state.
286    CANCEL_PENDING = 4;
287
288    // Specifies task is being cancelled.
289    CANCELLING = 5;
290
291    // Specifies task was cancelled.
292    CANCELLED = 6;
293
294    // Specifies task failed.
295    FAILED = 7;
296
297    // Specifies task was skipped due to cache hit.
298    SKIPPED = 8;
299
300    // Specifies that the task was not triggered because the task's trigger
301    // policy is not satisfied. The trigger policy is specified in the
302    // `condition` field of
303    // [PipelineJob.pipeline_spec][google.cloud.aiplatform.v1.PipelineJob.pipeline_spec].
304    NOT_TRIGGERED = 9;
305  }
306
307  // Output only. The system generated ID of the task.
308  int64 task_id = 1 [(google.api.field_behavior) = OUTPUT_ONLY];
309
310  // Output only. The id of the parent task if the task is within a component
311  // scope. Empty if the task is at the root level.
312  int64 parent_task_id = 12 [(google.api.field_behavior) = OUTPUT_ONLY];
313
314  // Output only. The user specified name of the task that is defined in
315  // [pipeline_spec][google.cloud.aiplatform.v1.PipelineJob.pipeline_spec].
316  string task_name = 2 [(google.api.field_behavior) = OUTPUT_ONLY];
317
318  // Output only. Task create time.
319  google.protobuf.Timestamp create_time = 3
320      [(google.api.field_behavior) = OUTPUT_ONLY];
321
322  // Output only. Task start time.
323  google.protobuf.Timestamp start_time = 4
324      [(google.api.field_behavior) = OUTPUT_ONLY];
325
326  // Output only. Task end time.
327  google.protobuf.Timestamp end_time = 5
328      [(google.api.field_behavior) = OUTPUT_ONLY];
329
330  // Output only. The detailed execution info.
331  PipelineTaskExecutorDetail executor_detail = 6
332      [(google.api.field_behavior) = OUTPUT_ONLY];
333
334  // Output only. State of the task.
335  State state = 7 [(google.api.field_behavior) = OUTPUT_ONLY];
336
337  // Output only. The execution metadata of the task.
338  Execution execution = 8 [(google.api.field_behavior) = OUTPUT_ONLY];
339
340  // Output only. The error that occurred during task execution.
341  // Only populated when the task's state is FAILED or CANCELLED.
342  google.rpc.Status error = 9 [(google.api.field_behavior) = OUTPUT_ONLY];
343
344  // Output only. A list of task status. This field keeps a record of task
345  // status evolving over time.
346  repeated PipelineTaskStatus pipeline_task_status = 13
347      [(google.api.field_behavior) = OUTPUT_ONLY];
348
349  // Output only. The runtime input artifacts of the task.
350  map<string, ArtifactList> inputs = 10
351      [(google.api.field_behavior) = OUTPUT_ONLY];
352
353  // Output only. The runtime output artifacts of the task.
354  map<string, ArtifactList> outputs = 11
355      [(google.api.field_behavior) = OUTPUT_ONLY];
356}
357
358// The runtime detail of a pipeline executor.
359message PipelineTaskExecutorDetail {
360  // The detail of a container execution. It contains the job names of the
361  // lifecycle of a container execution.
362  message ContainerDetail {
363    // Output only. The name of the
364    // [CustomJob][google.cloud.aiplatform.v1.CustomJob] for the main container
365    // execution.
366    string main_job = 1 [
367      (google.api.field_behavior) = OUTPUT_ONLY,
368      (google.api.resource_reference) = {
369        type: "aiplatform.googleapis.com/CustomJob"
370      }
371    ];
372
373    // Output only. The name of the
374    // [CustomJob][google.cloud.aiplatform.v1.CustomJob] for the
375    // pre-caching-check container execution. This job will be available if the
376    // [PipelineJob.pipeline_spec][google.cloud.aiplatform.v1.PipelineJob.pipeline_spec]
377    // specifies the `pre_caching_check` hook in the lifecycle events.
378    string pre_caching_check_job = 2 [
379      (google.api.field_behavior) = OUTPUT_ONLY,
380      (google.api.resource_reference) = {
381        type: "aiplatform.googleapis.com/CustomJob"
382      }
383    ];
384
385    // Output only. The names of the previously failed
386    // [CustomJob][google.cloud.aiplatform.v1.CustomJob] for the main container
387    // executions. The list includes the all attempts in chronological order.
388    repeated string failed_main_jobs = 3
389        [(google.api.field_behavior) = OUTPUT_ONLY];
390
391    // Output only. The names of the previously failed
392    // [CustomJob][google.cloud.aiplatform.v1.CustomJob] for the
393    // pre-caching-check container executions. This job will be available if the
394    // [PipelineJob.pipeline_spec][google.cloud.aiplatform.v1.PipelineJob.pipeline_spec]
395    // specifies the `pre_caching_check` hook in the lifecycle events. The list
396    // includes the all attempts in chronological order.
397    repeated string failed_pre_caching_check_jobs = 4
398        [(google.api.field_behavior) = OUTPUT_ONLY];
399  }
400
401  // The detailed info for a custom job executor.
402  message CustomJobDetail {
403    // Output only. The name of the
404    // [CustomJob][google.cloud.aiplatform.v1.CustomJob].
405    string job = 1 [
406      (google.api.field_behavior) = OUTPUT_ONLY,
407      (google.api.resource_reference) = {
408        type: "aiplatform.googleapis.com/CustomJob"
409      }
410    ];
411
412    // Output only. The names of the previously failed
413    // [CustomJob][google.cloud.aiplatform.v1.CustomJob]. The list includes the
414    // all attempts in chronological order.
415    repeated string failed_jobs = 3 [(google.api.field_behavior) = OUTPUT_ONLY];
416  }
417
418  oneof details {
419    // Output only. The detailed info for a container executor.
420    ContainerDetail container_detail = 1
421        [(google.api.field_behavior) = OUTPUT_ONLY];
422
423    // Output only. The detailed info for a custom job executor.
424    CustomJobDetail custom_job_detail = 2
425        [(google.api.field_behavior) = OUTPUT_ONLY];
426  }
427}
428