Version class
Creates a new version of a model from a trained TensorFlow model. If the version created in the cloud by this call is the first deployed version of the specified model, it will be made the default version of the model. When you add a version to a model that already has one or more versions, the default version does not automatically change. If you want a new version to be the default, you must call projects.models.versions.setDefault.
Constructors
- Version(String name, {VersionArgs? args, CustomResourceOptions? options})
-
Creates a new Version.
nameThe Pulumi resource name.argsArguments used to configure this Version. The set of arguments for Version.optionsResource options controlling this resource's behavior.
Properties
-
acceleratorConfig
↔ Output<
GoogleCloudMlV1AcceleratorConfigResponse> -
Optional. Accelerator config for using GPUs for online prediction (beta). Only specify this field if you have specified a Compute Engine (N1) machine type in the
machineTypefield. Learn more about using GPUs for online prediction.latefinal -
autoScaling
↔ Output<
GoogleCloudMlV1AutoScalingResponse> -
Automatically scale the number of nodes used to serve the model in response to increases and decreases in traffic. Care should be taken to ramp up traffic according to the model's ability to scale or you will start seeing increases in latency and 429 response codes.
latefinal
-
childResources
→ Set<
Resource> -
finalinherited
-
completionSources
↔ Map<
String, IOutputCompletionSource> -
latefinalinherited
-
container
↔ Output<
GoogleCloudMlV1ContainerSpecResponse> -
Optional. Specifies a custom container to use for serving predictions. If you specify this field, then
machineTypeis required. If you specify this field, thendeploymentUriis optional. If you specify this field, then you must not specifyruntimeVersion,packageUris,framework,pythonVersion, orpredictionClass.latefinal -
createTime
↔ Output<
String> -
The time the version was created.
latefinal
-
deploymentUri
↔ Output<
String> -
The Cloud Storage URI of a directory containing trained model artifacts to be used to create the model version. See the guide to deploying models for more information. The total number of files under this directory must not exceed 1000. During projects.models.versions.create, AI Platform Prediction copies all files from the specified directory to a location managed by the service. From then on, AI Platform Prediction uses these copies of the model artifacts to serve predictions, not the original files in Cloud Storage, so this location is useful only as a historical record. If you specify container, then this field is optional. Otherwise, it is required. Learn how to use this field with a custom container.
latefinal
-
description
↔ Output<
String> -
Optional. The description specified for the version when it was created.
latefinal
-
errorMessage
↔ Output<
String> -
The details of a failure or a cancellation.
latefinal
-
etag
↔ Output<
String> -
etagis used for optimistic concurrency control as a way to help prevent simultaneous updates of a model from overwriting each other. It is strongly suggested that systems make use of theetagin the read-modify-write cycle to perform model updates in order to avoid race conditions: Anetagis returned in the response toGetVersion, and systems are expected to put that etag in the request toUpdateVersionto ensure that their change will be applied to the model as intended.latefinal -
explanationConfig
↔ Output<
GoogleCloudMlV1ExplanationConfigResponse> -
Optional. Configures explainability features on the model's version. Some explanation features require additional metadata to be loaded as part of the model payload.
latefinal
-
framework
↔ Output<
String> -
Optional. The machine learning framework AI Platform uses to train this version of the model. Valid values are
TENSORFLOW,SCIKIT_LEARN,XGBOOST. If you do not specify a framework, AI Platform will analyze files in the deployment_uri to determine a framework. If you chooseSCIKIT_LEARNorXGBOOST, you must also set the runtime version of the model to 1.4 or greater. Do not specify a framework if you're deploying a custom prediction routine or if you're using a custom container.latefinal - hashCode → int
-
The hash code for this object.
no setterinherited
-
id
↔ Output<
String> -
getter/setter pairinherited
- isCustom → bool
-
Returns whether this resource is provider-managed.
no setterinherited
-
isDefault
↔ Output<
bool> -
If true, this version will be used to handle prediction requests that do not specify a version. You can change the default version by calling projects.methods.versions.setDefault.
latefinal
- isProtected → bool
-
Returns whether this resource is protected from deletion.
no setterinherited
- isRemote → bool
-
Whether this resource is registered as remote.
no setterinherited
- isResourceReference → bool
-
Whether this instance represents a resource value returned over RPC.
finalinherited
-
labels
↔ Output<
Map< String, String> > -
Optional. One or more labels that you can add, to organize your model versions. Each label is a key-value pair, where both the key and the value are arbitrary strings that you supply. For more information, see the documentation on using labels. Note that this field is not updatable for mls1* models.
latefinal
-
lastMigrationModelId
↔ Output<
String> -
The AI Platform (Unified)
ModelID for the last model migration.latefinal -
lastMigrationTime
↔ Output<
String> -
The last time this version was successfully migrated to AI Platform (Unified).
latefinal
-
lastUseTime
↔ Output<
String> -
The time the version was last used for prediction.
latefinal
-
machineType
↔ Output<
String> -
Optional. The type of machine on which to serve the model. Currently only applies to online prediction service. To learn about valid values for this field, read Choosing a machine type for online prediction. If this field is not specified and you are using a regional endpoint, then the machine type defaults to
n1-standard-2. If this field is not specified and you are using the global endpoint (ml.googleapis.com), then the machine type defaults tomls1-c1-m2.latefinal -
manualScaling
↔ Output<
GoogleCloudMlV1ManualScalingResponse> -
Manually select the number of nodes to use for serving the model. You should generally use
auto_scalingwith an appropriatemin_nodesinstead, but this option is available if you want more predictable billing. Beware that latency and error rates will increase if the traffic exceeds that capability of the system to serve it based on the selected number of nodes.latefinal -
modelId
↔ Output<
String> -
latefinal
-
name
↔ Output<
String> -
The name specified for the version when it was created. The version name must be unique within the model it is created in.
latefinal
-
packageUris
↔ Output<
List< String> > -
Optional. Cloud Storage paths (
gs://…) of packages for custom prediction routines or scikit-learn pipelines with custom code. For a custom prediction routine, one of these packages must contain your Predictor class (seepredictionClass). Additionally, include any dependencies used by your Predictor or scikit-learn pipeline uses that are not already included in your selected runtime version. If you specify this field, you must also setruntimeVersionto 1.4 or greater.latefinal -
predictionClass
↔ Output<
String> -
Optional. The fully qualified name (module_name.class_name) of a class that implements the Predictor interface described in this reference field. The module containing this class should be included in a package provided to the
packageUrisfield. Specify this field if and only if you are deploying a custom prediction routine (beta). If you specify this field, you must setruntimeVersionto 1.4 or greater and you must setmachineTypeto a legacy (MLS1) machine type. The following code sample provides the Predictor interface: class Predictor(object): """Interface for constructing custom predictors.""" def predict(self, instances, **kwargs): """Performs custom prediction. Instances are the decoded values from the request. They have already been deserialized from JSON. Args: instances: A list of prediction input instances. **kwargs: A dictionary of keyword args provided as additional fields on the predict request body. Returns: A list of outputs containing the prediction results. This list must be JSON serializable. """ raise NotImplementedError() @classmethod def from_path(cls, model_dir): """Creates an instance of Predictor using the given path. Loading of the predictor should be done in this method. Args: model_dir: The local directory that contains the exported model file along with any additional files uploaded when creating the version resource. Returns: An instance implementing this Predictor class. """ raise NotImplementedError() Learn more about the Predictor interface and custom prediction routines.latefinal -
project
↔ Output<
String> -
latefinal
-
pythonVersion
↔ Output<
String> -
The version of Python used in prediction. The following Python versions are available: * Python '3.7' is available when
runtime_versionis set to '1.15' or later. * Python '3.5' is available whenruntime_versionis set to a version from '1.4' to '1.14'. * Python '2.7' is available whenruntime_versionis set to '1.15' or earlier. Read more about the Python versions available for each runtime version.latefinal -
requestLoggingConfig
↔ Output<
GoogleCloudMlV1RequestLoggingConfigResponse> -
Optional. Only specify this field in a projects.models.versions.patch request. Specifying it in a projects.models.versions.create request has no effect. Configures the request-response pair logging on predictions from this Version.
latefinal
-
resourceTransforms
→ List<
ResourceTransform> -
Inherited/explicit async transforms.
no setterinherited
-
routes
↔ Output<
GoogleCloudMlV1RouteMapResponse> -
Optional. Specifies paths on a custom container's HTTP server where AI Platform Prediction sends certain requests. If you specify this field, then you must also specify the
containerfield. If you specify thecontainerfield and do not specify this field, it defaults to the following:json { "predict": "/v1/models/MODEL/versions/VERSION:predict", "health": "/v1/models/MODEL/versions/VERSION" }See RouteMap for more details about these default values.latefinal - runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
-
runtimeVersion
↔ Output<
String> -
The AI Platform runtime version to use for this deployment. For more information, see the runtime version list and how to manage runtime versions.
latefinal
-
serviceAccount
↔ Output<
String> -
Optional. Specifies the service account for resource access control. If you specify this field, then you must also specify either the
containerSpecor thepredictionClassfield. Learn more about using a custom service account.latefinal -
state
↔ Output<
String> -
The state of a version.
latefinal
-
transformations
→ List<
ResourceTransformation> -
Inherited/explicit legacy transformations.
no setterinherited
-
urn
↔ Output<
String> -
latefinalinherited
Methods
-
failId(
Object error) → void -
Completes this resource ID with an error when registration fails.
inherited
-
failOutputs(
Object error) → void -
Completes all output properties with
error.inherited -
failUrn(
Object error) → void -
Completes this resource URN with an error when registration fails.
inherited
-
getProvider(
String moduleMember) → ProviderResource? -
Returns provider for
moduleMember's package, if configured.inherited -
getResourceName(
) → String -
Returns this resource's logical name.
inherited
-
getResourceType(
) → String -
Returns this resource's Pulumi type token.
inherited
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
registerOutput<
T> (String propertyName, {Object? decoder(Object?)?, bool isSecret = false}) → Output< T> -
Registers a dynamic output property for this resource.
inherited
-
resolveId(
String? value, {required bool isKnown}) → void -
Resolves the provider-assigned ID for this resource.
inherited
-
resolveOutputs(
Struct outputs) → void -
Resolves all output properties from a monitor response payload.
inherited
-
resolveUrn(
String value) → void -
Resolves this resource's URN once assigned by the engine.
inherited
-
serializeProperties(
Map< String, dynamic> properties) → Future<Struct> -
Serializes resource properties for RPC transmission.
inherited
-
toString(
) → String -
A string representation of this object.
inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited