Skip to content
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_queued_resources_create/delete_force/delete/get/list #3904

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

Conversation

gryczj
Copy link
Contributor

@gryczj gryczj commented Oct 16, 2024

Description

Fixes #

Note: Before submitting a pull request, please open an issue for discussion if you are not associated with Google.

Checklist

  • I have followed guidelines from CONTRIBUTING.MD and Samples Style Guide
  • Tests pass: npm test (see Testing)
  • Lint pass: npm run lint (see Style)
  • These samples need a new API enabled in testing projects to pass (let us know which ones)
  • These samples need a new/updated env vars in testing projects set to pass (let us know which ones)
  • This pull request is from a branch created directly off of GoogleCloudPlatform/nodejs-docs-samples. Not a fork.
  • This sample adds a new sample directory, and I updated the CODEOWNERS file with the codeowners for this sample
  • This sample adds a new sample directory, and I created GitHub Actions workflow for this sample
  • This sample adds a new Product API, and I updated the Blunderbuss issue/PR auto-assigner with the codeowners for this sample
  • Please merge this PR for me once it is approved

@gryczj gryczj added kokoro:force-run Add this label to force Kokoro to re-run the tests. kokoro:run Add this label to force Kokoro to re-run the tests. labels Oct 16, 2024
@gryczj gryczj requested review from a team as code owners October 16, 2024 17:58
@product-auto-label product-auto-label bot added the samples Issues that are directly related to samples. label Oct 16, 2024
@kokoro-team kokoro-team removed kokoro:run Add this label to force Kokoro to re-run the tests. kokoro:force-run Add this label to force Kokoro to re-run the tests. labels Oct 16, 2024
@gryczj gryczj force-pushed the tpu_queued_resources_create branch 2 times, most recently from b42ccd0 to 0daddad Compare October 16, 2024 18:03
@gryczj gryczj added api: tpu Issues related to the Cloud TPU API. kokoro:force-run Add this label to force Kokoro to re-run the tests. kokoro:run Add this label to force Kokoro to re-run the tests. labels Oct 16, 2024
@gryczj gryczj force-pushed the tpu_queued_resources_create branch from 0daddad to 21186ec Compare October 16, 2024 18:05
@kokoro-team kokoro-team removed kokoro:run Add this label to force Kokoro to re-run the tests. kokoro:force-run Add this label to force Kokoro to re-run the tests. labels Oct 16, 2024
Copy link

snippet-bot bot commented Oct 16, 2024

Here is the summary of changes.

You are about to add 5 region tags.

This comment is generated by snippet-bot.
If you find problems with this result, please file an issue at:
https://github.com/googleapis/repo-automation-bots/issues.
To update this comment, add snippet-bot:force-run label or use the checkbox below:

  • Refresh this comment

@gryczj gryczj force-pushed the tpu_queued_resources_create branch from e4bd32f to 8c8311e Compare October 17, 2024 07:27
@gryczj gryczj marked this pull request as draft October 17, 2024 12:20
@gryczj gryczj force-pushed the tpu_queued_resources_create branch from bf9a4ae to bf5bab3 Compare October 18, 2024 10:40
@gryczj gryczj changed the title feat: tpu_queued_resources_create/delete_force feat: tpu_queued_resources_create/delete_force/delete/get Oct 21, 2024
@gryczj gryczj marked this pull request as ready for review October 21, 2024 14:42
@gryczj gryczj marked this pull request as draft October 22, 2024 09:41
@gryczj gryczj force-pushed the tpu_queued_resources_create branch from a1b33bf to 6b9e446 Compare October 22, 2024 13:51
@gryczj gryczj marked this pull request as ready for review October 22, 2024 13:52
@gryczj gryczj force-pushed the tpu_queued_resources_create branch 3 times, most recently from 1d7253d to 39771e6 Compare October 22, 2024 14:25
const tpuClient = new TpuClient();
const projectId = await tpuClient.getProjectId();

// Give a time to start process of creating TPU Node
Copy link
Contributor Author

@gryczj gryczj Oct 22, 2024

Choose a reason for hiding this comment

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

creating can take even 5min, that's why I put 1min timeouts between calls

@gryczj gryczj changed the title feat: tpu_queued_resources_create/delete_force/delete/get feat: tpu_queued_resources_create/delete_force/delete/get/list Oct 23, 2024
@gryczj gryczj force-pushed the tpu_queued_resources_create branch 4 times, most recently from 309f877 to 44661fc Compare October 29, 2024 11:55
@gryczj gryczj force-pushed the tpu_queued_resources_create branch 2 times, most recently from 60b5741 to d8f364b Compare November 12, 2024 16:12
@gryczj
Copy link
Contributor Author

gryczj commented Nov 12, 2024

Due to high costs of TPU Nodes, it was decided to use mocks in the tests.

@gryczj gryczj force-pushed the tpu_queued_resources_create branch 2 times, most recently from 071d90f to 3458b9a Compare November 21, 2024 08:51
@gryczj gryczj requested a review from iennae November 22, 2024 13:34
@gryczj gryczj force-pushed the tpu_queued_resources_create branch 3 times, most recently from dbaecb6 to 5875a3c Compare December 3, 2024 08:24
@gryczj gryczj requested a review from a team as a code owner December 3, 2024 08:24
@gryczj gryczj force-pushed the tpu_queued_resources_create branch from 5875a3c to ce8761b Compare December 3, 2024 08:26
// The name of the network you want the node to connect to. The network should be assigned to your project.
const networkName = 'compute-tpu-network';

// The region of the network, that you want the node to connect to.
Copy link
Contributor

Choose a reason for hiding this comment

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

Networks aren't assigned to regions. Subnetworks are. Does this value actually indicates the region the VM will be created in? (that would also indicate what subnetwork can be used)

Copy link
Contributor Author

Choose a reason for hiding this comment

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

as far as I remember, we are able to create VM in different region than subnetwork region.

// The zone in which to create the node.
// For more information about supported TPU types for specific zones,
// see https://cloud.google.com/tpu/docs/regions-zones
const zone = 'europe-west4-a';
Copy link
Contributor

Choose a reason for hiding this comment

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

We can deduct the region from the zone, so we don't have to explicitly define the region const above.

Copy link
Contributor

Choose a reason for hiding this comment

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

For the samples that are created can the region that is shown be the same across languages? I noticed that the Node.js versions seem to go with europe and the ones in Java are central. https://github.com/GoogleCloudPlatform/java-docs-samples/blob/fd43b65a0c1fc21d0fdbfac0f7ec3c5e89873b80/tpu/src/main/java/tpu/CreateQueuedResource.java#L39 as an example.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@m-strzelczyk, @iennae- requested changes implemented

@gryczj gryczj force-pushed the tpu_queued_resources_create branch from ce8761b to 33abf35 Compare December 4, 2024 11:04
@gryczj gryczj requested a review from m-strzelczyk December 4, 2024 11:04
@gryczj gryczj force-pushed the tpu_queued_resources_create branch from 33abf35 to 1a65640 Compare December 4, 2024 11:08
@BigBlackWolf BigBlackWolf self-requested a review December 5, 2024 11:53
@BigBlackWolf
Copy link

Hi @iennae, could you please take a look once again on this PR?

cc: @rsamborski

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
api: tpu Issues related to the Cloud TPU API. samples Issues that are directly related to samples.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

7 participants