Learn / DGX Spark Cluster

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

  1. 0:00Introduction
  2. 0:06On both: One key
  3. 0:12On both: Start vLLM
  4. 0:27First Spark: Add NGINX
  5. 0:41Check: Prove both work
  6. 0:51Failover test: Stop one, on purpose
  7. 1:03Stop: Stop and undo
  8. 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_KEY

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

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

Wrap up

The page shows how to remove it all, and fixes by symptom.

Sources

More lessons