forked from kubeflow/kfp-tekton
-
Notifications
You must be signed in to change notification settings - Fork 0
/
pipeline_spec.ts
9727 lines (9022 loc) · 329 KB
/
pipeline_spec.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
/* eslint-disable */
import Long from 'long';
import _m0 from 'protobufjs/minimal';
import { Status } from './google/rpc/status';
import { Struct, Value as Value1 } from './google/protobuf/struct';
export const protobufPackage = 'ml_pipelines';
/** The spec of a pipeline job. */
export interface PipelineJob {
/** Name of the job. */
name: string;
/** User friendly display name */
displayName: string;
/** Definition of the pipeline that is being executed. */
pipelineSpec: { [key: string]: any } | undefined;
/** The labels with user-defined metadata to organize PipelineJob. */
labels: { [key: string]: string };
/** Runtime config of the pipeline. */
runtimeConfig: PipelineJob_RuntimeConfig | undefined;
}
export interface PipelineJob_LabelsEntry {
key: string;
value: string;
}
/** The runtime config of a PipelineJob. */
export interface PipelineJob_RuntimeConfig {
/**
* Deprecated. Use [RuntimeConfig.parameter_values][] instead.
*
* @deprecated
*/
parameters: { [key: string]: Value };
/**
* A path in a Cloud Storage bucket which will be treated as the root
* output directory of the pipeline. It is used by the system to
* generate the paths of output artifacts.
* This is a GCP-specific optimization.
*/
gcsOutputDirectory: string;
/**
* The runtime parameters of the PipelineJob. The parameters will be
* passed into [PipelineJob.pipeline_spec][] to replace the placeholders
* at runtime.
*/
parameterValues: { [key: string]: any | undefined };
}
export interface PipelineJob_RuntimeConfig_ParametersEntry {
key: string;
value: Value | undefined;
}
export interface PipelineJob_RuntimeConfig_ParameterValuesEntry {
key: string;
value: any | undefined;
}
/** The spec of a pipeline. */
export interface PipelineSpec {
/** The metadata of the pipeline. */
pipelineInfo: PipelineInfo | undefined;
/**
* The deployment config of the pipeline.
* The deployment config can be extended to provide platform specific configs.
*/
deploymentSpec: { [key: string]: any } | undefined;
/** The version of the sdk, which compiles the spec. */
sdkVersion: string;
/** The version of the schema. */
schemaVersion: string;
/** The map of name to definition of all components used in this pipeline. */
components: { [key: string]: ComponentSpec };
/**
* The definition of the main pipeline. Execution of the pipeline is
* completed upon the completion of this component.
*/
root: ComponentSpec | undefined;
/** Optional field. The default root output directory of the pipeline. */
defaultPipelineRoot: string;
}
/** The definition of the runtime parameter. */
export interface PipelineSpec_RuntimeParameter {
/** Required field. The type of the runtime parameter. */
type: PrimitiveType_PrimitiveTypeEnum;
/**
* Optional field. Default value of the runtime parameter. If not set and
* the runtime parameter value is not provided during runtime, an error will
* be raised.
*/
defaultValue: Value | undefined;
}
export interface PipelineSpec_ComponentsEntry {
key: string;
value: ComponentSpec | undefined;
}
/** Definition of a component. */
export interface ComponentSpec {
/** Definition of the input parameters and artifacts of the component. */
inputDefinitions: ComponentInputsSpec | undefined;
/** Definition of the output parameters and artifacts of the component. */
outputDefinitions: ComponentOutputsSpec | undefined;
dag: DagSpec | undefined;
executorLabel: string | undefined;
}
/** A DAG contains multiple tasks. */
export interface DagSpec {
/** The tasks inside the dag. */
tasks: { [key: string]: PipelineTaskSpec };
/** Defines how the outputs of the dag are linked to the sub tasks. */
outputs: DagOutputsSpec | undefined;
}
export interface DagSpec_TasksEntry {
key: string;
value: PipelineTaskSpec | undefined;
}
/** Definition of the output artifacts and parameters of the DAG component. */
export interface DagOutputsSpec {
/** Name to the output artifact channel of the DAG. */
artifacts: { [key: string]: DagOutputsSpec_DagOutputArtifactSpec };
/** The name to the output parameter. */
parameters: { [key: string]: DagOutputsSpec_DagOutputParameterSpec };
}
/** Selects a defined output artifact from a sub task of the DAG. */
export interface DagOutputsSpec_ArtifactSelectorSpec {
/**
* The name of the sub task which produces the output that matches with
* the `output_artifact_key`.
*/
producerSubtask: string;
/** The key of [ComponentOutputsSpec.artifacts][] map of the producer task. */
outputArtifactKey: string;
}
/**
* Selects a list of output artifacts that will be aggregated to the single
* output artifact channel of the DAG.
*/
export interface DagOutputsSpec_DagOutputArtifactSpec {
/**
* The selected artifacts will be aggregated as output as a single
* output channel of the DAG.
*/
artifactSelectors: DagOutputsSpec_ArtifactSelectorSpec[];
}
export interface DagOutputsSpec_ArtifactsEntry {
key: string;
value: DagOutputsSpec_DagOutputArtifactSpec | undefined;
}
/** Selects a defined output parameter from a sub task of the DAG. */
export interface DagOutputsSpec_ParameterSelectorSpec {
/**
* The name of the sub task which produces the output that matches with
* the `output_parameter_key`.
*/
producerSubtask: string;
/** The key of [ComponentOutputsSpec.parameters][] map of the producer task. */
outputParameterKey: string;
}
/** Aggregate output parameters from sub tasks into a list object. */
export interface DagOutputsSpec_ParameterSelectorsSpec {
parameterSelectors: DagOutputsSpec_ParameterSelectorSpec[];
}
/** Aggregates output parameters from sub tasks into a map object. */
export interface DagOutputsSpec_MapParameterSelectorsSpec {
mappedParameters: { [key: string]: DagOutputsSpec_ParameterSelectorSpec };
}
export interface DagOutputsSpec_MapParameterSelectorsSpec_MappedParametersEntry {
key: string;
value: DagOutputsSpec_ParameterSelectorSpec | undefined;
}
/**
* We support four ways to fan-in output parameters from sub tasks to the DAG
* parent task.
* 1. Directly expose a single output parameter from a sub task,
* 2. (Conditional flow) Expose a list of output from multiple tasks
* (some might be skipped) but allows only one of the output being generated.
* 3. Expose a list of outputs from multiple tasks (e.g. iterator flow).
* 4. Expose the aggregation of output parameters as a name-value map.
*/
export interface DagOutputsSpec_DagOutputParameterSpec {
/**
* Returns the sub-task parameter as a DAG parameter. The selected
* parameter must have the same type as the DAG parameter type.
*/
valueFromParameter: DagOutputsSpec_ParameterSelectorSpec | undefined;
/**
* Returns one of the sub-task parameters as a DAG parameter. If there are
* multiple values are available to select, the DAG will fail. All the
* selected parameters must have the same type as the DAG parameter type.
*/
valueFromOneof: DagOutputsSpec_ParameterSelectorsSpec | undefined;
}
export interface DagOutputsSpec_ParametersEntry {
key: string;
value: DagOutputsSpec_DagOutputParameterSpec | undefined;
}
/** Definition specification of the component input parameters and artifacts. */
export interface ComponentInputsSpec {
/** Name to artifact input. */
artifacts: { [key: string]: ComponentInputsSpec_ArtifactSpec };
/** Name to parameter input. */
parameters: { [key: string]: ComponentInputsSpec_ParameterSpec };
}
/** Definition of an artifact input. */
export interface ComponentInputsSpec_ArtifactSpec {
artifactType: ArtifactTypeSchema | undefined;
}
/** Definition of a parameter input. */
export interface ComponentInputsSpec_ParameterSpec {
/**
* Specifies an input parameter's type.
* Deprecated. Use [ParameterSpec.parameter_type][] instead.
*
* @deprecated
*/
type: PrimitiveType_PrimitiveTypeEnum;
/** Specifies an input parameter's type. */
parameterType: ParameterType_ParameterTypeEnum;
/** Optional field. Default value of the input parameter. */
defaultValue: any | undefined;
}
export interface ComponentInputsSpec_ArtifactsEntry {
key: string;
value: ComponentInputsSpec_ArtifactSpec | undefined;
}
export interface ComponentInputsSpec_ParametersEntry {
key: string;
value: ComponentInputsSpec_ParameterSpec | undefined;
}
/** Definition specification of the component output parameters and artifacts. */
export interface ComponentOutputsSpec {
/** Name to artifact output. */
artifacts: { [key: string]: ComponentOutputsSpec_ArtifactSpec };
/** Name to parameter output. */
parameters: { [key: string]: ComponentOutputsSpec_ParameterSpec };
}
/** Definition of an artifact output. */
export interface ComponentOutputsSpec_ArtifactSpec {
artifactType: ArtifactTypeSchema | undefined;
/**
* Deprecated. Use [ArtifactSpec.metadata][] instead.
*
* @deprecated
*/
properties: { [key: string]: ValueOrRuntimeParameter };
/**
* Deprecated. Use [ArtifactSpec.metadata][] instead.
*
* @deprecated
*/
customProperties: { [key: string]: ValueOrRuntimeParameter };
/** Properties of the Artifact. */
metadata: { [key: string]: any } | undefined;
}
export interface ComponentOutputsSpec_ArtifactSpec_PropertiesEntry {
key: string;
value: ValueOrRuntimeParameter | undefined;
}
export interface ComponentOutputsSpec_ArtifactSpec_CustomPropertiesEntry {
key: string;
value: ValueOrRuntimeParameter | undefined;
}
/** Definition of a parameter output. */
export interface ComponentOutputsSpec_ParameterSpec {
/**
* Specifies an input parameter's type.
* Deprecated. Use [ParameterSpec.parameter_type][] instead.
*
* @deprecated
*/
type: PrimitiveType_PrimitiveTypeEnum;
/** Specifies an output parameter's type. */
parameterType: ParameterType_ParameterTypeEnum;
}
export interface ComponentOutputsSpec_ArtifactsEntry {
key: string;
value: ComponentOutputsSpec_ArtifactSpec | undefined;
}
export interface ComponentOutputsSpec_ParametersEntry {
key: string;
value: ComponentOutputsSpec_ParameterSpec | undefined;
}
/** The spec of task inputs. */
export interface TaskInputsSpec {
/**
* A map of input parameters which are small values, stored by the system and
* can be queriable.
*/
parameters: { [key: string]: TaskInputsSpec_InputParameterSpec };
/** A map of input artifacts. */
artifacts: { [key: string]: TaskInputsSpec_InputArtifactSpec };
}
/** The specification of a task input artifact. */
export interface TaskInputsSpec_InputArtifactSpec {
/**
* Pass the input artifact from another task within the same parent
* component.
*/
taskOutputArtifact: TaskInputsSpec_InputArtifactSpec_TaskOutputArtifactSpec | undefined;
/** Pass the input artifact from parent component input artifact. */
componentInputArtifact: string | undefined;
}
export interface TaskInputsSpec_InputArtifactSpec_TaskOutputArtifactSpec {
/**
* The name of the upstream task which produces the output that matches
* with the `output_artifact_key`.
*/
producerTask: string;
/** The key of [TaskOutputsSpec.artifacts][] map of the producer task. */
outputArtifactKey: string;
}
/**
* Represents an input parameter. The value can be taken from an upstream
* task's output parameter (if specifying `producer_task` and
* `output_parameter_key`, or it can be a runtime value, which can either be
* determined at compile-time, or from a pipeline parameter.
*/
export interface TaskInputsSpec_InputParameterSpec {
/** Output parameter from an upstream task. */
taskOutputParameter: TaskInputsSpec_InputParameterSpec_TaskOutputParameterSpec | undefined;
/** A constant value or runtime parameter. */
runtimeValue: ValueOrRuntimeParameter | undefined;
/** Pass the input parameter from parent component input parameter. */
componentInputParameter: string | undefined;
/** The final status of an uptream task. */
taskFinalStatus: TaskInputsSpec_InputParameterSpec_TaskFinalStatus | undefined;
/**
* Selector expression of Common Expression Language (CEL)
* that applies to the parameter found from above kind.
*
* The expression is applied to the Value type
* [Value][]. For example,
* 'size(string_value)' will return the size of the Value.string_value.
*
* After applying the selection, the parameter will be returned as a
* [Value][]. The type of the Value is either deferred from the input
* definition in the corresponding
* [ComponentSpec.input_definitions.parameters][], or if not found,
* automatically deferred as either string value or double value.
*
* In addition to the builtin functions in CEL, The value.string_value can
* be treated as a json string and parsed to the [google.protobuf.Value][]
* proto message. Then, the CEL expression provided in this field will be
* used to get the requested field. For examples,
* - if Value.string_value is a json array of "[1.1, 2.2, 3.3]",
* 'parseJson(string_value)[i]' will pass the ith parameter from the list
* to the current task, or
* - if the Value.string_value is a json map of "{"a": 1.1, "b": 2.2,
* "c": 3.3}, 'parseJson(string_value)[key]' will pass the map value from
* the struct map to the current task.
*
* If unset, the value will be passed directly to the current task.
*/
parameterExpressionSelector: string;
}
/** Represents an upstream task's output parameter. */
export interface TaskInputsSpec_InputParameterSpec_TaskOutputParameterSpec {
/**
* The name of the upstream task which produces the output parameter that
* matches with the `output_parameter_key`.
*/
producerTask: string;
/** The key of [TaskOutputsSpec.parameters][] map of the producer task. */
outputParameterKey: string;
}
/**
* Represents an upstream task's final status. The field can only be set if
* the schema version is `2.0.0`. The resolved input parameter will be a
* json payload in string type.
*/
export interface TaskInputsSpec_InputParameterSpec_TaskFinalStatus {
/** The name of the upsteram task where the final status is coming from. */
producerTask: string;
}
export interface TaskInputsSpec_ParametersEntry {
key: string;
value: TaskInputsSpec_InputParameterSpec | undefined;
}
export interface TaskInputsSpec_ArtifactsEntry {
key: string;
value: TaskInputsSpec_InputArtifactSpec | undefined;
}
/** The spec of task outputs. */
export interface TaskOutputsSpec {
/**
* A map of output parameters which are small values, stored by the system and
* can be queriable. The output key is used
* by [TaskInputsSpec.InputParameterSpec][] of the downstream task to specify
* the data dependency. The same key will also be used by
* [ExecutorInput.Inputs][] to reference the output parameter.
*/
parameters: { [key: string]: TaskOutputsSpec_OutputParameterSpec };
/**
* A map of output artifacts. Keyed by output key. The output key is used
* by [TaskInputsSpec.InputArtifactSpec][] of the downstream task to specify
* the data dependency. The same key will also be used by
* [ExecutorInput.Inputs][] to reference the output artifact.
*/
artifacts: { [key: string]: TaskOutputsSpec_OutputArtifactSpec };
}
/** The specification of a task output artifact. */
export interface TaskOutputsSpec_OutputArtifactSpec {
/** The type of the artifact. */
artifactType: ArtifactTypeSchema | undefined;
/**
* The properties of the artifact, which are determined either at
* compile-time, or at pipeline submission time through runtime parameters
*/
properties: { [key: string]: ValueOrRuntimeParameter };
/**
* The custom properties of the artifact, which are determined either at
* compile-time, or at pipeline submission time through runtime parameters
*/
customProperties: { [key: string]: ValueOrRuntimeParameter };
}
export interface TaskOutputsSpec_OutputArtifactSpec_PropertiesEntry {
key: string;
value: ValueOrRuntimeParameter | undefined;
}
export interface TaskOutputsSpec_OutputArtifactSpec_CustomPropertiesEntry {
key: string;
value: ValueOrRuntimeParameter | undefined;
}
/** Specification for output parameters produced by the task. */
export interface TaskOutputsSpec_OutputParameterSpec {
/** Required field. The type of the output parameter. */
type: PrimitiveType_PrimitiveTypeEnum;
}
export interface TaskOutputsSpec_ParametersEntry {
key: string;
value: TaskOutputsSpec_OutputParameterSpec | undefined;
}
export interface TaskOutputsSpec_ArtifactsEntry {
key: string;
value: TaskOutputsSpec_OutputArtifactSpec | undefined;
}
/**
* Represent primitive types. The wrapper is needed to give a namespace of
* enum value so we don't need add `PRIMITIVE_TYPE_` prefix of each enum value.
*
* @deprecated
*/
export interface PrimitiveType {}
/**
* The primitive types.
* Deprecated. Use [ParameterType.ParameterTypeEnum][] instead.
*
* @deprecated
*/
export enum PrimitiveType_PrimitiveTypeEnum {
PRIMITIVE_TYPE_UNSPECIFIED = 0,
INT = 1,
DOUBLE = 2,
STRING = 3,
UNRECOGNIZED = -1,
}
export function primitiveType_PrimitiveTypeEnumFromJSON(
object: any,
): PrimitiveType_PrimitiveTypeEnum {
switch (object) {
case 0:
case 'PRIMITIVE_TYPE_UNSPECIFIED':
return PrimitiveType_PrimitiveTypeEnum.PRIMITIVE_TYPE_UNSPECIFIED;
case 1:
case 'INT':
return PrimitiveType_PrimitiveTypeEnum.INT;
case 2:
case 'DOUBLE':
return PrimitiveType_PrimitiveTypeEnum.DOUBLE;
case 3:
case 'STRING':
return PrimitiveType_PrimitiveTypeEnum.STRING;
case -1:
case 'UNRECOGNIZED':
default:
return PrimitiveType_PrimitiveTypeEnum.UNRECOGNIZED;
}
}
export function primitiveType_PrimitiveTypeEnumToJSON(
object: PrimitiveType_PrimitiveTypeEnum,
): string {
switch (object) {
case PrimitiveType_PrimitiveTypeEnum.PRIMITIVE_TYPE_UNSPECIFIED:
return 'PRIMITIVE_TYPE_UNSPECIFIED';
case PrimitiveType_PrimitiveTypeEnum.INT:
return 'INT';
case PrimitiveType_PrimitiveTypeEnum.DOUBLE:
return 'DOUBLE';
case PrimitiveType_PrimitiveTypeEnum.STRING:
return 'STRING';
default:
return 'UNKNOWN';
}
}
/**
* Represent parameter types. The wrapper is needed to give a namespace of
* enum value so we don't need add `PARAMETER_TYPE_` prefix of each enum value.
*/
export interface ParameterType {}
/** The parameter types. */
export enum ParameterType_ParameterTypeEnum {
/** PARAMETER_TYPE_ENUM_UNSPECIFIED - Indicates that the parameter type was not specified. */
PARAMETER_TYPE_ENUM_UNSPECIFIED = 0,
/**
* NUMBER_DOUBLE - Indicates that a parameter is a number that is stored in a field of type
* `double`.
*/
NUMBER_DOUBLE = 1,
/**
* NUMBER_INTEGER - Indicates that a parameter is an integer stored in the `number_field`,
* which is of type `double`. NUMBER_INTEGER values must be within the range
* of JavaScript safe integers (-(2^53 - 1) to (2^53 - 1)). If you need to
* support integers outside the range of JavaScript safe integers, use the
* `STRING` parameter type to describe your parameter.
*/
NUMBER_INTEGER = 2,
/** STRING - Indicates that a parameter is a string. */
STRING = 3,
/** BOOLEAN - Indicates that a parameters is a boolean value. */
BOOLEAN = 4,
/**
* LIST - Indicates that a parameter is a list of values. LIST parameters are
* serialized to JSON when passed as an input or output of a pipeline step.
*/
LIST = 5,
/**
* STRUCT - Indicates that a parameter is a struct value; structs represent a data
* structure like a Python dictionary or a JSON object. STRUCT parameters
* are serialized to JSON when passed as an input or output of a pipeline
* step.
*/
STRUCT = 6,
UNRECOGNIZED = -1,
}
export function parameterType_ParameterTypeEnumFromJSON(
object: any,
): ParameterType_ParameterTypeEnum {
switch (object) {
case 0:
case 'PARAMETER_TYPE_ENUM_UNSPECIFIED':
return ParameterType_ParameterTypeEnum.PARAMETER_TYPE_ENUM_UNSPECIFIED;
case 1:
case 'NUMBER_DOUBLE':
return ParameterType_ParameterTypeEnum.NUMBER_DOUBLE;
case 2:
case 'NUMBER_INTEGER':
return ParameterType_ParameterTypeEnum.NUMBER_INTEGER;
case 3:
case 'STRING':
return ParameterType_ParameterTypeEnum.STRING;
case 4:
case 'BOOLEAN':
return ParameterType_ParameterTypeEnum.BOOLEAN;
case 5:
case 'LIST':
return ParameterType_ParameterTypeEnum.LIST;
case 6:
case 'STRUCT':
return ParameterType_ParameterTypeEnum.STRUCT;
case -1:
case 'UNRECOGNIZED':
default:
return ParameterType_ParameterTypeEnum.UNRECOGNIZED;
}
}
export function parameterType_ParameterTypeEnumToJSON(
object: ParameterType_ParameterTypeEnum,
): string {
switch (object) {
case ParameterType_ParameterTypeEnum.PARAMETER_TYPE_ENUM_UNSPECIFIED:
return 'PARAMETER_TYPE_ENUM_UNSPECIFIED';
case ParameterType_ParameterTypeEnum.NUMBER_DOUBLE:
return 'NUMBER_DOUBLE';
case ParameterType_ParameterTypeEnum.NUMBER_INTEGER:
return 'NUMBER_INTEGER';
case ParameterType_ParameterTypeEnum.STRING:
return 'STRING';
case ParameterType_ParameterTypeEnum.BOOLEAN:
return 'BOOLEAN';
case ParameterType_ParameterTypeEnum.LIST:
return 'LIST';
case ParameterType_ParameterTypeEnum.STRUCT:
return 'STRUCT';
default:
return 'UNKNOWN';
}
}
/** The spec of a pipeline task. */
export interface PipelineTaskSpec {
/** Basic info of a pipeline task. */
taskInfo: PipelineTaskInfo | undefined;
/** Specification for task inputs which contains parameters and artifacts. */
inputs: TaskInputsSpec | undefined;
/**
* A list of names of upstream tasks that do not provide input
* artifacts for this task, but nonetheless whose completion this task depends
* on.
*/
dependentTasks: string[];
cachingOptions: PipelineTaskSpec_CachingOptions | undefined;
/**
* Reference to a component. Use this field to define either a DAG or an
* executor.
*/
componentRef: ComponentRef | undefined;
/** Trigger policy of the task. */
triggerPolicy: PipelineTaskSpec_TriggerPolicy | undefined;
/** Iterator to iterate over an artifact input. */
artifactIterator: ArtifactIteratorSpec | undefined;
/** Iterator to iterate over a parameter input. */
parameterIterator: ParameterIteratorSpec | undefined;
}
export interface PipelineTaskSpec_CachingOptions {
/** Whether or not to enable cache for this task. Defaults to false. */
enableCache: boolean;
}
/**
* Trigger policy defines how the task gets triggered. If a task is not
* triggered, it will run into SKIPPED state.
*/
export interface PipelineTaskSpec_TriggerPolicy {
/**
* An expression which will be evaluated into a boolean value. True to
* trigger the task to run. The expression follows the language of
* [CEL Spec][https://github.com/google/cel-spec]. It can access the data
* from [ExecutorInput][] message of the task.
* For example:
* - `inputs.artifacts['model'][0].properties['accuracy']*100 > 90`
* - `inputs.parameters['type'] == 'foo' && inputs.parameters['num'] == 1`
*/
condition: string;
/**
* The trigger strategy of this task. The `strategy` and `condition` are
* in logic "AND", as a task will only be tested for the `condition` when
* the `strategy` is meet.
* Unset or set to default value of TRIGGER_STATEGY_UNDEFINED behaves the
* same as ALL_UPSTREAM_TASKS_SUCCEEDED.
*/
strategy: PipelineTaskSpec_TriggerPolicy_TriggerStrategy;
}
/**
* An enum defines the trigger strategy of when the task will be ready to be
* triggered.
* ALL_UPSTREAM_TASKS_SUCCEEDED - all upstream tasks in succeeded state.
* ALL_UPSTREAM_TASKS_COMPLETED - all upstream tasks in any final state.
* (Note that CANCELLED is also a final state but job will not trigger new
* tasks when job is in CANCELLING state, so that the task with the trigger
* policy at ALL_UPSTREAM_TASKS_COMPLETED will not start when job
* cancellation is in progress.)
*/
export enum PipelineTaskSpec_TriggerPolicy_TriggerStrategy {
/** TRIGGER_STRATEGY_UNSPECIFIED - Unspecified. Behave the same as ALL_UPSTREAM_TASKS_SUCCEEDED. */
TRIGGER_STRATEGY_UNSPECIFIED = 0,
/** ALL_UPSTREAM_TASKS_SUCCEEDED - Specifies that all upstream tasks are in succeeded state. */
ALL_UPSTREAM_TASKS_SUCCEEDED = 1,
/** ALL_UPSTREAM_TASKS_COMPLETED - Specifies that all upstream tasks are in any final state. */
ALL_UPSTREAM_TASKS_COMPLETED = 2,
UNRECOGNIZED = -1,
}
export function pipelineTaskSpec_TriggerPolicy_TriggerStrategyFromJSON(
object: any,
): PipelineTaskSpec_TriggerPolicy_TriggerStrategy {
switch (object) {
case 0:
case 'TRIGGER_STRATEGY_UNSPECIFIED':
return PipelineTaskSpec_TriggerPolicy_TriggerStrategy.TRIGGER_STRATEGY_UNSPECIFIED;
case 1:
case 'ALL_UPSTREAM_TASKS_SUCCEEDED':
return PipelineTaskSpec_TriggerPolicy_TriggerStrategy.ALL_UPSTREAM_TASKS_SUCCEEDED;
case 2:
case 'ALL_UPSTREAM_TASKS_COMPLETED':
return PipelineTaskSpec_TriggerPolicy_TriggerStrategy.ALL_UPSTREAM_TASKS_COMPLETED;
case -1:
case 'UNRECOGNIZED':
default:
return PipelineTaskSpec_TriggerPolicy_TriggerStrategy.UNRECOGNIZED;
}
}
export function pipelineTaskSpec_TriggerPolicy_TriggerStrategyToJSON(
object: PipelineTaskSpec_TriggerPolicy_TriggerStrategy,
): string {
switch (object) {
case PipelineTaskSpec_TriggerPolicy_TriggerStrategy.TRIGGER_STRATEGY_UNSPECIFIED:
return 'TRIGGER_STRATEGY_UNSPECIFIED';
case PipelineTaskSpec_TriggerPolicy_TriggerStrategy.ALL_UPSTREAM_TASKS_SUCCEEDED:
return 'ALL_UPSTREAM_TASKS_SUCCEEDED';
case PipelineTaskSpec_TriggerPolicy_TriggerStrategy.ALL_UPSTREAM_TASKS_COMPLETED:
return 'ALL_UPSTREAM_TASKS_COMPLETED';
default:
return 'UNKNOWN';
}
}
/**
* The spec of an artifact iterator. It supports fan-out a workflow from a list
* of artifacts.
*/
export interface ArtifactIteratorSpec {
/** The items to iterate. */
items: ArtifactIteratorSpec_ItemsSpec | undefined;
/**
* The name of the input artifact channel which has the artifact item from the
* [items][] collection.
*/
itemInput: string;
}
/**
* Specifies the name of the artifact channel which contains the collection of
* items to iterate. The iterator will create a sub-task for each item of
* the collection and pass the item as a new input artifact channel as
* specified by [item_input][].
*/
export interface ArtifactIteratorSpec_ItemsSpec {
/** The name of the input artifact. */
inputArtifact: string;
}
/**
* The spec of a parameter iterator. It supports fan-out a workflow from a
* string parameter which contains a JSON array.
*/
export interface ParameterIteratorSpec {
/** The items to iterate. */
items: ParameterIteratorSpec_ItemsSpec | undefined;
/**
* The name of the input parameter which has the item value from the
* [items][] collection.
*/
itemInput: string;
}
/** Specifies the spec to decribe the parameter items to iterate. */
export interface ParameterIteratorSpec_ItemsSpec {
/** The raw JSON array. */
raw: string | undefined;
/**
* The name of the input parameter whose value has the items collection.
* The parameter must be in STRING type and its content can be parsed
* as a JSON array.
*/
inputParameter: string | undefined;
}
export interface ComponentRef {
/**
* The name of a component. Refer to the key of the
* [PipelineSpec.components][] map.
*/
name: string;
}
/** Basic info of a pipeline. */
export interface PipelineInfo {
/**
* Required field. The name of the pipeline.
* The name will be used to create or find pipeline context in MLMD.
*/
name: string;
}
/** The definition of a artifact type in MLMD. */
export interface ArtifactTypeSchema {
/**
* The name of the type. The format of the title must be:
* `<namespace>.<title>`.
* Examples:
* - `aiplatform.Model`
* - `acme.CustomModel`
* When this field is set, the type must be pre-registered in the MLMD
* store.
*/
schemaTitle: string | undefined;
/**
* Points to a YAML file stored on Google Cloud Storage describing the
* format.
* Deprecated. Use [PipelineArtifactTypeSchema.schema_title][] or
* [PipelineArtifactTypeSchema.instance_schema][] instead.
*
* @deprecated
*/
schemaUri: string | undefined;
/**
* Contains a raw YAML string, describing the format of
* the properties of the type.
*/
instanceSchema: string | undefined;
/**
* The schema version of the artifact. If the value is not set, it defaults
* to the the latest version in the system.
*/
schemaVersion: string;
}
/** The basic info of a task. */
export interface PipelineTaskInfo {
/** The display name of the task. */
name: string;
}
/**
* Definition for a value or reference to a runtime parameter. A
* ValueOrRuntimeParameter instance can be either a field value that is
* determined during compilation time, or a runtime parameter which will be
* determined during runtime.
*/
export interface ValueOrRuntimeParameter {
/**
* Constant value which is determined in compile time.
* Deprecated. Use [ValueOrRuntimeParameter.constant][] instead.
*
* @deprecated
*/
constantValue: Value | undefined;
/** The runtime parameter refers to the parent component input parameter. */
runtimeParameter: string | undefined;
/** Constant value which is determined in compile time. */
constant: any | undefined;
}
/**
* The definition of the deployment config of the pipeline. It contains the
* the platform specific executor configs for KFP OSS.
*/
export interface PipelineDeploymentConfig {
/** Map from executor label to executor spec. */
executors: { [key: string]: PipelineDeploymentConfig_ExecutorSpec };
}
/**
* The specification on a container invocation.
* The string fields of the message support string based placeholder contract
* defined in [ExecutorInput](). The output of the container follows the
* contract of [ExecutorOutput]().
*/
export interface PipelineDeploymentConfig_PipelineContainerSpec {
/** The image uri of the container. */
image: string;
/**
* The main entrypoint commands of the container to run. If not provided,
* fallback to use the entry point command defined in the container image.
*/
command: string[];
/** The arguments to pass into the main entrypoint of the container. */
args: string[];
/** The lifecycle hooks of the container executor. */
lifecycle: PipelineDeploymentConfig_PipelineContainerSpec_Lifecycle | undefined;
resources: PipelineDeploymentConfig_PipelineContainerSpec_ResourceSpec | undefined;
/** Environment variables to be passed to the container. */
env: PipelineDeploymentConfig_PipelineContainerSpec_EnvVar[];
}
/**
* The lifecycle hooks of the container.
* Each hook follows the same I/O contract as the main container entrypoint.
* See [ExecutorInput]() and [ExecutorOutput]() for details.
* (-- TODO(b/165323565): add more documentation on caching and lifecycle
* hooks. --)
*/
export interface PipelineDeploymentConfig_PipelineContainerSpec_Lifecycle {
/**
* This hook is invoked before caching check. It can change the properties
* of the execution and output artifacts before they are used to compute
* the cache key. The updated metadata will be passed into the main
* container entrypoint.
*/
preCacheCheck: PipelineDeploymentConfig_PipelineContainerSpec_Lifecycle_Exec | undefined;
}
/** The command and args to execute a program. */
export interface PipelineDeploymentConfig_PipelineContainerSpec_Lifecycle_Exec {
/** The command of the exec program. */
command: string[];
/** The args of the exec program. */
args: string[];
}
/**
* The specification on the resource requirements of a container execution.
* This can include specification of vCPU, memory requirements, as well as
* accelerator types and counts.
*/
export interface PipelineDeploymentConfig_PipelineContainerSpec_ResourceSpec {
/**
* The limit of the number of vCPU cores. This container execution needs
* at most cpu_limit vCPU to run.
*/
cpuLimit: number;
/**
* The memory limit in GB. This container execution needs at most
* memory_limit RAM to run.
*/
memoryLimit: number;
accelerator:
| PipelineDeploymentConfig_PipelineContainerSpec_ResourceSpec_AcceleratorConfig
| undefined;
}
/** The specification on the accelerators being attached to this container. */
export interface PipelineDeploymentConfig_PipelineContainerSpec_ResourceSpec_AcceleratorConfig {
/** The type of accelerators. */
type: string;
/** The number of accelerators. */
count: number;
}
/**
* Environment variables to be passed to the container.
* Represents an environment variable present in a container.
*/
export interface PipelineDeploymentConfig_PipelineContainerSpec_EnvVar {
/**
* Name of the environment variable. Must be a valid C identifier. It can
* be composed of characters such as uppercase, lowercase characters,
* underscore, digits, but the leading character should be either a
* letter or an underscore.
*/
name: string;
/**
* Variables that reference a $(VAR_NAME) are expanded using the previous
* defined environment variables in the container and any environment
* variables defined by the platform runtime that executes this pipeline.
* If a variable cannot be resolved, the reference in the input string
* will be unchanged. The $(VAR_NAME) syntax can be escaped with a double
* $$, ie: $$(VAR_NAME). Escaped references will never be expanded,
* regardless of whether the variable exists or not.
*/
value: string;
}
/** The specification to import or reimport a new artifact to the pipeline. */
export interface PipelineDeploymentConfig_ImporterSpec {
/** The URI of the artifact. */
artifactUri: ValueOrRuntimeParameter | undefined;
/** The type of the artifact. */
typeSchema: ArtifactTypeSchema | undefined;
/**
* The properties of the artifact.
* Deprecated. Use [ImporterSpec.metadata][] instead.
*
* @deprecated
*/