comfygit-deploy 0.3.8__tar.gz → 0.3.8.dev1__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.
- {comfygit_deploy-0.3.8 → comfygit_deploy-0.3.8.dev1}/.gitignore +1 -0
- {comfygit_deploy-0.3.8 → comfygit_deploy-0.3.8.dev1}/PKG-INFO +2 -2
- comfygit_deploy-0.3.8.dev1/docs/architecture.md +87 -0
- {comfygit_deploy-0.3.8 → comfygit_deploy-0.3.8.dev1}/pyproject.toml +2 -2
- {comfygit_deploy-0.3.8 → comfygit_deploy-0.3.8.dev1}/README.md +0 -0
- {comfygit_deploy-0.3.8 → comfygit_deploy-0.3.8.dev1}/comfygit_deploy/__init__.py +0 -0
- {comfygit_deploy-0.3.8 → comfygit_deploy-0.3.8.dev1}/comfygit_deploy/cli.py +0 -0
- {comfygit_deploy-0.3.8 → comfygit_deploy-0.3.8.dev1}/comfygit_deploy/commands/__init__.py +0 -0
- {comfygit_deploy-0.3.8 → comfygit_deploy-0.3.8.dev1}/comfygit_deploy/commands/custom.py +0 -0
- {comfygit_deploy-0.3.8 → comfygit_deploy-0.3.8.dev1}/comfygit_deploy/commands/dev.py +0 -0
- {comfygit_deploy-0.3.8 → comfygit_deploy-0.3.8.dev1}/comfygit_deploy/commands/instances.py +0 -0
- {comfygit_deploy-0.3.8 → comfygit_deploy-0.3.8.dev1}/comfygit_deploy/commands/runpod.py +0 -0
- {comfygit_deploy-0.3.8 → comfygit_deploy-0.3.8.dev1}/comfygit_deploy/commands/worker.py +0 -0
- {comfygit_deploy-0.3.8 → comfygit_deploy-0.3.8.dev1}/comfygit_deploy/config.py +0 -0
- {comfygit_deploy-0.3.8 → comfygit_deploy-0.3.8.dev1}/comfygit_deploy/providers/__init__.py +0 -0
- {comfygit_deploy-0.3.8 → comfygit_deploy-0.3.8.dev1}/comfygit_deploy/providers/custom.py +0 -0
- {comfygit_deploy-0.3.8 → comfygit_deploy-0.3.8.dev1}/comfygit_deploy/providers/runpod.py +0 -0
- {comfygit_deploy-0.3.8 → comfygit_deploy-0.3.8.dev1}/comfygit_deploy/startup/__init__.py +0 -0
- {comfygit_deploy-0.3.8 → comfygit_deploy-0.3.8.dev1}/comfygit_deploy/startup/scripts.py +0 -0
- {comfygit_deploy-0.3.8 → comfygit_deploy-0.3.8.dev1}/comfygit_deploy/worker/__init__.py +0 -0
- {comfygit_deploy-0.3.8 → comfygit_deploy-0.3.8.dev1}/comfygit_deploy/worker/mdns.py +0 -0
- {comfygit_deploy-0.3.8 → comfygit_deploy-0.3.8.dev1}/comfygit_deploy/worker/native_manager.py +0 -0
- {comfygit_deploy-0.3.8 → comfygit_deploy-0.3.8.dev1}/comfygit_deploy/worker/server.py +0 -0
- {comfygit_deploy-0.3.8 → comfygit_deploy-0.3.8.dev1}/comfygit_deploy/worker/state.py +0 -0
- {comfygit_deploy-0.3.8 → comfygit_deploy-0.3.8.dev1}/tests/__init__.py +0 -0
- {comfygit_deploy-0.3.8 → comfygit_deploy-0.3.8.dev1}/tests/conftest.py +0 -0
- {comfygit_deploy-0.3.8 → comfygit_deploy-0.3.8.dev1}/tests/test_cli.py +0 -0
- {comfygit_deploy-0.3.8 → comfygit_deploy-0.3.8.dev1}/tests/test_config.py +0 -0
- {comfygit_deploy-0.3.8 → comfygit_deploy-0.3.8.dev1}/tests/test_custom_client.py +0 -0
- {comfygit_deploy-0.3.8 → comfygit_deploy-0.3.8.dev1}/tests/test_logs_streaming.py +0 -0
- {comfygit_deploy-0.3.8 → comfygit_deploy-0.3.8.dev1}/tests/test_mdns.py +0 -0
- {comfygit_deploy-0.3.8 → comfygit_deploy-0.3.8.dev1}/tests/test_mdns_scanner.py +0 -0
- {comfygit_deploy-0.3.8 → comfygit_deploy-0.3.8.dev1}/tests/test_native_manager.py +0 -0
- {comfygit_deploy-0.3.8 → comfygit_deploy-0.3.8.dev1}/tests/test_runpod_client.py +0 -0
- {comfygit_deploy-0.3.8 → comfygit_deploy-0.3.8.dev1}/tests/test_startup_script.py +0 -0
- {comfygit_deploy-0.3.8 → comfygit_deploy-0.3.8.dev1}/tests/test_unified_instances.py +0 -0
- {comfygit_deploy-0.3.8 → comfygit_deploy-0.3.8.dev1}/tests/test_worker_commands.py +0 -0
- {comfygit_deploy-0.3.8 → comfygit_deploy-0.3.8.dev1}/tests/test_worker_server.py +0 -0
- {comfygit_deploy-0.3.8 → comfygit_deploy-0.3.8.dev1}/tests/test_worker_state.py +0 -0
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: comfygit-deploy
|
|
3
|
-
Version: 0.3.8
|
|
3
|
+
Version: 0.3.8.dev1
|
|
4
4
|
Summary: ComfyGit Deploy - Remote deployment and worker management CLI
|
|
5
5
|
Requires-Python: >=3.10
|
|
6
6
|
Requires-Dist: aiohttp>=3.9.0
|
|
7
|
-
Requires-Dist: comfygit==0.3.8
|
|
7
|
+
Requires-Dist: comfygit==0.3.8.dev1
|
|
8
8
|
Requires-Dist: zeroconf>=0.131.0
|
|
9
9
|
Description-Content-Type: text/markdown
|
|
10
10
|
|
|
@@ -0,0 +1,87 @@
|
|
|
1
|
+
# ComfyGit Deploy - Architecture
|
|
2
|
+
|
|
3
|
+
## Overview
|
|
4
|
+
|
|
5
|
+
ComfyGit Deploy is a remote deployment and worker management CLI for ComfyUI. It provides two deployment modes: **cloud-based via RunPod** (managed serverless GPU) and **self-hosted workers** (HTTP API on local infrastructure). Both modes support multi-instance management, configuration persistence, and automatic ComfyUI environment setup.
|
|
6
|
+
|
|
7
|
+
**Entry point**: `comfygit_deploy.cli:main()` → `cg-deploy` command
|
|
8
|
+
|
|
9
|
+
## Core Architecture Pattern
|
|
10
|
+
|
|
11
|
+
**Layer-based with provider abstraction**:
|
|
12
|
+
1. **CLI Layer** (`cli.py` + `commands/`) - Argument parsing and command routing
|
|
13
|
+
2. **Provider Clients** (`providers/`) - Cloud API abstractions (RunPod, custom workers)
|
|
14
|
+
3. **Worker Runtime** (`worker/`) - Self-hosted instance management and HTTP server
|
|
15
|
+
4. **Shared Services** (`config.py`, `startup/`) - Configuration and script generation
|
|
16
|
+
5. **Domain Objects** (dataclasses in `state.py`) - Instance and state representation
|
|
17
|
+
|
|
18
|
+
No coupling to specific UI frameworks. All operations async-first with aiohttp.
|
|
19
|
+
|
|
20
|
+
## Module Organization
|
|
21
|
+
|
|
22
|
+
| Directory | Purpose | Key Concepts |
|
|
23
|
+
|-----------|---------|--------------|
|
|
24
|
+
| `cli.py` | Argument parsing and command dispatch | Subcommands, main() entry |
|
|
25
|
+
| `config.py` | Persistent configuration storage | DeployConfig, ~/.config/comfygit/deploy/ |
|
|
26
|
+
| `commands/` | Command handlers for CLI subcommands | runpod, custom, instances, dev, worker |
|
|
27
|
+
| `providers/` | Cloud provider REST/GraphQL clients | RunPodClient, CustomWorkerClient, API abstraction |
|
|
28
|
+
| `startup/` | Startup script generation for deployments | generate_startup_script(), deployment IDs |
|
|
29
|
+
| `worker/` | Self-hosted worker server and state | WorkerServer, InstanceState, PortAllocator, NativeManager |
|
|
30
|
+
|
|
31
|
+
## Key Abstractions
|
|
32
|
+
|
|
33
|
+
### Provider Clients (`providers/`)
|
|
34
|
+
- **RunPodClient** - RunPod GraphQL/REST client (pod provisioning, lifecycle, logs)
|
|
35
|
+
- **CustomWorkerClient** - HTTP client for self-hosted workers
|
|
36
|
+
- Unified interface: async methods for deploy, stop, terminate, logs
|
|
37
|
+
|
|
38
|
+
### Worker Server (`worker/`)
|
|
39
|
+
- **WorkerServer** - aiohttp-based REST API for instance management
|
|
40
|
+
- **WorkerState** - Persistent JSON state file tracking all instances
|
|
41
|
+
- **InstanceState** - Single instance (ComfyUI process) with port allocation and status
|
|
42
|
+
- **PortAllocator** - Reserved port pool (8200-8210) for instance mapping
|
|
43
|
+
- **NativeManager** - Launch/monitor native processes (non-Docker fallback)
|
|
44
|
+
|
|
45
|
+
### Configuration (`config.py`)
|
|
46
|
+
- **DeployConfig** - Load/save RunPod API keys and custom worker registry from JSON
|
|
47
|
+
- Defaults to `~/.config/comfygit/deploy/config.json`
|
|
48
|
+
|
|
49
|
+
### Startup Scripts (`startup/`)
|
|
50
|
+
- **generate_startup_script()** - Bash script template for ComfyUI + ComfyGit setup on RunPod
|
|
51
|
+
- Injects deployment ID, git source, branch, port configuration
|
|
52
|
+
- No side effects; pure script generation
|
|
53
|
+
|
|
54
|
+
## Where to Look
|
|
55
|
+
|
|
56
|
+
**Adding a new cloud provider**: Copy `providers/runpod.py` pattern → implement HTTP client
|
|
57
|
+
**Modifying worker API**: Edit `worker/server.py` route handlers and request/response handling
|
|
58
|
+
**State persistence**: `worker/state.py` → InstanceState serialization and WorkerState JSON management
|
|
59
|
+
**Configuration**: `config.py` → DeployConfig add new fields → update config schema
|
|
60
|
+
**CLI commands**: `commands/{provider}.py` → add handler function → register in `cli.py` subparser
|
|
61
|
+
**Instance lifecycle**: `worker/native_manager.py` → launch/monitor/cleanup process management
|
|
62
|
+
|
|
63
|
+
## Design Patterns
|
|
64
|
+
|
|
65
|
+
1. **Async-First** - All I/O async; sync wrappers use `asyncio.run()` in CLI commands
|
|
66
|
+
2. **Configuration as Code** - Startup scripts are pure functions generating Bash (no template files)
|
|
67
|
+
3. **Provider Polymorphism** - Same CLI commands dispatch to different backends (RunPod vs custom)
|
|
68
|
+
4. **Persistent State** - Worker state saved to JSON; survives restarts via state reload
|
|
69
|
+
5. **Port Allocation** - Reserved port ranges prevent conflicts; allocation persisted with instance
|
|
70
|
+
6. **Error Context** - Custom exceptions (RunPodAPIError, CustomWorkerError) with structured details
|
|
71
|
+
|
|
72
|
+
## Dependencies
|
|
73
|
+
|
|
74
|
+
- **comfygit** - Core library for environment management
|
|
75
|
+
- **aiohttp** - Async HTTP for APIs and worker server
|
|
76
|
+
- **zeroconf** - mDNS discovery for worker discovery (planned)
|
|
77
|
+
|
|
78
|
+
## Testing Strategy
|
|
79
|
+
|
|
80
|
+
Tests in `tests/` cover:
|
|
81
|
+
- Config load/save roundtrips
|
|
82
|
+
- Provider client API mocking
|
|
83
|
+
- Worker state serialization
|
|
84
|
+
- Port allocation logic
|
|
85
|
+
- Startup script generation
|
|
86
|
+
- Worker server routes and lifecycle
|
|
87
|
+
- Instance lifecycle operations
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
[project]
|
|
2
2
|
name = "comfygit-deploy"
|
|
3
|
-
version = "0.3.8"
|
|
3
|
+
version = "0.3.8.dev1"
|
|
4
4
|
description = "ComfyGit Deploy - Remote deployment and worker management CLI"
|
|
5
5
|
readme = "README.md"
|
|
6
6
|
requires-python = ">=3.10"
|
|
7
7
|
dependencies = [
|
|
8
|
-
"comfygit==0.3.8",
|
|
8
|
+
"comfygit==0.3.8.dev1",
|
|
9
9
|
"aiohttp>=3.9.0",
|
|
10
10
|
"zeroconf>=0.131.0",
|
|
11
11
|
]
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{comfygit_deploy-0.3.8 → comfygit_deploy-0.3.8.dev1}/comfygit_deploy/worker/native_manager.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|