@flyteorg/flyteidl 0.23.1 → 0.24.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1216,6 +1216,7 @@ Specifies either a simple value or a reference to another output.
1216
1216
  "collection", ":ref:`ref_flyteidl.core.BindingDataCollection`", "", "A collection of binding data. This allows nesting of binding data to any number of levels."
1217
1217
  "promise", ":ref:`ref_flyteidl.core.OutputReference`", "", "References an output promised by another node."
1218
1218
  "map", ":ref:`ref_flyteidl.core.BindingDataMap`", "", "A map of bindings. The key is always a string."
1219
+ "union", ":ref:`ref_flyteidl.core.UnionInfo`", "", ""
1219
1220
 
1220
1221
 
1221
1222
 
@@ -1509,6 +1510,7 @@ Scalar
1509
1510
  "error", ":ref:`ref_flyteidl.core.Error`", "", ""
1510
1511
  "generic", ":ref:`ref_google.protobuf.Struct`", "", ""
1511
1512
  "structured_dataset", ":ref:`ref_flyteidl.core.StructuredDataset`", "", ""
1513
+ "union", ":ref:`ref_flyteidl.core.Union`", "", ""
1512
1514
 
1513
1515
 
1514
1516
 
@@ -1581,6 +1583,49 @@ StructuredDatasetMetadata
1581
1583
 
1582
1584
 
1583
1585
 
1586
+ .. _ref_flyteidl.core.Union:
1587
+
1588
+ Union
1589
+ ------------------------------------------------------------------
1590
+
1591
+ The runtime representation of a tagged union value. See `UnionType` for more details.
1592
+
1593
+
1594
+
1595
+ .. csv-table:: Union type fields
1596
+ :header: "Field", "Type", "Label", "Description"
1597
+ :widths: auto
1598
+
1599
+ "value", ":ref:`ref_flyteidl.core.Literal`", "", ""
1600
+ "type", ":ref:`ref_flyteidl.core.LiteralType`", "", ""
1601
+
1602
+
1603
+
1604
+
1605
+
1606
+
1607
+
1608
+ .. _ref_flyteidl.core.UnionInfo:
1609
+
1610
+ UnionInfo
1611
+ ------------------------------------------------------------------
1612
+
1613
+
1614
+
1615
+
1616
+
1617
+ .. csv-table:: UnionInfo type fields
1618
+ :header: "Field", "Type", "Label", "Description"
1619
+ :widths: auto
1620
+
1621
+ "targetType", ":ref:`ref_flyteidl.core.LiteralType`", "", ""
1622
+
1623
+
1624
+
1625
+
1626
+
1627
+
1628
+
1584
1629
  .. _ref_flyteidl.core.Void:
1585
1630
 
1586
1631
  Void
@@ -2383,8 +2428,10 @@ Defines a strong type to allow type checking between interfaces.
2383
2428
  "blob", ":ref:`ref_flyteidl.core.BlobType`", "", "A blob might have specialized implementation details depending on associated metadata."
2384
2429
  "enum_type", ":ref:`ref_flyteidl.core.EnumType`", "", "Defines an enum with pre-defined string values."
2385
2430
  "structured_dataset_type", ":ref:`ref_flyteidl.core.StructuredDatasetType`", "", "Generalized schema support"
2431
+ "union_type", ":ref:`ref_flyteidl.core.UnionType`", "", "Defines an union type with pre-defined LiteralTypes."
2386
2432
  "metadata", ":ref:`ref_google.protobuf.Struct`", "", "This field contains type metadata that is descriptive of the type, but is NOT considered in type-checking. This might be used by consumers to identify special behavior or display extended information for the type."
2387
2433
  "annotation", ":ref:`ref_flyteidl.core.TypeAnnotation`", "", "This field contains arbitrary data that might have special semantic meaning for the client but does not effect internal flyte behavior."
2434
+ "structure", ":ref:`ref_flyteidl.core.TypeStructure`", "", "Hints to improve type matching."
2388
2435
 
2389
2436
 
2390
2437
 
@@ -2523,6 +2570,62 @@ TypeAnnotation encapsulates registration time information about a type. This can
2523
2570
 
2524
2571
 
2525
2572
 
