Skip to content

Conversation

@Thoughtseize1
Copy link
Contributor

@Thoughtseize1 Thoughtseize1 commented Oct 10, 2024

Description

Created new Samples for TPU. Create, Get, Delete operations.
Also added Sample for creating TPU with Startup Script
Doc page -> here

Region tag Sample
tpu_vm_create /tpu/create_tpu.py
tpu_vm_get /tpu/get_tpu.py
tpu_vm_delete /tpu/delete_tpu.py
tpu_vm_create_startup_script /tpu/create_tpu_with_script.py

Checklist

@product-auto-label product-auto-label bot added samples Issues that are directly related to samples. api: compute Issues related to the Compute Engine API. labels Oct 10, 2024
@Thoughtseize1 Thoughtseize1 added the snippet-bot:force-run Force snippet-bot runs its logic label Oct 10, 2024
@snippet-bot snippet-bot bot removed the snippet-bot:force-run Force snippet-bot runs its logic label Oct 10, 2024
@snippet-bot
Copy link

snippet-bot bot commented Oct 10, 2024

Here is the summary of changes.

You are about to add 4 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

@Thoughtseize1 Thoughtseize1 added the snippet-bot:force-run Force snippet-bot runs its logic label Oct 10, 2024
@snippet-bot snippet-bot bot removed the snippet-bot:force-run Force snippet-bot runs its logic label Oct 10, 2024
@Thoughtseize1 Thoughtseize1 marked this pull request as ready for review October 10, 2024 14:27
@Thoughtseize1 Thoughtseize1 requested review from a team as code owners October 10, 2024 14:27
@Thoughtseize1 Thoughtseize1 assigned m-strzelczyk and unassigned Sita04 Oct 10, 2024
Copy link
Contributor

@m-strzelczyk m-strzelczyk left a comment

Choose a reason for hiding this comment

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

Looks good!

I forgot to tell you all, TPUs are a separate product from Compute (politics....). So please move the whole tpu folder, a level higher to the repository root.

You'll need to update CODEOWNERS file and .github/blunderbuss.yml file. Just copy the setting of compute for tpu.

@Thoughtseize1 Thoughtseize1 requested review from a team as code owners October 11, 2024 14:08
@Thoughtseize1 Thoughtseize1 added the snippet-bot:force-run Force snippet-bot runs its logic label Oct 11, 2024
@Thoughtseize1
Copy link
Contributor Author

Looks good!

I forgot to tell you all, TPUs are a separate product from Compute (politics....). So please move the whole tpu folder, a level higher to the repository root.

You'll need to update CODEOWNERS file and .github/blunderbuss.yml file. Just copy the setting of compute for tpu.

I've moved the TPU folder to the root of the repository. I updated the CODEOWNERS file and .github/blunderbuss.yml. Could you please review and confirm if everything is correct? @m-strzelczyk

@snippet-bot snippet-bot bot removed the snippet-bot:force-run Force snippet-bot runs its logic label Oct 11, 2024
@Thoughtseize1 Thoughtseize1 added snippet-bot:force-run Force snippet-bot runs its logic api: tpu Issues related to the Cloud TPU API. labels Oct 15, 2024
@snippet-bot snippet-bot bot removed the snippet-bot:force-run Force snippet-bot runs its logic label Oct 15, 2024
@Thoughtseize1 Thoughtseize1 changed the title feat: TPU Create/get/delete Samples feat: TPU *Create / *get / *create_with_script / *delete Samples Oct 15, 2024
Comment on lines 35 to 49
# [START tpu_vm_create_startup_script]
# This startup script updates numpy to the latest version and logs the output to a file.
metadata = {
"startup-script": """#!/bin/bash
echo "Hello World" > /var/log/hello.log
sudo pip3 install --upgrade numpy >> /var/log/hello.log 2>&1
"""
}
node = tpu_v2.Node()
# Adding metadata with startup script to the TPU node.
node.metadata = metadata
# Enabling external IPs for internet access from the TPU node.
node.network_config = tpu_v2.NetworkConfig(enable_external_ips=True)

# [END tpu_vm_create_startup_script]
Copy link
Contributor

Choose a reason for hiding this comment

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

Maybe make this region tag span the whole node creation code. The gcloud example in docs is a full gcloud command, so we should have a full creation script as well IMO.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I changed it to provide users with a full example of creating TPU with the startup script 👍

@Thoughtseize1 Thoughtseize1 added the kokoro:force-run Add this label to force Kokoro to re-run the tests. label Oct 15, 2024
@kokoro-team kokoro-team removed the kokoro:force-run Add this label to force Kokoro to re-run the tests. label Oct 15, 2024
@Thoughtseize1 Thoughtseize1 added the kokoro:force-run Add this label to force Kokoro to re-run the tests. label Oct 16, 2024
@kokoro-team kokoro-team removed the kokoro:force-run Add this label to force Kokoro to re-run the tests. label Oct 16, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

api: compute Issues related to the Compute Engine API. 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.

4 participants