lazycloud-shared 0.0.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.
Files changed (126) hide show
  1. lazycloud_shared-0.0.0.dist-info/METADATA +8 -0
  2. lazycloud_shared-0.0.0.dist-info/RECORD +126 -0
  3. lazycloud_shared-0.0.0.dist-info/WHEEL +5 -0
  4. lazycloud_shared-0.0.0.dist-info/top_level.txt +1 -0
  5. shared/__init__.py +1 -0
  6. shared/app_identity.py +132 -0
  7. shared/app_lifecycle.py +43 -0
  8. shared/app_slug.py +44 -0
  9. shared/autoscaler_state.py +52 -0
  10. shared/autoscaling.py +371 -0
  11. shared/aws_connections.py +584 -0
  12. shared/billing_accounts.py +101 -0
  13. shared/billing_plans.py +22 -0
  14. shared/billing_quotes.py +469 -0
  15. shared/billing_rate_card.py +620 -0
  16. shared/bytes_transport.py +38 -0
  17. shared/cache_records.py +19 -0
  18. shared/callbacks.py +33 -0
  19. shared/capacity.py +237 -0
  20. shared/checkpoints.py +76 -0
  21. shared/compute_enrollment.py +156 -0
  22. shared/compute_fleet.py +89 -0
  23. shared/compute_policy.py +255 -0
  24. shared/container_requests.py +410 -0
  25. shared/containers.py +82 -0
  26. shared/contracts.py +8 -0
  27. shared/cron.py +95 -0
  28. shared/custom_domains.py +149 -0
  29. shared/deployment_records.py +450 -0
  30. shared/deployment_settings.py +25 -0
  31. shared/deployment_subdomains.py +100 -0
  32. shared/deployments.py +23 -0
  33. shared/enums.py +12 -0
  34. shared/env.py +167 -0
  35. shared/errors.py +69 -0
  36. shared/events.py +29 -0
  37. shared/external_identity.py +47 -0
  38. shared/function_payloads.py +220 -0
  39. shared/gpu.py +256 -0
  40. shared/http/__init__.py +1 -0
  41. shared/http/apps.py +87 -0
  42. shared/http/artifacts.py +78 -0
  43. shared/http/aws_connections.py +133 -0
  44. shared/http/base.py +16 -0
  45. shared/http/billing.py +187 -0
  46. shared/http/callbacks.py +23 -0
  47. shared/http/client_manifests.py +128 -0
  48. shared/http/collections.py +109 -0
  49. shared/http/compute.py +378 -0
  50. shared/http/compute_policy.py +163 -0
  51. shared/http/concurrency.py +53 -0
  52. shared/http/custom_domains.py +66 -0
  53. shared/http/deployments.py +118 -0
  54. shared/http/device_auth.py +57 -0
  55. shared/http/endpoint_forwarding.py +277 -0
  56. shared/http/endpoints.py +68 -0
  57. shared/http/errors.py +84 -0
  58. shared/http/functions.py +166 -0
  59. shared/http/gateway.py +333 -0
  60. shared/http/gateway_tasks.py +55 -0
  61. shared/http/images.py +79 -0
  62. shared/http/objects.py +96 -0
  63. shared/http/observability.py +376 -0
  64. shared/http/operations.py +210 -0
  65. shared/http/pods.py +331 -0
  66. shared/http/pricing.py +147 -0
  67. shared/http/provider_nodes.py +106 -0
  68. shared/http/secrets.py +128 -0
  69. shared/http/shells.py +78 -0
  70. shared/http/source_cache_cleanup.py +23 -0
  71. shared/http/storage.py +90 -0
  72. shared/http/stubs.py +170 -0
  73. shared/http/system.py +154 -0
  74. shared/http/task_payload.py +74 -0
  75. shared/http/tasks.py +141 -0
  76. shared/http/usage.py +214 -0
  77. shared/http/users.py +117 -0
  78. shared/http/volumes.py +250 -0
  79. shared/http/workspace_changes.py +86 -0
  80. shared/http/workspaces.py +169 -0
  81. shared/http_headers.py +61 -0
  82. shared/http_transport.py +203 -0
  83. shared/identity.py +311 -0
  84. shared/image_building/__init__.py +23 -0
  85. shared/image_building/authoring.py +62 -0
  86. shared/image_building/constants.py +31 -0
  87. shared/image_building/context.py +52 -0
  88. shared/image_building/credentials.py +245 -0
  89. shared/image_building/planning.py +15 -0
  90. shared/image_building/records.py +85 -0
  91. shared/image_building/requirements.py +49 -0
  92. shared/lifecycle.py +104 -0
  93. shared/logs.py +35 -0
  94. shared/managed_runtime_integrity.py +112 -0
  95. shared/mounts.py +66 -0
  96. shared/objects.py +41 -0
  97. shared/paths.py +19 -0
  98. shared/payments.py +431 -0
  99. shared/process_liveness.py +88 -0
  100. shared/provider_config.py +27 -0
  101. shared/py.typed +1 -0
  102. shared/queue_messages.py +21 -0
  103. shared/realtime/__init__.py +1 -0
  104. shared/realtime/contracts.py +302 -0
  105. shared/realtime/streams.py +768 -0
  106. shared/resources.py +26 -0
  107. shared/routing.py +96 -0
  108. shared/runtime_paths.py +15 -0
  109. shared/scheduling.py +391 -0
  110. shared/secrets.py +22 -0
  111. shared/serialization.py +183 -0
  112. shared/shell_protocol.py +121 -0
  113. shared/signals.py +228 -0
  114. shared/source_cache_cleanup.py +146 -0
  115. shared/task_context.py +71 -0
  116. shared/tasks.py +290 -0
  117. shared/timestamps.py +20 -0
  118. shared/transport_retry.py +126 -0
  119. shared/urls.py +198 -0
  120. shared/usage.py +163 -0
  121. shared/usage_query.py +19 -0
  122. shared/volumes.py +14 -0
  123. shared/worker_events.py +59 -0
  124. shared/workload_config.py +310 -0
  125. shared/workload_keys.py +22 -0
  126. shared/workspace_storage.py +89 -0
