0
0
MLOpsdevops~30 mins

Multi-region deployment in MLOps - Mini Project: Build & Apply

Choose your learning style9 modes available
Multi-region Deployment Setup
📖 Scenario: You work for a company that wants to deploy a machine learning model in multiple cloud regions to reduce latency and improve availability for users worldwide.Each region will have its own deployment configuration.
🎯 Goal: Build a simple Python dictionary that holds deployment configurations for three regions, add a variable to select the active region, filter the configuration for the active region, and print the deployment details.
📋 What You'll Learn
Create a dictionary named deployments with exact keys and values for three regions.
Add a variable named active_region with the exact value 'us-east-1'.
Use a dictionary comprehension to create active_deployment containing only the active region's configuration.
Print the active_deployment dictionary.
💡 Why This Matters
🌍 Real World
Multi-region deployment helps reduce latency and improve reliability by placing services closer to users in different geographic locations.
💼 Career
Understanding how to manage configurations for multi-region deployments is important for roles in MLOps, DevOps, and cloud engineering.
Progress0 / 4 steps
1
Create deployment configurations dictionary
Create a dictionary called deployments with these exact entries:
'us-east-1': {'model_version': 'v1.0', 'instances': 3},
'eu-west-1': {'model_version': 'v1.1', 'instances': 2},
'ap-southeast-1': {'model_version': 'v1.0', 'instances': 4}.
MLOps
Need a hint?

Use curly braces to create a dictionary. Keys are region names as strings. Values are dictionaries with keys model_version and instances.

2
Set the active deployment region
Create a variable called active_region and set it to the string 'us-east-1'.
MLOps
Need a hint?

Assign the string 'us-east-1' to the variable active_region.

3
Filter deployment for the active region
Use a dictionary comprehension to create a new dictionary called active_deployment that contains only the entry from deployments where the key matches active_region.
MLOps
Need a hint?

Use {key: value for key, value in dict.items() if condition} to filter the dictionary.

4
Print the active deployment configuration
Write a print statement to display the active_deployment dictionary.
MLOps
Need a hint?

Use print(active_deployment) to show the filtered dictionary.