Skip to content

multi-tier provisioning strategy#5226

Merged
kvenkatachala333 merged 8 commits intoGoogleCloudPlatform:developfrom
kvenkatachala333:spot2ondem
Feb 18, 2026
Merged

multi-tier provisioning strategy#5226
kvenkatachala333 merged 8 commits intoGoogleCloudPlatform:developfrom
kvenkatachala333:spot2ondem

Conversation

@kvenkatachala333
Copy link
Copy Markdown
Member

@kvenkatachala333 kvenkatachala333 commented Feb 10, 2026

I have implemented the Spot to On-Demand waterfall strategy for the h4d-vm integration test.

  1. tools/cloud-build/find_available_zone.sh
  • Added ENABLE_SPOT_FALLBACK environment variable check.
  • Validates zones against a list of provisioning models: ["SPOT", "STANDARD"] if fallback is enabled, otherwise just ["SPOT"].
  • Exports PROVISIONING_MODEL on success to indicate which model succeeded.
  1. tools/cloud-build/daily-tests/builds/h4d-vm.yaml
  • Enabled ENABLE_SPOT_FALLBACK=true.
  • Dynamically sets provisioning_model in the blueprint using the exported PROVISIONING_MODEL variable.
  • Sets enable_spot=false for Ansible if the provisioning model is STANDARD.
    Note: Ensure $$PROVISIONING_MODEL and $$SPOT_VAR are used in h4d-vm.yaml to prevent Cloud Build from attempting to substitute them as build variables.

@gemini-code-assist
Copy link
Copy Markdown
Contributor

Summary of Changes

Hello @kvenkatachala333, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed!

This pull request introduces a robust multi-tier provisioning strategy for integration tests, significantly improving their resilience and cost-efficiency. By first attempting to provision resources using Spot VMs and gracefully falling back to On-Demand VMs when necessary, the system ensures that tests can reliably acquire the required infrastructure while minimizing operational costs. This change centralizes the provisioning logic, making it more adaptable to varying cloud resource availability.

Highlights

  • Waterfall Provisioning Strategy: Implemented a new provisioning strategy for integration tests that prioritizes cost-effective Spot VMs and automatically falls back to On-Demand VMs if Spot instances are unavailable.
  • Dynamic Blueprint Generation: Introduced a new helper method, generate_blueprint_with_spot_config, to dynamically create temporary blueprint files with specified Spot VM configurations (enabled or disabled).
  • Tiered Deployment Logic: The deploy method was refactored to execute a two-tier deployment process: first attempting with Spot VMs, and upon failure, cleaning up any partial deployment and retrying with On-Demand VMs.
  • Error Handling and Cleanup: Enhanced error handling in the deployment process to catch failures during Spot VM provisioning, trigger cleanup of failed deployments, and proceed with the fallback On-Demand strategy.
Changelog
  • tools/python-integration-tests/deployment.py
    • Added copy and tempfile imports for blueprint manipulation.
    • Introduced generate_blueprint_with_spot_config method to create temporary blueprints with configurable Spot VM settings.
    • Refactored deploy method to implement a two-tier (Spot then On-Demand) provisioning strategy with fallback logic.
    • Incorporated error handling and cleanup (destroy) calls within the deploy method for failed provisioning attempts.
Using Gemini Code Assist

The full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips.

Invoking Gemini

You can request assistance from Gemini at any point by creating a comment using either /gemini <command> or @gemini-code-assist <command>. Below is a summary of the supported commands on the current page.

Feature Command Description
Code Review /gemini review Performs a code review for the current pull request in its current state.
Pull Request Summary /gemini summary Provides a summary of the current pull request in its current state.
Comment @gemini-code-assist Responds in comments when explicitly tagged, both in pull request comments and review comments.
Help /gemini help Displays a list of available commands.

Customization

To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a .gemini/ folder in the base of the repository. Detailed instructions can be found here.

Limitations & Feedback

Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for Github and other Google products, sign up here.

You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension.

Footnotes

  1. Review the Privacy Notices, Generative AI Prohibited Use Policy, Terms of Service, and learn how to configure Gemini Code Assist in GitHub here. Gemini can make mistakes, so double check it and use code with caution.

gemini-code-assist[bot]

This comment was marked as outdated.

@kvenkatachala333
Copy link
Copy Markdown
Member Author

/gemini review

Copy link
Copy Markdown
Contributor

@gemini-code-assist gemini-code-assist bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request introduces a multi-tier provisioning strategy, falling back from Spot to Standard VMs for the h4d-vm integration test. The changes look good and correctly implement the fallback logic in both the zone-finding script and the Cloud Build configuration. I have a small suggestion to improve clarity in the shell script. Overall, a solid implementation of the new strategy.

@simrankaurb
Copy link
Copy Markdown
Contributor

/gemini review

Copy link
Copy Markdown
Contributor

@gemini-code-assist gemini-code-assist bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request introduces a fallback strategy from Spot to Standard VMs for the h4d-vm integration test, which is a valuable improvement for test reliability. The changes in find_available_zone.sh correctly implement the core fallback logic. However, I have some suggestions to improve maintainability and robustness. In add-instance-labels.yml, several redundant conditional checks have been added. Finally, the find_available_zone.sh script has become quite complex and would benefit from refactoring to improve readability.

@kvenkatachala333 kvenkatachala333 added the release-chore To not include into release notes label Feb 12, 2026
LAVEEN
LAVEEN previously approved these changes Feb 13, 2026
@kvenkatachala333 kvenkatachala333 marked this pull request as ready for review February 18, 2026 09:53
@kvenkatachala333 kvenkatachala333 requested review from a team and samskillman as code owners February 18, 2026 09:53
@kvenkatachala333 kvenkatachala333 merged commit f7b69e3 into GoogleCloudPlatform:develop Feb 18, 2026
19 of 83 checks passed
@kvenkatachala333 kvenkatachala333 deleted the spot2ondem branch February 18, 2026 15:26
@kvenkatachala333 kvenkatachala333 mentioned this pull request Feb 18, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

release-chore To not include into release notes

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants