Skip to content

Commit

Permalink
chore: Replace AI Platform naming with Vertex AI (#405)
Browse files Browse the repository at this point in the history
  • Loading branch information
sasha-gitg committed May 19, 2021
1 parent a2d7b68 commit 7b7c950
Show file tree
Hide file tree
Showing 24 changed files with 240 additions and 240 deletions.
2 changes: 1 addition & 1 deletion .github/CODEOWNERS
Validating CODEOWNERS rules …
Expand Up @@ -10,7 +10,7 @@
# The AI Platform GAPIC libraries are owned by Cloud AI DPE
/google/cloud/aiplatform* @googleapis/cdpe-cloudai

# The AI Platform SDK is owned by Model Builder SDK Dev team
# The Vertex SDK is owned by Model Builder SDK Dev team
/google/cloud/aiplatform/* @googleapis/cloud-aiplatform-model-builder-sdk
/tests/unit/aiplatform/* @googleapis/cloud-aiplatform-model-builder-sdk

Expand Down
2 changes: 1 addition & 1 deletion .repo-metadata.json
Expand Up @@ -4,7 +4,7 @@
"product_documentation": "https://cloud.google.com/ai-platform",
"client_documentation": "https://googleapis.dev/python/aiplatform/latest",
"issue_tracker": "https://issuetracker.google.com/savedsearches/559744",
"release_level": "beta",
"release_level": "ga",
"language": "python",
"library_type": "GAPIC_COMBO",
"repo": "googleapis/python-aiplatform",
Expand Down
24 changes: 12 additions & 12 deletions README.rst
@@ -1,23 +1,23 @@
Python Client for Cloud AI Platform
Vertex SDK for Python
=================================================

|beta| |pypi| |versions|
|GA| |pypi| |versions|


`Cloud AI Platform`_: Google Cloud AI Platform is an integrated suite of machine learning tools and services for building and using ML models with AutoML or custom code. It offers both novices and experts the best workbench for the entire machine learning development lifecycle.
`Vertex AI`_: Google Vertex AI is an integrated suite of machine learning tools and services for building and using ML models with AutoML or custom code. It offers both novices and experts the best workbench for the entire machine learning development lifecycle.

- `Client Library Documentation`_
- `Product Documentation`_

.. |beta| image:: https://img.shields.io/badge/support-beta-orange.svg
:target: https://github.com/googleapis/google-cloud-python/blob/master/README.rst#beta-support
.. |GA| image:: https://img.shields.io/badge/support-ga-gold.svg
:target: https://github.com/googleapis/google-cloud-python/blob/master/README.rst#general-availability
.. |pypi| image:: https://img.shields.io/pypi/v/google-cloud-aiplatform.svg
:target: https://pypi.org/project/google-cloud-aiplatform/
.. |versions| image:: https://img.shields.io/pypi/pyversions/google-cloud-aiplatform.svg
:target: https://pypi.org/project/google-cloud-aiplatform/
.. _Cloud AI Platform: https://cloud.google.com/ai-platform-unified/docs
.. _Vertex AI: https://cloud.google.com/vertex-ai/docs
.. _Client Library Documentation: https://googleapis.dev/python/aiplatform/latest
.. _Product Documentation: https://cloud.google.com/ai-platform-unified/docs
.. _Product Documentation: https://cloud.google.com/vertex-ai/docs

Quick Start
-----------
Expand All @@ -26,12 +26,12 @@ In order to use this library, you first need to go through the following steps:

1. `Select or create a Cloud Platform project.`_
2. `Enable billing for your project.`_
3. `Enable the Cloud AI Platform API.`_
3. `Enable the Vertex AI API.`_
4. `Setup Authentication.`_

.. _Select or create a Cloud Platform project.: https://console.cloud.google.com/project
.. _Enable billing for your project.: https://cloud.google.com/billing/docs/how-to/modify-project#enable_billing_for_a_project
.. _Enable the Cloud AI Platform API.: https://cloud.google.com/ai-platform/docs
.. _Enable the Vertex AI API.: https://cloud.google.com/ai-platform/docs
.. _Setup Authentication.: https://googleapis.dev/python/google-api-core/latest/auth.html

Installation
Expand Down Expand Up @@ -72,12 +72,12 @@ Windows
Next Steps
~~~~~~~~~~

- Read the `Client Library Documentation`_ for Cloud AI Platform
- Read the `Client Library Documentation`_ for Vertex AI
API to see other available methods on the client.
- Read the `Cloud AI Platform API Product documentation`_ to learn
- Read the `Vertex AI API Product documentation`_ to learn
more about the product and see How-to Guides.
- View this `README`_ to see the full list of Cloud
APIs that we cover.

.. _Cloud AI Platform API Product documentation: https://cloud.google.com/ai-platform-unified/docs
.. _Vertex AI API Product documentation: https://cloud.google.com/vertex-ai/docs
.. _README: https://github.com/googleapis/google-cloud-python/blob/master/README.rst
88 changes: 44 additions & 44 deletions google/cloud/aiplatform/base.py
Expand Up @@ -60,14 +60,14 @@ def __init__(self, name: str = ""):

def log_create_with_lro(
self,
cls: Type["AiPlatformResourceNoun"],
cls: Type["VertexAiResourceNoun"],
lro: Optional[operation.Operation] = None,
):
"""Logs create event with LRO.
Args:
cls (AiPlatformResourceNoune):
AI Platform Resource Noun class that is being created.
cls (VertexAiResourceNoun):
Vertex AI Resource Noun class that is being created.
lro (operation.Operation):
Optional. Backing LRO for creation.
"""
Expand All @@ -80,7 +80,7 @@ def log_create_with_lro(

def log_create_complete(
self,
cls: Type["AiPlatformResourceNoun"],
cls: Type["VertexAiResourceNoun"],
resource: proto.Message,
variable_name: str,
):
Expand All @@ -89,10 +89,10 @@ def log_create_complete(
Will also include code snippet to instantiate resource in SDK.
Args:
cls (AiPlatformResourceNoun):
AI Platform Resource Noun class that is being created.
cls (VertexAiResourceNoun):
Vertex AI Resource Noun class that is being created.
resource (proto.Message):
AI Platform Resourc proto.Message
Vertex AI Resourc proto.Message
variable_name (str): Name of variable to use for code snippet
"""
self._logger.info(f"{cls.__name__} created. Resource name: {resource.name}")
Expand All @@ -103,7 +103,7 @@ def log_create_complete(

def log_create_complete_with_getter(
self,
cls: Type["AiPlatformResourceNoun"],
cls: Type["VertexAiResourceNoun"],
resource: proto.Message,
variable_name: str,
):
Expand All @@ -112,10 +112,10 @@ def log_create_complete_with_getter(
Will also include code snippet to instantiate resource in SDK.
Args:
cls (AiPlatformResourceNoun):
AI Platform Resource Noun class that is being created.
cls (VertexAiResourceNoun):
Vertex AI Resource Noun class that is being created.
resource (proto.Message):
AI Platform Resourc proto.Message
Vertex AI Resourc proto.Message
variable_name (str): Name of variable to use for code snippet
"""
self._logger.info(f"{cls.__name__} created. Resource name: {resource.name}")
Expand All @@ -125,14 +125,14 @@ def log_create_complete_with_getter(
)

def log_action_start_against_resource(
self, action: str, noun: str, resource_noun_obj: "AiPlatformResourceNoun"
self, action: str, noun: str, resource_noun_obj: "VertexAiResourceNoun"
):
"""Logs intention to start an action against a resource.
Args:
action (str): Action to complete against the resource ie: "Deploying". Can be empty string.
noun (str): Noun the action acts on against the resource. Can be empty string.
resource_noun_obj (AiPlatformResourceNoun):
resource_noun_obj (VertexAiResourceNoun):
Resource noun object the action is acting against.
"""
self._logger.info(
Expand All @@ -143,15 +143,15 @@ def log_action_started_against_resource_with_lro(
self,
action: str,
noun: str,
cls: Type["AiPlatformResourceNoun"],
cls: Type["VertexAiResourceNoun"],
lro: operation.Operation,
):
"""Logs an action started against a resource with lro.
Args:
action (str): Action started against resource. ie: "Deploy". Can be empty string.
noun (str): Noun the action acts on against the resource. Can be empty string.
cls (AiPlatformResourceNoun):
cls (VertexAiResourceNoun):
Resource noun object the action is acting against.
lro (operation.Operation): Backing LRO for action.
"""
Expand All @@ -160,14 +160,14 @@ def log_action_started_against_resource_with_lro(
)

def log_action_completed_against_resource(
self, noun: str, action: str, resource_noun_obj: "AiPlatformResourceNoun"
self, noun: str, action: str, resource_noun_obj: "VertexAiResourceNoun"
):
"""Logs action completed against resource.
Args:
noun (str): Noun the action acts on against the resource. Can be empty string.
action (str): Action started against resource. ie: "Deployed". Can be empty string.
resource_noun_obj (AiPlatformResourceNoun):
resource_noun_obj (VertexAiResourceNoun):
Resource noun object the action is acting against
"""
self._logger.info(
Expand Down Expand Up @@ -385,8 +385,8 @@ def __repr__(self) -> str:
return object.__repr__(self)


class AiPlatformResourceNoun(metaclass=abc.ABCMeta):
"""Base class the AI Platform resource nouns.
class VertexAiResourceNoun(metaclass=abc.ABCMeta):
"""Base class the Vertex AI resource nouns.
Subclasses require two class attributes:
Expand All @@ -400,7 +400,7 @@ class AiPlatformResourceNoun(metaclass=abc.ABCMeta):
@property
@classmethod
@abc.abstractmethod
def client_class(cls) -> Type[utils.AiPlatformServiceClientWithOverride]:
def client_class(cls) -> Type[utils.VertexAiServiceClientWithOverride]:
"""Client class required to interact with resource with optional
overrides."""
pass
Expand Down Expand Up @@ -464,7 +464,7 @@ def _instantiate_client(
cls,
location: Optional[str] = None,
credentials: Optional[auth_credentials.Credentials] = None,
) -> utils.AiPlatformServiceClientWithOverride:
) -> utils.VertexAiServiceClientWithOverride:
"""Helper method to instantiate service client for resource noun.
Args:
Expand All @@ -473,7 +473,7 @@ def _instantiate_client(
Optional custom credentials to use when accessing interacting with
resource noun.
Returns:
client (utils.AiPlatformServiceClientWithOverride):
client (utils.VertexAiServiceClientWithOverride):
Initialized service client for this service noun with optional overrides.
"""
return initializer.global_config.create_client(
Expand Down Expand Up @@ -580,7 +580,7 @@ def optional_sync(
return_input_arg: Optional[str] = None,
bind_future_to_self: bool = True,
):
"""Decorator for AiPlatformResourceNounWithFutureManager with optional sync
"""Decorator for VertexAiResourceNounWithFutureManager with optional sync
support.
Methods with this decorator should include a "sync" argument that defaults to
Expand Down Expand Up @@ -714,8 +714,8 @@ def wrapper(*args, **kwargs):
return optional_run_in_thread


class AiPlatformResourceNounWithFutureManager(AiPlatformResourceNoun, FutureManager):
"""Allows optional asynchronous calls to this AI Platform Resource
class VertexAiResourceNounWithFutureManager(VertexAiResourceNoun, FutureManager):
"""Allows optional asynchronous calls to this Vertex AI Resource
Nouns."""

def __init__(
Expand All @@ -735,7 +735,7 @@ def __init__(
resource noun.
resource_name(str): A fully-qualified resource name or ID.
"""
AiPlatformResourceNoun.__init__(
VertexAiResourceNoun.__init__(
self,
project=project,
location=location,
Expand All @@ -751,7 +751,7 @@ def _empty_constructor(
location: Optional[str] = None,
credentials: Optional[auth_credentials.Credentials] = None,
resource_name: Optional[str] = None,
) -> "AiPlatformResourceNounWithFutureManager":
) -> "VertexAiResourceNounWithFutureManager":
"""Initializes with all attributes set to None.
The attributes should be populated after a future is complete. This allows
Expand All @@ -768,7 +768,7 @@ def _empty_constructor(
An instance of this class with attributes set to None.
"""
self = cls.__new__(cls)
AiPlatformResourceNoun.__init__(
VertexAiResourceNoun.__init__(
self,
project=project,
location=location,
Expand All @@ -780,12 +780,12 @@ def _empty_constructor(
return self

def _sync_object_with_future_result(
self, result: "AiPlatformResourceNounWithFutureManager"
self, result: "VertexAiResourceNounWithFutureManager"
):
"""Populates attributes from a Future result to this object.
Args:
result: AiPlatformResourceNounWithFutureManager
result: VertexAiResourceNounWithFutureManager
Required. Result of future with same type as this object.
"""
sync_attributes = [
Expand All @@ -811,12 +811,12 @@ def _construct_sdk_resource_from_gapic(
project: Optional[str] = None,
location: Optional[str] = None,
credentials: Optional[auth_credentials.Credentials] = None,
) -> AiPlatformResourceNoun:
) -> VertexAiResourceNoun:
"""Given a GAPIC resource object, return the SDK representation.
Args:
gapic_resource (proto.Message):
A GAPIC representation of an AI Platform resource, usually
A GAPIC representation of an Vertex AI resource, usually
retrieved by a get_* or in a list_* API call.
project (str):
Optional. Project to construct SDK object from. If not set,
Expand All @@ -829,7 +829,7 @@ def _construct_sdk_resource_from_gapic(
Overrides credentials set in aiplatform.init.
Returns:
AiPlatformResourceNoun:
VertexAiResourceNoun:
An initialized SDK object that represents GAPIC type.
"""
sdk_resource = self._empty_constructor(
Expand All @@ -849,8 +849,8 @@ def _list(
project: Optional[str] = None,
location: Optional[str] = None,
credentials: Optional[auth_credentials.Credentials] = None,
) -> List[AiPlatformResourceNoun]:
"""Private method to list all instances of this AI Platform Resource,
) -> List[VertexAiResourceNoun]:
"""Private method to list all instances of this Vertex AI Resource,
takes a `cls_filter` arg to filter to a particular SDK resource
subclass.
Expand Down Expand Up @@ -878,7 +878,7 @@ def _list(
credentials set in aiplatform.init.
Returns:
List[AiPlatformResourceNoun] - A list of SDK resource objects
List[VertexAiResourceNoun] - A list of SDK resource objects
"""
self = cls._empty_constructor(
project=project, location=location, credentials=credentials
Expand Down Expand Up @@ -918,8 +918,8 @@ def _list_with_local_order(
project: Optional[str] = None,
location: Optional[str] = None,
credentials: Optional[auth_credentials.Credentials] = None,
) -> List[AiPlatformResourceNoun]:
"""Private method to list all instances of this AI Platform Resource,
) -> List[VertexAiResourceNoun]:
"""Private method to list all instances of this Vertex AI Resource,
takes a `cls_filter` arg to filter to a particular SDK resource
subclass. Provides client-side sorting when a list API doesn't support
`order_by`.
Expand Down Expand Up @@ -948,7 +948,7 @@ def _list_with_local_order(
credentials set in aiplatform.init.
Returns:
List[AiPlatformResourceNoun] - A list of SDK resource objects
List[VertexAiResourceNoun] - A list of SDK resource objects
"""

li = cls._list(
Expand Down Expand Up @@ -980,8 +980,8 @@ def list(
project: Optional[str] = None,
location: Optional[str] = None,
credentials: Optional[auth_credentials.Credentials] = None,
) -> List[AiPlatformResourceNoun]:
"""List all instances of this AI Platform Resource.
) -> List[VertexAiResourceNoun]:
"""List all instances of this Vertex AI Resource.
Example Usage:
Expand Down Expand Up @@ -1010,7 +1010,7 @@ def list(
credentials set in aiplatform.init.
Returns:
List[AiPlatformResourceNoun] - A list of SDK resource objects
List[VertexAiResourceNoun] - A list of SDK resource objects
"""

return cls._list(
Expand All @@ -1023,7 +1023,7 @@ def list(

@optional_sync()
def delete(self, sync: bool = True) -> None:
"""Deletes this AI Platform resource. WARNING: This deletion is
"""Deletes this Vertex AI resource. WARNING: This deletion is
permament.
Args:
Expand All @@ -1042,7 +1042,7 @@ def delete(self, sync: bool = True) -> None:

def __repr__(self) -> str:
if self._gca_resource:
return AiPlatformResourceNoun.__repr__(self)
return VertexAiResourceNoun.__repr__(self)

return FutureManager.__repr__(self)

Expand Down

0 comments on commit 7b7c950

Please sign in to comment.