-
Notifications
You must be signed in to change notification settings - Fork 2.8k
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
feat(tpu): add tpu queued resources list sample #9614
base: main
Are you sure you want to change the base?
Conversation
…u_queued_resources_delete_force and tpu_queued_resources_delete samples, created tests
Here is the summary of changes. You are about to add 1 region tag.
This comment is generated by snippet-bot.
|
} | ||
|
||
// List Queued Resources. | ||
public static TpuClient.ListQueuedResourcesPage listQueuedResources( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Import the TpuClient.ListQueuedResourcesPage
and only specify ListQueuedResourcesPage
as the return type.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you! Fixed
ListQueuedResourcesRequest request = | ||
ListQueuedResourcesRequest.newBuilder().setParent(parent).build(); | ||
|
||
return tpuClient.listQueuedResources(request).getPage(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Print the list of resources here and then return the value.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you! Added
|
||
TpuClient mockClient = mock(TpuClient.class); | ||
mockedTpuClient.when(TpuClient::create).thenReturn(mockClient); | ||
TpuClient.ListQueuedResourcesPagedResponse mockListQueuedResourcesResponse = |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Same comment here. Import the class and simplify the data type.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you! Fixed
Description
Documentation - https://cloud.google.com/tpu/docs/queued-resources
Sample in Python - https://github.com/GoogleCloudPlatform/python-docs-samples/pull/12716/files
Fixes #
Note: Before submitting a pull request, please open an issue for discussion if you are not associated with Google.
Checklist
pom.xml
parent set to latestshared-configuration
mvn clean verify
requiredmvn -P lint checkstyle:check
requiredmvn -P lint clean compile pmd:cpd-check spotbugs:check
advisory only