0
0
MLOpsdevops~10 mins

Blue-green deployment for models in MLOps - Interactive Code Practice

Choose your learning style9 modes available
Practice - 5 Tasks
Answer the questions below
1fill in blank
easy

Complete the code to define the active deployment environment in blue-green deployment.

MLOps
active_env = '[1]'
Drag options to blanks, or click blank then click option'
Ared
Bgreen
Cyellow
Dblue
Attempts:
3 left
💡 Hint
Common Mistakes
Choosing an environment color not used in blue-green deployment like 'red' or 'yellow'.
2fill in blank
medium

Complete the code to switch traffic to the new model environment.

MLOps
traffic_router.route_to('[1]')
Drag options to blanks, or click blank then click option'
Agreen
Bblue
Ctest
Ddev
Attempts:
3 left
💡 Hint
Common Mistakes
Routing traffic to 'test' or 'dev' which are not part of blue-green deployment.
3fill in blank
hard

Fix the error in the code that updates the model version in the inactive environment.

MLOps
deploy_model(version='v2', environment='[1]')
Drag options to blanks, or click blank then click option'
Agreen
Bblue
Cproduction
Dstaging
Attempts:
3 left
💡 Hint
Common Mistakes
Deploying to the active environment causing downtime or conflicts.
4fill in blank
hard

Fill both blanks to create a dictionary mapping environments to model versions.

MLOps
model_versions = {'blue': '[1]', 'green': '[2]'}
Drag options to blanks, or click blank then click option'
Av1
Bv2
Cv3
Dv0
Attempts:
3 left
💡 Hint
Common Mistakes
Assigning the same version to both environments.
5fill in blank
hard

Fill all three blanks to complete the function that switches active environment and updates traffic routing.

MLOps
def switch_environment(current_env):
    new_env = '[1]' if current_env == '[2]' else '[3]'
    traffic_router.route_to(new_env)
    return new_env
Drag options to blanks, or click blank then click option'
Agreen
Bblue
Cred
Dyellow
Attempts:
3 left
💡 Hint
Common Mistakes
Using colors not part of blue-green deployment like 'red' or 'yellow'.