1- # Redis Enterprise Test Environment
1+ # Redis Enterprise Test Environment with Full Validation
22#
33# Usage:
4- # docker compose up -d # Start enterprise and initialize cluster
5- # docker compose logs init # Check initialization status
4+ # docker compose up -d # Start and run full test cascade
5+ # docker compose logs -f # Watch all service logs
66# docker compose down -v # Clean up everything
7+ #
8+ # For Mac users: Set REDIS_ENTERPRISE_IMAGE=kurtfm/rs-arm:latest
79
810services :
911 # Redis Enterprise server
@@ -29,12 +31,12 @@ services:
2931 networks :
3032 - redis-net
3133
32- # Initialize cluster and create database
33- init :
34+ # Initialize cluster
35+ init-cluster :
3436 build :
3537 context : .
3638 dockerfile : Dockerfile
37- container_name : redis-enterprise- init
39+ container_name : init-cluster
3840 restart : " no"
3941 depends_on :
4042 enterprise :
@@ -47,43 +49,133 @@ services:
4749 command : |
4850 sh -c '
4951 echo "========================================" &&
50- echo "Initializing Redis Enterprise cluster..." &&
52+ echo "Step 1: Initializing Redis Enterprise cluster..." &&
5153 echo "========================================" &&
5254
53- # Initialize cluster
5455 redisctl enterprise workflow init-cluster \
5556 --insecure \
5657 --name "test-cluster" \
57585859 --password "Redis123!" \
5960 --accept-eula &&
6061
61- echo "" &&
62+ echo "✓ Cluster initialized successfully" &&
63+ echo ""
64+ '
65+
66+ # Create database
67+ create-db :
68+ build :
69+ context : .
70+ dockerfile : Dockerfile
71+ container_name : create-db
72+ restart : " no"
73+ depends_on :
74+ init-cluster :
75+ condition : service_completed_successfully
76+ environment :
77+ REDIS_ENTERPRISE_URL : " https://enterprise:9443"
78+ REDIS_ENTERPRISE_USER :
" [email protected] " 79+ REDIS_ENTERPRISE_PASSWORD : " Redis123!"
80+ RUST_LOG : ${RUST_LOG:-info}
81+ networks :
82+ - redis-net
83+ command : |
84+ sh -c '
6285 echo "========================================" &&
63- echo "Creating test database..." &&
86+ echo "Step 2: Creating test database..." &&
6487 echo "========================================" &&
6588
66- # Create database using the workflow
6789 redisctl enterprise workflow create-database \
6890 --insecure \
6991 --name "test-db" \
7092 --memory 100MB \
7193 --port 12000 &&
7294
95+ echo "✓ Database created successfully" &&
96+ echo ""
97+ '
98+
99+ # Validate API
100+ validate-api :
101+ build :
102+ context : .
103+ dockerfile : Dockerfile
104+ container_name : validate-api
105+ restart : " no"
106+ depends_on :
107+ create-db :
108+ condition : service_completed_successfully
109+ environment :
110+ REDIS_ENTERPRISE_URL : " https://enterprise:9443"
111+ REDIS_ENTERPRISE_USER :
" [email protected] " 112+ REDIS_ENTERPRISE_PASSWORD : " Redis123!"
113+ RUST_LOG : ${RUST_LOG:-info}
114+ networks :
115+ - redis-net
116+ command : |
117+ sh -c '
118+ echo "========================================" &&
119+ echo "Step 3: Validating API endpoints..." &&
120+ echo "========================================" &&
121+
122+ echo "→ Listing databases..." &&
123+ redisctl enterprise database list --insecure --output table &&
124+
125+ echo "" &&
126+ echo "→ Getting database info..." &&
127+ redisctl enterprise database get 1 --insecure --output json | head -20 &&
128+
73129 echo "" &&
130+ echo "→ Checking cluster info..." &&
131+ redisctl enterprise cluster info --insecure --query "name" &&
132+
133+ echo "✓ API validation successful" &&
134+ echo ""
135+ '
136+
137+ # Test Redis connection
138+ test-redis :
139+ image : redis:7-alpine
140+ container_name : test-redis
141+ restart : " no"
142+ depends_on :
143+ validate-api :
144+ condition : service_completed_successfully
145+ networks :
146+ - redis-net
147+ command : |
148+ sh -c '
74149 echo "========================================" &&
75- echo "Setup complete!" &&
150+ echo "Step 4: Testing Redis connection..." &&
151+ echo "========================================" &&
152+
153+ # Wait for database to be fully ready
154+ sleep 5 &&
155+
156+ echo "→ Setting test key..." &&
157+ redis-cli -h enterprise -p 12000 SET test:key "Hello from Docker!" &&
158+
159+ echo "→ Getting test key..." &&
160+ redis-cli -h enterprise -p 12000 GET test:key &&
161+
162+ echo "→ Running PING..." &&
163+ redis-cli -h enterprise -p 12000 PING &&
164+
165+ echo "→ Getting INFO..." &&
166+ redis-cli -h enterprise -p 12000 INFO server | head -10 &&
167+
168+ echo "" &&
169+ echo "========================================" &&
170+ echo "✅ All tests passed successfully!" &&
76171 echo "" &&
77172 echo "Web UI: https://localhost:8443" &&
78173 echo "Username: [email protected] " && 79174 echo "Password: Redis123!" &&
80175 echo "" &&
81176 echo "API: https://localhost:9443" &&
82177 echo "Database: redis://localhost:12000" &&
83- echo "========================================" &&
84-
85- # List databases to confirm
86- redisctl enterprise database list --insecure --output table
178+ echo "========================================"
87179 '
88180
89181networks :
0 commit comments