Skip to content

Commit 76b68c8

Browse files
committed
Initial commit: Draw Things gRPCServer Installer
0 parents  commit 76b68c8

File tree

4 files changed

+908
-0
lines changed

4 files changed

+908
-0
lines changed

.gitignore

Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
1+
# Python
2+
__pycache__/
3+
*.py[cod]
4+
*$py.class
5+
*.so
6+
.Python
7+
build/
8+
develop-eggs/
9+
dist/
10+
downloads/
11+
eggs/
12+
.eggs/
13+
lib/
14+
lib64/
15+
parts/
16+
sdist/
17+
var/
18+
wheels/
19+
*.egg-info/
20+
.installed.cfg
21+
*.egg
22+
23+
# Virtual Environment
24+
venv/
25+
ENV/
26+
env/
27+
.env/
28+
29+
# IDE
30+
.idea/
31+
.vscode/
32+
*.swp
33+
*.swo
34+
*~
35+
36+
# macOS
37+
.DS_Store
38+
.AppleDouble
39+
.LSOverride
40+
._*
41+
42+
# Logs
43+
*.log
44+
logs/
45+
log/
46+
47+
# Downloaded binaries
48+
gRPCServerCLI

LICENSE

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
MIT License
2+
3+
Copyright (c) 2024 Draw Things gRPCServer Installer Contributors
4+
5+
Permission is hereby granted, free of charge, to any person obtaining a copy
6+
of this software and associated documentation files (the "Software"), to deal
7+
in the Software without restriction, including without limitation the rights
8+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9+
copies of the Software, and to permit persons to whom the Software is
10+
furnished to do so, subject to the following conditions:
11+
12+
The above copyright notice and this permission notice shall be included in all
13+
copies or substantial portions of the Software.
14+
15+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21+
SOFTWARE.

README.md

Lines changed: 138 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,138 @@
1+
# Draw Things gRPCServer Installer
2+
3+
A Python script to install and manage the Draw Things Community gRPCServer on macOS. This installer handles downloading the latest gRPCServer binary, setting up a LaunchAgent service, and managing the server configuration.
4+
5+
## Requirements
6+
7+
- macOS 15
8+
- Python 3.9+
9+
10+
## Installation
11+
12+
1. Download the installer script:
13+
```bash
14+
git clone https://github.com/funkatron/draw-things-grpcservercli-installer.git
15+
```
16+
17+
## Usage
18+
19+
```bash
20+
# Basic installation with defaults
21+
./install-grpcservercli.py
22+
23+
# Install with custom model path
24+
./install-grpcservercli.py -m /path/to/models
25+
26+
# Install with custom port and server name
27+
./install-grpcservercli.py -p 7860 -n "MyServer"
28+
29+
# Install with security options
30+
./install-grpcservercli.py -s "mysecret"
31+
32+
# Install with model browser enabled
33+
./install-grpcservercli.py --model-browser
34+
35+
# Install with proxy configuration
36+
./install-grpcservercli.py --join '{"host":"proxy.local", "port":7859}'
37+
38+
# Restart the service
39+
./install-grpcservercli.py --restart
40+
41+
# Quiet install with defaults
42+
./install-grpcservercli.py -q
43+
44+
# Uninstall
45+
./install-grpcservercli.py --uninstall
46+
```
47+
48+
## Options
49+
50+
### Installer Options
51+
- `-m, --model-path`: Custom path to store models (default: Draw Things app models directory)
52+
- `-h, --help`: Show help message
53+
- `--uninstall`: Uninstall gRPCServerCLI and remove all related files
54+
- `--restart`: Restart the gRPCServerCLI service
55+
- `-q, --quiet`: Minimize output and assume default answers to prompts
56+
57+
### gRPCServerCLI Options
58+
- `-n, --name`: Server name in local network (default: machine name)
59+
- `-p, --port`: Port to run the server on (default: 7859)
60+
- `-a, --address`: Address to bind to (default: 0.0.0.0)
61+
- `-g, --gpu`: GPU index to use (default: 0)
62+
- `-d, --datadog-api-key`: Datadog API key for logging backend
63+
- `-s, --shared-secret`: Shared secret for server security
64+
- `--no-tls`: Disable TLS for connections (not recommended)
65+
- `--no-response-compression`: Disable response compression
66+
- `--model-browser`: Enable model browsing
67+
- `--no-flash-attention`: Disable Flash Attention
68+
- `--debug`: Enable verbose model inference logging
69+
- `--join`: JSON configuration for proxy setup
70+
71+
## Advanced Configuration
72+
73+
### Proxy Setup
74+
The `--join` option accepts a JSON string for proxy configuration:
75+
```json
76+
{
77+
"host": "proxy.example.com",
78+
"port": 7859,
79+
"servers": [
80+
{
81+
"address": "gpu1.local",
82+
"port": 7859,
83+
"priority": 1
84+
}
85+
]
86+
}
87+
```
88+
89+
Required fields:
90+
- `host`: The proxy server hostname
91+
- `port`: The proxy server port
92+
93+
Optional fields:
94+
- `servers`: List of GPU servers with:
95+
- `address`: Server hostname
96+
- `port`: Server port
97+
- `priority`: Server priority (1=high, 2=low)
98+
99+
## Service Management
100+
101+
The installer creates a LaunchAgent service that:
102+
- Starts automatically on login
103+
- Restarts automatically if it crashes
104+
- Can be managed with:
105+
```bash
106+
# Stop the service
107+
launchctl unload ~/Library/LaunchAgents/com.drawthings.grpcserver.plist
108+
109+
# Start the service
110+
launchctl load ~/Library/LaunchAgents/com.drawthings.grpcserver.plist
111+
112+
# Restart the service
113+
./install-grpcservercli.py --restart
114+
```
115+
116+
## Troubleshooting
117+
118+
1. **Port already in use**
119+
- The installer will detect if the port is in use and show which process is using it
120+
- Use a different port with `-p` or stop the conflicting process
121+
122+
2. **Permission denied when installing to /usr/local/bin**
123+
- The installer will automatically fall back to ~/.local/bin
124+
- You can run with sudo if you need to install in /usr/local/bin
125+
126+
3. **Service fails to start**
127+
- Check the system log for errors: `log show --predicate 'processImagePath contains "gRPCServerCLI"' --last 5m`
128+
- Ensure the model path exists and is accessible
129+
- Try restarting with `--restart` option
130+
131+
## License
132+
133+
This project is licensed under the MIT License - see the [LICENSE](LICENSE) file for details.
134+
135+
## Acknowledgments
136+
137+
- [Draw Things](https://drawthings.ai/)
138+
- [Draw Things Community](https://github.com/drawthingsai/draw-things-community)

0 commit comments

Comments
 (0)