Skip to main content
Version: 1.0

Transform Server Groups

Private Preview

This feature is currently in Private Preview.

This feature has the following limitations:
  • Must be enabled by Tecton support.
If you would like to participate in the preview, please file a feature request.

Introduction​

The Transform Server is a Tecton-managed compute node that executes user-specified code in real-time feature views as needed when reading feature vectors from Feature Services via the HTTP API.

A Transform Server Group is a group of Transform Server nodes that are capable of autoscaling. Each Transform Server Group belongs to exactly one workspace.

Transform Server Groups even in the same workspace are "isolated" from each other. This mean that Feature Services using different Transform Server Groups will not share Realtime Feature View computation infrastructure. This ensures that each team's operations remain independent and performant.

Transform Server Groups provide the following benefits:

  • Eliminate disruption caused by shared serving infrastructure, preventing resource contention between one team's test cases and another's production traffic. Transform Server Group isolation ensures that each team's operations remain independent and performant.
  • Facilitate granular resource and cost management in-repo server provisioning controls.
  • Ability to reuse custom environments across multiple Feature Services within a workspace, with isolated serving infrastructure.
  • Transform Server Groups are also compatible with Feature Server Groups. Using both for a Feature Service allows isolating serving infrastructure for both feature serving and realtime transformations for Realtime Feature Views.
  • Transform Server Groups also provide lower, and more consistent, median and tail latency compared to the current "environment-based" serving infrastructure.
Backwards compatibility with the Environments:
  • Transform Server Groups have an independent infrastructure from previous serving infrastructure for Transformations.
  • The HTTP serving API v1 remains intact and can be continued to serve traffic as-is; using Transform Server Groups requires opt-in changes to Feature Service definitions.

Managing Transform Server Groups​

This section describes how to create, use, and delete Transform Server Groups in a given workspace.

Create & Use​

  1. Select the desired live workspace:
% tecton workspace select <WORKSPACE_NAME>
  1. Create a new environment, or reuse an existing environment.

Note: The environment must be created before creating the Transform Server Group, and must contain a version of tecton-runtime>=1.0.0.

Assuming a requirements file requirements.in with the following content:

pycountry
fuzzywuzzy
tecton-runtime

You can create a new environment with the following command:

tecton environment create --name my-custom-env --description "My custom Python environment" --requirements requirements.in
  1. Add a Transform Server Group declaration in your feature repository's declarative config:
from tecton import ProvisionedScalingConfig
from tecton import TransformServerGroup

fraud_team_tsg = TransformServerGroup(
name="fraud_team_tsg",
description="Fraud detection team Transform Server Group",
owner="fraud-detection",
environment="my-custom-env", # The name of the environment created in step 2
scaling_config=ProvisionedScalingConfig(
desired_nodes=3,
),
)

To create a Transform Server Group with autoscaling enabled, use the AutoscalingConfig instead of ProvisionedScalingConfig.

  1. Apply the declarative config to the workspace:
% tecton apply
  1. Wait for the Transform Server Group to be in READY status, check the status with the tecton CLI command:
% tecton server-group list

Id Name Type Status Environment Description Created At Owner Last Modified By
=================================================================================================================================================================================================================
bde2a413a3491a27384fea41a75139c3 default TRANSFORM_SERVER_GROUP CREATING None Fraud detection team Feature Server Group 2024-09-09 03:13:47 UTC fraud-detection jon@tecton.ai

Note that applying a TransformServerGroup declaration will create new long-running cloud resources, and may incur additional costs.

  1. Once the group reaches the READY status, it can be used by Feature Services by specifying the server_group parameter.
from tecton import Attribute, RequestSource, Aggregate, realtime_feature_view
from tecton.types import Field, String, Timestamp, Float64, Int64
from datetime import datetime, timedelta

similarity_request = RequestSource(schema=[Field("text", String)])


@realtime_feature_view(
sources=[similarity_request],
mode="python",
features=[Attribute("similarity", Int64), Attribute("partial_similarity", Int64)],
)
def fuzzy_similarity(request):
from fuzzywuzzy import fuzz

baseline = "Mocha Cheesecake Fudge Brownie Bars"
result = {
"similarity": fuzz.ratio(baseline, request["text"]),
"partial_similarity": fuzz.partial_ratio(baseline, request["text"]),
}
return result


fraud_detection_feature_service = FeatureService(
name="fraud_detection_feature_service",
online_serving_enabled=True,
transform_server_group=fraud_team_tsg,
features=[fuzzy_similarity],
)
  1. Once you apply your FeatureService definition (also using tecton apply), you are ready to query features! You can use the HTTP API to query the features from the FeatureService, as described in Reading Feature data for inference.

Delete​

  1. Select the desired live workspace:
% tecton workspace select <WORKSPACE_NAME>
  1. Remove (or comment out) the declaration of the Transform Server Group in the declarative config:
# from tecton import AutoscalingConfig
# from tecton import TransformServerGroup
#
# default = TransformServerGroup(
# name="default",
# description="Fraud detection team Transform Server Group",
# owner="fraud-detection",
# environment="my-custom-env", # The name of the environment created in step 2
# scaling_config=AutoscalingConfig(min_nodes=1, max_nodes=10),
# )
  1. Apply the declarative config to the workspace:
% tecton apply
  1. No further actions are needed, as soon as the Transform Server Group is deleted it won’t be shown in the list of the groups provided by the tecton server-group list CLI command. For a couple of minutes the group will be present in the list in the DELETING status:
% tecton server-group list

Id Name Type Status Environment Description Created At Owner Last Modified By
==================================================================================================================================================================================================================
bde2a413a3491a27384fea41a75139c3 default TRANSFORM_SERVER_GROUP DELETING None Fraud detection team Feature Server Group 2024-09-09 03:13:47 UTC fraud-detection jon@tecton.ai

Note that destroying a TransformServerGroup declaration will cause corresponding cloud resources to be deleted.

Validations​

When using Transform Server Groups, the following validations are performed by Tecton:

  • The environment specified in the Transform Server Group must exist.
  • The environment specified in the Transform Server Group must contain a version of tecton-runtime>=1.0.0.
  • The Transform Server Group being used in a Feature Service must be in the READY status, and defined in the same workspace.
  • If a Transform Server Group is used by a Feature Service, it cannot be scaled down to 0 nodes to ensure uptime.
  • A Transform Server Group that is in use by a Feature Service cannot be deleted.
  • Transform Server Groups cannot be renamed.

Was this page helpful?

🧠 Hi! Ask me anything about Tecton!

Floating button icon