|
| 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