lockbot 2.13.0__tar.gz → 2.15.0__tar.gz

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 (129) hide show
  1. {lockbot-2.13.0/python/lockbot.egg-info → lockbot-2.15.0}/PKG-INFO +27 -46
  2. {lockbot-2.13.0 → lockbot-2.15.0}/README.md +26 -44
  3. {lockbot-2.13.0 → lockbot-2.15.0}/pyproject.toml +2 -3
  4. lockbot-2.15.0/python/lockbot/backend/app/agent_skill/SKILL.md +658 -0
  5. {lockbot-2.13.0 → lockbot-2.15.0}/python/lockbot/backend/app/backup/service.py +13 -0
  6. lockbot-2.15.0/python/lockbot/backend/app/bots/datasource.py +89 -0
  7. {lockbot-2.13.0 → lockbot-2.15.0}/python/lockbot/backend/app/bots/manager.py +1 -1
  8. lockbot-2.15.0/python/lockbot/backend/app/bots/metrics_access.py +69 -0
  9. {lockbot-2.13.0 → lockbot-2.15.0}/python/lockbot/backend/app/bots/models.py +3 -0
  10. {lockbot-2.13.0 → lockbot-2.15.0}/python/lockbot/backend/app/bots/router.py +37 -2
  11. {lockbot-2.13.0 → lockbot-2.15.0}/python/lockbot/backend/app/bots/schemas.py +11 -0
  12. {lockbot-2.13.0 → lockbot-2.15.0}/python/lockbot/backend/app/main.py +25 -0
  13. {lockbot-2.13.0 → lockbot-2.15.0}/python/lockbot/backend/app/managed_paths.py +1 -1
  14. {lockbot-2.13.0 → lockbot-2.15.0}/python/lockbot/backend/app/op_skill/SKILL.md +4 -0
  15. {lockbot-2.13.0 → lockbot-2.15.0}/python/lockbot/backend/app/resource_api/commands.py +38 -7
  16. {lockbot-2.13.0 → lockbot-2.15.0}/python/lockbot/backend/app/resource_api/discovery.py +29 -1
  17. {lockbot-2.13.0 → lockbot-2.15.0}/python/lockbot/backend/app/resource_api/event_log.py +4 -1
  18. {lockbot-2.13.0 → lockbot-2.15.0}/python/lockbot/backend/app/resource_api/notifications.py +15 -5
  19. {lockbot-2.13.0 → lockbot-2.15.0}/python/lockbot/backend/app/resource_api/resources.py +10 -2
  20. lockbot-2.15.0/python/lockbot/backend/app/resource_api/rules.py +85 -0
  21. {lockbot-2.13.0 → lockbot-2.15.0}/python/lockbot/backend/app/resource_api/skill.py +29 -0
  22. {lockbot-2.13.0 → lockbot-2.15.0}/python/lockbot/backend/app/resource_api/usage.py +84 -10
  23. {lockbot-2.13.0 → lockbot-2.15.0}/python/lockbot/backend/app/resource_api/view_links.py +1 -1
  24. {lockbot-2.13.0 → lockbot-2.15.0}/python/lockbot/backend/app/resource_api/views.py +10 -0
  25. {lockbot-2.13.0 → lockbot-2.15.0}/python/lockbot/core/base_bot.py +33 -3
  26. lockbot-2.15.0/python/lockbot/core/bot_instance.py +50 -0
  27. {lockbot-2.13.0 → lockbot-2.15.0}/python/lockbot/core/config.py +26 -150
  28. {lockbot-2.13.0 → lockbot-2.15.0}/python/lockbot/core/device_bot.py +10 -2
  29. {lockbot-2.13.0 → lockbot-2.15.0}/python/lockbot/core/handler.py +2 -69
  30. {lockbot-2.13.0 → lockbot-2.15.0}/python/lockbot/core/i18n/en.py +6 -0
  31. {lockbot-2.13.0 → lockbot-2.15.0}/python/lockbot/core/i18n/zh.py +6 -0
  32. {lockbot-2.13.0 → lockbot-2.15.0}/python/lockbot/core/io.py +3 -3
  33. {lockbot-2.13.0 → lockbot-2.15.0}/python/lockbot/core/node_bot.py +6 -0
  34. {lockbot-2.13.0 → lockbot-2.15.0}/python/lockbot/core/platforms/infoflow.py +3 -3
  35. {lockbot-2.13.0 → lockbot-2.15.0}/python/lockbot/core/queue_bot.py +47 -11
  36. {lockbot-2.13.0 → lockbot-2.15.0}/python/lockbot/core/queue_device_bot.py +31 -2
  37. {lockbot-2.13.0 → lockbot-2.15.0}/python/lockbot/core/request.py +2 -2
  38. lockbot-2.15.0/python/lockbot/core/resource_policy.py +40 -0
  39. {lockbot-2.13.0 → lockbot-2.15.0}/python/lockbot/core/scheduler.py +9 -26
  40. {lockbot-2.13.0 → lockbot-2.15.0}/python/lockbot/core/utils.py +1 -1
  41. lockbot-2.15.0/python/lockbot/metrics/__init__.py +1 -0
  42. lockbot-2.15.0/python/lockbot/metrics/exporter.py +642 -0
  43. lockbot-2.15.0/python/lockbot/metrics/gateway.py +413 -0
  44. {lockbot-2.13.0 → lockbot-2.15.0/python/lockbot.egg-info}/PKG-INFO +27 -46
  45. {lockbot-2.13.0 → lockbot-2.15.0}/python/lockbot.egg-info/SOURCES.txt +7 -2
  46. {lockbot-2.13.0 → lockbot-2.15.0}/python/lockbot.egg-info/requires.txt +0 -1
  47. lockbot-2.13.0/python/lockbot/backend/app/agent_skill/SKILL.md +0 -397
  48. lockbot-2.13.0/python/lockbot/core/bot_instance.py +0 -81
  49. lockbot-2.13.0/python/lockbot/core/entry.py +0 -81
  50. lockbot-2.13.0/python/lockbot/core/env.py +0 -11
  51. {lockbot-2.13.0 → lockbot-2.15.0}/LICENSE +0 -0
  52. {lockbot-2.13.0 → lockbot-2.15.0}/MANIFEST.in +0 -0
  53. {lockbot-2.13.0 → lockbot-2.15.0}/python/lockbot/__init__.py +0 -0
  54. {lockbot-2.13.0 → lockbot-2.15.0}/python/lockbot/backend/__init__.py +0 -0
  55. {lockbot-2.13.0 → lockbot-2.15.0}/python/lockbot/backend/app/__init__.py +0 -0
  56. {lockbot-2.13.0 → lockbot-2.15.0}/python/lockbot/backend/app/admin/__init__.py +0 -0
  57. {lockbot-2.13.0 → lockbot-2.15.0}/python/lockbot/backend/app/admin/router.py +0 -0
  58. {lockbot-2.13.0 → lockbot-2.15.0}/python/lockbot/backend/app/audit/__init__.py +0 -0
  59. {lockbot-2.13.0 → lockbot-2.15.0}/python/lockbot/backend/app/audit/models.py +0 -0
  60. {lockbot-2.13.0 → lockbot-2.15.0}/python/lockbot/backend/app/audit/router.py +0 -0
  61. {lockbot-2.13.0 → lockbot-2.15.0}/python/lockbot/backend/app/audit/service.py +0 -0
  62. {lockbot-2.13.0 → lockbot-2.15.0}/python/lockbot/backend/app/auth/__init__.py +0 -0
  63. {lockbot-2.13.0 → lockbot-2.15.0}/python/lockbot/backend/app/auth/dependencies.py +0 -0
  64. {lockbot-2.13.0 → lockbot-2.15.0}/python/lockbot/backend/app/auth/models.py +0 -0
  65. {lockbot-2.13.0 → lockbot-2.15.0}/python/lockbot/backend/app/auth/router.py +0 -0
  66. {lockbot-2.13.0 → lockbot-2.15.0}/python/lockbot/backend/app/auth/schemas.py +0 -0
  67. {lockbot-2.13.0 → lockbot-2.15.0}/python/lockbot/backend/app/backup/__init__.py +0 -0
  68. {lockbot-2.13.0 → lockbot-2.15.0}/python/lockbot/backend/app/backup/router.py +0 -0
  69. {lockbot-2.13.0 → lockbot-2.15.0}/python/lockbot/backend/app/backup/scheduler.py +0 -0
  70. {lockbot-2.13.0 → lockbot-2.15.0}/python/lockbot/backend/app/bot_audit/__init__.py +0 -0
  71. {lockbot-2.13.0 → lockbot-2.15.0}/python/lockbot/backend/app/bot_audit/models.py +0 -0
  72. {lockbot-2.13.0 → lockbot-2.15.0}/python/lockbot/backend/app/bot_audit/router.py +0 -0
  73. {lockbot-2.13.0 → lockbot-2.15.0}/python/lockbot/backend/app/bot_audit/service.py +0 -0
  74. {lockbot-2.13.0 → lockbot-2.15.0}/python/lockbot/backend/app/bots/__init__.py +0 -0
  75. {lockbot-2.13.0 → lockbot-2.15.0}/python/lockbot/backend/app/bots/encryption.py +0 -0
  76. {lockbot-2.13.0 → lockbot-2.15.0}/python/lockbot/backend/app/bots/webhook_handler.py +0 -0
  77. {lockbot-2.13.0 → lockbot-2.15.0}/python/lockbot/backend/app/broadcast/__init__.py +0 -0
  78. {lockbot-2.13.0 → lockbot-2.15.0}/python/lockbot/backend/app/broadcast/models.py +0 -0
  79. {lockbot-2.13.0 → lockbot-2.15.0}/python/lockbot/backend/app/broadcast/router.py +0 -0
  80. {lockbot-2.13.0 → lockbot-2.15.0}/python/lockbot/backend/app/broadcast/service.py +0 -0
  81. {lockbot-2.13.0 → lockbot-2.15.0}/python/lockbot/backend/app/config.py +0 -0
  82. {lockbot-2.13.0 → lockbot-2.15.0}/python/lockbot/backend/app/database.py +0 -0
  83. {lockbot-2.13.0 → lockbot-2.15.0}/python/lockbot/backend/app/deployment.py +0 -0
  84. {lockbot-2.13.0 → lockbot-2.15.0}/python/lockbot/backend/app/logs/__init__.py +0 -0
  85. {lockbot-2.13.0 → lockbot-2.15.0}/python/lockbot/backend/app/rate_limit.py +0 -0
  86. {lockbot-2.13.0 → lockbot-2.15.0}/python/lockbot/backend/app/resource_api/__init__.py +0 -0
  87. {lockbot-2.13.0 → lockbot-2.15.0}/python/lockbot/backend/app/resource_api/activity.py +0 -0
  88. {lockbot-2.13.0 → lockbot-2.15.0}/python/lockbot/backend/app/resource_api/errors.py +0 -0
  89. {lockbot-2.13.0 → lockbot-2.15.0}/python/lockbot/backend/app/resource_api/ingress.py +0 -0
  90. {lockbot-2.13.0 → lockbot-2.15.0}/python/lockbot/backend/app/resource_api/observability.py +0 -0
  91. {lockbot-2.13.0 → lockbot-2.15.0}/python/lockbot/backend/app/resource_api/op_skill.py +0 -0
  92. {lockbot-2.13.0 → lockbot-2.15.0}/python/lockbot/backend/app/resource_api/operator.py +0 -0
  93. {lockbot-2.13.0 → lockbot-2.15.0}/python/lockbot/backend/app/resource_api/snapshot.py +0 -0
  94. {lockbot-2.13.0 → lockbot-2.15.0}/python/lockbot/backend/app/resource_api/sources.py +0 -0
  95. {lockbot-2.13.0 → lockbot-2.15.0}/python/lockbot/backend/app/resource_api/traffic.py +0 -0
  96. {lockbot-2.13.0 → lockbot-2.15.0}/python/lockbot/backend/app/resource_api/usage_cleanup.py +0 -0
  97. {lockbot-2.13.0 → lockbot-2.15.0}/python/lockbot/backend/app/resource_api/versioning.py +0 -0
  98. {lockbot-2.13.0 → lockbot-2.15.0}/python/lockbot/backend/app/resource_auth/__init__.py +0 -0
  99. {lockbot-2.13.0 → lockbot-2.15.0}/python/lockbot/backend/app/resource_auth/authority.py +0 -0
  100. {lockbot-2.13.0 → lockbot-2.15.0}/python/lockbot/backend/app/resource_auth/credentials.py +0 -0
  101. {lockbot-2.13.0 → lockbot-2.15.0}/python/lockbot/backend/app/resource_auth/dependencies.py +0 -0
  102. {lockbot-2.13.0 → lockbot-2.15.0}/python/lockbot/backend/app/resource_auth/http_errors.py +0 -0
  103. {lockbot-2.13.0 → lockbot-2.15.0}/python/lockbot/backend/app/resource_auth/models.py +0 -0
  104. {lockbot-2.13.0 → lockbot-2.15.0}/python/lockbot/backend/app/resource_auth/pending.py +0 -0
  105. {lockbot-2.13.0 → lockbot-2.15.0}/python/lockbot/backend/app/resource_auth/router.py +0 -0
  106. {lockbot-2.13.0 → lockbot-2.15.0}/python/lockbot/backend/app/resource_auth/service.py +0 -0
  107. {lockbot-2.13.0 → lockbot-2.15.0}/python/lockbot/backend/app/service_traffic.py +0 -0
  108. {lockbot-2.13.0 → lockbot-2.15.0}/python/lockbot/backend/app/settings/__init__.py +0 -0
  109. {lockbot-2.13.0 → lockbot-2.15.0}/python/lockbot/backend/app/settings/models.py +0 -0
  110. {lockbot-2.13.0 → lockbot-2.15.0}/python/lockbot/backend/app/settings/router.py +0 -0
  111. {lockbot-2.13.0 → lockbot-2.15.0}/python/lockbot/backend/app/sqlite_paths.py +0 -0
  112. {lockbot-2.13.0 → lockbot-2.15.0}/python/lockbot/backend/app/state_migration.py +0 -0
  113. {lockbot-2.13.0 → lockbot-2.15.0}/python/lockbot/backend/app/state_ownership.py +0 -0
  114. {lockbot-2.13.0 → lockbot-2.15.0}/python/lockbot/backend/app/static.py +0 -0
  115. {lockbot-2.13.0 → lockbot-2.15.0}/python/lockbot/core/__init__.py +0 -0
  116. {lockbot-2.13.0 → lockbot-2.15.0}/python/lockbot/core/command_context.py +0 -0
  117. {lockbot-2.13.0 → lockbot-2.15.0}/python/lockbot/core/device_usage_alert.py +0 -0
  118. {lockbot-2.13.0 → lockbot-2.15.0}/python/lockbot/core/device_usage_utils.py +0 -0
  119. {lockbot-2.13.0 → lockbot-2.15.0}/python/lockbot/core/i18n/__init__.py +0 -0
  120. {lockbot-2.13.0 → lockbot-2.15.0}/python/lockbot/core/message_adapter.py +0 -0
  121. {lockbot-2.13.0 → lockbot-2.15.0}/python/lockbot/core/msg_utils.py +0 -0
  122. {lockbot-2.13.0 → lockbot-2.15.0}/python/lockbot/core/platforms/__init__.py +0 -0
  123. {lockbot-2.13.0 → lockbot-2.15.0}/python/lockbot/core/platforms/registry.py +0 -0
  124. {lockbot-2.13.0 → lockbot-2.15.0}/python/lockbot.egg-info/dependency_links.txt +0 -0
  125. {lockbot-2.13.0 → lockbot-2.15.0}/python/lockbot.egg-info/top_level.txt +0 -0
  126. {lockbot-2.13.0 → lockbot-2.15.0}/setup.cfg +0 -0
  127. {lockbot-2.13.0 → lockbot-2.15.0}/tools/create_super_admin.py +0 -0
  128. {lockbot-2.13.0 → lockbot-2.15.0}/tools/gen_keys.py +0 -0
  129. {lockbot-2.13.0 → lockbot-2.15.0}/tools/reset_super_admin_password.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: lockbot
