Skip to content

feat: Added sync argument in Matching Engine IndexEndpoint deploy_index #5305

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

KennyStryker
Copy link

@KennyStryker KennyStryker commented May 8, 2025

✨ Add sync argument to deploy_index method in Matching Engine IndexEndpoint

Fixes #5304 🦕

Description

This PR introduces a new sync parameter to the deploy_index method, enabling both synchronous and asynchronous deployments. By default, the method remains synchronous to preserve backward compatibility.

Changes

  • Added a sync: bool = True argument to the deploy_index method.
  • If sync is True, the method waits for the long-running deployment operation (LRO) to complete before returning.
  • If sync is False, the method returns immediately, and the LRO completes in the background.
  • Maintains all existing behavior as default.

Usage Example

# Synchronous deployment (default behavior)
endpoint.deploy_index(index=my_index, deployed_index_id="my-index-id")

# Asynchronous deployment
endpoint.deploy_index(index=my_index, deployed_index_id="my-index-id", sync=False)

Thank you for opening a Pull Request! Before submitting your PR, there are a few things you can do to make sure it goes smoothly:

  • Make sure to open an issue as a bug/issue before writing your code! That way we can discuss the change, evaluate designs, and agree on the general idea
  • Ensure the tests and linter pass
  • Code coverage does not decrease (if any source code was changed)
  • Appropriate docs were updated (if necessary)
  • Get the necessary approvals
  • Once the last commit on the PR has been approved, add the "ready to pull" label to the Pull Request

Note: do not merge your PR from GitHub. Adding the "ready to pull" label is the final step in the review process.
After approvals, the changes in your PR will be committed to the main branch and this PR will be closed.

Copy link

google-cla bot commented May 8, 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.

@product-auto-label product-auto-label bot added size: s Pull request size is small. api: vertex-ai Issues related to the googleapis/python-aiplatform API. labels May 8, 2025
@KennyStryker KennyStryker changed the title feat: Added sync argument in Matching Engine deploy_index feat: Added sync argument in Matching Engine IndexEndpoint deploy_index May 8, 2025
@KennyStryker
Copy link
Author

CLA Signed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
api: vertex-ai Issues related to the googleapis/python-aiplatform API. size: s Pull request size is small.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Added sync argument in Matching Engine IndexEndpoint deploy_index
1 participant