feat: quota auto validation before deployment #250
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Purpose
This pull request introduces a comprehensive set of changes to enable automated validation of AI model deployment quotas in Azure. The changes include adding pre-provisioning hooks, new scripts for quota validation, and updates to parameter files to support dynamic configurations. Below is a summary of the key changes:
Pre-provisioning Hooks for Quota Validation
azure.yamlto execute model deployment quota validation scripts for both POSIX and Windows environments. These hooks ensure that quota checks are performed before provisioning resources.Parameterization for AI Model Deployments
infra/main.parameters.jsonto include a newaiModelDeploymentsparameter, allowing dynamic configuration of model deployments, including model name, version, SKU, and capacity. This file also supports environment-specific configurations for backend and frontend resources.Quota Validation Scripts
infra/scripts/validate_model_deployment_quota.sh(Bash) andinfra/scripts/validate_model_deployment_quotas.ps1(PowerShell) to validate quotas for AI model deployments. These scripts parse deployment parameters, validate required inputs, and check quota availability using Azure CLI. [1] [2]infra/scripts/validate_model_quota.sh(Bash) andinfra/scripts/validate_model_quota.ps1(PowerShell) to perform detailed quota checks for specific regions and models, including fallback region suggestions if the primary region lacks sufficient quota. [1] [2]Enhanced Error Handling and Reporting
These changes collectively enhance the robustness of the deployment process by ensuring that quota constraints are validated upfront, reducing the likelihood of deployment failures.
Please refer below screenshot

Failed
Success

CODESPACE
Failed

Success

Does this introduce a breaking change?
How to Test
What to Check
Verify that the following are valid
Other Information