This directory contains a complete, N-node distributed application designed to perform Histogram Equalization on uploaded image files (JPG/TIFF). It features a real Custom TCP Protocol implementing a Map-Reduce style algorithm to ensure mathematically correct global equalization without visual artifacts. The system is deployed using Docker Compose. (not yet Kubernetes)
#990000).8000 to serve the UI and handle file uploads.6000 to orchestrate Worker nodes.6000.The Master and Workers communicate over a newline-delimited custom TCP protocol transmitting binary byte chunks:
REGISTER <id>. Master acknowledges.CALC_HIST + binary chunks. Workers calculate local 256-bin histograms and return JSON.APPLY_CDF + the 256-byte CDF + binary chunks. Workers apply the CDF natively to the byte arrays and return the result.<filename>_equalized.<ext>.Before deploying to a full Kubernetes cluster, you can verify the entire 3-node system locally:
# Build the Docker images
docker compose build
# Boot the Master and 2 Worker nodes in the background
docker compose up -d
# Check the logs to verify Workers successfully registered with the Master!
docker compose logs -f
Testing the Application:
http://localhost:8000..jpg or .tiff file.docker compose logs to see the Master Map-Reduce the workload across the two Workers over custom TCP.# Tear down the local cluster once done testing
docker compose down
To deploy this application to a real Kubernetes cluster utilizing Helm, you must first build and push the Docker images to a registry your K8s cluster can access (e.g., Docker Hub).
Assuming your Docker Hub username is johndoe:
# Build Master
docker build -t johndoe/ece465-histogram-master:v1 -f master/Dockerfile .
docker push johndoe/ece465-histogram-master:v1
# Build Worker
docker build -t johndoe/ece465-histogram-worker:v1 -f worker/Dockerfile .
docker push johndoe/ece465-histogram-worker:v1
Edit helm-histogram-eq/values.yaml to point to your new images:
master:
image:
repository: johndoe/ece465-histogram-master
tag: "v1"
worker:
replicaCount: 5 # Scale up to 5 workers instantly!
image:
repository: johndoe/ece465-histogram-worker
tag: "v1"
# Deploy the packaged Helm chart into K8s
helm install distributed-processor ./helm-histogram-eq
NodePort or LoadBalancer depending on your K8s setup.distributed-processor-helm-histogram-eq-master-svc).PersistentVolumeClaim.