Solega Co. Done For Your E-Commerce solutions.
  • Home
  • E-commerce
  • Start Ups
  • Project Management
  • Artificial Intelligence
  • Investment
  • More
    • Cryptocurrency
    • Finance
    • Real Estate
    • Travel
No Result
View All Result
  • Home
  • E-commerce
  • Start Ups
  • Project Management
  • Artificial Intelligence
  • Investment
  • More
    • Cryptocurrency
    • Finance
    • Real Estate
    • Travel
No Result
View All Result
No Result
View All Result
Home Artificial Intelligence

Learn MLOps on Google Cloud: Deploy Flask App using Artifact and Cloud Run. | by Muhammad Anang Mahrub | Dec, 2024

Solega Team by Solega Team
December 12, 2024
in Artificial Intelligence
Reading Time: 8 mins read
0
Learn MLOps on Google Cloud: Deploy Flask App using Artifact and Cloud Run. | by Muhammad Anang Mahrub | Dec, 2024
0
SHARES
1
VIEWS
Share on FacebookShare on Twitter


Muhammad Anang Mahrub

Generated by DALL E 3
Generated by DALL E 3

On the finish of 2024, I made a decision to study MLOps on Google Cloud. I purchased a course from Udemy about MLOps on Google Cloud and began to study. As a substitute of watching movies and writing my code, I write about what I do know on Medium. Writing about my studying journey will make me extra comfy with MLOps on Google Cloud.

So, to start out my writing journey, I wish to share how one can deploy a Flask App to the cloud utilizing Artifact and Cloud Run. Do you’ve a Flask App and wish to share it with different folks? However your luck with how to try this? Google Cloud may be one of many decisions for internet hosting your apps. Google Cloud has some alternatives, comparable to serverless, steady supply, straightforward integration with Google Service, and many others.

The very first thing to do whenever you wish to deploy Flask App is create a repository on Artifact Registry. In the event you don’t have a venture earlier than, it is best to create one. Go to your Google Cloud account and make a venture. After you make a venture, open your venture and search Artifact Registry within the search discipline. Click on on Artifact Registry, and your display will present the Artifact Registry part. Click on the Create Repository, fill within the required fields comparable to title and area, and click on Create.

Artifact Registry part

Construct the Docker Picture

First, we have to package deal our Flask app right into a Docker container. Run the next command to construct the Docker picture.

docker construct -t demo-flask-app .

-t demo-flask-app assigns a reputation to the Docker picture. The. on the finish specifies that the Dockerfile is within the present listing

Push the Picture to the Artifact Registry

After efficiently constructing the Docker picture, the following step is to push it to the Artifact Registry. Run the next command to replace the picture reference to your Artifact Registry.

docker tag flask-app REGION-docker.pkg.dev/PROJECT-ID/REPOSITORY-NAME/flask-app

REGION is the area the place your Artifact Registry is hosted (e.g., us-central1 ). PROJECT-ID is your Google Cloud venture ID, and REPOSITORY-NAME is the title of your Artifact Registry repository. After tagging, you possibly can push the picture with the next command beneath.

docker push REGION-docker.pkg.dev/PROJECT-ID/REPOSITORY-NAME/flask-app

Deploy the App to the Cloud Run

As soon as your container picture is within the Artifact Registry, you possibly can deploy it to Google Cloud Run. Cloud Run is a totally managed platform that lets you run containerized functions with out worrying about infrastructure. The deployment command appears to be like like this.

gcloud run deploy SERVICE-NAME 
--image REGION-docker.pkg.dev/PROJECT-ID/REPOSITORY-NAME/flask-app
--region REGION
--allow-unauthenticated

Change SERVICE-NAME with the title of your Cloud Run service (e.g., flask-service ). REGION is the area for deployment (e.g., us-central1 ). PROJECT-ID is your Google Cloud venture ID, and REPOSITORY-NAME is the title of your Artifact Registry repository. The --allow-unauthenticated flag makes the app publicly accessible. What occurs subsequent? Google Cloud Run will pull the container picture from Artifact Registry, deploy the containerized app in a scalable serverless setting, and supply a safe HTTPS URL to entry your app. Open the URL in a browser to see your Flask app dwell!

Congratulations! You’ve efficiently deployed a Flask app to Google Cloud utilizing Artifact Registry and Cloud Run. This course of ensures your utility is packaged, saved securely, and deployed in a extremely scalable, serverless setting. Be at liberty to go away feedback beneath in case you have questions or points. 🚀



Source link

Tags: AnangAppArtifactCloudDecDeployFlaskGooglelearnMahrubMLOpsMuhammadrun
Previous Post

What’s Next for Bitcoin? On-Chain Signals and ETF Inflows Spark Optimism

Next Post

3 Mistakes Almost Everyone Makes When They Negotiate | by Steven Toews, JD, MBA | The Startup | Dec, 2024

Next Post
3 Mistakes Almost Everyone Makes When They Negotiate | by Steven Toews, JD, MBA | The Startup | Dec, 2024

3 Mistakes Almost Everyone Makes When They Negotiate | by Steven Toews, JD, MBA | The Startup | Dec, 2024

Leave a Reply Cancel reply

Your email address will not be published. Required fields are marked *

POPULAR POSTS

  • 10 Ways To Get a Free DoorDash Gift Card

    10 Ways To Get a Free DoorDash Gift Card

    0 shares
    Share 0 Tweet 0
  • They Combed the Co-ops of Upper Manhattan With $700,000 to Spend

    0 shares
    Share 0 Tweet 0
  • Saal.AI and Cisco Systems Inc Ink MoU to Explore AI and Big Data Innovations at GITEX Global 2024

    0 shares
    Share 0 Tweet 0
  • Exxon foe Engine No. 1 to build fossil fuel plants with Chevron

    0 shares
    Share 0 Tweet 0
  • They Wanted a House in Chicago for Their Growing Family. Would $650,000 Be Enough?

    0 shares
    Share 0 Tweet 0
Solega Blog

Categories

  • Artificial Intelligence
  • Cryptocurrency
  • E-commerce
  • Finance
  • Investment
  • Project Management
  • Real Estate
  • Start Ups
  • Travel

Connect With Us

Recent Posts

How Cox Automotive Ties Employee Experience to Customer Success

How Cox Automotive Ties Employee Experience to Customer Success

June 22, 2025
7 Essential Things To Do When You Get Paid

7 Essential Things To Do When You Get Paid

June 22, 2025

© 2024 Solega, LLC. All Rights Reserved | Solega.co

No Result
View All Result
  • Home
  • E-commerce
  • Start Ups
  • Project Management
  • Artificial Intelligence
  • Investment
  • More
    • Cryptocurrency
    • Finance
    • Real Estate
    • Travel

© 2024 Solega, LLC. All Rights Reserved | Solega.co