feldera 0.96.0__py3-none-any.whl → 0.98.0__py3-none-any.whl
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.
Potentially problematic release.
This version of feldera might be problematic. Click here for more details.
- feldera/enums.py +121 -104
- feldera/pipeline.py +154 -133
- feldera/pipeline_builder.py +4 -1
- feldera/rest/feldera_client.py +58 -37
- feldera/rest/pipeline.py +1 -0
- feldera/stats.py +149 -0
- {feldera-0.96.0.dist-info → feldera-0.98.0.dist-info}/METADATA +24 -6
- {feldera-0.96.0.dist-info → feldera-0.98.0.dist-info}/RECORD +10 -9
- {feldera-0.96.0.dist-info → feldera-0.98.0.dist-info}/WHEEL +0 -0
- {feldera-0.96.0.dist-info → feldera-0.98.0.dist-info}/top_level.txt +0 -0
feldera/enums.py
CHANGED
|
@@ -36,155 +36,126 @@ class BuildMode(Enum):
|
|
|
36
36
|
|
|
37
37
|
class PipelineStatus(Enum):
|
|
38
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
|
-
Failed
|
|
65
|
-
"""
|
|
66
|
-
|
|
67
|
-
NOT_FOUND = 1
|
|
39
|
+
Represents the state that this pipeline is currently in.
|
|
40
|
+
|
|
41
|
+
.. code-block:: text
|
|
42
|
+
|
|
43
|
+
Stopped ◄─────────── Stopping ◄───── All states can transition
|
|
44
|
+
│ ▲ to Stopping by either:
|
|
45
|
+
/start or /pause │ │ (1) user calling /stop?force=true, or;
|
|
46
|
+
▼ │ (2) pipeline encountering a fatal
|
|
47
|
+
⌛Provisioning Suspending resource or runtime error,
|
|
48
|
+
│ ▲ having the system call /stop?force=true
|
|
49
|
+
▼ │ /stop effectively
|
|
50
|
+
⌛Initializing ─────────────┤ ?force=false
|
|
51
|
+
│ │
|
|
52
|
+
┌─────────┼────────────────────┴─────┐
|
|
53
|
+
│ ▼ │
|
|
54
|
+
│ Paused ◄──────► Unavailable │
|
|
55
|
+
│ │ ▲ ▲ │
|
|
56
|
+
│ /start │ │ /pause │ │
|
|
57
|
+
│ ▼ │ │ │
|
|
58
|
+
│ Running ◄─────────────┘ │
|
|
59
|
+
└────────────────────────────────────┘
|
|
60
|
+
"""
|
|
61
|
+
|
|
62
|
+
NOT_FOUND = 0
|
|
68
63
|
"""
|
|
69
64
|
The pipeline has not been created yet.
|
|
70
65
|
"""
|
|
71
66
|
|
|
72
|
-
|
|
67
|
+
STOPPED = 1
|
|
73
68
|
"""
|
|
74
|
-
|
|
69
|
+
The pipeline has not (yet) been started or has been stopped either
|
|
70
|
+
manually by the user or automatically by the system due to a
|
|
71
|
+
resource or runtime error.
|
|
75
72
|
|
|
76
|
-
The pipeline remains in this state until
|
|
77
|
-
a deployment by invoking the `/deploy` endpoint.
|
|
78
|
-
"""
|
|
73
|
+
The pipeline remains in this state until:
|
|
79
74
|
|
|
80
|
-
|
|
75
|
+
1. The user starts it via `/start` or `/pause`, transitioning to `PROVISIONING`.
|
|
76
|
+
2. Early start fails (e.g., compilation failure), transitioning to `STOPPING`.
|
|
81
77
|
"""
|
|
82
|
-
The runner triggered a deployment of the pipeline and is
|
|
83
|
-
waiting for the pipeline HTTP server to come up.
|
|
84
|
-
|
|
85
|
-
In this state, the runner provisions a runtime for the pipeline,
|
|
86
|
-
starts the pipeline within this runtime and waits for it to start accepting HTTP requests.
|
|
87
78
|
|
|
88
|
-
|
|
89
|
-
|
|
79
|
+
PROVISIONING = 2
|
|
80
|
+
"""
|
|
81
|
+
Compute (and optionally storage) resources needed for running the pipeline
|
|
82
|
+
are being provisioned.
|
|
90
83
|
|
|
91
|
-
|
|
92
|
-
`PipelineStatus.INITIALIZING` state.
|
|
93
|
-
2. A pre-defined timeout has passed. The runner performs forced
|
|
94
|
-
shutdown of the pipeline; returns to the `PipelineStatus.SHUTDOWN` state.
|
|
95
|
-
3. The user cancels the pipeline by invoking the `/shutdown` endpoint.
|
|
96
|
-
The manager performs forced shutdown of the pipeline, returns to the
|
|
97
|
-
`PipelineStatus.SHUTDOWN` state.
|
|
84
|
+
The pipeline remains in this state until:
|
|
98
85
|
|
|
86
|
+
1. Resources are provisioned successfully, transitioning to `INITIALIZING`.
|
|
87
|
+
2. Provisioning fails or times out, transitioning to `STOPPING`.
|
|
88
|
+
3. The user cancels the pipeline via `/stop`, transitioning to `STOPPING`.
|
|
99
89
|
"""
|
|
100
90
|
|
|
101
|
-
INITIALIZING =
|
|
91
|
+
INITIALIZING = 3
|
|
102
92
|
"""
|
|
103
93
|
The pipeline is initializing its internal state and connectors.
|
|
104
94
|
|
|
105
|
-
This state is part of the pipeline's deployment process. In this state,
|
|
106
|
-
the pipeline's HTTP server is up and running, but its query engine
|
|
107
|
-
and input and output connectors are still initializing.
|
|
108
|
-
|
|
109
95
|
The pipeline remains in this state until:
|
|
110
96
|
|
|
111
|
-
1.
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
shutdown of the pipeline; returns to the `PipelineStatus.SHUTDOWN` state.
|
|
116
|
-
4. The user cancels the pipeline by invoking the `/shutdown` endpoint.
|
|
117
|
-
The manager performs forced shutdown of the pipeline; returns to the
|
|
118
|
-
`PipelineStatus.SHUTDOWN` state.
|
|
119
|
-
|
|
97
|
+
1. Initialization succeeds, transitioning to `PAUSED`.
|
|
98
|
+
2. Initialization fails or times out, transitioning to `STOPPING`.
|
|
99
|
+
3. The user suspends the pipeline via `/suspend`, transitioning to `SUSPENDING`.
|
|
100
|
+
4. The user stops the pipeline via `/stop`, transitioning to `STOPPING`.
|
|
120
101
|
"""
|
|
121
102
|
|
|
122
|
-
PAUSED =
|
|
103
|
+
PAUSED = 4
|
|
123
104
|
"""
|
|
124
|
-
The pipeline is
|
|
105
|
+
The pipeline is initialized but data processing is paused.
|
|
125
106
|
|
|
126
107
|
The pipeline remains in this state until:
|
|
127
108
|
|
|
128
|
-
1.
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
The manager passes the shutdown request to the pipeline to perform a
|
|
133
|
-
graceful shutdown; transitions to the `PipelineStatus.SHUTTING_DOWN` state.
|
|
134
|
-
3. An unexpected runtime error renders the pipeline `PipelineStatus.FAILED`.
|
|
135
|
-
|
|
109
|
+
1. The user starts it via `/start`, transitioning to `RUNNING`.
|
|
110
|
+
2. A runtime error occurs, transitioning to `STOPPING`.
|
|
111
|
+
3. The user suspends it via `/suspend`, transitioning to `SUSPENDING`.
|
|
112
|
+
4. The user stops it via `/stop`, transitioning to `STOPPING`.
|
|
136
113
|
"""
|
|
137
114
|
|
|
138
|
-
RUNNING =
|
|
115
|
+
RUNNING = 5
|
|
139
116
|
"""
|
|
140
117
|
The pipeline is processing data.
|
|
141
118
|
|
|
142
119
|
The pipeline remains in this state until:
|
|
143
120
|
|
|
144
|
-
1. The user pauses
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
The runner passes the shutdown request to the pipeline to perform a
|
|
149
|
-
graceful shutdown; transitions to the
|
|
150
|
-
`PipelineStatus.SHUTTING_DOWN` state.
|
|
151
|
-
3. An unexpected runtime error renders the pipeline
|
|
152
|
-
`PipelineStatus.FAILED`.
|
|
153
|
-
|
|
121
|
+
1. The user pauses it via `/pause`, transitioning to `PAUSED`.
|
|
122
|
+
2. A runtime error occurs, transitioning to `STOPPING`.
|
|
123
|
+
3. The user suspends it via `/suspend`, transitioning to `SUSPENDING`.
|
|
124
|
+
4. The user stops it via `/stop`, transitioning to `STOPPING`.
|
|
154
125
|
"""
|
|
155
126
|
|
|
156
|
-
|
|
127
|
+
UNAVAILABLE = 6
|
|
157
128
|
"""
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
In this state, the pipeline finishes any ongoing data processing,
|
|
161
|
-
produces final outputs, shuts down input/output connectors and
|
|
162
|
-
terminates.
|
|
129
|
+
The pipeline was initialized at least once but is currently unreachable
|
|
130
|
+
or not ready.
|
|
163
131
|
|
|
164
132
|
The pipeline remains in this state until:
|
|
165
133
|
|
|
166
|
-
1.
|
|
167
|
-
2. A
|
|
168
|
-
|
|
134
|
+
1. A successful status check transitions it back to `PAUSED` or `RUNNING`.
|
|
135
|
+
2. A runtime error occurs, transitioning to `STOPPING`.
|
|
136
|
+
3. The user suspends it via `/suspend`, transitioning to `SUSPENDING`.
|
|
137
|
+
4. The user stops it via `/stop`, transitioning to `STOPPING`.
|
|
169
138
|
|
|
139
|
+
Note: While in this state, `/start` or `/pause` express desired state but
|
|
140
|
+
are only applied once the pipeline becomes reachable.
|
|
170
141
|
"""
|
|
171
142
|
|
|
172
|
-
|
|
173
|
-
"""
|
|
174
|
-
The pipeline remains in this state until the users acknowledge the failure
|
|
175
|
-
by issuing a call to shutdown the pipeline; transitions to the
|
|
176
|
-
`PipelineStatus.SHUTDOWN` state.
|
|
143
|
+
SUSPENDING = 7
|
|
177
144
|
"""
|
|
145
|
+
The pipeline is being suspended to storage.
|
|
178
146
|
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
147
|
+
The pipeline remains in this state until:
|
|
148
|
+
|
|
149
|
+
1. Suspension succeeds, transitioning to `STOPPING`.
|
|
150
|
+
2. A runtime error occurs, transitioning to `STOPPING`.
|
|
183
151
|
"""
|
|
184
152
|
|
|
185
|
-
|
|
153
|
+
STOPPING = 8
|
|
186
154
|
"""
|
|
187
|
-
The pipeline
|
|
155
|
+
The pipeline's compute resources are being scaled down to zero.
|
|
156
|
+
|
|
157
|
+
The pipeline remains in this state until deallocation completes,
|
|
158
|
+
transitioning to `STOPPED`.
|
|
188
159
|
"""
|
|
189
160
|
|
|
190
161
|
@staticmethod
|
|
@@ -258,3 +229,49 @@ class CheckpointStatus(Enum):
|
|
|
258
229
|
"""
|
|
259
230
|
|
|
260
231
|
return self.error
|
|
232
|
+
|
|
233
|
+
|
|
234
|
+
class StorageStatus(Enum):
|
|
235
|
+
"""
|
|
236
|
+
Represents the current storage usage status of the pipeline.
|
|
237
|
+
"""
|
|
238
|
+
|
|
239
|
+
CLEARED = 0
|
|
240
|
+
"""
|
|
241
|
+
The pipeline has not been started before, or the user has cleared storage.
|
|
242
|
+
|
|
243
|
+
In this state, the pipeline has no storage resources bound to it.
|
|
244
|
+
"""
|
|
245
|
+
|
|
246
|
+
INUSE = 1
|
|
247
|
+
"""
|
|
248
|
+
The pipeline was (attempted to be) started before, transitioning from `STOPPED`
|
|
249
|
+
to `PROVISIONING`, which caused the storage status to become `INUSE`.
|
|
250
|
+
|
|
251
|
+
Being in the `INUSE` state restricts certain edits while the pipeline is `STOPPED`.
|
|
252
|
+
|
|
253
|
+
The pipeline remains in this state until the user invokes `/clear`, transitioning
|
|
254
|
+
it to `CLEARING`.
|
|
255
|
+
"""
|
|
256
|
+
|
|
257
|
+
CLEARING = 2
|
|
258
|
+
"""
|
|
259
|
+
The pipeline is in the process of becoming unbound from its storage resources.
|
|
260
|
+
|
|
261
|
+
If storage resources are configured to be deleted upon clearing, their deletion
|
|
262
|
+
occurs before transitioning to `CLEARED`. Otherwise, no actual work is required,
|
|
263
|
+
and the transition happens immediately.
|
|
264
|
+
|
|
265
|
+
If storage is not deleted during clearing, the responsibility to manage or delete
|
|
266
|
+
those resources lies with the user.
|
|
267
|
+
"""
|
|
268
|
+
|
|
269
|
+
@staticmethod
|
|
270
|
+
def from_str(value):
|
|
271
|
+
for member in StorageStatus:
|
|
272
|
+
if member.name.lower() == value.lower():
|
|
273
|
+
return member
|
|
274
|
+
raise ValueError(f"Unknown value '{value}' for enum {StorageStatus.__name__}")
|
|
275
|
+
|
|
276
|
+
def __eq__(self, other):
|
|
277
|
+
return self.value == other.value
|