Workspaces
Workspaces are environments that can contain isolated feature repositories. Every Tecton cluster includes one Workspace by default named prod
.
Workspaces are creating using the Tecton CLI. There are two types of workspaces:
- Live Workspaces support materialization and online feature serving, but this behavior is disabled by default.
- Development Workspaces allow you to perform experimental and exploratory development without incurring any materialization costs.
Creating a new Workspace
Workspaces are created using the CLI.
$ tecton workspace create my_workspace
Created workspace "my_workspace".
Switched to workspace "my_workspace".
You're now on a new, empty workspace. Workspaces isolate their state,
so if you run "tecton plan" Tecton will not see any existing state
for this configuration.
Cloning an existing Workspace
Running tecton apply
within a workspace simply applies the local feature repo to the Workspace. Suppose you would like to iterate on a live Workspace in an experimental development Workspace using a new git branch.
-
Select the existing Workspace using
tecton workspace select
:$ tecton workspace select existing_workspace Switched to workspace "existing_workspace".
-
(Optional) Restore the existing Workspace to your local repo
$ tecton restore
-
Create a new workspace
$ tecton workspace create my_workspace Created workspace "my_workspace". Switched to workspace "my_workspace". You're now on a new, empty workspace. Workspaces isolate their state, so if you run "tecton plan" Tecton will not see any existing state for this configuration.
-
Apply the current state to your new workspace.
The new workspace
my_workspace
is empty. Runtecton apply
so that the new workspace reflects the currentprod
state, which has been captured in your local Git branch.$ tecton apply ✅ Imported 11 Python modules from the feature repository ✅ Collecting local feature declarations ↓↓↓↓↓↓↓↓↓↓↓↓ Plan Start ↓↓↓↓↓↓↓↓↓↓ ... ↑↑↑↑↑↑↑↑↑↑↑↑ Plan End ↑↑↑↑↑↑↑↑↑↑↑↑ Are you sure you want to apply this plan? [Y/n] Y All done!
-
Create a new Git branch
To develop using the existing Workspace state as a base, create a new Git branch from main in which to store changes made in your workspace:
# Create a new git branch git checkout -b "my_workspace_branch" Switched to new branch "my_workspace_branch"
You now have a development environment with a workspace and a Git branch that reflect the current state of existing_workspace
.
Interacting with Workspaces
Once you create a workspace and apply it to the remote Tecton cluster, you can use it interactively for feature engineering and exploratory development.
To view objects in your workspace, do the following in your interactive notebook:
-
Switch into the new workspace using the Tecton
Workspace
class:import tecton my_workspace = tecton.get_workspace("my_workspace")
-
Fetch a Feature View from the workspace:
experimental_fv = my_workspace.get_feature_view("my_experimental_feature")
-
Preview features from the Feature View:
from datetime import datetime from datetime import timedelta feature_df = experimental_fv.get_historical_features( start_time=(datetime.now() - timedelta(days = 7), from_source=True )
Creating Live Workspaces
Live workspaces have materialization and real-time serving enabled. This is useful for creating different feature store configurations for different teams, setting up staging and production workspaces, or developing when you need materialization or serving.
Live workspaces can be created using the --live
flag.
$ tecton workspace create my_workspace --live
Warning: applying features to a live workspace may incur additional costs as features are backfilled. Please proceed with caution whenever applying changes to a live workspace.