Skip to content

Commit 005b455

Browse files
committedOct 24, 2024
Add 4.0 migration info.
1 parent c6c7905 commit 005b455

File tree

3 files changed

+136
-2
lines changed

3 files changed

+136
-2
lines changed
 

‎docs/user_guides/index.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -6,4 +6,4 @@ This section serves to provide guides and examples for the common usage of abstr
66
- [Feature Store](fs/index.md): Learn about the common usage of the core Hopsworks Feature Store abstractions, such as Feature Groups, Feature Views, Data Validation and Storage Connectors. Also, learn from the [Client Integrations](integrations/index.md) guides how to connect to the Feature Store from external environments such as a local Python environment, Databricks, or AWS Sagemaker
77
- [MLOps](mlops/index.md): Learn about the common usage of Hopsworks MLOps abstractions, such as the Model Registry or Model Serving.
88
- [Projects](projects/index.md): The core abstraction on Hopsworks are [Projects](../concepts/projects/governance.md). Learn in this section how to manage your projects and the services therein.
9-
- [Migration](migration/30_migration.md): Learn how to migrate to newer versions of Hopsworks.
9+
- [Migration](migration/40_migration.md): Learn how to migrate to newer versions of Hopsworks.
+134
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,134 @@
1+
# 4.0 Migration Guide
2+
3+
## Breaking Changes
4+
5+
With the release of Hopsworks 4.0, a number of necessary breaking
6+
changes have been put in place to improve the overall experience of
7+
using the Hopsworks platform. These breaking changes can be categorized
8+
in the following areas:
9+
10+
- Python API
11+
12+
- Multi-Environment Docker Images
13+
14+
- On-Demand Transformation Functions
15+
16+
### Python API
17+
18+
A number of significant changes have been made in the Python API
19+
Hopsworks 4.0. Previously, in Hopsworks 3.X, there were 3 python
20+
libraries used (“hopsworks”, “hsfs” & “hsml”) to develop feature,
21+
training & inference pipelines, with the 4.0 release there is now
22+
one single “hopsworks” python library that can should be used. For
23+
backwards compatibility, it will still be possible to import both
24+
the “hsfs” & “hsml” libraries but these are now effectively aliases
25+
to the “hopsworks” python library and their use going forward should
26+
be considered as deprecated.
27+
28+
Another significant change in the Hopsworks Python API is the use of
29+
optional extras to allow a developer to easily import exactly what is
30+
needed as part of their work. The main ones are great-expectations and
31+
polars. It is arguable whether this is a breaking change but it is
32+
important to note depending on how a particular pipeline has been
33+
written which may encounter a problem when executing using Hopsworks
34+
4.0.
35+
36+
Finally, there are a number of relatively small breaking changes and
37+
deprecated methods to improve the developer experience, these include:
38+
39+
- connection.init() is now considered deprecated
40+
41+
- When loading arrow_flight_client, an OptionalDependencyNotFoundError can be now thrown providing more detailed information on the error than the previous ModuleNotFoundError in 3.X.
42+
43+
- DatasetApi's zip and unzip will now return False when a timeout is exceeded instead of previously throwing an Exception
44+
45+
46+
### Multi-Environment Docker Images
47+
48+
As part of the Hopsworks 4.0 release, an engineering team using
49+
Hopsworks can now customize the docker images that they use for their
50+
feature, training and inference pipelines. By adding this flexibility,
51+
a set of breaking changes are necessary. Instead of having one common
52+
docker image for fti pipelines, with the release of 4.0 a number of
53+
specific docker images are provided to allow an engineering team using
54+
Hopsworks to install exactly what they need to get their feature,
55+
training and inference pipelines up and running. This breaking change
56+
will require existing customers running Hopsworks 3.X to test their
57+
existing pipelines using Hopsworks 4.0 before upgrading their
58+
production environments.
59+
60+
61+
### On-Demand Transformation Functions
62+
63+
A number of changes have been made to transformation functions in the
64+
last releases of Hopsworks. With 4.0, On-Demand Transformation Functions
65+
are now better supported which has resulted in some breaking changes.
66+
The following is how transformation functions were used in previous
67+
versions of Hopsworks and the how transformation functions are used
68+
in the 4.0 release.
69+
70+
71+
=== "Pre-4.0"
72+
```python
73+
#################################################
74+
# Creating transformation funciton Hopsworks 3.8#
75+
#################################################
76+
77+
# Define custom transformation function
78+
def add_one(feature):
79+
return feature + 1
80+
81+
# Create transformation function
82+
add_one = fs.create_transformation_function(add_one,
83+
output_type=int,
84+
version=1,
85+
)
86+
87+
# Save transformation function
88+
add_one.save()
89+
90+
# Retrieve transformation function
91+
scaler = fs.get_transformation_function(
92+
name="add_one",
93+
version=1,
94+
)
95+
96+
# Create feature view
97+
feature_view = fs.get_or_create_feature_view(
98+
name='serving_fv',
99+
version=1,
100+
query=selected_features,
101+
# Apply your custom transformation functions to the feature `feature_1`
102+
transformation_functions={
103+
"feature_1": add_one,
104+
},
105+
labels=['target'],
106+
)
107+
```
108+
109+
=== "4.0"
110+
```python
111+
#################################################
112+
# Creating transformation funciton Hopsworks 4.0#
113+
#################################################
114+
115+
# Define custom transformation function
116+
@hopsworks.udf(int)
117+
def add_one(feature):
118+
return feature + 1
119+
120+
# Create feature view
121+
feature_view = fs.get_or_create_feature_view(
122+
name='serving_fv',
123+
version=1,
124+
query=selected_features,
125+
# Apply the custom transformation functions defined to the feature `feature_1`
126+
transformation_functions=[
127+
add_one("feature_1"),
128+
],
129+
labels=['target'],
130+
)
131+
```
132+
133+
Note that the number of lines of code required has been significantly
134+
reduced using the “@hopsworks.udf” python decorator.

‎mkdocs.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -196,7 +196,7 @@ nav:
196196
- Troubleshooting: user_guides/mlops/serving/troubleshooting.md
197197
- Vector Database: user_guides/mlops/vector_database/index.md
198198
- Migration:
199-
- 2.X to 3.0: user_guides/migration/30_migration.md
199+
- 3.X to 4.0: user_guides/migration/40_migration.md
200200
- Setup and Administration:
201201
- setup_installation/index.md
202202
- Client Installation:

0 commit comments

Comments
 (0)