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

feat: add TPU v2alpha1 #55

Merged
merged 2 commits into from Oct 15, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
11 changes: 11 additions & 0 deletions docs/index.rst
Expand Up @@ -2,6 +2,9 @@

.. include:: multiprocessing.rst

This package includes clients for multiple versions of Cloud TPU.
By default, you will get version ``tpu_v1``.


API Reference
-------------
Expand All @@ -11,6 +14,14 @@ API Reference
tpu_v1/services
tpu_v1/types

API Reference
-------------
.. toctree::
:maxdepth: 2

tpu_v2alpha1/services
tpu_v2alpha1/types

Changelog
---------

Expand Down
6 changes: 6 additions & 0 deletions docs/tpu_v2alpha1/services.rst
@@ -0,0 +1,6 @@
Services for Google Cloud Tpu v2alpha1 API
==========================================
.. toctree::
:maxdepth: 2

tpu
10 changes: 10 additions & 0 deletions docs/tpu_v2alpha1/tpu.rst
@@ -0,0 +1,10 @@
Tpu
---------------------

.. automodule:: google.cloud.tpu_v2alpha1.services.tpu
:members:
:inherited-members:

.. automodule:: google.cloud.tpu_v2alpha1.services.tpu.pagers
:members:
:inherited-members:
7 changes: 7 additions & 0 deletions docs/tpu_v2alpha1/types.rst
@@ -0,0 +1,7 @@
Types for Google Cloud Tpu v2alpha1 API
=======================================

.. automodule:: google.cloud.tpu_v2alpha1.types
:members:
:undoc-members:
:show-inheritance:
90 changes: 90 additions & 0 deletions google/cloud/tpu_v2alpha1/__init__.py
@@ -0,0 +1,90 @@
# -*- coding: utf-8 -*-
# Copyright 2020 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#

from .services.tpu import TpuClient
from .services.tpu import TpuAsyncClient

from .types.cloud_tpu import AcceleratorType
from .types.cloud_tpu import AccessConfig
from .types.cloud_tpu import AttachedDisk
from .types.cloud_tpu import CreateNodeRequest
from .types.cloud_tpu import DeleteNodeRequest
from .types.cloud_tpu import GenerateServiceIdentityRequest
from .types.cloud_tpu import GenerateServiceIdentityResponse
from .types.cloud_tpu import GetAcceleratorTypeRequest
from .types.cloud_tpu import GetGuestAttributesRequest
from .types.cloud_tpu import GetGuestAttributesResponse
from .types.cloud_tpu import GetNodeRequest
from .types.cloud_tpu import GetRuntimeVersionRequest
from .types.cloud_tpu import GuestAttributes
from .types.cloud_tpu import GuestAttributesEntry
from .types.cloud_tpu import GuestAttributesValue
from .types.cloud_tpu import ListAcceleratorTypesRequest
from .types.cloud_tpu import ListAcceleratorTypesResponse
from .types.cloud_tpu import ListNodesRequest
from .types.cloud_tpu import ListNodesResponse
from .types.cloud_tpu import ListRuntimeVersionsRequest
from .types.cloud_tpu import ListRuntimeVersionsResponse
from .types.cloud_tpu import NetworkConfig
from .types.cloud_tpu import NetworkEndpoint
from .types.cloud_tpu import Node
from .types.cloud_tpu import OperationMetadata
from .types.cloud_tpu import RuntimeVersion
from .types.cloud_tpu import SchedulingConfig
from .types.cloud_tpu import ServiceAccount
from .types.cloud_tpu import ServiceIdentity
from .types.cloud_tpu import StartNodeRequest
from .types.cloud_tpu import StopNodeRequest
from .types.cloud_tpu import Symptom
from .types.cloud_tpu import UpdateNodeRequest