@@ -0,0 +1,8 @@
1
+ Metadata-Version: 2.4
2
+ Name: lazycloud-shared
3
+ Version: 0.0.0
4
+ Summary: Boundary-safe shared primitives and HTTP payloads for the compute platform.
5
+ Requires-Python: >=3.10
6
+ Requires-Dist: certifi>=2025.1.31
7
+ Requires-Dist: croniter>=6.2.4
8
+ Requires-Dist: pydantic<3,>=2.8
@@ -0,0 +1,126 @@
1
+ shared/__init__.py,sha256=kKDUnghi3XUPIATQle0obOsNlzlfOOFL0P8Efg4TxpE,77
2
+ shared/app_identity.py,sha256=hZF37GQffNJxS8VUGXl5WNcvQd4nYRPk2QTgWF_HMaU,4485
3
+ shared/app_lifecycle.py,sha256=JuhIF_-gd6IDudaqV5EDpYGFGt4Q4wv94y9WeXZ-EPo,850
4
+ shared/app_slug.py,sha256=YZ0GlbGYH1Xy_IpSngF02mDHmSqPn3nBAWmVT4x_2yA,1193
5
+ shared/autoscaler_state.py,sha256=cJ929AnMsfTkkJkYgCHHvRO002QA7Dp4N7kPR4ydwp8,1329
6
+ shared/autoscaling.py,sha256=Ea-AetNeSvr-PbM-3BzaFV1-qeKLnFaOzyTmyC-EaEI,12582
7
+ shared/aws_connections.py,sha256=uZpAJ92BEeYuJC2HMulgnRBHitfkEGnUGCgvW8bbAJQ,27156
8
+ shared/billing_accounts.py,sha256=qTQ8zCrh3cozs0WqmFPvBSxi14ZIU4BzZDF8OTP25b4,4412
9
+ shared/billing_plans.py,sha256=xVyPcbiQnln9tcBrM6Jw15QYCK5-RBvRaFV2i_ulHJ8,603
10
+ shared/billing_quotes.py,sha256=XyE-D-lcB1tGrjd8MXXml6PYZV50CH45K8O8zMXzaDg,16843
11
+ shared/billing_rate_card.py,sha256=fQiSMFa4-dpV3TqxdNlazCPiAaMJd4ohhS1DbrmI3TM,25264
12
+ shared/bytes_transport.py,sha256=_PaBbxEOB-XF2vTAQXvfUkMQs2Ftlg4ju71NXxyhor4,861
13
+ shared/cache_records.py,sha256=kP9t-CE4ZX-y2O1v5mryyJa1-Ft8XHVWbXGXwKplMMQ,476
14
+ shared/callbacks.py,sha256=Gt_N45fl7zb666kbD3wmsnuonjRTtvsQlO6-DOFRVMA,1001
15
+ shared/capacity.py,sha256=F-BvrVuQw3bCWjXof6JaBHitCagxjDdbyNCyT86qpSg,8794
16
+ shared/checkpoints.py,sha256=DvzO95SR3GUWwoGDzzqgY_N-amj7O9DOhV3lNyjXXvk,2076
17
+ shared/compute_enrollment.py,sha256=Gw_37Bc4vulkOW_hLnSI2zLsSsWr7UEjtIeRRnDR3_8,4262
18
+ shared/compute_fleet.py,sha256=5X0jwvKN0W4vOvw29e8cv9OKFcEWiNpuUwY4VaThtwg,2581
19
+ shared/compute_policy.py,sha256=f3QpzJIJPD5y1PABR8ojxUJIgqK4uLSTbyRACrZ4K2k,11564
20
+ shared/container_requests.py,sha256=Xdt9g5AES4yhXrosj521OKessBxr0PwNjw7MumYGOx8,15997
21
+ shared/containers.py,sha256=xm5E2PaaD4sx0L4hh-FlzPY-SPBrFROojPHDTmUfm2U,2693
22
+ shared/contracts.py,sha256=bpbnQJxn3Yy1PbSpYla6G2eTq7RgEaF21QSBjUZ3j-o,179
23
+ shared/cron.py,sha256=83D2tmOMxajMuYofOTcZnMzG-uXBH5QuB1EE1BJMJGM,2845
24
+ shared/custom_domains.py,sha256=Y5sOXp-E8AAJDuAChhgNgcyDhZ4dlNCvgBXVSYNDKE8,5468
25
+ shared/deployment_records.py,sha256=MSOC-HG2LmbV7E2T8zV44gBbXzIlGRpamV1-TGe4U7I,17060
26
+ shared/deployment_settings.py,sha256=2Us-nZR-CbPsLgutDhWl8VFvjFPDGQjzoOX5YUL8WoU,1064
27
+ shared/deployment_subdomains.py,sha256=wWSUSVo59cWCIHgUKFxwC13xgMU6Bm-sCuwZARrYlvs,3922
28
+ shared/deployments.py,sha256=jDicoYySDK5s0u4883cH2lMm5eCfT0JVpI1LBHLPLTk,433
29
+ shared/enums.py,sha256=IHJi97VHgrV4Oj2DsO-3Yg-VQqVA32A3-_QpVt8Gq-k,215
30
+ shared/env.py,sha256=YwzykbVppqODUeQZzWSALAogVg4LA_wldOsk-NnvcAs,5477
31
+ shared/errors.py,sha256=YaON9DLGFCd-u03b5dkYSoVmwtyzGKfyaWncdVqX3hc,1999
32
+ shared/events.py,sha256=FmFiPIVp_32KEFAwN3wL2o4hwiT8tV2ln_dsIEUvAxI,631
33
+ shared/external_identity.py,sha256=kpVqPXUSPBvX9qNjeaTxo6hZ_FYJsIpPr58Vbfd8ZpI,1736
34
+ shared/function_payloads.py,sha256=EWbK9_jU9__dOMsAV7Hl8tRps-M1hoBZqY62ZyG0Tig,7489
35
+ shared/gpu.py,sha256=r50INDwOQekhd9FysDRAf8p6cKuZnSRziBDtb3Xtemo,8227
36
+ shared/http_headers.py,sha256=TAKIypZFvFO4pqcoxkqyPETK8rhy_reHfj_C5iEFTFY,1964
37
+ shared/http_transport.py,sha256=q5iqzDUkTx9vNEMoNixRaGFfKuJccbuiPzPqilh5PG4,6326
38
+ shared/identity.py,sha256=1xbkN4r2kmmponR1MUAn8P9gGLtGVIWOunkx-jZ6wPM,9071
39
+ shared/lifecycle.py,sha256=MhKHfpd7pkgXBaLvmEHnFPs39b3UqPuj3eVQvT_mAGM,3389
40
+ shared/logs.py,sha256=k1-koZnFQ74Keu9nne-5rSPfF9MC7QXrD-HDs8ZcT98,944
41
+ shared/managed_runtime_integrity.py,sha256=-hY6OcAnYLqScwX4v_2AaCWjWFunKaGvstZ64Zp4cYo,3328
42
+ shared/mounts.py,sha256=uWTkASpRd2bk_rVwxqtd-OpTGN9ZakSoPug-_M7jFww,1933
43
+ shared/objects.py,sha256=NmJ_bhhNDDE7bj1EVHPUvk7A0ZOxUqe1fgJ80jAxmNU,1150
44
+ shared/paths.py,sha256=LiFCHohIx9dRPxYqbvkmlMlHbhFnNCDqRwWyqLLxFpk,507
45
+ shared/payments.py,sha256=RxmK6KDUQTCwuyAivQjFOJ42PfMx3BWyFohPlOb7WnY,19094
46
+ shared/process_liveness.py,sha256=m7_jHMfVhcxI5VgUrYpqRJ4-CNxPLMwq-wPtkobx6P8,2849
47
+ shared/provider_config.py,sha256=MyhcI-p4COF14m7Cai6gzkVWOhI46Rykjg5T9LhN9JA,700
48
+ shared/py.typed,sha256=AbpHGcgLb-kRsJGnwFEktk7uzpZOCcBY74-YBdrKVGs,1
49
+ shared/queue_messages.py,sha256=ux-407dOW9Z0tqLwUkZURpKC4HxZU3wBIDd8_6Awpb4,569
50
+ shared/resources.py,sha256=oa4bAQvWIzc-q4966iiOW7Q8fgf8EJ0-S_NrfrV4QhY,784
51
+ shared/routing.py,sha256=MCjrdiuzlZhr3aajkprFFcihZStNaFWxQlBgZakm4bk,2445
52
+ shared/runtime_paths.py,sha256=eyMZrg9noO9a37i1wvBakejgB3-Wvd9IbVwq9xlQAbg,369
53
+ shared/scheduling.py,sha256=GMkm01wi40DhnfoEukBjaO_saHSynLAvawm53QzQX1Q,12613
54
+ shared/secrets.py,sha256=VU5NiNpizdpPATphjgsqbxmYzirxaM_fmTuj3B_Yjd8,552
55
+ shared/serialization.py,sha256=Iq9muTemq8XdcRRVfxgOnEFyKEG4WQxWCNLi49AQ86Q,6357
56
+ shared/shell_protocol.py,sha256=84zbks7tAQ26DdED1loj-R_51j082w6KkM7b2wze0Qk,3606
57
+ shared/signals.py,sha256=UFgu1qut0scjtWfXRWkvO0yzlJGnWRYGvCOawabVBrw,6215
58
+ shared/source_cache_cleanup.py,sha256=y8LwABTIsA6gOk6ZLyuckcPAjJCd48lTIHRh_mppapM,4634
59
+ shared/task_context.py,sha256=yCM42ltgklV4rUjjopboQ8h5EHs1gzq5KHJvaUtEq-8,2539
60
+ shared/tasks.py,sha256=eeff1-tl8C7hltVj-vOqIujKW0sJgzZbUP9qbqpIl-w,8632
61
+ shared/timestamps.py,sha256=ha3gHn1OiJ72rEZdYs9wrBdMq47UBwJNhktxcB2w7hg,639
62
+ shared/transport_retry.py,sha256=eUc3V9ynwpxVGwr9qy0AD8mL-ZsX-D5ndMdv7GikCzI,4142
63
+ shared/urls.py,sha256=zCbFWbIxn6Z329E3AyuXvWUV8Q5SUdhMA9LAOS6mTDM,7537
64
+ shared/usage.py,sha256=trkT2B3xDYnXac871yt557VA05XQHPuAsuIFXRCj8qI,6221
65
+ shared/usage_query.py,sha256=zuj0FG-TyptX_duM1lTdI23MaXX2OwHxU-xjW5_qUWc,450
66
+ shared/volumes.py,sha256=k7ZGVJUMbc2jYAoaOtu1ZoXksdrd6OYr0MN3JjpKtAY,297
67
+ shared/worker_events.py,sha256=Aaf3LIrk3Ns0Mll8GID69bEhdegTOb_Q64jz0E8vw4Q,1878
68
+ shared/workload_config.py,sha256=0NdtQT-YC3PXcWGnRLm7N8iHfS1rCrj5cFUwPYCOxKc,12046
69
+ shared/workload_keys.py,sha256=CpWC3mNbZBvxyerLkXmzL6MY1SYc2SjECxRtRXNgsVI,945
70
+ shared/workspace_storage.py,sha256=DNNytFaG_29fqfnyHLlde-8qdhY1EgVk-v-1U7AMoH4,3508
71
+ shared/http/__init__.py,sha256=rL4jfmBThSdygQbABEVtF6sienPE4r5T5jV6nYHdl0E,73
72
+ shared/http/apps.py,sha256=n5xbwOEYITM1nkCieh97qmT16ts8rSHH1W9nhQPAuEg,2450
73
+ shared/http/artifacts.py,sha256=4YQ9Z0IiBd7i3Za7u0i0CSIqpwfw8soCrSK3eSgz5GE,1719
74
+ shared/http/aws_connections.py,sha256=rmebeDMXVfc6qBotowKZORxjkh7tKePFXQFjujq2cjo,5137
75
+ shared/http/base.py,sha256=0Fr0ABhbrAbOPrjgvnrgCcWXMmxFuOetGZ_VDkL8GjE,297
76
+ shared/http/billing.py,sha256=00jBn9atJxxu7rR1wHbvv7xs61eQR7fzpKZm3am3DTA,7838
77
+ shared/http/callbacks.py,sha256=mo7PjBHVya7usbM1uX5hKVl9NqYA8Htpx_KEcPs5REU,474
78
+ shared/http/client_manifests.py,sha256=TvdujrBQ3jOsbTA5ZCIajHiXR7kVyvFUyP0xpa5vafI,3572
79
+ shared/http/collections.py,sha256=wd-uhwUIks3tb7cjTe0jrqvAIk-5eTZN64GF5P_HAO8,2210
80
+ shared/http/compute.py,sha256=GMXY3HHOi46yFJoiCv-enszlz_AhrEHzV8uArGa6-Sw,11492
81
+ shared/http/compute_policy.py,sha256=xUUytgRy1OR4O1nZZpognDbYq7e0e34gm2RnC_ss5UI,5018
82
+ shared/http/concurrency.py,sha256=vb-2eE3Y1dKZNqDzS6JU6h4qMg4Bh7UTAKYarXXoKL0,1280
83
+ shared/http/custom_domains.py,sha256=UCZUTlNjV9RX5Zxcnj_GE_p8XaQCmtDzhfpVbh8OaJk,1878
84
+ shared/http/deployments.py,sha256=zjy9nNG2Htx4kBnLguQvk2bOKfhsFOzXTTGuLzSEJMg,3299
85
+ shared/http/device_auth.py,sha256=-d0W7Iq0VP_1IVS9jE93Frf3-k1pDbx_-vmfZMeLfvc,1413
86
+ shared/http/endpoint_forwarding.py,sha256=AXrA2bZX9sfMUe03DNOMkxV9RoVr20nxD2t1XEbo_vw,9066
87
+ shared/http/endpoints.py,sha256=OFeCbpYUsxDPsaYRhddIbe1y0dQ49HpIJrCc-3zHVuo,1837
88
+ shared/http/errors.py,sha256=Mvw4D3tEPnnWBMS0XD_Ay3NJmAPyPjLssJSaNxriLtY,2331
89
+ shared/http/functions.py,sha256=BgMfgpSjDkk0271uS7acCNuan0rkvP-Uu6A5x1ZQHNY,4371
90
+ shared/http/gateway.py,sha256=W6F3XmY9HlSvF7fVI-cCn3dZpgRHxUdMI6IkASdlXrE,10230
91
+ shared/http/gateway_tasks.py,sha256=sl_myC1V327-qCKne52QTsgdPD4grsjVJCnV-V9hg1o,1185
92
+ shared/http/images.py,sha256=M5hOha0KgeeUAIbveJ3EZysPBBjSmzRO6H36lr3ktIQ,2358
93
+ shared/http/objects.py,sha256=ToxdDpQgHvmNEL9i72IMinTe0yc5JhquVWjTdbdnDyA,3411
94
+ shared/http/observability.py,sha256=e2mfG8QEOieLlwM_hIX5yxfQjr7bCFK8qE4TY2XHqbQ,11503
95
+ shared/http/operations.py,sha256=EvrRxtBDhRLk2AZ8xJE7IvT1fbJkgkMeFdc9jdDOtgI,5715
96
+ shared/http/pods.py,sha256=VziKi0IqBk0xzEnJt378YipB3VmMDeFnkOD9arl3zO0,7829
97
+ shared/http/pricing.py,sha256=9b3wmyY4D3rEL64NgoUlUI4SULErJ7fkIzm9i5sBn9c,4926
98
+ shared/http/provider_nodes.py,sha256=eK8mWJVnqcsIsRiCGVHpI1BQ93iPU9bupT-NlmGcCik,3949
99
+ shared/http/secrets.py,sha256=kscNSzsoN-DLxWEtTZgM-0vWQOoZe9re9kUJyfIMm4M,2983
100
+ shared/http/shells.py,sha256=Ls61IA7FVrkl-CcCkYqxF1kRscsDMuIxJa6On5yWaaY,1894
101
+ shared/http/source_cache_cleanup.py,sha256=KQihb2Bd5qGk2HsqUWSHzyFG4vYB-cQ11dXIEm3eWe8,727
102
+ shared/http/storage.py,sha256=IvXNnmONhz9tVTdsXK8cloW3mXtT8rYAH9QteUSnzs0,2221
103
+ shared/http/stubs.py,sha256=EpclPTy4O0g7jBL1HXNwTBoeXOD30rVM0CapJpbp4RY,5302
104
+ shared/http/system.py,sha256=P8hsPkS35RTI2Wry92wVkg6rNRrmXhgUMc8byqZv-xw,3991
105
+ shared/http/task_payload.py,sha256=f6vaFEwWRDQ95T84pSdYjY-gGI5RauSJOPLmkFMgQcE,2314
106
+ shared/http/tasks.py,sha256=Ndye-4Yu9T5HC7P6nHaDTXSGPG0EEdD5XAUz1EWPzpA,4252
107
+ shared/http/usage.py,sha256=tLzswNTw82y_HFI2_Ua4G9AVu7laAug5y9HcVN884ls,7391
108
+ shared/http/users.py,sha256=8piLrfslDYOjgLCJVWK1kZ-YZsesZvkyvqWo30rpTD4,3056
109
+ shared/http/volumes.py,sha256=cnakMfJK-79oSMdUMDL_whEqVUpW2aKB8s_Oh05vHJY,5395
110
+ shared/http/workspace_changes.py,sha256=qQwwsOlv9VqjJfN-bWxikLDluEnlKgBXXP4dtfH9ukQ,2327
111
+ shared/http/workspaces.py,sha256=B-dGXCmyHnTF-IBTONbs5oEpvwkN18INNv1ufvRkQb4,4938
112
+ shared/image_building/__init__.py,sha256=9u9Yx5JMq3hKyBKrGsskKorhhUhgBcjTZBhnbqvZ92E,595
113
+ shared/image_building/authoring.py,sha256=IuCaZ8KeqCD2etFk-vJqfURK0yRqiOF8w1T2J3VrzEY,1661
114
+ shared/image_building/constants.py,sha256=1-qoxfTEFd7LFS_vL8L-SMdZJH9Xr86qG-ncoI-dX1c,884
115
+ shared/image_building/context.py,sha256=PsBmlv6dLsB0jrfu2IEJF8zcQrx24fehEEc3cLk-JGs,1730
116
+ shared/image_building/credentials.py,sha256=fq9j7FCjSvX-t_zXRFcOGJ8H3H6Sr41iIdaP3WcFRDc,7953
117
+ shared/image_building/planning.py,sha256=va5azNmvaMGvHYHM7t3inok3zCkF60wV-Vwqgf261rM,376
118
+ shared/image_building/records.py,sha256=szyJW5QH6IHavfsWaIhZcfyWRRlHbJYYlnSsl4Hy5U8,2354
119
+ shared/image_building/requirements.py,sha256=c3-TA81OLr81WZOGkyub4Z9EyWS97A9lYuVXsjhash4,1614
120
+ shared/realtime/__init__.py,sha256=KWxT4ZXAHvm261_qRAZh2_b6qr0iypRFHGElstAT148,79
121
+ shared/realtime/contracts.py,sha256=DGlh8afS79DPpMQiUFNQJigyIxF-kYlrDQsll9ZDFJQ,10195
122
+ shared/realtime/streams.py,sha256=e5VO-4F7Ff5ZTv6iYoted49wRiT2O05q0IeYH2ROOsg,28914
123
+ lazycloud_shared-0.0.0.dist-info/METADATA,sha256=hPVGjPGHnNmB0zhNOIUprokYQxfUunab5RJccUwv7cg,266
124
+ lazycloud_shared-0.0.0.dist-info/WHEEL,sha256=YVMoNqKzERt-wjUZwJ33xBGAwnFl-4cqbYkTtWa4itE,91
125
+ lazycloud_shared-0.0.0.dist-info/top_level.txt,sha256=z5mXWqeZX62G-ufzsJBRQ_MKUlAZRN_yYAKvyZw7hBk,7
126
+ lazycloud_shared-0.0.0.dist-info/RECORD,,
@@ -0,0 +1,5 @@
1
+ Wheel-Version: 1.0
2
+ Generator: setuptools (84.0.0)
3
+ Root-Is-Purelib: true
4
+ Tag: py3-none-any
5
+
@@ -0,0 +1 @@
1
+ shared
shared/__init__.py ADDED
@@ -0,0 +1 @@
1
+ """Protocol-neutral contracts shared across LazyCloud process boundaries."""
shared/app_identity.py ADDED
@@ -0,0 +1,132 @@
1
+ from __future__ import annotations
2
+
3
+ NAME = "lazycloud"
4
+ DISPLAY_NAME = NAME.replace("-", " ").title()
5
+ ENV_PREFIX = NAME.upper().replace("-", "_")
6
+ _LABEL_NAME = "".join(part.capitalize() for part in NAME.replace("_", "-").split("-"))
7
+ HOME_DIR = f".{NAME}"
8
+ STATE_DIR = f"/var/lib/{NAME}"
9
+ CACHE_DIR = f"{STATE_DIR}/cache"
10
+ CACHE_PAGES_DIR = f"{CACHE_DIR}/pages"
11
+ WORKER_BUNDLE_ROOT = f"/tmp/{NAME}-containers"
12
+ WORKER_CHECKPOINT_ROOT = f"/tmp/{NAME}-checkpoints"
13
+ CHECKPOINT_SIGNAL_ROOT = f"/tmp/{NAME}-checkpoint-signals"
14
+ MANAGED_PACKAGE_ROOT = f"/tmp/{NAME}-packages"
15
+ FUNCTION_IMAGE = f"{NAME}-function"
16
+ ENDPOINT_IMAGE = f"{NAME}-endpoint"
17
+ POD_IMAGE = f"{NAME}-pod"
18
+ SHELL_IMAGE = f"{NAME}-shell"
19
+ SHELL_LOG_PATH = f"/tmp/{NAME}-shell.log"
20
+ AGENT_CONTAINER_TMP_PATH = f"/tmp/{NAME}"
21
+ AGENT_CONTAINER_LOG_PATH = f"/var/log/{NAME}"
22
+ AGENT_STATE_DIR = f"{STATE_DIR}/agent"
23
+ AGENT_CONTAINER_DATA_PATH = f"{AGENT_STATE_DIR}/data"
24
+ AGENT_CONTAINER_OBJECT_PATH = f"{AGENT_CONTAINER_DATA_PATH}/objects"
25
+ AGENT_WORKER_CONFIG_PATH = f"/etc/{NAME}/worker/config.json"
26
+ CLI_NAME = NAME
27
+ ADMIN_CLI_NAME = f"{NAME}-admin"
28
+ REDIS_KEY_PREFIX = NAME
29
+ OBJECT_STORE_BUCKET = f"{NAME}-objects"
30
+
31
+ WORKSPACE_BUCKET_PREFIX = "workspace"
32
+ """Default prefix of a workspace's own bucket.
33
+
34
+ A deployment sharing an AWS account with another one overrides this, because the
35
+ grant that reaches `workspace-*` cannot otherwise tell two deployments apart.
36
+ """
37
+ DATA_STORAGE_BUCKET = f"{NAME}-data"
38
+ OBJECT_STORE_ACCESS_KEY_ID = NAME
39
+ OBJECT_STORE_SECRET_ACCESS_KEY = f"{NAME}-secret"
40
+ WORKSPACE_OBJECT_BUCKET = "default"
41
+ IMAGE_BUILD_CONTEXT_BUCKET = "build-contexts"
42
+ CLUSTER_NAME_LABEL = f"{_LABEL_NAME}ClusterName"
43
+ POOL_NAME_LABEL = f"{_LABEL_NAME}PoolName"
44
+ MACHINE_ID_LABEL = f"{_LABEL_NAME}MachineId"
45
+ DEFAULT_RESOURCE_TYPE = NAME
46
+ EVENT_SOURCE = f"{NAME}-cluster"
47
+ INTERNAL_WEBHOOK_FORMAT = f"{NAME}-webhook"
48
+ METRICS_NAMESPACE = NAME.replace("-", "_")
49
+ AGENT_NAME = f"{NAME}-agent"
50
+ AGENT_SERVICE_DESCRIPTION = f"{DISPLAY_NAME} agent"
51
+ AGENT_LAUNCHD_LABEL_PREFIX = f"com.{NAME}.agent"
52
+ CONTROL_PLANE_SERVICE_NAME = f"{NAME}-api"
53
+ CONTROL_PLANE_IMAGE = "api"
54
+ SCHEDULER_PROCESS_NAME = f"{NAME}-scheduler"
55
+ SCHEDULER_IMAGE = "scheduler"
56
+ CONTAINER_WORKER_PROCESS_NAME = f"{NAME}-container-worker"
57
+ CONTAINER_WORKER_IMAGE = "container-worker"
58
+ CONTAINER_HELPER_PATH = f"/usr/local/bin/{NAME}-sandbox-supervisor"
59
+ WORKER_BOOTSTRAP_PROCESS_NAME = f"{NAME}-worker-bootstrap"
60
+ WORKER_BOOTSTRAP_IMAGE = "worker-bootstrap"
61
+ CACHE_SERVER_PROCESS_NAME = f"{NAME}-cache-server"
62
+ CACHE_SERVER_IMAGE = "cache-server"
63
+ SANDBOX_COMPOSE_OVERRIDE_PATH = f"/tmp/{NAME}-docker-compose.override.yml"
64
+ METRICS_SOURCE = NAME
65
+ PRIVATE_RESOURCE_PREFIX = f"{NAME}-private"
66
+ SOURCE_CACHE_DIR = f"{NAME}-source-cache"
67
+ SOURCE_PACKAGE_BUCKET = f"{NAME}-source-packages"
68
+ WORKSPACE_UPLOAD_BUCKETS = frozenset(
69
+ {WORKSPACE_OBJECT_BUCKET, SOURCE_PACKAGE_BUCKET, IMAGE_BUILD_CONTEXT_BUCKET}
70
+ )
71
+
72
+ __all__ = [
73
+ "ADMIN_CLI_NAME",
74
+ "AGENT_CONTAINER_DATA_PATH",
75
+ "AGENT_CONTAINER_LOG_PATH",
76
+ "AGENT_CONTAINER_OBJECT_PATH",
77
+ "AGENT_CONTAINER_TMP_PATH",
78
+ "AGENT_LAUNCHD_LABEL_PREFIX",
79
+ "AGENT_NAME",
80
+ "AGENT_SERVICE_DESCRIPTION",
81
+ "AGENT_STATE_DIR",
82
+ "AGENT_WORKER_CONFIG_PATH",
83
+ "CACHE_DIR",
84
+ "CACHE_PAGES_DIR",
85
+ "CACHE_SERVER_IMAGE",
86
+ "CACHE_SERVER_PROCESS_NAME",
87
+ "CHECKPOINT_SIGNAL_ROOT",
88
+ "CLI_NAME",
89
+ "CLUSTER_NAME_LABEL",
90
+ "CONTAINER_HELPER_PATH",
91
+ "CONTAINER_WORKER_IMAGE",
92
+ "CONTAINER_WORKER_PROCESS_NAME",
93
+ "CONTROL_PLANE_IMAGE",
94
+ "CONTROL_PLANE_SERVICE_NAME",
95
+ "DATA_STORAGE_BUCKET",
96
+ "DEFAULT_RESOURCE_TYPE",
97
+ "DISPLAY_NAME",
98
+ "ENDPOINT_IMAGE",
99
+ "ENV_PREFIX",
100
+ "EVENT_SOURCE",
101
+ "FUNCTION_IMAGE",
102
+ "HOME_DIR",
103
+ "IMAGE_BUILD_CONTEXT_BUCKET",
104
+ "INTERNAL_WEBHOOK_FORMAT",
105
+ "MACHINE_ID_LABEL",
106
+ "MANAGED_PACKAGE_ROOT",
107
+ "METRICS_NAMESPACE",
108
+ "METRICS_SOURCE",
109
+ "NAME",
110
+ "OBJECT_STORE_ACCESS_KEY_ID",
111
+ "OBJECT_STORE_BUCKET",
112
+ "OBJECT_STORE_SECRET_ACCESS_KEY",
113
+ "POD_IMAGE",
114
+ "POOL_NAME_LABEL",
115
+ "PRIVATE_RESOURCE_PREFIX",
116
+ "REDIS_KEY_PREFIX",
117
+ "SANDBOX_COMPOSE_OVERRIDE_PATH",
118
+ "SCHEDULER_IMAGE",
119
+ "SCHEDULER_PROCESS_NAME",
120
+ "SHELL_IMAGE",
121
+ "SHELL_LOG_PATH",
122
+ "SOURCE_CACHE_DIR",
123
+ "SOURCE_PACKAGE_BUCKET",
124
+ "STATE_DIR",
125
+ "WORKER_BOOTSTRAP_IMAGE",
126
+ "WORKER_BOOTSTRAP_PROCESS_NAME",
127
+ "WORKER_BUNDLE_ROOT",
128
+ "WORKER_CHECKPOINT_ROOT",
129
+ "WORKSPACE_BUCKET_PREFIX",
130
+ "WORKSPACE_OBJECT_BUCKET",
131
+ "WORKSPACE_UPLOAD_BUCKETS",
132
+ ]
@@ -0,0 +1,43 @@
1
+ from __future__ import annotations
2
+
3
+ from enum import Enum
4
+
5
+
6
+ class AppLifecycleState(str, Enum):
7
+ Active = "active"
8
+ Pausing = "pausing"
9
+ Paused = "paused"
10
+ Resuming = "resuming"
11
+ Deleting = "deleting"
12
+ CleanupFailed = "cleanup_failed"
13
+ Deleted = "deleted"
14
+
15
+
16
+ class AppLifecycleTarget(str, Enum):
17
+ Active = "active"
18
+ Paused = "paused"
19
+ Deleted = "deleted"
20
+
21
+
22
+ class AppDeploymentIntentTarget(str, Enum):
23
+ Active = "active"
24
+ Inactive = "inactive"
25
+ Deleted = "deleted"
26
+
27
+
28
+ UNFINISHED_APP_LIFECYCLE_STATES = frozenset(
29
+ {
30
+ AppLifecycleState.Pausing,
31
+ AppLifecycleState.Resuming,
32
+ AppLifecycleState.Deleting,
33
+ AppLifecycleState.CleanupFailed,
34
+ }
35
+ )
36
+
37
+
38
+ __all__ = [
39
+ "UNFINISHED_APP_LIFECYCLE_STATES",
40
+ "AppDeploymentIntentTarget",
41
+ "AppLifecycleState",
42
+ "AppLifecycleTarget",
43
+ ]
shared/app_slug.py ADDED
@@ -0,0 +1,44 @@
1
+ from __future__ import annotations
2
+
3
+ import keyword
4
+ import re
5
+
6
+ APP_SLUG_PATTERN = re.compile(r"^[a-z][a-z0-9_]{0,62}$")
7
+
8
+
9
+ def validate_app_slug(value: str) -> str:
10
+ slug = value.strip()
11
+ if not APP_SLUG_PATTERN.fullmatch(slug) or keyword.iskeyword(slug):
12
+ msg = (
13
+ "app slug must be a lowercase Python identifier segment, "
14
+ "start with a letter, and contain only lowercase letters, digits, or underscores"
15
+ )
16
+ raise ValueError(msg)
17
+ return slug
18
+
19
+
20
+ def app_slug_from_name(value: str) -> str:
21
+ raw = value.strip().lower()
22
+ slug = re.sub(r"[^a-z0-9_]+", "_", raw).strip("_")
23
+ if not slug or not slug[0].isalpha():
24
+ slug = f"app_{slug or 'default'}"
25
+ if len(slug) > 63:
26
+ slug = slug[:63].rstrip("_")
27
+ if keyword.iskeyword(slug):
28
+ slug = f"{slug}_app"
29
+ return validate_app_slug(slug)
30
+
31
+
32
+ def app_slug_or_default(value: str | None, *, default: str) -> str:
33
+ selected = (value or "").strip()
34
+ if selected:
35
+ return validate_app_slug(selected)
36
+ return app_slug_from_name(default)
37
+
38
+
39
+ __all__ = [
40
+ "APP_SLUG_PATTERN",
41
+ "app_slug_from_name",
42
+ "app_slug_or_default",
43
+ "validate_app_slug",
44
+ ]
@@ -0,0 +1,52 @@
1
+ from __future__ import annotations
2
+
3
+ from datetime import datetime
4
+
5
+ from pydantic import Field, JsonValue
6
+
7
+ from shared.contracts import ContractModel
8
+ from shared.enums import StringEnum
9
+ from shared.timestamps import utc_now
10
+
11
+
12
+ class AutoscalerTargetKind(StringEnum):
13
+ Function = "function"
14
+ Endpoint = "endpoint"
15
+ Pod = "pod"
16
+
17
+
18
+ class AutoscalerStateRecord(ContractModel):
19
+ name: str
20
+ workspace_id: str
21
+ source: str
22
+ target_kind: AutoscalerTargetKind
23
+ target_id: str
24
+ deployment_id: str = ""
25
+ app_id: str = ""
26
+ current_count: int = 0
27
+ desired_count: int = 0
28
+ signal_name: str = ""
29
+ signal_value: int = 0
30
+ decision: str = ""
31
+ reason: str = ""
32
+ active: bool = True
33
+ valid: bool = True
34
+ lock_acquired: bool = True
35
+ owner_lock_key: str = ""
36
+ cooldown_until: datetime | None = None
37
+ failed_container_count: int = 0
38
+ error: str = ""
39
+ last_sample: dict[str, JsonValue] = Field(default_factory=dict)
40
+ last_actions: list[dict[str, JsonValue]] = Field(default_factory=list)
41
+ updated_at: datetime = Field(default_factory=utc_now)
42
+
43
+
44
+ def autoscaler_state_name(target_kind: AutoscalerTargetKind, target_id: str) -> str:
45
+ return f"{target_kind.value}:{target_id}"
46
+
47
+
48
+ __all__ = [
49
+ "AutoscalerStateRecord",
50
+ "AutoscalerTargetKind",
51
+ "autoscaler_state_name",
52
+ ]