3
- Version: 2.13.0
3
+ Version: 2.15.0
4
4
  Summary: Cluster resource management bot for IM platforms
5
5
  Author-email: Jianbang Yang <yangjianbang112@gmail.com>
6
6
  License: MIT
@@ -23,7 +23,6 @@ Description-Content-Type: text/markdown
23
23
  License-File: LICENSE
24
24
  Requires-Dist: pycryptodome
25
25
  Requires-Dist: requests
26
- Requires-Dist: flask
27
26
  Requires-Dist: six
28
27
  Requires-Dist: fastapi
29
28
  Requires-Dist: uvicorn[standard]
@@ -47,7 +46,7 @@ Dynamic: license-file
47
46
  Cluster resource management bot for IM platforms (e.g., Baidu InfoFlow).
48
47
 
49
48
  Lock and unlock GPU devices, cluster nodes, and queue slots via chat commands.
50
- Supports both standalone Flask deployment and a full platform mode with FastAPI + Vue.js frontend.
49
+ Runs as a multi-bot platform with FastAPI and a Vue.js frontend.
51
50
 
52
51
  [中文文档](README_CN.md) | [Live Demo](https://dynamicheart.github.io/lockbot/)
53
52
 
@@ -128,10 +127,11 @@ docker exec -it lockbot python tools/create_super_admin.py --username admin --em
128
127
  | `TOKEN` | Bot signature verification token | `""` |
129
128
  | `AESKEY` | Message decryption AES key | `""` |
130
129
  | `WEBHOOK_URL` | Message webhook URL | `""` |
131
- | `PORT` | Server listen port | `8090` |
132
130
  | `DEFAULT_DURATION` | Default lock duration (seconds) | `7200` (2h) |
133
131
  | `MAX_LOCK_DURATION` | Max lock duration (seconds) | `-1` (unlimited) |
134
132
  | `EARLY_NOTIFY` | Notify before lock expiry | `false` |
133
+ | `FORBID_RELOCK` | Reject renewal and longer booking claims when explicitly enabled per bot | `false` |
134
+ | `MAX_RESOURCES_PER_USER` | Held + booked resources per user/bot; nodes for NODE/QUEUE, cards for DEVICE/QUEUE_DEVICE | `-1` (unlimited) |
135
135
 
136
136
  See `python/lockbot/core/config.py` for the full configuration reference.
137
137
 
@@ -178,48 +178,29 @@ ruff check python/ tests/
178
178
  ruff format --check python/ tests/
179
179
  ```
180
180
 
181
- ## Standalone Mode
182
-
183
- Single-bot deployment with a lightweight Flask webhook server.
184
-
185
- **Device Lock Bot** (per-GPU locking):
186
-
187
- ```python
188
- from lockbot.core.bot_instance import BotInstance
189
- from lockbot.core.entry import create_app
190
-
191
- instance = BotInstance("DEVICE", {
192
- "BOT_NAME": "my-gpu-bot",
193
- "WEBHOOK_URL": "https://your-webhook-url",
194
- "TOKEN": "your-bot-token",
195
- "AESKEY": "your-aes-key",
196
- "CLUSTER_CONFIGS": {
197
- "node0": ["A800", "A800", "H100"],
198
- "node1": ["A800", "H100"],
199
- },
200
- })
201
-
202
- app = create_app(bot=instance.bot, bot_name="my-gpu-bot", port=8000)
203
- app.run(host="0.0.0.0", port=8000)
204
- ```
205
-
206
- **Node Lock Bot / Queue Bot** (per-node locking or queue scheduling):
207
-
208
- ```python
209
- from lockbot.core.bot_instance import BotInstance
210
- from lockbot.core.entry import create_app
211
-
212
- instance = BotInstance("NODE", { # or "QUEUE" for queue scheduling
213
- "BOT_NAME": "my-node-bot",
214
- "WEBHOOK_URL": "https://your-webhook-url",
215
- "TOKEN": "your-bot-token",
216
- "AESKEY": "your-aes-key",
217
- "CLUSTER_CONFIGS": ["node0", "node1", "node2", "node3"],
218
- })
219
-
220
- app = create_app(bot=instance.bot, bot_name="my-node-bot", port=8000)
221
- app.run(host="0.0.0.0", port=8000)
222
- ```
181
+ ## Migrating an older standalone deployment
182
+
183
+ The deprecated Flask entry (`lockbot.core.entry.create_app` / `run_bot`) and process-global
184
+ `Config.get/set/load_from_file/load_from_env` API have been removed. Bot construction no
185
+ longer starts a private scheduler. The supported deployment is the FastAPI platform above,
186
+ including when managing only one bot. Existing platform Docker deployments keep the same
187
+ startup command, ports and persistent data layout; no database reset is required.
188
+
189
+ For an old standalone deployment:
190
+
191
+ 1. Keep a backup of its configuration and JSON state before stopping its old webhook server.
192
+ 2. Start the platform, create the matching bot type, and copy its cluster, messaging
193
+ credentials and runtime rules into the bot editor. Do not publish credentials in logs.
194
+ 3. Restore the saved cluster state through the platform's existing cluster-state import
195
+ while the bot is stopped. Verify resource names, holders, expiry and queues before start.
196
+ Do not copy old state over an unrelated bot's directory or remove the old data volume.
197
+ 4. Point the messaging platform callback at `/api/bots/webhook/{bot_id}` and start the bot.
198
+ Keep the previous image and backup until the new callback and expiry checks work.
199
+
200
+ The core bot classes remain independently constructible for tests, with per-instance
201
+ `Config` objects. Platform scheduling, persisted state formats and legacy state migrations
202
+ remain supported. The external XPU monitoring example under `docs/examples/xpu_monitor`
203
+ is a separate program; its optional Flask webhook still uses its documented own dependencies.
223
204
 
224
205
  ## License
225
206
 
@@ -3,7 +3,7 @@
3
3
  Cluster resource management bot for IM platforms (e.g., Baidu InfoFlow).
4
4
 
5
5
  Lock and unlock GPU devices, cluster nodes, and queue slots via chat commands.
6
- Supports both standalone Flask deployment and a full platform mode with FastAPI + Vue.js frontend.
6
+ Runs as a multi-bot platform with FastAPI and a Vue.js frontend.
7
7
 
8
8
  [中文文档](README_CN.md) | [Live Demo](https://dynamicheart.github.io/lockbot/)
9
9
 
@@ -84,10 +84,11 @@ docker exec -it lockbot python tools/create_super_admin.py --username admin --em
84
84
  | `TOKEN` | Bot signature verification token | `""` |
85
85
  | `AESKEY` | Message decryption AES key | `""` |
86
86
  | `WEBHOOK_URL` | Message webhook URL | `""` |
87
- | `PORT` | Server listen port | `8090` |
88
87
  | `DEFAULT_DURATION` | Default lock duration (seconds) | `7200` (2h) |
89
88
  | `MAX_LOCK_DURATION` | Max lock duration (seconds) | `-1` (unlimited) |
90
89
  | `EARLY_NOTIFY` | Notify before lock expiry | `false` |
90
+ | `FORBID_RELOCK` | Reject renewal and longer booking claims when explicitly enabled per bot | `false` |
91
+ | `MAX_RESOURCES_PER_USER` | Held + booked resources per user/bot; nodes for NODE/QUEUE, cards for DEVICE/QUEUE_DEVICE | `-1` (unlimited) |
91
92
 
92
93
  See `python/lockbot/core/config.py` for the full configuration reference.
93
94
 
@@ -134,48 +135,29 @@ ruff check python/ tests/
134
135
  ruff format --check python/ tests/
135
136
  ```
136
137
 
137
- ## Standalone Mode
138
-
139
- Single-bot deployment with a lightweight Flask webhook server.
140
-
141
- **Device Lock Bot** (per-GPU locking):
142
-
143
- ```python
144
- from lockbot.core.bot_instance import BotInstance
145
- from lockbot.core.entry import create_app
146
-
147
- instance = BotInstance("DEVICE", {
148
- "BOT_NAME": "my-gpu-bot",
149
- "WEBHOOK_URL": "https://your-webhook-url",
150
- "TOKEN": "your-bot-token",
151
- "AESKEY": "your-aes-key",
152
- "CLUSTER_CONFIGS": {
153
- "node0": ["A800", "A800", "H100"],
154
- "node1": ["A800", "H100"],
155
- },
156
- })
157
-
158
- app = create_app(bot=instance.bot, bot_name="my-gpu-bot", port=8000)
159
- app.run(host="0.0.0.0", port=8000)
160
- ```
161
-
162
- **Node Lock Bot / Queue Bot** (per-node locking or queue scheduling):
163
-
164
- ```python
165
- from lockbot.core.bot_instance import BotInstance
166
- from lockbot.core.entry import create_app
167
-
168
- instance = BotInstance("NODE", { # or "QUEUE" for queue scheduling
169
- "BOT_NAME": "my-node-bot",
170
- "WEBHOOK_URL": "https://your-webhook-url",
171
- "TOKEN": "your-bot-token",
172
- "AESKEY": "your-aes-key",
173
- "CLUSTER_CONFIGS": ["node0", "node1", "node2", "node3"],
174
- })
175
-
176
- app = create_app(bot=instance.bot, bot_name="my-node-bot", port=8000)
177
- app.run(host="0.0.0.0", port=8000)
178
- ```
138
+ ## Migrating an older standalone deployment
139
+
140
+ The deprecated Flask entry (`lockbot.core.entry.create_app` / `run_bot`) and process-global
141
+ `Config.get/set/load_from_file/load_from_env` API have been removed. Bot construction no
142
+ longer starts a private scheduler. The supported deployment is the FastAPI platform above,
143
+ including when managing only one bot. Existing platform Docker deployments keep the same
144
+ startup command, ports and persistent data layout; no database reset is required.
145
+
146
+ For an old standalone deployment:
147
+
148
+ 1. Keep a backup of its configuration and JSON state before stopping its old webhook server.
149
+ 2. Start the platform, create the matching bot type, and copy its cluster, messaging
150
+ credentials and runtime rules into the bot editor. Do not publish credentials in logs.
151
+ 3. Restore the saved cluster state through the platform's existing cluster-state import
152
+ while the bot is stopped. Verify resource names, holders, expiry and queues before start.
153
+ Do not copy old state over an unrelated bot's directory or remove the old data volume.
154
+ 4. Point the messaging platform callback at `/api/bots/webhook/{bot_id}` and start the bot.
155
+ Keep the previous image and backup until the new callback and expiry checks work.
156
+
157
+ The core bot classes remain independently constructible for tests, with per-instance
158
+ `Config` objects. Platform scheduling, persisted state formats and legacy state migrations
159
+ remain supported. The external XPU monitoring example under `docs/examples/xpu_monitor`
160
+ is a separate program; its optional Flask webhook still uses its documented own dependencies.
179
161
 
180
162
  ## License
181
163
 
@@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta"
4
4
 
5
5
  [project]
6
6
  name = "lockbot"
7
- version = "2.13.0"
7
+ version = "2.15.0"
8
8
  description = "Cluster resource management bot for IM platforms"
9
9
  readme = "README.md"
10
10
  license = {text = "MIT"}
@@ -27,10 +27,9 @@ classifiers = [
27
27
  ]
28
28
 
29
29
  dependencies = [
30
- # Core (standalone bot)
30
+ # Core
31
31
  "pycryptodome",
32
32
  "requests",
33
- "flask",
34
33
  "six",
35
34
  # Backend (platform mode)
36
35
  "fastapi",