Two copies on two DGX Sparks, part 2: set up, check and stop
Now let's set up two copies. We haven't run these steps on hardware. Make one long random key.
Chapters
- 0:00Introduction
- 0:06On both: One key
- 0:12On both: Start vLLM
- 0:27First Spark: Add NGINX
- 0:41Check: Prove both work
- 0:51Failover test: Stop one, on purpose
- 1:03Stop: Stop and undo
- 1:12Wrap up
Read the transcript
Introduction
Now let's set up two copies. We haven't run these steps on hardware.
On both: One key
Make one long random key. Type it in on each Spark, so it stays out of your shell history.
openssl rand -hex 32
read -rs VLLM_API_KEY && export VLLM_API_KEYOn both: Start vLLM
This loads the GPU and much of the memory, so check both Sparks are free. Set each Spark's own link address, the image and the model. Then start the container. Follow its log until it says the application has started.
export LINK_IP="THIS-SPARK-LINK-ADDRESS"
docker run -d --name vllm-copy --gpus all --ipc=host \
-p "$LINK_IP:8000:8000" -e VLLM_API_KEY \
-v ~/.cache/huggingface:/root/.cache/huggingface \
"$VLLM_IMAGE" vllm serve "$MODEL"
docker logs -f vllm-copyFirst Spark: Add NGINX
On the first Spark, write the NGINX file from the page, naming both link addresses. Start NGINX. It listens only on that Spark. From your computer, open an SSH tunnel to reach it.
Check: Prove both work
Check each server's health by itself. List the models through the one address, with your key. Send several requests at once, and watch both logs.
Failover test: Stop one, on purpose
The next test stops a model server, and cuts off whatever it's answering. Stop the second one, then send a new request. It should still be answered. Then start it again, and wait for it to load.
Stop: Stop and undo
Stopping ends any replies in progress. Stop the balancer first. Then stop the model server on both Sparks.
docker stop spark-front
docker stop vllm-copyWrap up
The page shows how to remove it all, and fixes by symptom.
Sources
- docs.vllm.ai/en/latest/deployment/nginx
- docs.vllm.ai/en/latest/usage/security
- github.com/NVIDIA/dgx-spark-playbooks/tree/main/nvidia/vllm
- nginx.org/en/docs/http/ngx_http_upstream_module.html
- nginx.org/en/docs/http/ngx_http_proxy_module.html
- docs.vllm.ai/en/latest/deployment/docker