2573
+
2574
+
2575
+ .. _ref_flyteidl.core.TypeStructure:
2576
+
2577
+ TypeStructure
2578
+ ------------------------------------------------------------------
2579
+
2580
+ Hints to improve type matching
2581
+ e.g. allows distinguishing output from custom type transformers
2582
+ even if the underlying IDL serialization matches.
2583
+
2584
+
2585
+
2586
+ .. csv-table:: TypeStructure type fields
2587
+ :header: "Field", "Type", "Label", "Description"
2588
+ :widths: auto
2589
+
2590
+ "tag", ":ref:`ref_string`", "", "Must exactly match for types to be castable"
2591
+
2592
+
2593
+
2594
+
2595
+
2596
+
2597
+
2598
+ .. _ref_flyteidl.core.UnionType:
2599
+
2600
+ UnionType
2601
+ ------------------------------------------------------------------
2602
+
2603
+ Defines a tagged union type, also known as a variant (and formally as the sum type).
2604
+
2605
+ A sum type S is defined by a sequence of types (A, B, C, ...), each tagged by a string tag
2606
+ A value of type S is constructed from a value of any of the variant types. The specific choice of type is recorded by
2607
+ storing the varaint's tag with the literal value and can be examined in runtime.
2608
+
2609
+ Type S is typically written as
2610
+ S := Apple A | Banana B | Cantaloupe C | ...
2611
+
2612
+ Notably, a nullable (optional) type is a sum type between some type X and the singleton type representing a null-value:
2613
+ Optional X := X | Null
2614
+
2615
+ See also: https://en.wikipedia.org/wiki/Tagged_union
2616
+
2617
+
2618
+
2619
+ .. csv-table:: UnionType type fields
2620
+ :header: "Field", "Type", "Label", "Description"
2621
+ :widths: auto
2622
+
2623
+ "variants", ":ref:`ref_flyteidl.core.LiteralType`", "repeated", "Predefined set of variants in union."
2624
+
2625
+
2626
+
2627
+
2628
+
2526
2629
 
2527
2630
 
2528
2631
 
@@ -2594,46 +2697,6 @@ Define a set of simple types.
2594
2697
 
2595
2698
 
2596
2699
 
2597
- .. _ref_flyteidl/core/workflow_closure.proto:
2598
-
2599
- flyteidl/core/workflow_closure.proto
2600
- ==================================================================
2601
-
2602
-
2603
-
2604
-
2605
-
2606
- .. _ref_flyteidl.core.WorkflowClosure:
2607
-
2608
- WorkflowClosure
2609
- ------------------------------------------------------------------
2610
-
2611
- Defines an enclosed package of workflow and tasks it references.
2612
-
2613
-
2614
-
2615
- .. csv-table:: WorkflowClosure type fields
2616
- :header: "Field", "Type", "Label", "Description"
2617
- :widths: auto
2618
-
2619
- "workflow", ":ref:`ref_flyteidl.core.WorkflowTemplate`", "", "required. Workflow template."
2620
- "tasks", ":ref:`ref_flyteidl.core.TaskTemplate`", "repeated", "optional. A collection of tasks referenced by the workflow. Only needed if the workflow references tasks."
2621
-
2622
-
2623
-
2624
-
2625
-
2626
-
2627
-
2628
-
2629
-
2630
-
2631
-
2632
-
2633
-
2634
-
2635
-
2636
-
2637
2700
  .. _ref_flyteidl/core/workflow.proto:
2638
2701
 
2639
2702
  flyteidl/core/workflow.proto
@@ -2954,6 +3017,46 @@ Failure Handling Strategy
2954
3017
 
2955
3018
 
2956
3019
 
3020
+ .. _ref_flyteidl/core/workflow_closure.proto:
3021
+
3022
+ flyteidl/core/workflow_closure.proto
3023
+ ==================================================================
3024
+
3025
+
3026
+
3027
+
3028
+
3029
+ .. _ref_flyteidl.core.WorkflowClosure:
3030
+
3031
+ WorkflowClosure
3032
+ ------------------------------------------------------------------
3033
+
3034
+ Defines an enclosed package of workflow and tasks it references.
3035
+
3036
+
3037
+
3038
+ .. csv-table:: WorkflowClosure type fields
3039
+ :header: "Field", "Type", "Label", "Description"
3040
+ :widths: auto
3041
+
3042
+ "workflow", ":ref:`ref_flyteidl.core.WorkflowTemplate`", "", "required. Workflow template."
3043
+ "tasks", ":ref:`ref_flyteidl.core.TaskTemplate`", "repeated", "optional. A collection of tasks referenced by the workflow. Only needed if the workflow references tasks."
3044
+
3045
+
3046
+
3047
+
3048
+
3049
+
3050
+
3051
+
3052
+
3053
+
3054
+
3055
+
3056
+
3057
+
3058
+
3059
+
2957
3060
  .. _ref_google/protobuf/timestamp.proto:
