Improved Error Messaging for Insufficient Resources and Parallel Deployment Implementation #148
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.
Summary:
This update enhances deployment by introducing more robust error handling, especially for insufficient resource errors, and enabling parallel deployments. It aims to provide clearer feedback during deployment failures and reduce overall deployment time.
Key Changes:
New Exception Classes: Added
DeploymentException
,InsufficientResources
, andFailedDeployment
classes to better categorize deployment errors.Enhanced Deployment Status Checking: Implemented a
wait_for_deployment
method to actively monitor deployment status, detect failures across all deployments, and detect insufficient resource errors.Improved Resource Demand Handling: Added logic to check for resource demands and provide specific error messages for insufficient resources.
Refined Status Reporting: Updated the
print_app_status
method (formershow_status
) to display deployment status information in a more readable format.Parallel Deployment Implementation: Modified the
deploy
method to useserve.api._run
with_blocking=False
, allowing all deployments to start simultaneously. Thewait_for_deployment
method then monitors the status of all deployments.Deployment Process Refactoring: Restructured the deployment process to handle exceptions more gracefully and provide more informative error messages.
Tests: Added test to ensure deployment exceptions are thrown correctly.
Resolves: #124 and #125
Error Output Examples:
Insufficient resources error:
Deployment error: