Skip to content

Commit

Permalink
update beta
Browse files Browse the repository at this point in the history
  • Loading branch information
dizcology committed Nov 3, 2020
1 parent 799d865 commit 57aa05f
Show file tree
Hide file tree
Showing 16 changed files with 6,245 additions and 6,698 deletions.
7 changes: 2 additions & 5 deletions docs/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -347,12 +347,9 @@
intersphinx_mapping = {
"python": ("http://python.readthedocs.org/en/latest/", None),
"google-auth": ("https://google-auth.readthedocs.io/en/stable", None),
"google.api_core": (
"https://googleapis.dev/python/google-api-core/latest/",
None,
),
"google.api_core": ("https://googleapis.dev/python/google-api-core/latest/", None,),
"grpc": ("https://grpc.io/grpc/python/", None),

"proto-plus": ("https://proto-plus-python.readthedocs.io/en/latest/", None),
}


Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@
from google.cloud.aiplatform_v1beta1.types import (
data_labeling_job as gca_data_labeling_job,
)
from google.cloud.aiplatform_v1beta1.types import explanation
from google.cloud.aiplatform_v1beta1.types import hyperparameter_tuning_job
from google.cloud.aiplatform_v1beta1.types import (
hyperparameter_tuning_job as gca_hyperparameter_tuning_job,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,7 @@
from google.cloud.aiplatform_v1beta1.types import (
data_labeling_job as gca_data_labeling_job,
)
from google.cloud.aiplatform_v1beta1.types import explanation
from google.cloud.aiplatform_v1beta1.types import hyperparameter_tuning_job
from google.cloud.aiplatform_v1beta1.types import (
hyperparameter_tuning_job as gca_hyperparameter_tuning_job,
Expand Down
24 changes: 24 additions & 0 deletions google/cloud/aiplatform_v1beta1/types/batch_prediction_job.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@
from google.cloud.aiplatform_v1beta1.types import (
completion_stats as gca_completion_stats,
)
from google.cloud.aiplatform_v1beta1.types import explanation
from google.cloud.aiplatform_v1beta1.types import io
from google.cloud.aiplatform_v1beta1.types import job_state
from google.cloud.aiplatform_v1beta1.types import machine_resources
Expand Down Expand Up @@ -114,6 +115,25 @@ class BatchPredictionJob(proto.Message):
object.
- ``csv``: Generating explanations for CSV format is not
supported.
explanation_spec (~.explanation.ExplanationSpec):
Explanation configuration for this BatchPredictionJob. Can
only be specified if
``generate_explanation``
is set to ``true``. It's invalid to specified it with
generate_explanation set to false or unset.
This value overrides the value of
``Model.explanation_spec``.
All fields of
``explanation_spec``
are optional in the request. If a field of
``explanation_spec``
is not populated, the value of the same field of
``Model.explanation_spec``
is inherited. The corresponding
``Model.explanation_spec``
must be populated, otherwise explanation for this Model is
not allowed.
output_info (~.batch_prediction_job.BatchPredictionJob.OutputInfo):
Output only. Information further describing
the output of this job.
Expand Down Expand Up @@ -326,6 +346,10 @@ class OutputInfo(proto.Message):

generate_explanation = proto.Field(proto.BOOL, number=23)

explanation_spec = proto.Field(
proto.MESSAGE, number=25, message=explanation.ExplanationSpec,
)

output_info = proto.Field(proto.MESSAGE, number=9, message=OutputInfo,)

state = proto.Field(proto.ENUM, number=10, enum=job_state.JobState,)
Expand Down
10 changes: 5 additions & 5 deletions google/cloud/aiplatform_v1beta1/types/explanation_metadata.py
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ class ExplanationMetadata(proto.Message):
be keyed by this key (if not grouped with another feature).
For custom images, the key must match with the key in
``instance``[].
``instance``.
outputs (Sequence[~.explanation_metadata.ExplanationMetadata.OutputsEntry]):
Required. Map from output names to output
metadata.
Expand Down Expand Up @@ -183,10 +183,10 @@ class FeatureValueDomain(proto.Message):
(with mean = 0 and stddev = 1) was obtained.
Attributes:
min_ (float):
min_value (float):
The minimum permissible value for this
feature.
max_ (float):
max_value (float):
The maximum permissible value for this
feature.
original_mean (float):
Expand All @@ -199,9 +199,9 @@ class FeatureValueDomain(proto.Message):
deviation of the domain prior to normalization.
"""

min_ = proto.Field(proto.FLOAT, number=1)
min_value = proto.Field(proto.FLOAT, number=1)

max_ = proto.Field(proto.FLOAT, number=2)
max_value = proto.Field(proto.FLOAT, number=2)

original_mean = proto.Field(proto.FLOAT, number=3)

Expand Down
117 changes: 48 additions & 69 deletions google/cloud/aiplatform_v1beta1/types/model.py
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ class Model(proto.Message):
supported_export_formats (Sequence[~.model.Model.ExportFormat]):
Output only. The formats in which this Model
may be exported. If empty, this Model is not
avaiable for export.
available for export.
training_pipeline (str):
Output only. The resource name of the
TrainingPipeline that uploaded this Model, if
Expand Down Expand Up @@ -390,35 +390,31 @@ class PredictSchemata(proto.Message):

class ModelContainerSpec(proto.Message):
r"""Specification of a container for serving predictions. This message
is a subset of the [Kubernetes Container v1 core
specification](https://kubernetes.io/docs/reference/generated/kubernetes-api/v1.18/#container-v1-core).
is a subset of the Kubernetes Container v1 core
`specification <https://tinyurl.com/k8s-io-api/v1.18/#container-v1-core>`__.
Attributes:
image_uri (str):
Required. Immutable. URI of the Docker image to be used as
the custom container for serving predictions. This URI must
identify an image in Artifact Registry or Container
Registry. Learn more about the [container publishing
requirements](https://cloud.google.com/ai-platform-unified/docs/predictions/custom-container-requirements#publishing),
including permissions requirements for the AI Platform
Service Agent.
Registry. Learn more about the container publishing
requirements, including permissions requirements for the AI
Platform Service Agent,
`here <https://tinyurl.com/cust-cont-reqs#publishing>`__.
The container image is ingested upon
``ModelService.UploadModel``,
stored internally, and this original path is afterwards not
used.
To learn about the requirements for the Docker image itself,
read [Custom container
requirements](https://cloud.google.com/ai-platform-unified/docs/predictions/custom-container-requirements).
see `Custom container
requirements <https://tinyurl.com/cust-cont-reqs>`__.
command (Sequence[str]):
Immutable. Specifies the command that runs when the
container starts. This overrides the container's
[``ENTRYPOINT``](https://docs.docker.com/engine/reference/builder/#entrypoint).
`ENTRYPOINT <https://docs.docker.com/engine/reference/builder/#entrypoint>`__.
Specify this field as an array of executable and arguments,
similar to a Docker ``ENTRYPOINT``'s "exec" form, not its
"shell" form.
Expand All @@ -430,23 +426,20 @@ class ModelContainerSpec(proto.Message):
```CMD`` <https://docs.docker.com/engine/reference/builder/#cmd>`__,
if either exists. If this field is not specified and the
container does not have an ``ENTRYPOINT``, then refer to the
[Docker documentation about how ``CMD`` and ``ENTRYPOINT``
interact](https://docs.docker.com/engine/reference/builder/#understand-how-cmd-and-entrypoint-interact).
Docker documentation about how ``CMD`` and ``ENTRYPOINT``
`interact <https://tinyurl.com/h3kdcgs>`__.
If you specify this field, then you can also specify the
``args`` field to provide additional arguments for this
command. However, if you specify this field, then the
container's ``CMD`` is ignored. See the [Kubernetes
documentation about how the ``command`` and ``args`` fields
interact with a container's ``ENTRYPOINT`` and
container's ``CMD`` is ignored. See the `Kubernetes
documentation <https://tinyurl.com/y8bvllf4>`__ about how
the ``command`` and ``args`` fields interact with a
container's ``ENTRYPOINT`` and ``CMD``.
``CMD``](https://kubernetes.io/docs/tasks/inject-data-application/define-command-argument-container/#notes).
In this field, you can reference [environment variables set
In this field, you can reference environment variables `set
by AI
Platform](https://cloud.google.com/ai-platform-unified/docs/predictions/custom-container-requirements#aip-variables)
Platform <https://tinyurl.com/cust-cont-reqs#aip-variables>`__
and environment variables set in the
``env``
field. You cannot reference environment variables set in the
Expand All @@ -457,10 +450,9 @@ class ModelContainerSpec(proto.Message):
cannot be resolved, the reference in the input string is
used unchanged. To avoid variable expansion, you can escape
this syntax with ``$$``; for example: $$(VARIABLE_NAME) This
field corresponds to the ``command`` field of the
[Kubernetes Containers v1 core
API](https://kubernetes.io/docs/reference/generated/kubernetes-api/v1.18/#container-v1-core).
field corresponds to the ``command`` field of the Kubernetes
Containers `v1 core
API <https://tinyurl.com/k8s-io-api/v1.18/#container-v1-core>`__.
args (Sequence[str]):
Immutable. Specifies arguments for the command that runs
when the container starts. This overrides the container's
Expand All @@ -471,25 +463,21 @@ class ModelContainerSpec(proto.Message):
If you don't specify this field but do specify the
``command``
field, then the command from the ``command`` field runs
without any additional arguments. See the [Kubernetes
documentation about how the ``command`` and ``args`` fields
interact with a container's ``ENTRYPOINT`` and
``CMD``](https://kubernetes.io/docs/tasks/inject-data-application/define-command-argument-container/#notes).
without any additional arguments. See the `Kubernetes
documentation <https://tinyurl.com/y8bvllf4>`__ about how
the ``command`` and ``args`` fields interact with a
container's ``ENTRYPOINT`` and ``CMD``.
If you don't specify this field and don't specify the
``command`` field, then the container's
```ENTRYPOINT`` <https://docs.docker.com/engine/reference/builder/#cmd>`__
and ``CMD`` determine what runs based on their default
behavior. See the [Docker documentation about how ``CMD``
and ``ENTRYPOINT``
interact](https://docs.docker.com/engine/reference/builder/#understand-how-cmd-and-entrypoint-interact).
behavior. See the Docker documentation about how ``CMD`` and
``ENTRYPOINT`` `interact <https://tinyurl.com/h3kdcgs>`__.
In this field, you can reference [environment variables set
In this field, you can reference environment variables `set
by AI
Platform](https://cloud.google.com/ai-platform-unified/docs/predictions/custom-container-requirements#aip-variables)
Platform <https://tinyurl.com/cust-cont-reqs#aip-variables>`__
and environment variables set in the
``env``
field. You cannot reference environment variables set in the
Expand All @@ -500,10 +488,9 @@ class ModelContainerSpec(proto.Message):
cannot be resolved, the reference in the input string is
used unchanged. To avoid variable expansion, you can escape
this syntax with ``$$``; for example: $$(VARIABLE_NAME) This
field corresponds to the ``args`` field of the [Kubernetes
Containers v1 core
API](https://kubernetes.io/docs/reference/generated/kubernetes-api/v1.18/#container-v1-core).
field corresponds to the ``args`` field of the Kubernetes
Containers `v1 core
API <https://tinyurl.com/k8s-io-api/v1.18/#container-v1-core>`__.
env (Sequence[~.env_var.EnvVar]):
Immutable. List of environment variables to set in the
container. After the container starts running, code running
Expand Down Expand Up @@ -535,16 +522,14 @@ class ModelContainerSpec(proto.Message):
then the expansion does not occur.
This field corresponds to the ``env`` field of the
[Kubernetes Containers v1 core
API](https://kubernetes.io/docs/reference/generated/kubernetes-api/v1.18/#container-v1-core).
Kubernetes Containers `v1 core
API <https://tinyurl.com/k8s-io-api/v1.18/#container-v1-core>`__.
ports (Sequence[~.model.Port]):
Immutable. List of ports to expose from the container. AI
Platform sends any prediction requests that it receives to
the first port on this list. AI Platform also sends
[liveness and health
checks](https://cloud.google.com/ai-platform-unified/docs/predictions/custom-container-requirements#health) to
`liveness and health
checks <https://tinyurl.com/cust-cont-reqs#health>`__ to
this port.
If you do not specify this field, it defaults to following
Expand All @@ -560,9 +545,8 @@ class ModelContainerSpec(proto.Message):
AI Platform does not use ports other than the first one
listed. This field corresponds to the ``ports`` field of the
[Kubernetes Containers v1 core
API](https://kubernetes.io/docs/reference/generated/kubernetes-api/v1.18/#container-v1-core).
Kubernetes Containers `v1 core
API <https://tinyurl.com/k8s-io-api/v1.18/#container-v1-core>`__.
predict_route (str):
Immutable. HTTP path on the container to send prediction
requests to. AI Platform forwards requests sent using
Expand All @@ -589,24 +573,21 @@ class ModelContainerSpec(proto.Message):
the Endpoint.name][] field of the Endpoint where this
Model has been deployed. (AI Platform makes this value
available to your container code as the
[``AIP_ENDPOINT_ID`` environment
variable](https://cloud.google.com/ai-platform-unified/docs/predictions/custom-container-requirements#aip-variables).)
```AIP_ENDPOINT_ID`` <https://tinyurl.com/cust-cont-reqs#aip-variables>`__
environment variable.)
- DEPLOYED_MODEL:
``DeployedModel.id``
of the ``DeployedModel``. (AI Platform makes this value
available to your container code as the
[``AIP_DEPLOYED_MODEL_ID`` environment
variable](https://cloud.google.com/ai-platform-unified/docs/predictions/custom-container-requirements#aip-variables).)
```AIP_DEPLOYED_MODEL_ID`` environment
variable <https://tinyurl.com/cust-cont-reqs#aip-variables>`__.)
health_route (str):
Immutable. HTTP path on the container to send health checkss
to. AI Platform intermittently sends GET requests to this
path on the container's IP address and port to check that
the container is healthy. Read more about [health
checks](https://cloud.google.com/ai-platform-unified/docs/predictions/custom-container-requirements#checks).
the container is healthy. Read more about `health
checks <https://tinyurl.com/cust-cont-reqs#checks>`__.
For example, if you set this field to ``/bar``, then AI
Platform intermittently sends a GET request to the following
Expand All @@ -625,17 +606,15 @@ class ModelContainerSpec(proto.Message):
the Endpoint.name][] field of the Endpoint where this
Model has been deployed. (AI Platform makes this value
available to your container code as the
[``AIP_ENDPOINT_ID`` environment
variable](https://cloud.google.com/ai-platform-unified/docs/predictions/custom-container-requirements#aip-variables).)
```AIP_ENDPOINT_ID`` <https://tinyurl.com/cust-cont-reqs#aip-variables>`__
environment variable.)
- DEPLOYED_MODEL:
``DeployedModel.id``
of the ``DeployedModel``. (AI Platform makes this value
available to your container code as the
[``AIP_DEPLOYED_MODEL_ID`` environment
variable](https://cloud.google.com/ai-platform-unified/docs/predictions/custom-container-requirements#aip-variables).)
```AIP_DEPLOYED_MODEL_ID`` <https://tinyurl.com/cust-cont-reqs#aip-variables>`__
environment variable.)
"""

image_uri = proto.Field(proto.STRING, number=1)
Expand Down

0 comments on commit 57aa05f

Please sign in to comment.