You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
@@ -4,7 +4,7 @@ This file provides guidance to Claude Code (claude.ai/code) when working with co
4
4
5
5
## Project Overview
6
6
7
-
Weave Node Manager (wnm) is a Python application for managing Autonomi nodes on Linux and macOS systems. It's an Alpha-stage Python port of the `anm` (autonomic node manager) tool. The system automatically manages node lifecycle: creating, starting, stopping, upgrading, and removing nodes based on system resource thresholds (CPU, memory, disk, network I/O, load average).
7
+
Weave Node Manager (wnm) is a Python application for managing Autonomi nodes on Linux and macOS systems. The system automatically manages node lifecycle: creating, starting, stopping, upgrading, and removing nodes based on system resource thresholds (CPU, memory, disk, network I/O, load average).
8
8
9
9
**Platforms**:
10
10
-**Linux**: systemd or setsid for process management, UFW for firewall (root or user-level)
@@ -13,286 +13,87 @@ Weave Node Manager (wnm) is a Python application for managing Autonomi nodes on
13
13
14
14
## Development Environment
15
15
16
-
### macOS Development (Native)
17
-
18
-
**On macOS, you can run and test natively** using launchd for process management:
-**Binary**: `get_latest_binary_version()` - Checks for new antnode versions
64
+
### Key Modules
65
+
-**`models.py`**: SQLAlchemy ORM — `Machine` (single row, cluster config) and `Node` (one row per node)
66
+
-**`config.py`**: Multi-layer config — CLI args → env vars → config files → DB → defaults; global `options`, `machine_config`, session factory `S` created at import
WNM supports running multiple node operations simultaneously to better utilize powerful hardware. This feature allows aggressive scaling on machines with high capacity.
221
-
222
-
### Configuration Parameters
223
-
224
-
**Per-Operation Limits:**
225
-
-`--max_concurrent_upgrades` (default: 1): Maximum nodes upgrading simultaneously
226
-
-`--max_concurrent_starts` (default: 1): Maximum nodes starting/restarting simultaneously
227
-
-`--max_concurrent_removals` (default: 1): Maximum nodes being removed simultaneously
228
-
229
-
**Global Limit:**
230
-
-`--max_concurrent_operations` (default: 1): Total concurrent operations across all types
231
-
232
-
The effective limit is MIN(per_operation_limit, remaining_global_capacity).
233
-
234
-
### Examples
235
-
236
-
**Conservative (default):**
237
-
```bash
238
-
wnm --max_concurrent_upgrades 1 \
239
-
--max_concurrent_starts 1 \
240
-
--max_concurrent_operations 1
241
-
```
242
-
243
-
**Aggressive (powerful machine):**
244
-
```bash
245
-
wnm --max_concurrent_upgrades 4 \
246
-
--max_concurrent_starts 4 \
247
-
--max_concurrent_removals 2 \
248
-
--max_concurrent_operations 8
249
-
```
250
-
251
-
**Very aggressive (high-end server):**
252
-
```bash
253
-
wnm --max_concurrent_upgrades 10 \
254
-
--max_concurrent_starts 10 \
255
-
--max_concurrent_removals 5 \
256
-
--max_concurrent_operations 20
257
-
```
258
-
259
-
### Behavior
260
-
261
-
WNM will **aggressively scale to capacity** each cycle:
262
-
- If upgrade limit is 4 and 2 nodes are upgrading, WNM will start 2 more upgrades immediately
263
-
- Operations respect both per-type limits AND global limit
264
-
- Dead node removals always take priority and ignore limits
265
-
- Each action selects a different node (no duplicate operations on same node)
266
-
267
-
### Capacity Constraints
268
-
269
-
Operations are limited by actual node availability:
270
-
-**Upgrades**: Limited by nodes needing upgrade
271
-
-**Starts**: Limited by stopped nodes available
272
-
-**Adds**: Limited by node cap - total nodes
273
-
-**Removes**: Limited by stopped/running nodes available
274
-
275
-
Example: If `max_concurrent_starts=4` but only 2 stopped nodes exist, WNM will:
Per-type limits (`--max_concurrent_upgrades/starts/removals`, default 1) combined with a global cap (`--max_concurrent_operations`, default 1). Effective limit = MIN(per-type, remaining global). See `docs/USER-GUIDE-PART3.md` for configuration examples.
278
93
279
94
## Important Constraints
280
-
281
-
- Concurrent operations respect configured limits (defaults: 1 operation per cycle, configurable for powerful machines)
282
-
- Nodes are added/removed based on the "youngest" (most recent `age` timestamp)
283
-
- Upgrades only proceed when no removals are pending
284
-
- Database has single Machine row (id=1); updates apply to entire cluster
285
-
- Lock file prevents concurrent execution
286
-
-**Platform-specific requirements**:
287
-
- Linux (root): Requires sudo for systemd and ufw
288
-
- Linux (user): No sudo required, uses setsid
289
-
- macOS: No sudo required, uses launchd
290
-
291
-
## Platform Support
292
-
293
-
See `MACOS-SUPPORT-PLAN.md` for detailed macOS implementation roadmap.
294
-
See `PLATFORM-SUPPORT.md` for platform-specific details on:
295
-
- Process management (systemd, launchd, setsid)
296
-
- Firewall management (UFW, null)
297
-
- Path conventions
298
-
- Binary management and upgrades
95
+
- Single `Machine` row (id=1); all config updates apply cluster-wide
96
+
- Nodes selected for removal by "youngest" (`age` timestamp)
97
+
- Upgrades skipped unless `--enable_upgrade` is passed (antnode self-upgrades by default)
98
+
- Linux root mode requires sudo for systemd and UFW
99
+
-`--port_start`, `--metrics_port_start`, and `--process_manager` are immutable after `--init`
0 commit comments