2958
3061
 
2959
3062
  google/protobuf/timestamp.proto
@@ -0,0 +1,41 @@
1
+ syntax = "proto3";
2
+
3
+ package flyteidl.admin;
4
+ option go_package = "github.com/flyteorg/flyteidl/gen/pb-go/flyteidl/admin";
5
+
6
+
7
+ // Encapsulates specifications for routing an execution onto a specific cluster.
8
+ message ClusterAssignment {
9
+ Affinity affinity = 1;
10
+ }
11
+
12
+ // Defines a set of constraints used to select eligible objects based on labels they possess.
13
+ message Affinity {
14
+ // Multiples selectors are 'and'-ed together to produce the list of matching, eligible objects.
15
+ repeated Selector selectors = 1;
16
+ }
17
+
18
+ // A Selector is a specification for identifying a set of objects with corresponding labels.
19
+ message Selector {
20
+
21
+ // The label key.
22
+ string key = 1;
23
+
24
+ // One or more values used to match labels.
25
+ // For equality (or inequality) requirements, values must contain a single element.
26
+ // For set-based requirements, values may contain one or more elements.
27
+ repeated string value = 2;
28
+
29
+ // Defines how a label with a corresponding key and value is selected or excluded.
30
+ enum Operator {
31
+ EQUALS = 0;
32
+ NOT_EQUALS = 1;
33
+ IN = 2;
34
+ NOT_IN = 3;
35
+ EXISTS = 4; // A label key with any value
36
+
37
+ // K8s supports more operators, we can consider adding them if necessary
38
+ }
39
+ Operator operator = 3;
40
+ }
41
+
@@ -3,6 +3,7 @@ syntax = "proto3";
3
3
  package flyteidl.admin;
4
4
  option go_package = "github.com/flyteorg/flyteidl/gen/pb-go/flyteidl/admin";
5
5
 
6
+ import "flyteidl/admin/cluster_assignment.proto";
6
7
  import "flyteidl/admin/common.proto";
7
8
  import "flyteidl/core/literals.proto";
8
9
  import "flyteidl/core/execution.proto";
@@ -285,6 +286,9 @@ message ExecutionSpec {
285
286
  // User setting to configure where to store offloaded data (i.e. Blobs, structured datasets, query data, etc.).
286
287
  // This should be a prefix like s3://my-bucket/my-data
287
288
  RawOutputDataConfig raw_output_data_config = 19;
289
+
290
+ // Controls how to select an available cluster on which this execution should run.
291
+ ClusterAssignment cluster_assignment = 20;
288
292
  }
289
293
 
290
294
  // Request to terminate an in-progress execution. This action is irreversible.
@@ -356,4 +360,4 @@ message ExecutionStateChangeDetails {
356
360
  string principal = 3;
357
361
  }
358
362
 
359
- message ExecutionUpdateResponse {}
363
+ message ExecutionUpdateResponse {}
@@ -3,6 +3,7 @@ syntax = "proto3";
3
3
  package flyteidl.admin;
4
4
  option go_package = "github.com/flyteorg/flyteidl/gen/pb-go/flyteidl/admin";
5
5
 
6
+ import "flyteidl/admin/cluster_assignment.proto";
6
7
  import "flyteidl/core/execution.proto";
7
8
 
8
9
  // Defines a resource that can be configured by customizable Project-, ProjectDomain- or WorkflowAttributes
@@ -28,6 +29,9 @@ enum MatchableResource {
28
29
 
29
30
  // Adds defaults for customizable workflow-execution specifications and overrides.
30
31
  WORKFLOW_EXECUTION_CONFIG = 6;
32
+
33
+ // Controls how to select an available cluster on which this execution should run.
34
+ CLUSTER_ASSIGNMENT = 7;
31
35
  }
32
36
 
