feat: add consistent deployment/update process (deploy.sh + docs + AGENTS.md)
- scripts/deploy.sh: target-aware deploy (dankclaw/dankserver). Pushes main, pulls on the target, installs/enables systemd unit, restarts service, and checks the health endpoint; --dry-run preview; pre-flight dirty-tree check - docs/deployment.md: full deployment/update process with mermaid workflow, target map, manual update commands, service units, and troubleshooting - AGENTS.md: add Deployment & Update Process section (deploy.sh usage, target map, mermaid workflow) and a Summary table row - docs/index.md: crosslink deployment doc
This commit is contained in:
@@ -0,0 +1,133 @@
|
||||
# Deployment and Update Process
|
||||
|
||||
This page describes how to deploy and update the LLM servers on Dankserver and Dankclaw. The process uses git as the single source of truth. All script edits flow through this repository.
|
||||
|
||||
## Overview
|
||||
|
||||
Two servers run LLM inference services. Each server pulls its scripts from this repository. The deployment process moves a committed change from the repository to a running service.
|
||||
|
||||
| Target | Host | Runtime | Service | Port |
|
||||
|--------|------|---------|---------|------|
|
||||
| Dankclaw | dank@dankclaw | ROCmFPX llama.cpp | llama-server | 8080 |
|
||||
| Dankserver | dank@dankserver | vLLM (Docker) | vllm-qwen36 | 8000 |
|
||||
|
||||
## Workflow
|
||||
|
||||
The deployment workflow has six steps.
|
||||
|
||||
```mermaid
|
||||
graph LR
|
||||
A[Edit scripts locally] --> B[Commit]
|
||||
B --> C[Push to origin<br>Gitea on Dankclaw]
|
||||
C --> D[Pull on target<br>git pull]
|
||||
D --> E[Restart systemd service]
|
||||
E --> F[Verify health endpoint]
|
||||
```
|
||||
|
||||
1. Fetch the current script from the target machine.
|
||||
2. Commit the fetched version in this repository.
|
||||
3. Edit the script locally in the working tree.
|
||||
4. Commit and push the change to origin.
|
||||
5. Pull the change on the target machine.
|
||||
6. Restart the service and verify that it is healthy.
|
||||
|
||||
## Deploy Script
|
||||
|
||||
The `scripts/deploy.sh` script executes steps 4 through 6. Run it from the repository root.
|
||||
|
||||
Run this command to deploy to Dankclaw:
|
||||
|
||||
```
|
||||
./scripts/deploy.sh dankclaw
|
||||
```
|
||||
|
||||
Run this command to deploy to Dankserver:
|
||||
|
||||
```
|
||||
./scripts/deploy.sh dankserver
|
||||
```
|
||||
|
||||
Add the `--dry-run` flag to preview without making changes:
|
||||
|
||||
```
|
||||
./scripts/deploy.sh dankclaw --dry-run
|
||||
```
|
||||
|
||||
The script does these actions:
|
||||
|
||||
1. Verifies that the local working tree has no uncommitted changes.
|
||||
2. Pushes the `main` branch to origin.
|
||||
3. Pulls the repository on the target machine.
|
||||
4. Installs or updates the systemd unit.
|
||||
5. Reloads systemd and restarts the service.
|
||||
6. Waits for the health endpoint to respond.
|
||||
|
||||
## Manual Update
|
||||
|
||||
If you cannot run the deploy script, update a server manually. Complete each step on the target machine.
|
||||
|
||||
### Update Dankclaw
|
||||
|
||||
1. Pull the repository.
|
||||
2. Symlink the unit file, if it changed.
|
||||
3. Reload and restart the service.
|
||||
|
||||
Run these commands on Dankclaw:
|
||||
|
||||
```
|
||||
cd /home/dank/vllmScripts
|
||||
git pull origin main
|
||||
sudo ln -sf /home/dank/vllmScripts/scripts/llama-server.service /etc/systemd/system/llama-server.service
|
||||
sudo systemctl daemon-reload
|
||||
sudo systemctl restart llama-server
|
||||
curl -sf http://127.0.0.1:8080/health
|
||||
```
|
||||
|
||||
### Update Dankserver
|
||||
|
||||
Run these commands on Dankserver:
|
||||
|
||||
```
|
||||
cd /home/dank/vLLM
|
||||
git pull origin main
|
||||
sudo systemctl daemon-reload
|
||||
sudo systemctl restart vllm-qwen36
|
||||
curl -sf http://127.0.0.1:8000/health
|
||||
```
|
||||
|
||||
## Service Units
|
||||
|
||||
### Dankclaw — llama-server
|
||||
|
||||
The active service on Dankclaw runs the ROCmFPX llama.cpp runtime. It serves the Ling-3.0-flash ROCmFP4 MTP model with `draft-mtp` speculative decoding. The unit file is `scripts/llama-server.service` in the repository. The machine symlinks it to `/etc/systemd/system/llama-server.service`.
|
||||
|
||||
### Dankserver — vllm-qwen36
|
||||
|
||||
The vLLM service on Dankserver runs in a Docker container. The unit file is a physical file on the machine, not a symlink into the repository. The `vllm-qwen36.sh` launcher in the repository passes the model and flags to `docker run`.
|
||||
|
||||
> Note: a second unit, `vllm-awq-qwen36.service`, currently runs the AWQ 4-bit model on port 34401. Verify the intended service before a restart. See the repository `git log` for the latest decision.
|
||||
|
||||
## Validation
|
||||
|
||||
The deploy script checks the health endpoint after a restart. For deeper checks, run the validation script on the target.
|
||||
|
||||
Run this command on Dankserver to test vLLM throughput:
|
||||
|
||||
```
|
||||
./scripts/validate-vllm.sh
|
||||
```
|
||||
|
||||
## Troubleshooting
|
||||
|
||||
If the health check fails after a deploy:
|
||||
|
||||
1. Read the service logs with `journalctl -u <service> -n 200`.
|
||||
2. Confirm that the model files exist in the cache.
|
||||
3. Confirm that the GPU has free memory.
|
||||
4. Check the service status with `systemctl status <service>`.
|
||||
|
||||
## See Also
|
||||
|
||||
- [AGENTS.md](../AGENTS.md) — the git workflow rules
|
||||
- [README.md](../README.md) — repository overview
|
||||
- [index.md](index.md) — knowledge base index
|
||||
@@ -35,6 +35,7 @@ graph LR
|
||||
|
||||
- [[VLLM Overview]] — installation, CLI, API, architecture, quantization, parallelism
|
||||
- [[VLLM Index]] — quick reference with commands, endpoints, and parameter table
|
||||
- [[deployment]] — deploy and update process for both servers
|
||||
|
||||
## Memory Management
|
||||
|
||||
|
||||
Reference in New Issue
Block a user