The Gyandoot Service is a gRPC service that processes images from Chitragupt, gets predictions from Valmiki, and serves UI recommendations.
To start the Redis service:
# Navigate to the gyandoot-svc directory
cd gyandoot-svc
# Start Redis using Docker Compose
docker-compose up -d redisThis will start a Redis instance available at localhost:6379.
The following utilities are available to test and verify the service:
Before running tests, populate Redis with test recommendation data:
# Build the Redis initialization utility
go build -o init_redis cmd/init_redis/main.go
# Run the utility (default Redis address is localhost:6379)
./init_redis
# Or specify a custom Redis address
./init_redis --redis_addr=redis:6379To test image processing from Chitragupt to Gyandoot to Valmiki:
# Create a directory for test images
mkdir -p test_images
# Copy some test images to the directory
# (JPG/JPEG files are supported)
# Build the test utility
go build -o test_util cmd/test_util/main.go
# Run the test (default server address is localhost:50051)
./test_util
# Or with custom parameters
./test_util --server_addr=localhost:50051 --image_dir=./test_images --device_id=test-device-001 --frame_interval=500msWhen the Gyandoot service runs with image verification enabled, it:
- Logs details about each received image
- Saves the first 10 images to the
./debug_imagesdirectory for inspection - Logs image headers and data transfer to Valmiki
To check if images are being received correctly:
- Run the Gyandoot service
- Send test images using the test utility
- Check the logs for image reception details
- Inspect saved images in the
./debug_imagesdirectory
If you're having trouble connecting to Redis:
# Check if Redis container is running
docker ps | grep redis
# Check Redis logs
docker logs gyandoot-redis
# Connect to Redis CLI for manual testing
docker exec -it gyandoot-redis redis-cliIf images aren't being processed correctly:
- Check the logs for any errors during image reception
- Verify that the debug images in
./debug_imagescontain valid image data - Ensure Redis contains the necessary recommendation data
- Check the Valmiki service is running and accessible
The Gyandoot service accepts the following command-line flags:
--port: Port for Gyandoot gRPC service (default: :50051)--valmiki_addr: Address for Valmiki gRPC service (default: localhost:50052)--ui_addr: Address for UI gRPC service (default: localhost:50053)--redis_addr: Address for Redis server (default: localhost:6379)--process_timeout: Timeout for processing a single frame (default: 500ms)