-
Notifications
You must be signed in to change notification settings - Fork 550
/
literals.proto
183 lines (149 loc) · 5.64 KB
/
literals.proto
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
syntax = "proto3";
package flyteidl.core;
option go_package = "github.com/flyteorg/flyte/flyteidl/gen/pb-go/flyteidl/core";
import "google/protobuf/timestamp.proto";
import "google/protobuf/duration.proto";
import "google/protobuf/struct.proto";
import "flyteidl/core/types.proto";
// Primitive Types
message Primitive {
// Defines one of simple primitive types. These types will get translated into different programming languages as
// described in https://developers.google.com/protocol-buffers/docs/proto#scalar.
oneof value {
int64 integer = 1;
double float_value = 2;
string string_value = 3;
bool boolean = 4;
google.protobuf.Timestamp datetime = 5;
google.protobuf.Duration duration = 6;
}
}
// Used to denote a nil/null/None assignment to a scalar value. The underlying LiteralType for Void is intentionally
// undefined since it can be assigned to a scalar of any LiteralType.
message Void {
}
// Refers to an offloaded set of files. It encapsulates the type of the store and a unique uri for where the data is.
// There are no restrictions on how the uri is formatted since it will depend on how to interact with the store.
message Blob {
BlobMetadata metadata = 1;
string uri = 3;
}
message BlobMetadata {
BlobType type = 1;
}
// A simple byte array with a tag to help different parts of the system communicate about what is in the byte array.
// It's strongly advisable that consumers of this type define a unique tag and validate the tag before parsing the data.
message Binary {
bytes value = 1;
string tag = 2;
}
// A strongly typed schema that defines the interface of data retrieved from the underlying storage medium.
message Schema {
string uri = 1;
SchemaType type = 3;
}
// The runtime representation of a tagged union value. See `UnionType` for more details.
message Union {
Literal value = 1;
LiteralType type = 2;
}
message StructuredDatasetMetadata {
// Bundle the type information along with the literal.
// This is here because StructuredDatasets can often be more defined at run time than at compile time.
// That is, at compile time you might only declare a task to return a pandas dataframe or a StructuredDataset,
// without any column information, but at run time, you might have that column information.
// flytekit python will copy this type information into the literal, from the type information, if not provided by
// the various plugins (encoders).
// Since this field is run time generated, it's not used for any type checking.
StructuredDatasetType structured_dataset_type = 1;
}
message StructuredDataset {
// String location uniquely identifying where the data is.
// Should start with the storage location (e.g. s3://, gs://, bq://, etc.)
string uri = 1;
StructuredDatasetMetadata metadata = 2;
}
message Scalar {
oneof value {
Primitive primitive = 1;
Blob blob = 2;
Binary binary = 3;
Schema schema = 4;
Void none_type = 5;
Error error = 6;
google.protobuf.Struct generic = 7;
StructuredDataset structured_dataset = 8;
Union union = 9;
}
}
// A simple value. This supports any level of nesting (e.g. array of array of array of Blobs) as well as simple primitives.
message Literal {
oneof value {
// A simple value.
Scalar scalar = 1;
// A collection of literals to allow nesting.
LiteralCollection collection = 2;
// A map of strings to literals.
LiteralMap map = 3;
}
// A hash representing this literal.
// This is used for caching purposes. For more details refer to RFC 1893
// (https://github.com/flyteorg/flyte/blob/master/rfc/system/1893-caching-of-offloaded-objects.md)
string hash = 4;
// Additional metadata for literals.
map<string, string> metadata = 5;
}
// A collection of literals. This is a workaround since oneofs in proto messages cannot contain a repeated field.
message LiteralCollection {
repeated Literal literals = 1;
}
// A map of literals. This is a workaround since oneofs in proto messages cannot contain a repeated field.
message LiteralMap {
map<string, Literal> literals = 1;
}
// A collection of BindingData items.
message BindingDataCollection {
repeated BindingData bindings = 1;
}
// A map of BindingData items.
message BindingDataMap {
map<string, BindingData> bindings = 1;
}
message UnionInfo {
LiteralType targetType = 1;
}
// Specifies either a simple value or a reference to another output.
message BindingData {
oneof value {
// A simple scalar value.
Scalar scalar = 1;
// A collection of binding data. This allows nesting of binding data to any number
// of levels.
BindingDataCollection collection = 2;
// References an output promised by another node.
OutputReference promise = 3;
// A map of bindings. The key is always a string.
BindingDataMap map = 4;
}
UnionInfo union = 5;
}
// An input/output binding of a variable to either static value or a node output.
message Binding {
// Variable name must match an input/output variable of the node.
string var = 1;
// Data to use to bind this variable.
BindingData binding = 2;
}
// A generic key value pair.
message KeyValuePair {
//required.
string key = 1;
//+optional.
string value = 2;
}
// Retry strategy associated with an executable unit.
message RetryStrategy {
// Number of retries. Retries will be consumed when the job fails with a recoverable error.
// The number of retries must be less than or equals to 10.
uint32 retries = 5;
}