docker-compose.rdma-sim.yml 5.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209
  1. services:
  2. # SeaweedFS Master Server
  3. seaweedfs-master:
  4. image: chrislusf/seaweedfs:latest
  5. container_name: seaweedfs-master
  6. command: master -ip=seaweedfs-master -port=9333 -mdir=/data
  7. ports:
  8. - "9333:9333"
  9. volumes:
  10. - master-data:/data
  11. networks:
  12. - seaweedfs-rdma
  13. healthcheck:
  14. test: ["CMD", "pgrep", "-f", "weed"]
  15. interval: 15s
  16. timeout: 10s
  17. retries: 5
  18. start_period: 30s
  19. # SeaweedFS Volume Server
  20. seaweedfs-volume:
  21. image: chrislusf/seaweedfs:latest
  22. container_name: seaweedfs-volume
  23. command: volume -mserver=seaweedfs-master:9333 -ip=seaweedfs-volume -port=8080 -dir=/data
  24. ports:
  25. - "8080:8080"
  26. volumes:
  27. - volume-data:/data
  28. depends_on:
  29. seaweedfs-master:
  30. condition: service_healthy
  31. networks:
  32. - seaweedfs-rdma
  33. healthcheck:
  34. test: ["CMD", "pgrep", "-f", "weed"]
  35. interval: 15s
  36. timeout: 10s
  37. retries: 5
  38. start_period: 30s
  39. # RDMA Simulation Environment
  40. rdma-simulation:
  41. build:
  42. context: .
  43. dockerfile: docker/Dockerfile.rdma-simulation
  44. container_name: rdma-simulation
  45. privileged: true # Required for RDMA kernel module loading
  46. environment:
  47. - RDMA_DEVICE=rxe0
  48. - UCX_TLS=rc_verbs,ud_verbs,tcp
  49. - UCX_LOG_LEVEL=info
  50. volumes:
  51. - /lib/modules:/lib/modules:ro # Host kernel modules
  52. - /sys:/sys # Required for sysfs access
  53. - rdma-simulation-data:/opt/rdma-sim/data
  54. networks:
  55. - seaweedfs-rdma
  56. ports:
  57. - "18515:18515" # RDMA application port
  58. - "4791:4791" # RDMA CM port
  59. - "4792:4792" # Additional RDMA port
  60. command: |
  61. bash -c "
  62. echo '🚀 Setting up RDMA simulation environment...'
  63. sudo /opt/rdma-sim/setup-soft-roce.sh || echo 'RDMA setup failed, continuing...'
  64. echo '📋 RDMA environment status:'
  65. /opt/rdma-sim/test-rdma.sh || true
  66. echo '🔧 UCX information:'
  67. /opt/rdma-sim/ucx-info.sh || true
  68. echo '✅ RDMA simulation ready - keeping container alive...'
  69. tail -f /dev/null
  70. "
  71. healthcheck:
  72. test: ["CMD", "test", "-f", "/opt/rdma-sim/setup-soft-roce.sh"]
  73. interval: 30s
  74. timeout: 10s
  75. retries: 3
  76. start_period: 30s
  77. # Rust RDMA Engine (with RDMA simulation support)
  78. rdma-engine:
  79. build:
  80. context: .
  81. dockerfile: Dockerfile.rdma-engine
  82. container_name: rdma-engine
  83. environment:
  84. - RUST_LOG=debug
  85. - RDMA_SOCKET_PATH=/tmp/rdma-engine.sock
  86. # UCX configuration for real RDMA
  87. - UCX_TLS=rc_verbs,ud_verbs,tcp,shm
  88. - UCX_NET_DEVICES=all
  89. - UCX_LOG_LEVEL=info
  90. - UCX_RNDV_SCHEME=put_zcopy
  91. - UCX_RNDV_THRESH=8192
  92. volumes:
  93. - rdma-socket:/tmp
  94. # Share network namespace with RDMA simulation for device access
  95. network_mode: "container:rdma-simulation"
  96. depends_on:
  97. rdma-simulation:
  98. condition: service_healthy
  99. command: ["./rdma-engine-server", "--debug", "--ipc-socket", "/tmp/rdma-engine.sock"]
  100. healthcheck:
  101. test: ["CMD", "test", "-S", "/tmp/rdma-engine.sock"]
  102. interval: 10s
  103. timeout: 5s
  104. retries: 3
  105. start_period: 15s
  106. # Go RDMA Sidecar / Demo Server
  107. rdma-sidecar:
  108. build:
  109. context: .
  110. dockerfile: Dockerfile.sidecar
  111. container_name: rdma-sidecar
  112. ports:
  113. - "8081:8081"
  114. environment:
  115. - RDMA_SOCKET_PATH=/tmp/rdma-engine.sock
  116. - VOLUME_SERVER_URL=http://seaweedfs-volume:8080
  117. - DEBUG=true
  118. volumes:
  119. - rdma-socket:/tmp
  120. depends_on:
  121. rdma-engine:
  122. condition: service_healthy
  123. seaweedfs-volume:
  124. condition: service_healthy
  125. networks:
  126. - seaweedfs-rdma
  127. command: [
  128. "./demo-server",
  129. "--port", "8081",
  130. "--rdma-socket", "/tmp/rdma-engine.sock",
  131. "--volume-server", "http://seaweedfs-volume:8080",
  132. "--enable-rdma",
  133. "--debug"
  134. ]
  135. healthcheck:
  136. test: ["CMD", "curl", "-f", "http://localhost:8081/health"]
  137. interval: 10s
  138. timeout: 5s
  139. retries: 3
  140. start_period: 20s
  141. # Test Client for Integration Testing
  142. test-client:
  143. build:
  144. context: .
  145. dockerfile: Dockerfile.test-client
  146. container_name: test-client
  147. environment:
  148. - RDMA_SOCKET_PATH=/tmp/rdma-engine.sock
  149. - SIDECAR_URL=http://rdma-sidecar:8081
  150. - SEAWEEDFS_MASTER=http://seaweedfs-master:9333
  151. - SEAWEEDFS_VOLUME=http://seaweedfs-volume:8080
  152. volumes:
  153. - rdma-socket:/tmp
  154. depends_on:
  155. rdma-sidecar:
  156. condition: service_healthy
  157. networks:
  158. - seaweedfs-rdma
  159. profiles:
  160. - testing
  161. command: ["tail", "-f", "/dev/null"] # Keep container running for manual testing
  162. # Integration Test Runner with RDMA
  163. integration-tests-rdma:
  164. build:
  165. context: .
  166. dockerfile: Dockerfile.test-client
  167. container_name: integration-tests-rdma
  168. environment:
  169. - RDMA_SOCKET_PATH=/tmp/rdma-engine.sock
  170. - SIDECAR_URL=http://rdma-sidecar:8081
  171. - SEAWEEDFS_MASTER=http://seaweedfs-master:9333
  172. - SEAWEEDFS_VOLUME=http://seaweedfs-volume:8080
  173. - RDMA_SIMULATION=true
  174. volumes:
  175. - rdma-socket:/tmp
  176. - ./tests:/tests
  177. depends_on:
  178. rdma-sidecar:
  179. condition: service_healthy
  180. rdma-simulation:
  181. condition: service_healthy
  182. networks:
  183. - seaweedfs-rdma
  184. profiles:
  185. - testing
  186. command: ["/tests/run-integration-tests.sh"]
  187. volumes:
  188. master-data:
  189. driver: local
  190. volume-data:
  191. driver: local
  192. rdma-socket:
  193. driver: local
  194. rdma-simulation-data:
  195. driver: local
  196. networks:
  197. seaweedfs-rdma:
  198. driver: bridge
  199. ipam:
  200. config:
  201. - subnet: 172.20.0.0/16