Beyond Manual


Hello folks ,
Super excited to share what I've been diving into lately! This latest project is all about getting hands-on with DevOps, really focusing on making things smooth and automated from code to deployment.
So, What Did I Build?
First off, there's a neat little web app at its core. It's pretty straightforward: you give it a link, and it generates a QR code for you. I put it together using Python with FastAPI for the backend (that's where the QR magic happens with the qrcode( module!) and HTML with JavaScript for the basic frontend. Basically, you type your link into the webpage, it zips off to the backend via an API, the QR code gets made, and then you get that sweet PNG image back.
But Here's Where the DevOps Kicks In (The Real Fun Part!)
Honestly, for me, this project wasn't just about building the app itself. It was about creating the system behind it – making the whole deployment process awesome and fully automated.
Here's how I tackled the DevOps side:
Jenkins as the Brains: I've got Jenkins orchestrating the entire CI/CD pipeline. It's the central hub that makes sure everything happens smoothly.
Pipeline as Code (Groovy!): All the pipeline logic is written in Groovy. This means the deployment steps are version-controlled right alongside my application code, keeping everything super consistent.
Docker compose(For local testing): Before deploying i choose docker compose to do local testing , it was really worth to do as i found multiple issues there.
Always-On Automation: The cool part? Any time I push a change to the app's repository, Jenkins automatically kicks off the whole pipeline. This means faster updates and truly continuous delivery no manual steps needed!
AWS for Deployment Power: Once the app is built and ready, its images are securely stored in AWS Elastic Container Registry (ECR). From there, Jenkins handles the seamless deployment directly to Amazon Elastic Container Service (ECS), ensuring the app is always running reliably and can scale up whenever needed.
ISSUES IN JOURNEY
So, no project can go without bugs and problem this project was not so special , there were some issues i tackle in whole journey.
CORS Problems: Initially, my backend were giving frontend the silent treatment! The classic CORS (Cross-Origin Resource Sharing) issue was blocking requests. A quick fix was to properly configure CORS on the backend to allow that crucial communication.
Jenkins Webhook Snafu: Getting Jenkins to listen for repository changes was surprisingly tricky. Since Jenkins was running on my laptop without a static IP, I used ngrok to expose it publicly. But even then, the webhook wasn't triggering! Turns out, I just needed to add /github-webhook/ to the end of the webhook payload URL in GitHub.
Missing Dependencies: Local testing with Docker Compose hit a snag the backend kept crashing. It was a sneaky bug the pillow module, essential for image processing, was missing from the backend requirements for Docker Compose, even though it was correctly listed elsewhere. Adding it in fixed everything instantly.
ECR Tagging Mystery: One challenge I'm still actively working on is with ECR, when pushing one single image multiple images are pushed (3 images are pushing) , only one seems to consistently get the latest tag. It's a minor hiccup that I'm currently debugging to ensure consistent tagging for all artifacts.
ECS CPU Architecture Mismatch: The frontend service on ECS was a real headache it just wouldn't start and kept rolling back. After a lot of digging, I found the issue a CPU architecture mismatch! The task definition for the frontend was set to ARM_64 , while it needed to be X86_64 to match the rest of the environment. Simple fix, big relief it literally take 2 hours of debugging as i just looking task config json i noticed it was really a headache.
Frontend-Backend Communication in AWS: Even with everything deployed, the frontend (running locally in my browser) couldn't 'see' the backend service in AWS. I initially tried AWS CloudMap, but it wasn't the right fit for this cross-environment communication. The ultimate solution was to use an Application Load Balancer (ALB) between them and change the request link to alb dns, allowing the frontend to successfully send requests to the backend.
So, that's the journey of this project from start to finish! While this might not be the absolute most optimized way to deploy everything just yet, it's been an incredible learning experience and a solid first step on my DevOps path. I'm just getting started, and I'm really excited to dive into more complex deployments and DevOps projects in the future.
GITHUB: https://github.com/Harshit10j2004/Jenkinstutorial.git
Subscribe to my newsletter
Read articles from harshit Gupta directly inside your inbox. Subscribe to the newsletter, and don't miss out.
Written by
