How We Used MinIO, ClamAV, TensorFlow, and MeiliSearch to Create a Supercharged Image Search – and Had Fun Along the Way
adorsys were given a fun challenge by one of our clients. They had tons of files being uploaded into a MinIO server (deployed on Kubernetes, naturally), and they wanted to search their images based on quality scores. But not just any old search – they needed to be able to search based on image quality. Challenge accepted! We saw it as a perfect opportunity to flex our machine learning muscles, with a side of security. And, because we’re overachievers, we threw in a bonus feature: virus scanning with ClamAV. Yep, we went the extra mile, and the client loved it.
Here’s how it all came together – from virus scanning (bonus!) to AI-powered image quality analysis and searchability.
The Flow: From MinIO to AI-Powered Image Search Our system works like this: whenever a file is uploaded to MinIO, a series of tasks kicks off to keep everything secure and give us those sweet quality scores for images. Let’s break it down:
Here’s the flow in a handy diagram:
TensorFlow and the Client’s GPU Power – A Match Made in the Cloud The client had an AWS EKS GPU cluster just begging to be used. Naturally, we seized the opportunity to flex some AI-powered muscle and trained a TensorFlow model to score images. We used ArgoCD to define a pipeline that collected and cleaned image data, trained the model, and deployed it to a TensorFlow server. (A whole process for another blog post, but trust me, it was a breeze with a few trusty Python scripts.)
The pipeline flowed like this:
Note: Why Not TensorFlow Serving? Good question! We thought about using TensorFlow Serving, but it wasn’t compatible with all the CPUs in our environment at the time. Instead, we built a custom TensorFlow server. Don’t worry, though – we’ll switch to TensorFlow Serving in the future when things are more standardized.
The Webhook App – Powered by NestJS and RabbitMQ Our NestJS webhook app sits in the middle of this process, making sure all the file upload events get processed smoothly. Here’s how it works:
领英推荐
Here’s how the app’s logic looks:
Docker Compose: Keeping It All Together We used Docker Compose to spin up the whole environment easily.
Bonus: Monitoring and Smaller Apps We didn’t stop there! For monitoring and keeping track of what’s going on in our system, we use a bunch of smaller apps like TensorBoard (to monitor the AI model) and file-browser (to manage files). We’ll dive deeper into these tools in another article, but suffice to say, they make life a lot easier when you’re juggling multiple services and deployments.
Helm – The Real MVP of Deployment And of course, all of this is deployed using Helm. Helm made it easy to package everything, from MinIO to ClamAV, TensorFlow, and MeiliSearch, and deploy it onto our Kubernetes cluster. Helm charts let us manage the complexity of our multi-service system, so we could scale and deploy everything in a way that didn’t make our heads explode.
Conclusion: Fun, Stress, and a Happy Client In the end, we delivered a system that could not only scan files for viruses but also analyze image quality with AI, and make everything searchable with MeiliSearch. And the best part? The client loved it.
So what did we learn along the way?
Was it all smooth sailing? Not exactly. But we had fun, learned a lot, and most importantly, the client was thrilled with the result.
Stay tuned for our next article, where we’ll dive into the smaller apps and tools we used for monitoring and file management. Until then, stay virus-free and keep innovating!
Keen to explore how adorsys can guide your company into this world? Reach out to us here, our team will be delighted to discuss tailored solutions for your organisation.
Written by Stephane Segning Lambou (Senior Software Architect at adorsys).
https://lnkd.in/eSdx2Mkn