Complete the code to define the active deployment environment in blue-green deployment.
active_env = '[1]'
In blue-green deployment, the active environment is usually set to 'blue' or 'green'. Here, 'blue' is the initial active environment.
Complete the code to switch traffic to the new model environment.
traffic_router.route_to('[1]')
Switching traffic to the 'green' environment activates the new model version in blue-green deployment.
Fix the error in the code that updates the model version in the inactive environment.
deploy_model(version='v2', environment='[1]')
The new model version should be deployed to the inactive environment, which is 'green' if 'blue' is active.
Fill both blanks to create a dictionary mapping environments to model versions.
model_versions = {'blue': '[1]', 'green': '[2]'}The 'blue' environment runs version 'v1' and the 'green' environment runs the new version 'v2' during blue-green deployment.
Fill all three blanks to complete the function that switches active environment and updates traffic routing.
def switch_environment(current_env): new_env = '[1]' if current_env == '[2]' else '[3]' traffic_router.route_to(new_env) return new_env
This function switches from 'blue' to 'green' or vice versa, routing traffic accordingly in blue-green deployment.