Skip to content

Conversation

@JuanFKurucz
Copy link

Summary

Fixed notebook execution failures in the Vertex AI Model Monitoring lab due to Google Cloud organization policy constraints that restrict resource deployment to specific regions.

Problem

While working through the "Machine Learning in the Enterprise" course lab, encountered a FailedPrecondition error when uploading models to Vertex AI:

FailedPrecondition: 400 The request has violated one or more Org Policies: violations 
{
  description: "The project failed the org policy enforcement check for constraints/gcp.resourceLocations"
}

Changes Made

  • Added explicit aiplatform initialization: Added a new cell with aiplatform.init(project=PROJECT_ID, location=LOCATION) to ensure all Vertex AI operations use the correct project and region configuration
  • Fixed dependency conflict: Added protobuf==3.20.3 to pip install command to resolve version compatibility issues
  • Reset execution state: Cleared execution counts and reset placeholder values for PROJECT_ID and LOCATION to make the notebook reusable
  • Improved lab compatibility: Changes ensure the notebook works correctly within Qwiklabs' resource location restrictions

Testing

✅ Verified model upload now succeeds when proper region (e.g., us-west1) is specified
✅ Confirmed all subsequent model monitoring operations complete successfully
✅ Lab can now be completed end-to-end without resource constraint errors

This fix enables students to successfully complete the lab while adhering to the organization policies set in the Qwiklabs environment.

@google-cla
Copy link

google-cla bot commented Aug 4, 2025

Thanks for your pull request! It looks like this may be your first contribution to a Google open source project. Before we can look at your pull request, you'll need to sign a Contributor License Agreement (CLA).

View this failed invocation of the CLA check for more information.

For the most up to date status, view the checks section at the bottom of the pull request.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant