Skip to content
This repository has been archived by the owner on Jul 6, 2023. It is now read-only.

Commit

Permalink
feat(v2alpha1): add AcceleratorConfig (#214)
Browse files Browse the repository at this point in the history
* chore: adding imports for types in LRO annotations

PiperOrigin-RevId: 508454659

Source-Link: googleapis/googleapis@cd53720

Source-Link: googleapis/googleapis-gen@fd75657
Copy-Tag: eyJwIjoiLmdpdGh1Yi8uT3dsQm90LnlhbWwiLCJoIjoiZmQ3NTY1N2NkNWZjNzMzZDMxYWY2Nzk5Mjc1MzJjZmRjYzhmMTgxMiJ9

* 🦉 Updates from OwlBot post-processor

See https://github.com/googleapis/repo-automation-bots/blob/main/packages/owl-bot/README.md

* revert

* revert

---------

Co-authored-by: Owl Bot <gcf-owl-bot[bot]@users.noreply.github.com>
Co-authored-by: Anthonios Partheniou <partheniou@google.com>
  • Loading branch information
3 people committed Feb 10, 2023
1 parent 3c9b309 commit 77b7f38
Show file tree
Hide file tree
Showing 3 changed files with 58 additions and 0 deletions.
2 changes: 2 additions & 0 deletions google/cloud/tpu_v2alpha1/__init__.py
Expand Up @@ -20,6 +20,7 @@

from .services.tpu import TpuAsyncClient, TpuClient
from .types.cloud_tpu import (
AcceleratorConfig,
AcceleratorType,
AccessConfig,
AttachedDisk,
Expand Down Expand Up @@ -66,6 +67,7 @@

__all__ = (
"TpuAsyncClient",
"AcceleratorConfig",
"AcceleratorType",
"AccessConfig",
"AttachedDisk",
Expand Down
2 changes: 2 additions & 0 deletions google/cloud/tpu_v2alpha1/types/__init__.py
Expand Up @@ -14,6 +14,7 @@
# limitations under the License.
#
from .cloud_tpu import (
AcceleratorConfig,
AcceleratorType,
AccessConfig,
AttachedDisk,
Expand Down Expand Up @@ -59,6 +60,7 @@
)

__all__ = (
"AcceleratorConfig",
"AcceleratorType",
"AccessConfig",
"AttachedDisk",
Expand Down
54 changes: 54 additions & 0 deletions google/cloud/tpu_v2alpha1/types/cloud_tpu.py
Expand Up @@ -66,6 +66,7 @@
"GetGuestAttributesRequest",
"GetGuestAttributesResponse",
"SimulateMaintenanceEventRequest",
"AcceleratorConfig",
"ShieldedInstanceConfig",
},
)
Expand Down Expand Up @@ -389,6 +390,8 @@ class Node(proto.Message):
queued_resource (str):
Output only. The qualified name of the
QueuedResource that requested this Node.
accelerator_config (google.cloud.tpu_v2alpha1.types.AcceleratorConfig):
The AccleratorConfig for the TPU Node.
shielded_instance_config (google.cloud.tpu_v2alpha1.types.ShieldedInstanceConfig):
Shielded Instance options.
"""
Expand Down Expand Up @@ -588,6 +591,11 @@ class ApiVersion(proto.Enum):
proto.STRING,
number=43,
)
accelerator_config: "AcceleratorConfig" = proto.Field(
proto.MESSAGE,
number=44,
message="AcceleratorConfig",
)
shielded_instance_config: "ShieldedInstanceConfig" = proto.Field(
proto.MESSAGE,
number=45,
Expand Down Expand Up @@ -1366,6 +1374,8 @@ class AcceleratorType(proto.Message):
The resource name.
type_ (str):
The accelerator type.
accelerator_configs (MutableSequence[google.cloud.tpu_v2alpha1.types.AcceleratorConfig]):
The accelerator config.
"""

name: str = proto.Field(
Expand All @@ -1376,6 +1386,11 @@ class AcceleratorType(proto.Message):
proto.STRING,
number=2,
)
accelerator_configs: MutableSequence["AcceleratorConfig"] = proto.RepeatedField(
proto.MESSAGE,
number=3,
message="AcceleratorConfig",
)


class GetAcceleratorTypeRequest(proto.Message):
Expand Down Expand Up @@ -1762,6 +1777,45 @@ class SimulateMaintenanceEventRequest(proto.Message):
)


class AcceleratorConfig(proto.Message):
r"""A TPU accelerator configuration.
Attributes:
type_ (google.cloud.tpu_v2alpha1.types.AcceleratorConfig.Type):
Required. Type of TPU.
topology (str):
Required. Topology of TPU in chips.
"""

class Type(proto.Enum):
r"""TPU type.
Values:
TYPE_UNSPECIFIED (0):
Unspecified version.
V2 (2):
TPU v2.
V3 (4):
TPU v3.
V4 (7):
TPU v4.
"""
TYPE_UNSPECIFIED = 0
V2 = 2
V3 = 4
V4 = 7

type_: Type = proto.Field(
proto.ENUM,
number=1,
enum=Type,
)
topology: str = proto.Field(
proto.STRING,
number=2,
)


class ShieldedInstanceConfig(proto.Message):
r"""A set of Shielded Instance options.
Expand Down

0 comments on commit 77b7f38

Please sign in to comment.