-
Configured WSL/Ubuntu and installed prerequisites:
python3,pip,venv,docker,kubectl
-
Downloaded monolithic source files
- Including the MobileNet SSD model files
-
Tested
monolith.pylocally- Verified result was saved as
result.jpg
- Verified result was saved as
- Accepts images via
/upload(Flask + HTTP POST) - Stores image to MinIO:
original/<image_id>.jpg - Pushes metadata (
image_id,original_path) toresize_queue
- Listens to
resize_queue - Downloads image from MinIO
- Resizes image (25%)
- Stores to
resized/<image_id>.jpg - Pushes metadata (
path,origin_h,origin_w) tograyscale_queue
- Listens to
grayscale_queue - Converts image to grayscale
- Stores to
grayscale/<image_id>.jpg - Pushes metadata to
objectdetect_queue
- Listens to
objectdetect_queue - Loads MobileNet SSD model
- Runs detection on grayscale image (converted to BGR)
- Pushes detections and
image_idtotag_queue
- Listens to
tag_queue - Loads original image
- Draws labeled bounding boxes
- Stores final result to
tagged/<image_id>.jpg
Each service:
- Has its own
Dockerfile - Installs dependencies via
requirements.txt - Entrypoint is the service's Python script
-
Deployed Redis using
redis.yaml -
Deployed MinIO using
minio.yaml- Web UI exposed via
NodePort 30003
- Web UI exposed via
-
Each microservice had a
.yamlfile used for deployment. It sets environment variables for redis and minio. -
Exposed
ImageGrabServiceonNodePort 30005 -
Example:
docker build -t aneka457/resize-service .
docker push aneka457/resize-service
kubectl apply -f resize-deployment.yaml- Image uploaded via curl:
curl -X POST -F "image=@test.jpg" http://<EC2_IP>:30005/upload-
Image passed through all stages:
- Saved at each step in MinIO
-
Final image viewable/downloadable from MinIO Web UI under
tagged/
┌─────────────────────┐
│ ImageGrabService │
│ ──────────────── │
│ Accepts image via │
curl/upload ───▶ │ HTTP POST (/upload) │
│ Stores to: │
│ images/original/ │
│ Pushes to: │
│ resize_queue │
└─────────┬───────────┘
│
▼
┌─────────────────────┐
│ ResizeService │
│ ──────────────── │
│ Downloads from: │
│ images/original/ │
│ Stores to: │
│ images/resized/ │
│ Pushes to: │
│ grayscale_queue │
└─────────┬───────────┘
│
▼
┌─────────────────────┐
│ GrayscaleService │
│ ──────────────── │
│ Downloads from: │
│ images/resized/ │
│ Stores to: │
│ images/grayscale/ │
│ Pushes to: │
│ objectdetect_queue │
└─────────┬───────────┘
│
▼
┌────────────────────────┐
│ ObjectDetectService │
│ ──────────────────── │
│ Downloads from: │
│ images/grayscale/ │
│ Pushes detection info │
│ (no image) to: │
│ tag_queue │
└─────────┬──────────────┘
│
▼
┌─────────────────────┐
│ TagService │
│ ──────────────── │
│ Downloads from: │
│ images/original/ │
│ Draws boxes │
│ Stores to: │
│ images/tagged/ │
└─────────────────────┘
┌──────────────┐
│ MinIO │ -> queue system, do one thing
│ Object Store │ -> does not depend directly on the others, communicate through a queue system
└──────────────┘ -> each service pushes metadata (like image ID and path) into a Redis queue, and the next service listens for it.
┌──────────────┐
│ Redis │ -> acts as object storage for big files (like a local Amazon S3)
│ Message Bus │ -> images are too big to be passed through a reddis queue, so we pass only the metadata
└──────────────┘ -> each service reads from or writes to a subfolder in the images bucket
- Add detailed logs.