Swarm curl Client/Server Over Nextmini
Deploys external curl client and server services into the swarm network, inserts explicit routes, and validates end-to-end HTTP traffic.
This example adds external client/server services on top of a running swarm dataplane deployment (typically from examples/multi-dc).
For base swarm dataplane deployment, use Multi-DC Swarm Dataplane.
The flow is:
- Deploy
curl-serverandcurl-clientservices in the same overlay network as dataplane (nextmini_nextmini-net). - Insert explicit routes with
route/insert_route.py. - Read service logs to confirm
curlreaches the server through Nextmini.
Prerequisites
Before running this page, ensure:
- Multi-DC controller + dataplane are already running (see
examples/multi-dc). - You can run commands on the swarm manager.
curl-serverandcurl-clientimages are built on the nodes where they will be scheduled.
Deployment order
1. Build server/client images
On the host that will run the server service:
cd /path/to/nextmini/examples/swarm-curl
docker build -t curl-server -f src/Dockerfile.server .On the host that will run the client service:
cd /path/to/nextmini/examples/swarm-curl
docker build -t curl-client -f src/Dockerfile.client .2. Manager: create server then client services
From the swarm manager, deploy server first:
docker service create \
--name curl-server \
--replicas 1 \
--network nextmini_nextmini-net \
--publish 8080:8080 \
--constraint 'node.hostname==<SERVER_HOSTNAME>' \
--restart-condition on-failure \
--restart-delay 5s \
--restart-max-attempts 3 \
curl-server:latestThen deploy client:
docker service create \
--name curl-client \
--replicas 1 \
--network nextmini_nextmini-net \
--constraint 'node.hostname==<CLIENT_HOSTNAME>' \
--restart-condition on-failure \
--restart-delay 10s \
--restart-max-attempts 5 \
curl-client:latest3. Insert routes
route/insert_route.py does two important things:
- Reads service VIPs for
curl-clientandcurl-serverfrom Docker. - Inserts two DB routes using
INTERMEDIATE_HOPS = [1, 2, 3]:- client ->
1,2,3-> server - server ->
3,2,1-> client
- client ->
Before running it, update database host in route/insert_route.py if needed:
cd /path/to/nextmini/examples/swarm-curl
rg 'host=' route/insert_route.pyThen insert routes:
cd route
uv run insert_route.pyVerify
From swarm manager:
docker service ls
docker service logs --tail 100 curl-server
docker service logs --tail 100 curl-clientSuccessful client logs include a completed curl run and HTTP output from the server (Hello World).
Optional DB verification from the controller host:
cd /path/to/nextmini/examples/multi-dc
docker compose -f controller-standalone.yml exec postgres \
psql -U pgusr -d nextmini -c "SELECT src_node_id, dst_node_id, route FROM routes LIMIT 10;"Tear down
Remove client/server services from the manager:
docker service rm curl-client curl-serverIf this environment was created only for this test, also remove dataplane and control-plane services:
# swarm manager
docker stack rm nextmini
# controller host
cd /path/to/nextmini/examples/multi-dc
docker compose -f controller-standalone.yml downMulti-DC Swarm Dataplane
Runs controller and database on one host, then deploys dataplane replicas from a Docker Swarm manager across worker hosts.
SBA Swarm for Distributed Training
Deploys two PyTorch-capable dataplane nodes in Docker Swarm with a separate controller/Postgres host, then runs distributed training tests.