py-serverless-kit 2.3.2__py3-none-any.whl → 2.3.3__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.
- py_serverless_kit/_version.py +1 -1
- py_serverless_kit/core/onprem_control.py +461 -414
- py_serverless_kit/core/testing.py +14 -4
- py_serverless_kit/runtime/onprem_host.py +5 -1
- py_serverless_kit/runtime_js/package.json +1 -1
- py_serverless_kit/studio/meta.py +5 -1
- {py_serverless_kit-2.3.2.dist-info → py_serverless_kit-2.3.3.dist-info}/METADATA +1 -1
- {py_serverless_kit-2.3.2.dist-info → py_serverless_kit-2.3.3.dist-info}/RECORD +11 -11
- {py_serverless_kit-2.3.2.dist-info → py_serverless_kit-2.3.3.dist-info}/WHEEL +0 -0
- {py_serverless_kit-2.3.2.dist-info → py_serverless_kit-2.3.3.dist-info}/entry_points.txt +0 -0
- {py_serverless_kit-2.3.2.dist-info → py_serverless_kit-2.3.3.dist-info}/licenses/LICENSE +0 -0
py_serverless_kit/_version.py
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
__version__ = "2.3.
|
|
1
|
+
__version__ = "2.3.3"
|
|
2
2
|
__author__ = "Asif Khan @ Kavion.ai"
|
|
@@ -1,414 +1,461 @@
|
|
|
1
|
-
"""Talk to a deployed on-premises host's control API (``/__pskit/...``).
|
|
2
|
-
|
|
3
|
-
Used by ``pskit logs``, ``pskit workflow ...`` and the live dashboard. The admin
|
|
4
|
-
token is read from the generated ``pskit_host.json`` and only ever sent to the
|
|
5
|
-
host itself.
|
|
6
|
-
"""
|
|
7
|
-
|
|
8
|
-
from __future__ import annotations
|
|
9
|
-
|
|
10
|
-
import base64
|
|
11
|
-
import json
|
|
12
|
-
import socket
|
|
13
|
-
import subprocess
|
|
14
|
-
import time
|
|
15
|
-
from pathlib import Path
|
|
16
|
-
from typing import Any, Dict, Optional, Tuple
|
|
17
|
-
from urllib.error import HTTPError, URLError
|
|
18
|
-
from urllib.parse import quote, urlencode, urlsplit
|
|
19
|
-
from urllib.request import Request, urlopen
|
|
20
|
-
|
|
21
|
-
from .onprem_servers import DEPLOYED_FILE, LOCAL, deployed_server
|
|
22
|
-
from .project import WORK_DIR
|
|
23
|
-
|
|
24
|
-
__all__ = [
|
|
25
|
-
"DEPLOYED_FILE", "LOCAL", "HostControl", "HostUnavailable", "control_for", "control_url", "deployed_host",
|
|
26
|
-
"deployed_on", "deployed_server", "host_spec", "record_key", "remember_deploy", "rendered_spec",
|
|
27
|
-
]
|
|
28
|
-
_ROUTE_TTL = 120.0 # seconds a direct / SSH route decision is reused
|
|
29
|
-
_ROUTES: Dict[str, Tuple[str, float]] = {}
|
|
30
|
-
|
|
31
|
-
# Runs on the server over SSH: one HTTP request to the host on its loopback. The request (with the admin token)
|
|
32
|
-
# arrives on stdin, so nothing secret is on a command line.
|
|
33
|
-
_SSH_FETCH = (
|
|
34
|
-
"import sys,json,base64,urllib.request,urllib.error\n"
|
|
35
|
-
"r=json.loads(sys.stdin.readline())\n"
|
|
36
|
-
"b=base64.b64decode(r['b']) if r.get('b') is not None else None\n"
|
|
37
|
-
"q=urllib.request.Request(r['u'],data=b,method=r['m'],headers=r['h'])\n"
|
|
38
|
-
"try:\n"
|
|
39
|
-
" p=urllib.request.urlopen(q,timeout=r['t']);s=p.status;h=dict(p.headers);d=p.read()\n"
|
|
40
|
-
"except urllib.error.HTTPError as e:\n"
|
|
41
|
-
" s=e.code;h=dict(e.headers or {});d=e.read()\n"
|
|
42
|
-
"except Exception as e:\n"
|
|
43
|
-
" sys.stderr.write('pskit: no pskit host answers on port %s of this server (%s)\\n'"
|
|
44
|
-
" % (r['u'].split(':')[2].split('/')[0],getattr(e,'reason',None) or e));sys.exit(3)\n"
|
|
45
|
-
"sys.stdout.write(json.dumps({'s':s,'h':h,'b':base64.b64encode(d).decode()}))\n"
|
|
46
|
-
)
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
class HostUnavailable(OSError):
|
|
50
|
-
"""The host did not answer (not running, wrong address, firewall...)."""
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
class
|
|
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
|
-
self
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
for
|
|
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
|
-
raise HostUnavailable(
|
|
177
|
-
f"on-prem host at {self.where} is not reachable{why},
|
|
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
|
-
) -> Dict[str, Any]:
|
|
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
|
-
def
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
return
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
return
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
def
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
|
|
317
|
-
|
|
318
|
-
return
|
|
319
|
-
return
|
|
320
|
-
|
|
321
|
-
|
|
322
|
-
def
|
|
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
|
-
deployed
|
|
392
|
-
|
|
393
|
-
|
|
394
|
-
|
|
395
|
-
|
|
396
|
-
|
|
397
|
-
|
|
398
|
-
|
|
399
|
-
|
|
400
|
-
|
|
401
|
-
|
|
402
|
-
|
|
403
|
-
|
|
404
|
-
|
|
405
|
-
|
|
406
|
-
|
|
407
|
-
if
|
|
408
|
-
|
|
409
|
-
|
|
410
|
-
|
|
411
|
-
|
|
412
|
-
|
|
413
|
-
|
|
414
|
-
|
|
1
|
+
"""Talk to a deployed on-premises host's control API (``/__pskit/...``).
|
|
2
|
+
|
|
3
|
+
Used by ``pskit logs``, ``pskit workflow ...`` and the live dashboard. The admin
|
|
4
|
+
token is read from the generated ``pskit_host.json`` and only ever sent to the
|
|
5
|
+
host itself.
|
|
6
|
+
"""
|
|
7
|
+
|
|
8
|
+
from __future__ import annotations
|
|
9
|
+
|
|
10
|
+
import base64
|
|
11
|
+
import json
|
|
12
|
+
import socket
|
|
13
|
+
import subprocess
|
|
14
|
+
import time
|
|
15
|
+
from pathlib import Path
|
|
16
|
+
from typing import Any, Dict, Optional, Tuple
|
|
17
|
+
from urllib.error import HTTPError, URLError
|
|
18
|
+
from urllib.parse import quote, urlencode, urlsplit
|
|
19
|
+
from urllib.request import Request, urlopen
|
|
20
|
+
|
|
21
|
+
from .onprem_servers import DEPLOYED_FILE, LOCAL, deployed_server
|
|
22
|
+
from .project import WORK_DIR
|
|
23
|
+
|
|
24
|
+
__all__ = [
|
|
25
|
+
"DEPLOYED_FILE", "LOCAL", "FunctionFailed", "HostControl", "HostUnavailable", "control_for", "control_url", "deployed_host",
|
|
26
|
+
"deployed_on", "deployed_server", "host_spec", "record_key", "remember_deploy", "rendered_spec",
|
|
27
|
+
]
|
|
28
|
+
_ROUTE_TTL = 120.0 # seconds a direct / SSH route decision is reused
|
|
29
|
+
_ROUTES: Dict[str, Tuple[str, float]] = {}
|
|
30
|
+
|
|
31
|
+
# Runs on the server over SSH: one HTTP request to the host on its loopback. The request (with the admin token)
|
|
32
|
+
# arrives on stdin, so nothing secret is on a command line.
|
|
33
|
+
_SSH_FETCH = (
|
|
34
|
+
"import sys,json,base64,urllib.request,urllib.error\n"
|
|
35
|
+
"r=json.loads(sys.stdin.readline())\n"
|
|
36
|
+
"b=base64.b64decode(r['b']) if r.get('b') is not None else None\n"
|
|
37
|
+
"q=urllib.request.Request(r['u'],data=b,method=r['m'],headers=r['h'])\n"
|
|
38
|
+
"try:\n"
|
|
39
|
+
" p=urllib.request.urlopen(q,timeout=r['t']);s=p.status;h=dict(p.headers);d=p.read()\n"
|
|
40
|
+
"except urllib.error.HTTPError as e:\n"
|
|
41
|
+
" s=e.code;h=dict(e.headers or {});d=e.read()\n"
|
|
42
|
+
"except Exception as e:\n"
|
|
43
|
+
" sys.stderr.write('pskit: no pskit host answers on port %s of this server (%s)\\n'"
|
|
44
|
+
" % (r['u'].split(':')[2].split('/')[0],getattr(e,'reason',None) or e));sys.exit(3)\n"
|
|
45
|
+
"sys.stdout.write(json.dumps({'s':s,'h':h,'b':base64.b64encode(d).decode()}))\n"
|
|
46
|
+
)
|
|
47
|
+
|
|
48
|
+
|
|
49
|
+
class HostUnavailable(OSError):
|
|
50
|
+
"""The host did not answer (not running, wrong address, firewall...)."""
|
|
51
|
+
|
|
52
|
+
|
|
53
|
+
class FunctionFailed(HostUnavailable):
|
|
54
|
+
"""The host answered, but the function raised: ``error_type`` and ``cause`` are its exception's. (A
|
|
55
|
+
HostUnavailable so callers that report host errors report this too.)"""
|
|
56
|
+
|
|
57
|
+
def __init__(self, error_type: str, cause: str) -> None:
|
|
58
|
+
self.error_type = error_type
|
|
59
|
+
self.cause = cause
|
|
60
|
+
super().__init__(f"the function raised {error_type}: {cause}")
|
|
61
|
+
|
|
62
|
+
|
|
63
|
+
class HostControl:
|
|
64
|
+
"""Client for a host's ``/__pskit`` API.
|
|
65
|
+
|
|
66
|
+
``ssh`` (the deploy's SSH login) keeps a host on another machine reachable when its port is not: it binds
|
|
67
|
+
127.0.0.1 there (the default) or a firewall blocks the port. The request then runs on the server over SSH.
|
|
68
|
+
"""
|
|
69
|
+
|
|
70
|
+
def __init__(
|
|
71
|
+
self,
|
|
72
|
+
base_url: str,
|
|
73
|
+
token: str = "",
|
|
74
|
+
timeout: float = 10.0,
|
|
75
|
+
*,
|
|
76
|
+
ssh: Optional[Dict[str, Any]] = None,
|
|
77
|
+
remote_port: Optional[int] = None,
|
|
78
|
+
remote_path: str = "",
|
|
79
|
+
server: Optional[str] = None,
|
|
80
|
+
force_ssh: bool = False,
|
|
81
|
+
) -> None:
|
|
82
|
+
if not base_url.lower().startswith(("http://", "https://")):
|
|
83
|
+
raise ValueError(f"on-prem control URL must be http(s), got {base_url!r}")
|
|
84
|
+
self.base_url = base_url.rstrip("/")
|
|
85
|
+
self.token = token
|
|
86
|
+
self.timeout = timeout
|
|
87
|
+
self.ssh = ssh if ssh and ssh.get("host") else None
|
|
88
|
+
self.remote_port = int(remote_port or urlsplit(self.base_url).port or 8080)
|
|
89
|
+
self.remote_path = remote_path
|
|
90
|
+
self.server = server
|
|
91
|
+
self.force_ssh = force_ssh
|
|
92
|
+
|
|
93
|
+
@property
|
|
94
|
+
def where(self) -> str:
|
|
95
|
+
"""The saved server and URL, for messages."""
|
|
96
|
+
return f"{self.base_url} (server {self.server})" if self.server else self.base_url
|
|
97
|
+
|
|
98
|
+
# ------------------------------------------------------------------ transport
|
|
99
|
+
def fetch(
|
|
100
|
+
self,
|
|
101
|
+
method: str,
|
|
102
|
+
path: str,
|
|
103
|
+
data: Optional[bytes] = None,
|
|
104
|
+
headers: Optional[Dict[str, str]] = None,
|
|
105
|
+
query: Optional[Dict[str, Any]] = None,
|
|
106
|
+
timeout: Optional[float] = None,
|
|
107
|
+
) -> Tuple[int, Dict[str, str], bytes]:
|
|
108
|
+
"""One request: ``(status, headers, body)`` for any HTTP status, HostUnavailable when nothing answers."""
|
|
109
|
+
params = {k: v for k, v in (query or {}).items() if v is not None and v != ""}
|
|
110
|
+
suffix = path + ("?" + urlencode(params) if params else "")
|
|
111
|
+
sent = dict(headers or {})
|
|
112
|
+
if self.token:
|
|
113
|
+
sent["x-pskit-token"] = self.token
|
|
114
|
+
wait = timeout or self.timeout
|
|
115
|
+
if self.ssh is not None and (self.force_ssh or self._route() == "ssh"):
|
|
116
|
+
why = "" if self.force_ssh else "port not reachable from here"
|
|
117
|
+
return self._fetch_ssh(method, suffix, data, sent, wait, direct_error=why)
|
|
118
|
+
req = Request(self.base_url + suffix, data=data, method=method) # noqa: S310 - http(s) checked in __init__
|
|
119
|
+
for key, value in sent.items():
|
|
120
|
+
req.add_header(key, value)
|
|
121
|
+
try:
|
|
122
|
+
with urlopen(req, timeout=wait) as resp: # noqa: S310
|
|
123
|
+
return resp.status, dict(resp.headers), resp.read()
|
|
124
|
+
except HTTPError as exc:
|
|
125
|
+
return exc.code, dict(exc.headers or {}), exc.read()
|
|
126
|
+
except (URLError, OSError, ValueError) as exc:
|
|
127
|
+
reason = getattr(exc, "reason", exc)
|
|
128
|
+
if self.ssh is not None:
|
|
129
|
+
_ROUTES[self.base_url] = ("ssh", time.monotonic() + _ROUTE_TTL)
|
|
130
|
+
return self._fetch_ssh(method, suffix, data, sent, wait, direct_error=str(reason))
|
|
131
|
+
raise HostUnavailable(f"on-prem host at {self.where} is not reachable: {reason}") from None
|
|
132
|
+
|
|
133
|
+
def _route(self) -> str:
|
|
134
|
+
"""``direct`` when this machine can open the host's port, else ``ssh``; remembered for a while."""
|
|
135
|
+
cached = _ROUTES.get(self.base_url)
|
|
136
|
+
if cached and cached[1] > time.monotonic():
|
|
137
|
+
return cached[0]
|
|
138
|
+
parts = urlsplit(self.base_url)
|
|
139
|
+
try:
|
|
140
|
+
with socket.create_connection((parts.hostname or "", parts.port or 80), timeout=3):
|
|
141
|
+
route = "direct"
|
|
142
|
+
except OSError:
|
|
143
|
+
route = "ssh"
|
|
144
|
+
_ROUTES[self.base_url] = (route, time.monotonic() + _ROUTE_TTL)
|
|
145
|
+
return route
|
|
146
|
+
|
|
147
|
+
def _fetch_ssh(
|
|
148
|
+
self, method: str, suffix: str, data: Optional[bytes], headers: Dict[str, str], timeout: float,
|
|
149
|
+
direct_error: str = "",
|
|
150
|
+
) -> Tuple[int, Dict[str, str], bytes]:
|
|
151
|
+
from ..providers.onprem_remote import _shq, _ssh_base, _target
|
|
152
|
+
|
|
153
|
+
assert self.ssh is not None
|
|
154
|
+
candidates = ([self.remote_path.rstrip("/") + "/python/bin/python3"] if self.remote_path else []) + [
|
|
155
|
+
"python3", "python"]
|
|
156
|
+
command = (
|
|
157
|
+
'export PATH="/usr/local/bin:/usr/bin:/bin:$PATH"; '
|
|
158
|
+
f"for p in {' '.join(_shq(c) for c in candidates)}; do "
|
|
159
|
+
f'if command -v "$p" >/dev/null 2>&1; then exec "$p" -c {_shq(_SSH_FETCH)}; fi; done; '
|
|
160
|
+
"echo 'pskit: no python3 on the server' >&2; exit 127"
|
|
161
|
+
)
|
|
162
|
+
request = {
|
|
163
|
+
"m": method,
|
|
164
|
+
"u": f"http://127.0.0.1:{self.remote_port}{suffix}",
|
|
165
|
+
"h": headers,
|
|
166
|
+
"b": None if data is None else base64.b64encode(data).decode("ascii"),
|
|
167
|
+
"t": timeout,
|
|
168
|
+
}
|
|
169
|
+
argv = _ssh_base(self.ssh) + [_target(self.ssh), command]
|
|
170
|
+
why = f" directly ({direct_error})" if direct_error else ""
|
|
171
|
+
try:
|
|
172
|
+
proc = subprocess.run( # noqa: S603 - explicit argv, no local shell
|
|
173
|
+
argv, input=(json.dumps(request) + "\n").encode("utf-8"), capture_output=True, timeout=timeout + 40
|
|
174
|
+
)
|
|
175
|
+
except FileNotFoundError:
|
|
176
|
+
raise HostUnavailable(
|
|
177
|
+
f"on-prem host at {self.where} is not reachable{why}, and `{argv[0]}` is not installed here "
|
|
178
|
+
"to reach it over SSH"
|
|
179
|
+
) from None
|
|
180
|
+
except subprocess.TimeoutExpired:
|
|
181
|
+
raise HostUnavailable(f"on-prem host at {self.where}: no answer over SSH in {int(timeout + 40)}s") from None
|
|
182
|
+
err = proc.stderr.decode("utf-8", "replace").strip()
|
|
183
|
+
if proc.returncode:
|
|
184
|
+
detail = err.splitlines()[-1] if err else f"ssh exited with {proc.returncode}"
|
|
185
|
+
redeploy = "pskit deploy" + (f" --server {self.server}" if self.server else "")
|
|
186
|
+
raise HostUnavailable(
|
|
187
|
+
f"on-prem host at {self.where} is not reachable{why}, nor over SSH to {self.ssh.get('host')}: "
|
|
188
|
+
f"{detail}. If the host is not running there, redeploy it: {redeploy}"
|
|
189
|
+
)
|
|
190
|
+
try:
|
|
191
|
+
out = json.loads(proc.stdout.decode("utf-8"))
|
|
192
|
+
return int(out["s"]), dict(out.get("h") or {}), base64.b64decode(out.get("b") or "")
|
|
193
|
+
except (ValueError, KeyError, TypeError):
|
|
194
|
+
raise HostUnavailable(f"on-prem host at {self.where}: unexpected answer over SSH: {err[-300:]}") from None
|
|
195
|
+
|
|
196
|
+
def request(
|
|
197
|
+
self,
|
|
198
|
+
method: str,
|
|
199
|
+
path: str,
|
|
200
|
+
body: Any = None,
|
|
201
|
+
query: Optional[Dict[str, Any]] = None,
|
|
202
|
+
timeout: Optional[float] = None,
|
|
203
|
+
*,
|
|
204
|
+
data: Optional[bytes] = None,
|
|
205
|
+
) -> Any:
|
|
206
|
+
"""A JSON call: ``body`` as JSON or ``data`` as raw bytes. 404 -> KeyError, 400/405/413 -> ValueError."""
|
|
207
|
+
headers = {"accept": "application/json"}
|
|
208
|
+
if body is not None:
|
|
209
|
+
data = json.dumps(body, default=str).encode("utf-8")
|
|
210
|
+
headers["content-type"] = "application/json"
|
|
211
|
+
status, _headers, raw = self.fetch(method, path, data, headers, query, timeout)
|
|
212
|
+
if status >= 400:
|
|
213
|
+
message = _error_body(raw, status)
|
|
214
|
+
if status == 404:
|
|
215
|
+
raise KeyError(message)
|
|
216
|
+
if status in (400, 405, 413):
|
|
217
|
+
raise ValueError(message)
|
|
218
|
+
if status == 401:
|
|
219
|
+
raise PermissionError(f"{message} (check provider.options.admin_token)")
|
|
220
|
+
failed = _function_error(raw)
|
|
221
|
+
if failed is not None:
|
|
222
|
+
raise failed
|
|
223
|
+
raise HostUnavailable(f"{self.base_url} answered HTTP {status}: {message}")
|
|
224
|
+
if not raw:
|
|
225
|
+
return None
|
|
226
|
+
try:
|
|
227
|
+
return json.loads(raw.decode("utf-8"))
|
|
228
|
+
except ValueError:
|
|
229
|
+
raise HostUnavailable(f"{self.base_url} returned a non-JSON response") from None
|
|
230
|
+
|
|
231
|
+
# ------------------------------------------------------------------ helpers
|
|
232
|
+
def health(self) -> Dict[str, Any]:
|
|
233
|
+
return dict(self.request("GET", "/__pskit/health", timeout=3) or {})
|
|
234
|
+
|
|
235
|
+
def stats(self) -> Dict[str, Any]:
|
|
236
|
+
return dict(self.request("GET", "/__pskit/stats") or {})
|
|
237
|
+
|
|
238
|
+
def logs(
|
|
239
|
+
self,
|
|
240
|
+
since: int = 0,
|
|
241
|
+
limit: int = 200,
|
|
242
|
+
level: Optional[str] = None,
|
|
243
|
+
function: Optional[str] = None,
|
|
244
|
+
q: Optional[str] = None,
|
|
245
|
+
source: Optional[str] = None,
|
|
246
|
+
before: Optional[int] = None,
|
|
247
|
+
local: bool = False,
|
|
248
|
+
) -> Dict[str, Any]:
|
|
249
|
+
query = {
|
|
250
|
+
"since": since,
|
|
251
|
+
"limit": limit,
|
|
252
|
+
"level": level,
|
|
253
|
+
"function": function,
|
|
254
|
+
"q": q,
|
|
255
|
+
"source": source,
|
|
256
|
+
"before": before,
|
|
257
|
+
}
|
|
258
|
+
path = "/__pskit/logs/local" if local else "/__pskit/logs"
|
|
259
|
+
return dict(self.request("GET", path, query=query) or {})
|
|
260
|
+
|
|
261
|
+
def log_streams(self) -> Dict[str, Any]:
|
|
262
|
+
return dict(self.request("GET", "/__pskit/logs/streams") or {})
|
|
263
|
+
|
|
264
|
+
def clear_logs(self, function: Optional[str] = None) -> Dict[str, Any]:
|
|
265
|
+
return dict(self.request("DELETE", "/__pskit/logs", query={"function": function}) or {})
|
|
266
|
+
|
|
267
|
+
def start_workflow(self, workflow: str, data: Any, wait: bool = False) -> Dict[str, Any]:
|
|
268
|
+
path = "/__pskit/workflows/" + quote(workflow, safe="")
|
|
269
|
+
return dict(
|
|
270
|
+
self.request(
|
|
271
|
+
"POST", path, body=data, query={"wait": "true" if wait else None}, timeout=None if wait else 15
|
|
272
|
+
)
|
|
273
|
+
or {}
|
|
274
|
+
)
|
|
275
|
+
|
|
276
|
+
def executions(
|
|
277
|
+
self, workflow: Optional[str] = None, status: Optional[str] = None, limit: int = 20, offset: int = 0
|
|
278
|
+
) -> Dict[str, Any]:
|
|
279
|
+
query = {"workflow": workflow, "status": status, "limit": limit, "offset": offset}
|
|
280
|
+
return dict(self.request("GET", "/__pskit/executions", query=query) or {})
|
|
281
|
+
|
|
282
|
+
def execution(self, execution_id: str) -> Dict[str, Any]:
|
|
283
|
+
return dict(self.request("GET", "/__pskit/executions/" + quote(execution_id, safe="")) or {})
|
|
284
|
+
|
|
285
|
+
def cancel(self, execution_id: str) -> Dict[str, Any]:
|
|
286
|
+
return dict(self.request("POST", "/__pskit/executions/" + quote(execution_id, safe="") + "/cancel") or {})
|
|
287
|
+
|
|
288
|
+
|
|
289
|
+
def _function_error(raw: bytes) -> Optional[FunctionFailed]:
|
|
290
|
+
"""The host's answer when the function itself raised: ``{"errorType": ..., "cause": ...}``."""
|
|
291
|
+
try:
|
|
292
|
+
payload = json.loads(raw.decode("utf-8"))
|
|
293
|
+
except Exception: # noqa: BLE001
|
|
294
|
+
return None
|
|
295
|
+
if isinstance(payload, dict) and payload.get("errorType"):
|
|
296
|
+
return FunctionFailed(str(payload["errorType"]), str(payload.get("cause") or ""))
|
|
297
|
+
return None
|
|
298
|
+
|
|
299
|
+
|
|
300
|
+
def _error_body(raw: bytes, status: int) -> str:
|
|
301
|
+
try:
|
|
302
|
+
payload = json.loads(raw.decode("utf-8"))
|
|
303
|
+
except Exception: # noqa: BLE001
|
|
304
|
+
return f"HTTP {status}"
|
|
305
|
+
if isinstance(payload, dict):
|
|
306
|
+
return str(payload.get("error") or payload.get("cause") or payload)
|
|
307
|
+
return str(payload)
|
|
308
|
+
|
|
309
|
+
|
|
310
|
+
def record_key(record: Dict[str, Any]) -> str:
|
|
311
|
+
return str(record.get("key") or f"{record.get('provider')}-{record.get('stage')}")
|
|
312
|
+
|
|
313
|
+
|
|
314
|
+
def host_spec(record: Dict[str, Any], root: Path) -> Optional[Dict[str, Any]]:
|
|
315
|
+
"""The spec the host was last *deployed* with, else the one last rendered (package / plan rewrite that)."""
|
|
316
|
+
deployed = deployed_host(root, str(record.get("stage") or ""), record)
|
|
317
|
+
if deployed is not None:
|
|
318
|
+
return dict(deployed.get("spec") or {})
|
|
319
|
+
return rendered_spec(Path(root) / WORK_DIR / record_key(record))
|
|
320
|
+
|
|
321
|
+
|
|
322
|
+
def rendered_spec(work_dir: Path) -> Optional[Dict[str, Any]]:
|
|
323
|
+
try:
|
|
324
|
+
spec = json.loads((Path(work_dir) / "onprem_app" / "pskit_host.json").read_text("utf-8"))
|
|
325
|
+
except (OSError, ValueError):
|
|
326
|
+
return None
|
|
327
|
+
return spec if isinstance(spec, dict) else None
|
|
328
|
+
|
|
329
|
+
|
|
330
|
+
# ---------------------------------------------------------------------- where a stage was deployed
|
|
331
|
+
_SPEC_KEYS = ("host", "port", "endpoint", "admin_token", "deploy", "unit_name", "service", "stage")
|
|
332
|
+
|
|
333
|
+
|
|
334
|
+
def deployed_host(
|
|
335
|
+
root: Path, stage: str, record: Optional[Dict[str, Any]] = None
|
|
336
|
+
) -> Optional[Dict[str, Any]]:
|
|
337
|
+
"""``{server, spec, deployed_at}`` written by the last successful ``pskit deploy`` of ``onprem-<stage>``."""
|
|
338
|
+
key = record_key(record) if record else f"onprem-{stage}"
|
|
339
|
+
try:
|
|
340
|
+
data = json.loads((Path(root) / WORK_DIR / key / DEPLOYED_FILE).read_text("utf-8"))
|
|
341
|
+
except (OSError, ValueError):
|
|
342
|
+
return None
|
|
343
|
+
return data if isinstance(data, dict) and isinstance(data.get("spec"), dict) else None
|
|
344
|
+
|
|
345
|
+
|
|
346
|
+
def remember_deploy(work_dir: Path, server: Optional[str], cluster: Optional[str] = None) -> Optional[Dict[str, Any]]:
|
|
347
|
+
"""After a successful deploy: keep where the host runs, so trigger / logs / test and the next deploy use it.
|
|
348
|
+
On a scaling cluster ``server`` is its master and ``cluster`` its name."""
|
|
349
|
+
spec = rendered_spec(work_dir)
|
|
350
|
+
if spec is None:
|
|
351
|
+
return None
|
|
352
|
+
data = {
|
|
353
|
+
"server": server or None,
|
|
354
|
+
"cluster": cluster or None,
|
|
355
|
+
"deployed_at": time.strftime("%Y-%m-%dT%H:%M:%SZ", time.gmtime()),
|
|
356
|
+
"spec": {k: spec[k] for k in _SPEC_KEYS if k in spec},
|
|
357
|
+
}
|
|
358
|
+
path = Path(work_dir) / DEPLOYED_FILE
|
|
359
|
+
path.parent.mkdir(parents=True, exist_ok=True)
|
|
360
|
+
path.write_bytes((json.dumps(data, indent=2, sort_keys=True) + "\n").encode("utf-8"))
|
|
361
|
+
return data
|
|
362
|
+
|
|
363
|
+
|
|
364
|
+
def deployed_on(spec: Dict[str, Any], server: Optional[str], cluster: Optional[str] = None) -> Dict[str, Any]:
|
|
365
|
+
"""The ``deployed_on`` summary kept in ``deployment.json`` (shown by deploy, info and the studio)."""
|
|
366
|
+
deploy = spec.get("deploy") or {}
|
|
367
|
+
method = str(deploy.get("method") or "local")
|
|
368
|
+
ssh_host = str((deploy.get("ssh") or {}).get("host") or "")
|
|
369
|
+
where = "this machine" if method == "local" or not ssh_host else ssh_host
|
|
370
|
+
label = f"{server} ({where})" if server else where
|
|
371
|
+
if cluster:
|
|
372
|
+
label = f"cluster {cluster} (master {label})"
|
|
373
|
+
return {"server": server or None, "cluster": cluster or None, "method": method, "host": ssh_host or None,
|
|
374
|
+
"label": label, "endpoint": spec.get("endpoint")}
|
|
375
|
+
|
|
376
|
+
|
|
377
|
+
def control_url(spec: Dict[str, Any], record: Optional[Dict[str, Any]] = None) -> str:
|
|
378
|
+
"""Loopback for a host on this machine, otherwise the advertised endpoint."""
|
|
379
|
+
from ..runtime.onprem_host import health_url
|
|
380
|
+
|
|
381
|
+
method = str((spec.get("deploy") or {}).get("method") or "local")
|
|
382
|
+
if method == "local":
|
|
383
|
+
return health_url(spec)[: -len("/__pskit/health")]
|
|
384
|
+
endpoint = spec.get("endpoint") or (record or {}).get("endpoint")
|
|
385
|
+
if not endpoint:
|
|
386
|
+
return health_url(spec)[: -len("/__pskit/health")]
|
|
387
|
+
return str(endpoint).rstrip("/")
|
|
388
|
+
|
|
389
|
+
|
|
390
|
+
def _spec_ssh(spec: Dict[str, Any]) -> Tuple[Optional[Dict[str, Any]], str]:
|
|
391
|
+
"""The SSH login and remote folder of a host deployed over SSH (also docker on an SSH host)."""
|
|
392
|
+
deploy = spec.get("deploy") or {}
|
|
393
|
+
ssh = deploy.get("ssh") or {}
|
|
394
|
+
if str(deploy.get("method") or "local") == "local" or not ssh.get("host") or not ssh.get("user"):
|
|
395
|
+
return None, ""
|
|
396
|
+
return dict(ssh), str(ssh.get("path") or "")
|
|
397
|
+
|
|
398
|
+
|
|
399
|
+
def control_for_group(record: Dict[str, Any], root: Path, group: str) -> Optional[HostControl]:
|
|
400
|
+
"""A client for the host of placement group ``group`` (``provider.options.placement``): each server answers
|
|
401
|
+
only the routes of its own functions. None when the group is the default one (use ``control_for``) or its
|
|
402
|
+
spec is not here."""
|
|
403
|
+
from .onprem_placement import app_dir
|
|
404
|
+
|
|
405
|
+
main = host_spec(record, root) or {}
|
|
406
|
+
default = str(main.get("default_group") or "")
|
|
407
|
+
if not group or not default or group == default:
|
|
408
|
+
return None
|
|
409
|
+
try:
|
|
410
|
+
spec = json.loads((Path(root) / WORK_DIR / record_key(record) / app_dir(group, default) / "pskit_host.json")
|
|
411
|
+
.read_text("utf-8"))
|
|
412
|
+
except (OSError, ValueError):
|
|
413
|
+
return None
|
|
414
|
+
if not isinstance(spec, dict) or not spec.get("endpoint"):
|
|
415
|
+
return None
|
|
416
|
+
ssh, remote_path = _spec_ssh(spec)
|
|
417
|
+
port = int(spec.get("port") or 8080)
|
|
418
|
+
return HostControl(str(spec["endpoint"]), token=str(spec.get("admin_token") or ""), ssh=ssh, remote_port=port,
|
|
419
|
+
remote_path=remote_path)
|
|
420
|
+
|
|
421
|
+
|
|
422
|
+
def control_for(record: Dict[str, Any], root: Path, server: Optional[str] = None) -> Optional[HostControl]:
|
|
423
|
+
"""A client for the deployment's host, or None when it is not an on-prem deployment.
|
|
424
|
+
|
|
425
|
+
Without ``server`` this is the host of the last successful deploy (its saved server, SSH host or this
|
|
426
|
+
machine), even after ``package`` / ``plan`` re-rendered the spec for another target. ``server`` (or
|
|
427
|
+
``PSKIT_DEPLOY_SERVER``, set by ``--server``) picks the host on that saved SSH server instead: the same
|
|
428
|
+
project deployed to several machines. ``local`` picks this machine. A host whose port cannot be reached
|
|
429
|
+
from here is called over SSH.
|
|
430
|
+
"""
|
|
431
|
+
import os
|
|
432
|
+
|
|
433
|
+
if record.get("provider") != "onprem":
|
|
434
|
+
return None
|
|
435
|
+
from .onprem_servers import SERVER_ENV, get_server
|
|
436
|
+
|
|
437
|
+
spec = host_spec(record, root)
|
|
438
|
+
deployed = deployed_host(root, str(record.get("stage") or ""), record)
|
|
439
|
+
token = str((spec or {}).get("admin_token") or "")
|
|
440
|
+
port = int((spec or {}).get("port") or 8080)
|
|
441
|
+
name = server or os.environ.get(SERVER_ENV) or None
|
|
442
|
+
if name == LOCAL:
|
|
443
|
+
from ..runtime.onprem_host import health_url
|
|
444
|
+
|
|
445
|
+
return HostControl(health_url({**(spec or {}), "host": "127.0.0.1"})[: -len("/__pskit/health")], token=token)
|
|
446
|
+
if name and name != (deployed or {}).get("server"):
|
|
447
|
+
from .onprem_servers import server_target
|
|
448
|
+
from .onprem_services import ssh_options
|
|
449
|
+
|
|
450
|
+
item = get_server(root, name) # ServerError (a ValueError) for an unknown name
|
|
451
|
+
_ssh, remote_path = _spec_ssh(spec or {})
|
|
452
|
+
return HostControl(f"http://{item['host']}:{port}", token=token, ssh=ssh_options(server_target(root, name)),
|
|
453
|
+
remote_port=port, remote_path=remote_path, server=name)
|
|
454
|
+
if spec is None:
|
|
455
|
+
endpoint = record.get("endpoint")
|
|
456
|
+
if not endpoint:
|
|
457
|
+
return None
|
|
458
|
+
return HostControl(str(endpoint))
|
|
459
|
+
ssh, remote_path = _spec_ssh(spec)
|
|
460
|
+
return HostControl(control_url(spec, record), token=token, ssh=ssh, remote_port=port, remote_path=remote_path,
|
|
461
|
+
server=(deployed or {}).get("server") or None)
|
|
@@ -618,14 +618,19 @@ def send(
|
|
|
618
618
|
body = (payload if isinstance(payload, str) else _dumps(payload)).encode() if has_body else None
|
|
619
619
|
headers = {"content-type": "application/json"} if body else {}
|
|
620
620
|
if provider == "onprem":
|
|
621
|
-
from .onprem_control import control_for
|
|
621
|
+
from .onprem_control import control_for, control_for_group
|
|
622
622
|
|
|
623
623
|
# The host of the last deploy (or --server), not the URL in the record: package / plan may have
|
|
624
|
-
# re-rendered it for another machine, and a closed port is reached over SSH.
|
|
625
|
-
|
|
624
|
+
# re-rendered it for another machine, and a closed port is reached over SSH. With placement, the
|
|
625
|
+
# host of the function's group: a server answers only the routes of its own functions.
|
|
626
|
+
group_control = control_for_group(record or {}, project.root, str(fn_rec.get("group") or ""))
|
|
627
|
+
control = group_control or control_for(record or {}, project.root)
|
|
626
628
|
if control is not None:
|
|
627
629
|
endpoint = str((record or {}).get("endpoint") or "").rstrip("/")
|
|
628
|
-
|
|
630
|
+
if group_control is not None:
|
|
631
|
+
route = path or trig["path"]
|
|
632
|
+
else:
|
|
633
|
+
route = url[len(endpoint):] if endpoint and url.startswith(endpoint) else (path or trig["path"])
|
|
629
634
|
route = route if route.startswith("/") else "/" + route
|
|
630
635
|
return {"kind": "http", "url": control.base_url + route,
|
|
631
636
|
**_host_http(control, trig["method"], route, body, headers)}
|
|
@@ -646,6 +651,11 @@ def send(
|
|
|
646
651
|
except TriggerError:
|
|
647
652
|
raise
|
|
648
653
|
except Exception as exc: # noqa: BLE001 - credentials, permissions, missing resources: report them
|
|
654
|
+
from .onprem_control import FunctionFailed
|
|
655
|
+
|
|
656
|
+
if isinstance(exc, FunctionFailed):
|
|
657
|
+
raise TriggerError(f"{function} raised {exc.error_type}: {exc.cause} (the host is up; the error is in the"
|
|
658
|
+
f" function's code, see pskit logs -f {function})") from None
|
|
649
659
|
raise TriggerError(f"{type(exc).__name__}: {exc}") from None
|
|
650
660
|
return {"kind": trig["type"], "summary": trig["summary"], **out}
|
|
651
661
|
|
|
@@ -2202,8 +2202,12 @@ class Host:
|
|
|
2202
2202
|
data = json.loads(raw.decode("utf-8")) if raw else None
|
|
2203
2203
|
except ValueError:
|
|
2204
2204
|
data = raw.decode("utf-8", "replace")
|
|
2205
|
+
kind = EventType.INVOKE
|
|
2206
|
+
if isinstance(data, dict) and data.get("__pskit") in (EventType.INVOKE, EventType.SCHEDULE):
|
|
2207
|
+
# pskit trigger / the studio's Test send {"__pskit": kind, "data": ...}: the function gets data.
|
|
2208
|
+
kind, data = data["__pskit"], data.get("data")
|
|
2205
2209
|
try:
|
|
2206
|
-
result = host.invoke(function, Event(type=
|
|
2210
|
+
result = host.invoke(function, Event(type=kind, data=data, source="onprem.invoke"))
|
|
2207
2211
|
except KeyError as exc:
|
|
2208
2212
|
return self._json(404, {"error": str(exc)})
|
|
2209
2213
|
except Exception as exc: # noqa: BLE001
|
py_serverless_kit/studio/meta.py
CHANGED
|
@@ -388,7 +388,11 @@ HANDLER_TEMPLATES: Dict[str, str] = {
|
|
|
388
388
|
"http": '''
|
|
389
389
|
|
|
390
390
|
def {func}(event: Event, ctx: Context):
|
|
391
|
-
"""HTTP handler: event.http has method, path, query, path_params, headers and json().
|
|
391
|
+
"""HTTP handler: event.http has method, path, query, path_params, headers and json().
|
|
392
|
+
|
|
393
|
+
Also called from a workflow step or invoke(): then event.http is None and event.data is the input."""
|
|
394
|
+
if event.http is None:
|
|
395
|
+
return {{"message": "Hello, world!", "input": event.data}}
|
|
392
396
|
name = event.http.query.get("name", "world")
|
|
393
397
|
return {{"message": f"Hello, {{name}}!"}}
|
|
394
398
|
''',
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.5
|
|
2
2
|
Name: py-serverless-kit
|
|
3
|
-
Version: 2.3.
|
|
3
|
+
Version: 2.3.3
|
|
4
4
|
Summary: Write a Python serverless function once and deploy it to AWS, Azure, GCP, 7 more clouds, or an on-premises host with one YAML file, powered by Terraform.
|
|
5
5
|
Project-URL: Homepage, https://github.com/ak9347128658/serverless_kit
|
|
6
6
|
Project-URL: Documentation, https://github.com/ak9347128658/serverless_kit/tree/main/docs
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
py_serverless_kit/__init__.py,sha256=S-Cyucn4rdyF0CTv274nSk22vJ6w8PR2yzczIsYUJ_8,1452
|
|
2
2
|
py_serverless_kit/__main__.py,sha256=efQ6c0zP-ZF8iu2fR2QkuX5LVQTXyn3O-xZlq7cKX5A,38
|
|
3
|
-
py_serverless_kit/_version.py,sha256=
|
|
3
|
+
py_serverless_kit/_version.py,sha256=qBzYFOGddEfQhpo03NIVhsH1GLaiqVeELvIwD86rs-0,59
|
|
4
4
|
py_serverless_kit/client.py,sha256=mcphnzVZ3jGoFBgv9cU3A5GEav2YBF6MrqRZiD9hQPE,13747
|
|
5
5
|
py_serverless_kit/cli/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
6
6
|
py_serverless_kit/cli/main.py,sha256=rvmj20DvkQ7eDSYD4_XwuT5BkBo_NPR0FRWTFM6GVKs,141857
|
|
@@ -23,7 +23,7 @@ py_serverless_kit/core/onprem_clients.py,sha256=yKVaSHtyBUGMCCgHCDp8ygSbJLHmQGpa
|
|
|
23
23
|
py_serverless_kit/core/onprem_cluster.py,sha256=2drUkiURsXFaYmqBT0Yv1301gkPezdN4iOeWazIwNZo,83429
|
|
24
24
|
py_serverless_kit/core/onprem_cluster_scripts.py,sha256=DA1rr-5ZVmpMazV9DuifaaCFltUQu0rsEFmCtEO6WrA,36764
|
|
25
25
|
py_serverless_kit/core/onprem_console.py,sha256=RYsx8BOEQIFxJm6Ci9b2TJ12t5gLW4A68Nhw7BYMCCA,16813
|
|
26
|
-
py_serverless_kit/core/onprem_control.py,sha256=
|
|
26
|
+
py_serverless_kit/core/onprem_control.py,sha256=PQX5VocUzecTJh4_HTBbipl2m46qZ5vo-y5H9nJoIcA,20800
|
|
27
27
|
py_serverless_kit/core/onprem_lb.py,sha256=U27qX7YR3h15w9RvsEZn1S0IphJSwzVJmPhy0BDaQwU,29110
|
|
28
28
|
py_serverless_kit/core/onprem_network.py,sha256=gP0EdVI6-XEVPsvfQHeT9Co33kDa79K9CINj66MbJ9M,22442
|
|
29
29
|
py_serverless_kit/core/onprem_placement.py,sha256=RPpJfTp8xB5a6BKvauk6y37woKUW0OvnNKEZ-ZPG7o0,17289
|
|
@@ -41,7 +41,7 @@ py_serverless_kit/core/resource_usage.py,sha256=Qc_Ig69w0tEXkfIA6TxLsIA8tNzeCAoi
|
|
|
41
41
|
py_serverless_kit/core/retain.py,sha256=Tjhtsgfod2IPCglPLNhWZLCH6jY76NmMbFeEi-eKYYI,8175
|
|
42
42
|
py_serverless_kit/core/settings_bundle.py,sha256=qt7bKNiNxfhsJrarAUHFzLGQAauH4z5bAHCe6ha0iMU,19260
|
|
43
43
|
py_serverless_kit/core/setup_check.py,sha256=9pg99p_R-iLBn066icYatKihHNbMSH23s6ZAWO3EhxY,40853
|
|
44
|
-
py_serverless_kit/core/testing.py,sha256=
|
|
44
|
+
py_serverless_kit/core/testing.py,sha256=Qg8X_1hCAnUYYw3cRoDDQ9IrUpxaRttis_J2JJSwznk,47819
|
|
45
45
|
py_serverless_kit/core/onprem_templates/kafka_queue.py.txt,sha256=KcnG95vLm0UDINapShNTsLsgsPUG4-pqQ-X2hasvphg,4212
|
|
46
46
|
py_serverless_kit/core/onprem_templates/nats_queue.py.txt,sha256=pmeuI5l3onupSasaJWMb_GTpoQ7bfW-C_bLZ7jjeIFE,5469
|
|
47
47
|
py_serverless_kit/core/onprem_templates/rabbitmq_queue.py.txt,sha256=A9B1cxmVZ0980vejKkjl5PY-F1Ep3RlqZCxfyaO8rbg,4644
|
|
@@ -89,7 +89,7 @@ py_serverless_kit/runtime/invoke.py,sha256=bDAkAUuXA4DPi_vltwVm-l2xIyahai0Xw853x
|
|
|
89
89
|
py_serverless_kit/runtime/log.py,sha256=t1pv2gFquyMoDCPVTJdrXgmv8iI6r0QbWCKNSNSkWoI,2874
|
|
90
90
|
py_serverless_kit/runtime/manifest.py,sha256=ZEYqytO1eay2kOFfdl1lgLGDqLnMteMJm6ZdzO_aG04,4126
|
|
91
91
|
py_serverless_kit/runtime/node_worker.py,sha256=zoDbNRJ3hdgSNXYXJv4azfdgyWISrYtRkaoItv0bgmM,11209
|
|
92
|
-
py_serverless_kit/runtime/onprem_host.py,sha256=
|
|
92
|
+
py_serverless_kit/runtime/onprem_host.py,sha256=bvjVivZFeqNMT9k6yfhd5avjuUxbz3cs2VTtn8CVWEg,133882
|
|
93
93
|
py_serverless_kit/runtime/peers.py,sha256=R2c_rMo6ssF3OJobJYwWdvsXJV2cdigyHZhNFlCMhQM,12164
|
|
94
94
|
py_serverless_kit/runtime/resources.py,sha256=bEtpeAbjRWDxlA1hF4IPKNwTGW8yVwpPCM-6O62bxsI,3853
|
|
95
95
|
py_serverless_kit/runtime/response.py,sha256=uybQq5Bdfxndx3iI0yd6uaVcC9Xjg9Lx50k8wrTX61U,6582
|
|
@@ -135,7 +135,7 @@ py_serverless_kit/runtime_js/invoke.js,sha256=DHA8vtnzWvP_G49GWT6TCljcUUg0aSOmAE
|
|
|
135
135
|
py_serverless_kit/runtime_js/log.js,sha256=VLPNXkumduA1zaG4gsKLBORVlI-wlOtIdSB00p-K0n4,5114
|
|
136
136
|
py_serverless_kit/runtime_js/manifest.js,sha256=4P_NS3yFc9gn-TTEd2wwhKRqDwXDW4YDaw8ETHIUzFA,4578
|
|
137
137
|
py_serverless_kit/runtime_js/onprem.js,sha256=PWuQz6xU_boUzrJ75fi00kwkr4IeaIhBHnchDqndmiE,2798
|
|
138
|
-
py_serverless_kit/runtime_js/package.json,sha256=
|
|
138
|
+
py_serverless_kit/runtime_js/package.json,sha256=2bHHkobkR3UGty0VIcAKdO6ISnKZ3pnk8wtF9mvObvw,284
|
|
139
139
|
py_serverless_kit/runtime_js/resources.js,sha256=vqRjf4LhXYTiVMsOBA6SXnBhOvMwhrS2q38i5LqKeP8,3297
|
|
140
140
|
py_serverless_kit/runtime_js/response.js,sha256=RagfQCspN3jdtyvOKt2F52Rwq8FBT4k_0OKWQYH6Wu4,5800
|
|
141
141
|
py_serverless_kit/runtime_js/routing.js,sha256=IM8zv0SIYU-d2lXZiup3KPL4Wfqtcec9PEdpSOwKSp4,2084
|
|
@@ -161,7 +161,7 @@ py_serverless_kit/studio/discover.py,sha256=Jp6n3ovnIeWBY8g_dZdyuSu0LdHv3mU-tzA_
|
|
|
161
161
|
py_serverless_kit/studio/files.py,sha256=WWrw8s4lcuqRKc7MBdKvE2r82ynr0TVqc0h0758r6TU,5042
|
|
162
162
|
py_serverless_kit/studio/guides.py,sha256=3uf610asllhGC3ZNSLECkfYCTf7_jq9Nj1XYo-jrpP4,2634
|
|
163
163
|
py_serverless_kit/studio/jobs.py,sha256=Emi2utNLA0uQjm8aHKx_8SLczwmyBtumALJvIu_1PcU,15345
|
|
164
|
-
py_serverless_kit/studio/meta.py,sha256=
|
|
164
|
+
py_serverless_kit/studio/meta.py,sha256=SD-8ce9UvBvkEz3WiIpC03wUxVpWJp_N1LXqq2-80eI,26356
|
|
165
165
|
py_serverless_kit/studio/node_stubs.py,sha256=TDGwRF2WSDbfVsqi-6Qa6lTFGaqvNfGIF3CYJ7rmwPI,7139
|
|
166
166
|
py_serverless_kit/studio/project.py,sha256=LJYOyRwp4M9oLBI75e-FTqFrt_NfUak-WYbrnAa8IYQ,16748
|
|
167
167
|
py_serverless_kit/studio/server.py,sha256=FxD4FP3m7P3nV7ZSNiPVMx73csHV-321hBdFB5Ipk5w,48730
|
|
@@ -275,8 +275,8 @@ py_serverless_kit/studio/guides/tencent/database.md,sha256=i-ru3zul8msV8Ad2lZyOn
|
|
|
275
275
|
py_serverless_kit/studio/guides/tencent/queue.md,sha256=Mn3P_E2i-ubCZL17V2vtAJXKsX6yZsI0Rv3seP6T-Mo,3556
|
|
276
276
|
py_serverless_kit/studio/guides/tencent/storage.md,sha256=_JarrP9lnwP2TGc7UlWgQ17BbR7-X4A7ERP-W3oeowQ,4074
|
|
277
277
|
py_serverless_kit/studio/guides/tencent/topic.md,sha256=ZSQ4JhOFLa_MgSoQBT0b0MryFXiJn9YWoeUidluhlYo,3354
|
|
278
|
-
py_serverless_kit-2.3.
|
|
279
|
-
py_serverless_kit-2.3.
|
|
280
|
-
py_serverless_kit-2.3.
|
|
281
|
-
py_serverless_kit-2.3.
|
|
282
|
-
py_serverless_kit-2.3.
|
|
278
|
+
py_serverless_kit-2.3.3.dist-info/METADATA,sha256=bH6eXIdBPEXKNxr5BQmTLouhiWCkPzLYKVhYtJLxkhg,21451
|
|
279
|
+
py_serverless_kit-2.3.3.dist-info/WHEEL,sha256=W3fkpkm7-wf9vBI5Z-7s0eWkeM-spu78I8Neb98DeEg,87
|
|
280
|
+
py_serverless_kit-2.3.3.dist-info/entry_points.txt,sha256=I-fW8cddXp3EkwMyijn1KuLGZ0MungQBPpjJ5Ey7xuY,110
|
|
281
|
+
py_serverless_kit-2.3.3.dist-info/licenses/LICENSE,sha256=GhfSg8Bmq_7wlksflc7XI72zY2Z03FPpPa0GUUHz-8s,1099
|
|
282
|
+
py_serverless_kit-2.3.3.dist-info/RECORD,,
|
|
File without changes
|
|
File without changes
|
|
File without changes
|