A Deployment object is used to manage the online and batch serving of a deployed FeatureList in a production environment.
Distinguishing FeatureList and Deployment allows multiple deployments for a given FeatureList. This is useful when a FeatureList object is used for multiple use cases. This allows for better organization and management of use cases.
Creating Deployment Objects¶
A Deployment object is created when a feature list is deployed.
To create a Deployment object, the corresponding FeatureList object must have all its Feature objects labeled as "PRODUCTION_READY". After that, the
deploy() method can be used to create the Deployment object, and the
enable() method can be called to activate it.
# Check Feature objects are PRODUCTION_READY. # A readiness metric of 100% should be returned. display(my_feature_list.production_ready_fraction) # Create deployment my_deployment = my_feature_list.deploy( name="Deployment of the improved feature list", ) # Activate deployment my_deployment.enable()
Trying to deploy a feature list which has features that aren't labeled as "PRODUCTION_READY" will raise an error.
disable() method can be used to disable the deployment when it is no longer needed.
enabledproperty can be used to check the status of the deployment.
Using Deployment for Online Serving¶
For online serving, the Deployment object provides REST API service templates that can be used to serve features. Python or shell script templates for the REST API service are retrieved from the Deployment object using the
For Python script:
For Shell script:
Using Deployment for Batch Serving¶
For batch serving, the Deployment object provides the
compute_batch_feature_table() method, which returns a BatchFeatureTable object representing a table in the feature store containing the batch feature values.
For more details, refer to the SDK reference for BatchFeatureTable object.
Listing and Retrieving Deployment Objects¶
From a Catalog¶
To list the Deployment objects in the catalog, use the
To retrieve a specific Deployment by its name from the catalog, use the
To retrieve a specific Deployment by its Object ID from the catalog, use the
Use the Deployment object class methods to list deployments across all catalogs:
list()to list all deployments across catalogs.
get()to get an Deployment object by its name.
get_by_id()to get a Deployment object by its Object ID.
Getting the Feature List Associated with a Deployment¶
feature_list_id property to get the Object ID of the feature list associated with a Deployment object:
For a given a feature_list, the
get_feature_jobs_status() method returns a report on the recent activity of scheduled feature jobs in your feature store.