Skip to content

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 <[email protected]>
  • Loading branch information
3 people authored Feb 10, 2023
1 parent f4c0faa commit 0d76a5c
Show file tree
Hide file tree
Showing 3 changed files with 58 additions and 0 deletions.
Original file line number Diff line number Diff line change
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
Original file line number Diff line number Diff line change
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
Original file line number Diff line number Diff line change
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 0d76a5c

Please sign in to comment.