-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
8861695
commit 4fe884f
Showing
12 changed files
with
203 additions
and
16 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
import os | ||
import hopsworks | ||
|
||
from loguru import logger | ||
|
||
|
||
def get_hopsworks_feature_store(): | ||
HOPSWORKS_API_KEY = os.environ.get("HOPSWORKS_API_KEY") | ||
if HOPSWORKS_API_KEY: | ||
logger.info("Loging to Hopsworks using HOPSWORKS_API_KEY env var.") | ||
project = hopsworks.login(api_key_value=HOPSWORKS_API_KEY) | ||
else: | ||
logger.info("Login to Hopsworks using cached API KEY.") | ||
project = hopsworks.login() | ||
|
||
return project.get_feature_store() |
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,78 @@ | ||
import hopsworks | ||
|
||
# Login to Hopsworks | ||
project = hopsworks.login() | ||
|
||
|
||
# Get deployment registry | ||
mr = project.get_model_serving() | ||
|
||
# List all deployments | ||
deployments = mr.get_deployments() | ||
|
||
# Delete each deployment | ||
for deployment in deployments: | ||
print(f"Deleting deployment: {deployment.name}.") | ||
deployment.delete() | ||
|
||
# Get the model registry | ||
mr = project.get_model_registry() | ||
|
||
# List all models | ||
for model_name in ["ranking_model", "candidate_model", "query_model"]: | ||
models = mr.get_models(name=model_name) | ||
|
||
# Delete each model | ||
for model in models: | ||
print(f"Deleting model: {model.name} (version: {model.version})") | ||
model.delete() | ||
|
||
|
||
# Get feature store | ||
fs = project.get_feature_store() | ||
|
||
|
||
for feature_view in [ | ||
"retrieval", | ||
"articles", | ||
"customers", | ||
"candidate_embeddings", | ||
"ranking", | ||
]: | ||
# Get all feature views | ||
try: | ||
feature_views = fs.get_feature_views(name=feature_view) | ||
except: | ||
print(f"Couldn't find feature view: {feature_view}. Skipping...") | ||
feature_views = [] | ||
|
||
# Delete each feature view | ||
for fv in feature_views: | ||
print(f"Deleting feature view: {fv.name} (version: {fv.version})") | ||
try: | ||
fv.delete() | ||
except Exception: | ||
print(f"Failed to delete feature view {fv.name}.") | ||
|
||
for feature_group in [ | ||
"customers", | ||
"articles", | ||
"transactions", | ||
"interactions", | ||
"candidate_embeddings_fg", | ||
"ranking", | ||
]: | ||
# Get all feature groups | ||
try: | ||
feature_groups = fs.get_feature_groups(name=feature_group) | ||
except: | ||
print(f"Couldn't find feature group: {feature_view}. Skipping...") | ||
feature_groups = [] | ||
|
||
# Delete each feature group | ||
for fg in feature_groups: | ||
print(f"Deleting feature group: {fg.name} (version: {fg.version})") | ||
try: | ||
fg.delete() | ||
except: | ||
print(f"Failed to delete feature group {fv.name}.") |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.