Add library build, Docker cluster, and example client
Introduce a Makefile that builds libtoastyfs.a and libtoastyfs.so from the client-side sources (client, tcp, byte_queue, message, basic) so external programs can link against the ToastyFS client API in include/toastyfs.h. Add a Dockerfile and docker-compose.yml that spin up a 3-node ToastyFS server cluster on a private bridge network with ports 8081-8083 exposed on the host. Include cluster.sh as a convenience wrapper (up/down/status/ logs/run) — the "run" sub-command builds the library, compiles a user- supplied C source against it, starts the cluster, and executes the binary. Add examples/example.c demonstrating synchronous PUT, GET, DELETE, and a NOT_FOUND verification. https://claude.ai/code/session_019DVhmc25jfzcHnmdNxzib2
This commit is contained in:
@@ -0,0 +1,52 @@
|
||||
services:
|
||||
node1:
|
||||
build: .
|
||||
command:
|
||||
- "--addr"
|
||||
- "172.20.0.11:8080"
|
||||
- "--peer"
|
||||
- "172.20.0.12:8080"
|
||||
- "--peer"
|
||||
- "172.20.0.13:8080"
|
||||
networks:
|
||||
cluster:
|
||||
ipv4_address: 172.20.0.11
|
||||
ports:
|
||||
- "8081:8080"
|
||||
|
||||
node2:
|
||||
build: .
|
||||
command:
|
||||
- "--addr"
|
||||
- "172.20.0.12:8080"
|
||||
- "--peer"
|
||||
- "172.20.0.11:8080"
|
||||
- "--peer"
|
||||
- "172.20.0.13:8080"
|
||||
networks:
|
||||
cluster:
|
||||
ipv4_address: 172.20.0.12
|
||||
ports:
|
||||
- "8082:8080"
|
||||
|
||||
node3:
|
||||
build: .
|
||||
command:
|
||||
- "--addr"
|
||||
- "172.20.0.13:8080"
|
||||
- "--peer"
|
||||
- "172.20.0.11:8080"
|
||||
- "--peer"
|
||||
- "172.20.0.12:8080"
|
||||
networks:
|
||||
cluster:
|
||||
ipv4_address: 172.20.0.13
|
||||
ports:
|
||||
- "8083:8080"
|
||||
|
||||
networks:
|
||||
cluster:
|
||||
driver: bridge
|
||||
ipam:
|
||||
config:
|
||||
- subnet: 172.20.0.0/24
|
||||
Reference in New Issue
Block a user