GenAI Deployment Guide: Dockerizing LLM Apps with AWS ECR & Parameter Store
Skills:
AI Workflow Automation90%
Key Takeaways
This video demonstrates how to deploy a GenAI application using Docker, AWS ECR, and Parameter Store, showcasing a secure and professional deployment process for a Python-based application.
Full Transcript
All right. Now that we know how the application works and we have looked at the front end and the back end, it's now time to deploy the application. To deploy the app, we are going to first package it into a Docker container. Now there are two things that we have to look at. One is thevb file. As we can see the AWS credentials consist of the account ID, the access key ID and the secret access. This is the credentials for my particular user in AWS. This application actually runs in appunner where we would be creating a separate role and giving it access to all these services. So it's a bad practice if I'm going to supply these enviables inside my application which is actually created just for me. And one of the good practice is to actually always use IM roles and policies. And these are the application variables that I have to provide to my application. The default region, the bedrock ID, the OpenAI API key and the OpenAI model. All right. So what I do is I have to now create this as an end toend package. To create the package we are using a docker file. In the docker file we are working with one of the python 3.11 slim which is the smaller base image for python 3.11. We create a working directory at / app. We copy the requirements.txt txt all the packages and then we finally install all the package. Then in terms of code, we just copy the app.py and agent.py file and we then simply run our function using python app.py. So this docker file can then help us to create the docker container and then we'll push it to the docker container registry. So before we do let's quickly have a look at the architecture. So as we can see the docker file would be helping us to create the docker container. Then we'll finally push the docker container up here and the application would then be deployed in appunner. Apprunner would then pull the docker container and run the app. But before that before running it it will also go to parameter store to get all the environment variables that it needs. It will also inject these environment variables. So these would be available to the application. Now to be able to call all these services currently it was using the application in my local was using my AWS credentials but now we would be attaching an IM role to the appunner. What this role does is gives it permission to connect to knowledge basis and also to parameter store to fetch environment variables. It connects to knowledge basis to obviously retrieve all the documents from a given query and parameter store to get the open AI API key so that it can finally use that API key to call open AAI. All right. So to finally start with the deployment part which is the left side of the application um architecture diagram. Let's start with creating our ECR container. So we'll go to the dashboard. We'll mention ECR in search. This takes us to the ECR dashboard. Click on create and we can give it a nice name Chennai bot and that's it. Click on create. Finally, it's created. We can see the push commands. Now, first we have to log into this Docker registry to be able to push things. We'll go back to the code. Now we'll just make sure that source envir all the local my user credentials are loaded so that it doesn't interfere with any other AWS credentials if they are all on this machine. I'm logging into this registry. The login has succeeded. Finally I'll build the image for genib bot using the build command. One thing that I would mention is that I would always append it with platform Linux x64. This is because my machine a MacBook over here it has ARM based platform and just to not interfere with that the type of of image this has to be is going to be x86 and that's why it's a good practice to simply mention that the platform should be Linux x86 and so that the docker container is not created in as an ARM based image. All right. So I just write platform. Okay. It worked nicely. The build is done. I can finally tag it. I can then All right. Now the push is done. This container is now pushed to the AWS ECR. We can go to the dashboard. We can refresh it and we can see that the image is pushed. Now that we have ECR in place, let's also go and set up parameter store. So on the search we will mention parameter store. Here we'll click on create parameter. We'll name our parameter OpenAI API key. We'll mention it as secure string. So it would be encrypted and stored in AWS. And in the value, we would be putting the ENV value that we have just to make sure we don't have any spaces anywhere. All right. So with this this parameter is created. OpenAI API key. It's nice. Now that we had the parameter also stored in OpenAI API key, the value is stored in parameter store. We can finally use Approna to deploy the application.
Original Description
Description
In this seventh video of our series, we move from development to deployment. We walk through the essential steps of containerizing a Python-based GenAI application and setting up the AWS infrastructure needed for a secure, professional launch.
Key highlights in this video:
Security Best Practices: Why you should never bake personal AWS credentials into your Docker images and how to use IAM Roles instead.
Writing the Dockerfile: Creating a lightweight container using the python:3.11-slim base image for faster deployment.
The Mac/ARM Compatibility Fix: A critical tip on using --platform linux/amd64 to ensure Docker images built on MacBooks (M1/M2/M3) work seamlessly on AWS cloud servers.
AWS ECR (Elastic Container Registry): Step-by-step guide to creating a repository, authenticating the Docker CLI, and pushing your image.
AWS Parameter Store: How to securely store sensitive data like OpenAI API keys as SecureStrings to keep them encrypted and out of your source code.
Cloud Architecture Review: A look at how AWS AppRunner pulls the image and fetches secrets at runtime.
This video is a must-watch for MLOps engineers and developers looking to deploy AI applications using enterprise-grade security and standards.
🛠 Tech Stack:
Docker (Containerization)
AWS ECR (Image Registry)
AWS Parameter Store (Secret Management)
IAM (Cloud Security)
Python 3.11
Watch on YouTube ↗
(saves to browser)
Sign in to unlock AI tutor explanation · ⚡30
Playlist
Uploads from Analytics Vidhya · Analytics Vidhya · 0 of 60
← Previous
Next →
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
The DataHour: Data Science in Retail
Analytics Vidhya
The DataHour: Anomaly detection using NLP and Predictive Modeling
Analytics Vidhya
The DataHour: Energy Data Science Project from Scratch
Analytics Vidhya
The DataHour: Explainable AI Need and Implementation
Analytics Vidhya
The DataHour: Google Cloud AI/ML
Analytics Vidhya
Prediction to Production in Machine Learning #machinelearning #prediction
Analytics Vidhya
Practical Applications of Data science in Ecommerce
Analytics Vidhya
How to tackle Overfitting?#machinelearning #overfitting
Analytics Vidhya
Building Data Pipelines on GCP #googlecloud #datapipelines #data
Analytics Vidhya
Hands-on with A/B Testing #abtesting #datascience
Analytics Vidhya
Efficient Implementations of Transformers #transformers #cnn #machinelearning
Analytics Vidhya
Modern Deep Learning Architecture #deeplearning #architecture #deeplearningtutorial
Analytics Vidhya
Key steps for Designing Artificial Neural Network (ANN) for Image classification #machinelearning
Analytics Vidhya
5 things you should know about Azure SQL #azure #sql #datahour #datascience
Analytics Vidhya
AI & ML in the Automotive Industry #machinelearning #ai
Analytics Vidhya
Building Machine Learning Models in BigQuery
Analytics Vidhya
NLP aspects in Telecommunication Industry
Analytics Vidhya
Practical Time Series Analysis
Analytics Vidhya
Fundamentals of Quantum Computing
Analytics Vidhya
A DAY IN THE LIFE of a Data Scientist (From waking up to working on algorithms)
Analytics Vidhya
Classification Machine Learning Model from Scratch
Analytics Vidhya
Knowledge Graph Solutions using Neo4j
Analytics Vidhya
Model Guesstimation (MLOps)
Analytics Vidhya
ETL Pipelines in Google Cloud Platform
Analytics Vidhya
Key steps for Designing Convolutional Neural Network(CNN) for Image Classification
Analytics Vidhya
Getting Started with AWS EC2 #amazon #aws
Analytics Vidhya
How to Use Azure NLP and Graph Databases for Intelligent Knowledge Mining
Analytics Vidhya
Certified AI & ML BlackBelt Plus Program #shorts
Analytics Vidhya
Visualizing Data using Python #machinelearning #visualization #python
Analytics Vidhya
DCNN for Machine RUL Prediction using Time-series Data #timeseries #machinelearning #datascience
Analytics Vidhya
M in ML stands for Math & Magic
Analytics Vidhya
An Unsupervised ML approach using Clustering
Analytics Vidhya
Customizing Large Language Models GPT3 for Real-life Use Cases #gpt3 #datascience
Analytics Vidhya
Model Parameters vs Hyperparameters - Techniques in ML Engineering #machinelearning
Analytics Vidhya
Practical MLOps #mlops #datascience
Analytics Vidhya
Data Engineering with Databricks #dataengineering #databricks
Analytics Vidhya
Multi-Objective Optimisation
Analytics Vidhya
When Airflow Meets Kubernetes
Analytics Vidhya
AI in Banking
Analytics Vidhya
Learn Convolutional Neural Network for Image Recognition
Analytics Vidhya
Extracting Value from Data
Analytics Vidhya
How to measure Marketing Channel Effectiveness
Analytics Vidhya
Transforming Lives | Data Science Immersive Bootcamp
Analytics Vidhya
Stock Market Analysis - AI driven approach
Analytics Vidhya
Become a Data Engineering Professional in 2022 | Future Trends + Skills Required
Analytics Vidhya
Ensemble Techniques in Machine Learning #machinelearning #ensemble #datascience
Analytics Vidhya
The Power of Visualization | Tableau Full Course | Analytics Vidhya
Analytics Vidhya
Demand for Data Engineers is on the Rise | Data Engineer | Analytics Vidhya
Analytics Vidhya
Data Visualization in Data Science | DataHour | Analytics Vidhya
Analytics Vidhya
Role of Optimization in Machine Learning & Deep Learning | DataHour | Analytics Vidhya
Analytics Vidhya
Solving any Machine Learning Problem | Approach and Steps Involved
Analytics Vidhya
Topic Modeling Explained with Implementation | Using LDA in Python | DataHour by Arpendu Ganguly
Analytics Vidhya
Data Engineering in E-Commerce | The Best Case Study
Analytics Vidhya
Introduction to Classification using Azure Machine Learning | DataHour | Analytics Vidhya
Analytics Vidhya
Introduction to Federated Learning | DataHour | Analytics Vidhya
Analytics Vidhya
Diffusion Models for Generative Arts | DataHour | Analytics Vidhya
Analytics Vidhya
Master Google Analytics in 1 Hour | DataHour | Analytics Vidhya
Analytics Vidhya
Learn Hypothesis Testing | DataHour | Analytics Vidhya
Analytics Vidhya
A Practical Approach to Kaggle Competition | DataHour | Analytics Vidhya
Analytics Vidhya
Making AI work for Business | DataHour | Analytics Vidhya
Analytics Vidhya
More on: AI Workflow Automation
View skill →Related Reads
📰
📰
📰
📰
Stop Using 6 Chrome Tabs for Code Reviews—Do It in Your Terminal
Dev.to · Learn AI Resource
Roadmap for infrastructure/backend development in the .NET ecosystem?
Reddit r/devops
Your NOC Video Wall Is Just a Linux Box Now (Architecture + the 5-Year Math)
Dev.to · Pavel Suchkov
AWS CodePipeline Tutorial: Deploy to EC2 with CodeCommit, CodeBuild & CodeDeploy
Dev.to · Guna SantoshDeep Srivastava
🎓
Tutor Explanation
DeepCamp AI