33
37
  // Defines a set of overridable task resource attributes set during task registration.
@@ -116,6 +120,8 @@ message MatchingAttributes {
116
120
  PluginOverrides plugin_overrides = 6;
117
121
 
118
122
  WorkflowExecutionConfig workflow_execution_config = 7;
123
+
124
+ ClusterAssignment cluster_assignment = 8;
119
125
  }
120
126
  }
121
127
 
@@ -52,6 +52,12 @@ message Schema {
52
52
  SchemaType type = 3;
53
53
  }
54
54
 
55
+ // The runtime representation of a tagged union value. See `UnionType` for more details.
56
+ message Union {
57
+ Literal value = 1;
58
+ LiteralType type = 2;
59
+ }
60
+
55
61
  message StructuredDatasetMetadata {
56
62
  // Bundle the type information along with the literal.
57
63
  // This is here because StructuredDatasets can often be more defined at run time than at compile time.
@@ -81,6 +87,7 @@ message Scalar {
81
87
  Error error = 6;
82
88
  google.protobuf.Struct generic = 7;
83
89
  StructuredDataset structured_dataset = 8;
90
+ Union union = 9;
84
91
  }
85
92
  }
86
93
 
@@ -123,6 +130,10 @@ message BindingDataMap {
123
130
  map<string, BindingData> bindings = 1;
124
131
  }
125
132
 
133
+ message UnionInfo {
134
+ LiteralType targetType = 1;
135
+ }
136
+
126
137
  // Specifies either a simple value or a reference to another output.
127
138
  message BindingData {
128
139
  oneof value {
@@ -139,6 +150,8 @@ message BindingData {
139
150
  // A map of bindings. The key is always a string.
140
151
  BindingDataMap map = 4;
141
152
  }
153
+
154
+ UnionInfo union = 5;
142
155
  }
143
156
 
144
157
  // An input/output binding of a variable to either static value or a node output.
@@ -90,6 +90,32 @@ message EnumType {
90
90
  repeated string values = 1;
91
91
  }
92
92
 
93
+ // Defines a tagged union type, also known as a variant (and formally as the sum type).
94
+ //
95
+ // A sum type S is defined by a sequence of types (A, B, C, ...), each tagged by a string tag
96
+ // A value of type S is constructed from a value of any of the variant types. The specific choice of type is recorded by
97
+ // storing the varaint's tag with the literal value and can be examined in runtime.
98
+ //
99
+ // Type S is typically written as
100
+ // S := Apple A | Banana B | Cantaloupe C | ...
101
+ //
102
+ // Notably, a nullable (optional) type is a sum type between some type X and the singleton type representing a null-value:
103
+ // Optional X := X | Null
104
+ //
105
+ // See also: https://en.wikipedia.org/wiki/Tagged_union
106
+ message UnionType {
107
+ // Predefined set of variants in union.
108
+ repeated LiteralType variants = 1;
109
+ }
110
+
111
+ // Hints to improve type matching
112
+ // e.g. allows distinguishing output from custom type transformers
113
+ // even if the underlying IDL serialization matches.
114
+ message TypeStructure {
115
+ // Must exactly match for types to be castable
116
+ string tag = 1;
117
+ }
118
+
93
119
  // TypeAnnotation encapsulates registration time information about a type. This can be used for various control-plane operations. TypeAnnotation will not be available at runtime when a task runs.
94
120
  message TypeAnnotation {
95
121
  // A arbitrary JSON payload to describe a type.
@@ -119,6 +145,9 @@ message LiteralType {
119
145
 
120
146
  // Generalized schema support
121
147
  StructuredDatasetType structured_dataset_type = 8;
148
+
149
+ // Defines an union type with pre-defined LiteralTypes.
150
+ UnionType union_type = 10;
122
151
  }
123
152
 
124
153
  // This field contains type metadata that is descriptive of the type, but is NOT considered in type-checking. This might be used by
@@ -128,6 +157,9 @@ message LiteralType {
128
157
  // This field contains arbitrary data that might have special semantic
129
158
  // meaning for the client but does not effect internal flyte behavior.
130
159
  TypeAnnotation annotation = 9;
160
+
161
+ // Hints to improve type matching.
162
+ TypeStructure structure = 11;
131
163
  }
132
164
 
133
165
  // A reference to an output produced by a node. The type can be retrieved -and validated- from