__all__ = (
"TpuAsyncClient",
"AcceleratorType",
"AccessConfig",
"AttachedDisk",
"CreateNodeRequest",
"DeleteNodeRequest",
"GenerateServiceIdentityRequest",
"GenerateServiceIdentityResponse",
"GetAcceleratorTypeRequest",
"GetGuestAttributesRequest",
"GetGuestAttributesResponse",
"GetNodeRequest",
"GetRuntimeVersionRequest",
"GuestAttributes",
"GuestAttributesEntry",
"GuestAttributesValue",
"ListAcceleratorTypesRequest",
"ListAcceleratorTypesResponse",
"ListNodesRequest",
"ListNodesResponse",
"ListRuntimeVersionsRequest",
"ListRuntimeVersionsResponse",
"NetworkConfig",
"NetworkEndpoint",
"Node",
"OperationMetadata",
"RuntimeVersion",
"SchedulingConfig",
"ServiceAccount",
"ServiceIdentity",
"StartNodeRequest",
"StopNodeRequest",
"Symptom",
"TpuClient",
"UpdateNodeRequest",
)
153 changes: 153 additions & 0 deletions google/cloud/tpu_v2alpha1/gapic_metadata.json
@@ -0,0 +1,153 @@
{
"comment": "This file maps proto services/RPCs to the corresponding library clients/methods",
"language": "python",
"libraryPackage": "google.cloud.tpu_v2alpha1",
"protoPackage": "google.cloud.tpu.v2alpha1",
"schema": "1.0",
"services": {
"Tpu": {
"clients": {
"grpc": {
"libraryClient": "TpuClient",
"rpcs": {
"CreateNode": {
"methods": [
"create_node"
]
},
"DeleteNode": {
"methods": [
"delete_node"
]
},
"GenerateServiceIdentity": {
"methods": [
"generate_service_identity"
]
},
"GetAcceleratorType": {
"methods": [
"get_accelerator_type"
]
},
"GetGuestAttributes": {
"methods": [
"get_guest_attributes"
]
},
"GetNode": {
"methods": [
"get_node"
]
},
"GetRuntimeVersion": {
"methods": [
"get_runtime_version"
]
},
"ListAcceleratorTypes": {
"methods": [
"list_accelerator_types"
]
},
"ListNodes": {
"methods": [
"list_nodes"
]
},
"ListRuntimeVersions": {
"methods": [
"list_runtime_versions"
]
},
"StartNode": {
"methods": [
"start_node"
]
},
"StopNode": {
"methods": [
"stop_node"
]
},
"UpdateNode": {
"methods": [
"update_node"
]
}
}
},
"grpc-async": {
"libraryClient": "TpuAsyncClient",
"rpcs": {
"CreateNode": {
"methods": [
"create_node"
]
},
"DeleteNode": {
"methods": [
"delete_node"
]
},
"GenerateServiceIdentity": {
"methods": [
"generate_service_identity"
]
},
"GetAcceleratorType": {
"methods": [
"get_accelerator_type"
]
},
"GetGuestAttributes": {
"methods": [
"get_guest_attributes"
]
},
"GetNode": {
"methods": [
"get_node"
]
},
"GetRuntimeVersion": {
"methods": [
"get_runtime_version"
]
},
"ListAcceleratorTypes": {
"methods": [
"list_accelerator_types"
]
},
"ListNodes": {
"methods": [
"list_nodes"
]
},
"ListRuntimeVersions": {
"methods": [
"list_runtime_versions"
]
},
"StartNode": {
"methods": [
"start_node"
]
},
"StopNode": {
"methods": [
"stop_node"
]
},
"UpdateNode": {
"methods": [
"update_node"
]
}
}
}
}
}
}
}
2 changes: 2 additions & 0 deletions google/cloud/tpu_v2alpha1/py.typed
@@ -0,0 +1,2 @@
# Marker file for PEP 561.
# The google-cloud-tpu package uses inline types.
15 changes: 15 additions & 0 deletions google/cloud/tpu_v2alpha1/services/__init__.py
@@ -0,0 +1,15 @@
# -*- coding: utf-8 -*-
# Copyright 2020 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#
22 changes: 22 additions & 0 deletions google/cloud/tpu_v2alpha1/services/tpu/__init__.py
@@ -0,0 +1,22 @@
# -*- coding: utf-8 -*-
# Copyright 2020 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#
from .client import TpuClient
from .async_client import TpuAsyncClient

__all__ = (
"TpuClient",
"TpuAsyncClient",
)