Skip to content

Commit

Permalink
Merge branch 'master' into podfv2
Browse files Browse the repository at this point in the history
  • Loading branch information
franciscojavierarceo authored Oct 5, 2024
2 parents bf31d59 + 9646f03 commit 9aff889
Show file tree
Hide file tree
Showing 42 changed files with 99 additions and 59 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ jobs:
needs: [get-version, publish-python-sdk]
strategy:
matrix:
component: [feature-server, feature-server-java, feature-transformation-server, feast-operator]
component: [feature-server, feature-server-java, feature-transformation-server, feast-helm-operator]
env:
MAVEN_CACHE: gs://feast-templocation-kf-feast/.m2.2020-08-19.tar
REGISTRY: feastdev
Expand Down
2 changes: 1 addition & 1 deletion .releaserc.js
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ module.exports = {
"CHANGELOG.md",
"java/pom.xml",
"infra/charts/**/*.*",
"infra/feast-operator/**/*",
"infra/feast-helm-operator/**/*",
"ui/package.json",
"sdk/python/feast/ui/package.json",
"sdk/python/feast/ui/yarn.lock"
Expand Down
12 changes: 6 additions & 6 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -430,15 +430,15 @@ build-feature-server-java-docker:
-t $(REGISTRY)/feature-server-java:$(VERSION) \
-f java/infra/docker/feature-server/Dockerfile --load .

push-feast-operator-docker:
cd infra/feast-operator && \
IMAGE_TAG_BASE=$(REGISTRY)/feast-operator \
push-feast-helm-operator-docker:
cd infra/feast-helm-operator && \
IMAGE_TAG_BASE=$(REGISTRY)/feast-helm-operator \
VERSION=$(VERSION) \
$(MAKE) docker-push

build-feast-operator-docker:
cd infra/feast-operator && \
IMAGE_TAG_BASE=$(REGISTRY)/feast-operator \
build-feast-helm-operator-docker:
cd infra/feast-helm-operator && \
IMAGE_TAG_BASE=$(REGISTRY)/feast-helm-operator \
VERSION=$(VERSION) \
$(MAKE) docker-build

Expand Down
7 changes: 6 additions & 1 deletion docs/getting-started/quickstart.md
Original file line number Diff line number Diff line change
Expand Up @@ -475,7 +475,12 @@ We now serialize the latest values of features since the beginning of time to pr
{% tab title="Bash" %}
```bash
CURRENT_TIME=$(date -u +"%Y-%m-%dT%H:%M:%S")
feast materialize-incremental $CURRENT_TIME
# For mac
LAST_YEAR=$(date -u -v -1y +"%Y-%m-%dT%H:%M:%S")
# For Linux
# LAST_YEAR=$(date -u -d "last year" +"%Y-%m-%dT%H:%M:%S")

feast materialize-incremental $LAST_YEAR $CURRENT_TIME
```
{% endtab %}
{% endtabs %}
Expand Down
2 changes: 1 addition & 1 deletion docs/how-to-guides/running-feast-in-production.md
Original file line number Diff line number Diff line change
Expand Up @@ -225,7 +225,7 @@ helm install feast-release feast-charts/feast-feature-server \

This will deploy a single service. The service must have read access to the registry file on cloud storage and to the online store (e.g. via [podAnnotations](https://kubernetes-on-aws.readthedocs.io/en/latest/user-guide/iam-roles.html)). It will keep a copy of the registry in their memory and periodically refresh it, so expect some delays in update propagation in exchange for better performance.

> Alternatively, deploy the same helm chart with a [Kubernetes Operator](/infra/feast-operator).
> Alternatively, deploy the same helm chart with a [Kubernetes Operator](/infra/feast-helm-operator).
## 5. Using environment variables in your yaml configuration

Expand Down
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,8 @@ BUNDLE_METADATA_OPTS ?= $(BUNDLE_CHANNELS) $(BUNDLE_DEFAULT_CHANNEL)
# This variable is used to construct full image tags for bundle and catalog images.
#
# For example, running 'make bundle-build bundle-push catalog-build catalog-push' will build and push both
# feastdev/feast-operator-bundle:$VERSION and feastdev/feast-operator-catalog:$VERSION.
IMAGE_TAG_BASE ?= feastdev/feast-operator
# feastdev/feast-helm-operator-bundle:$VERSION and feastdev/feast-helm-operator-catalog:$VERSION.
IMAGE_TAG_BASE ?= feastdev/feast-helm-operator

# BUNDLE_IMG defines the image:tag used for the bundle.
# You can use it as an arg. (E.g make bundle-build BUNDLE_IMG=<some-registry>/<project-name-bundle>:<tag>)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ layout:
plugins:
manifests.sdk.operatorframework.io/v2: {}
scorecard.sdk.operatorframework.io/v2: {}
projectName: feast-operator
projectName: feast-helm-operator
resources:
- api:
crdVersion: v1
Expand Down
File renamed without changes.
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
# Adds namespace to all resources.
namespace: feast-operator-system
namespace: feast-helm-operator-system

# Value of this field is prepended to the
# names of all resources, e.g. a deployment named
# "wordpress" becomes "alices-wordpress".
# Note that it should also match with the prefix (text before '-') of the namespace
# field above.
namePrefix: feast-operator-
namePrefix: feast-helm-operator-

# Labels to add to all resources and selectors.
#labels:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,5 +4,5 @@ apiVersion: kustomize.config.k8s.io/v1beta1
kind: Kustomization
images:
- name: controller
newName: feastdev/feast-operator
newName: feastdev/feast-helm-operator
newTag: 0.40.0
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@ metadata:
app.kubernetes.io/name: namespace
app.kubernetes.io/instance: system
app.kubernetes.io/component: manager
app.kubernetes.io/created-by: feast-operator
app.kubernetes.io/part-of: feast-operator
app.kubernetes.io/created-by: feast-helm-operator
app.kubernetes.io/part-of: feast-helm-operator
app.kubernetes.io/managed-by: kustomize
name: system
---
Expand All @@ -21,8 +21,8 @@ metadata:
app.kubernetes.io/name: deployment
app.kubernetes.io/instance: controller-manager
app.kubernetes.io/component: manager
app.kubernetes.io/created-by: feast-operator
app.kubernetes.io/part-of: feast-operator
app.kubernetes.io/created-by: feast-helm-operator
app.kubernetes.io/part-of: feast-helm-operator
app.kubernetes.io/managed-by: kustomize
spec:
selector:
Expand Down Expand Up @@ -68,7 +68,7 @@ spec:
containers:
- args:
- --leader-elect
- --leader-election-id=feast-operator
- --leader-election-id=feast-helm-operator
image: controller:latest
name: manager
securityContext:
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# These resources constitute the fully configured set of manifests
# used to generate the 'manifests/' directory in a bundle.
resources:
- bases/feast-operator.clusterserviceversion.yaml
- bases/feast-helm-operator.clusterserviceversion.yaml
- ../default
- ../samples
- ../scorecard
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@ metadata:
app.kubernetes.io/name: clusterrole
app.kubernetes.io/instance: feastfeatureserver-editor-role
app.kubernetes.io/component: rbac
app.kubernetes.io/created-by: feast-operator
app.kubernetes.io/part-of: feast-operator
app.kubernetes.io/created-by: feast-helm-operator
app.kubernetes.io/part-of: feast-helm-operator
app.kubernetes.io/managed-by: kustomize
name: feastfeatureserver-editor-role
rules:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@ metadata:
app.kubernetes.io/name: clusterrole
app.kubernetes.io/instance: feastfeatureserver-editor-role
app.kubernetes.io/component: rbac
app.kubernetes.io/created-by: feast-operator
app.kubernetes.io/part-of: feast-operator
app.kubernetes.io/created-by: feast-helm-operator
app.kubernetes.io/part-of: feast-helm-operator
app.kubernetes.io/managed-by: kustomize
name: feastfeatureserver-editor-rolebinding
roleRef:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@ metadata:
app.kubernetes.io/name: role
app.kubernetes.io/instance: leader-election-role
app.kubernetes.io/component: rbac
app.kubernetes.io/created-by: feast-operator
app.kubernetes.io/part-of: feast-operator
app.kubernetes.io/created-by: feast-helm-operator
app.kubernetes.io/part-of: feast-helm-operator
app.kubernetes.io/managed-by: kustomize
name: leader-election-role
rules:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@ metadata:
app.kubernetes.io/name: rolebinding
app.kubernetes.io/instance: leader-election-rolebinding
app.kubernetes.io/component: rbac
app.kubernetes.io/created-by: feast-operator
app.kubernetes.io/part-of: feast-operator
app.kubernetes.io/created-by: feast-helm-operator
app.kubernetes.io/part-of: feast-helm-operator
app.kubernetes.io/managed-by: kustomize
name: leader-election-rolebinding
roleRef:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@ metadata:
app.kubernetes.io/name: clusterrole
app.kubernetes.io/instance: manager-role
app.kubernetes.io/component: rbac
app.kubernetes.io/created-by: feast-operator
app.kubernetes.io/part-of: feast-operator
app.kubernetes.io/created-by: feast-helm-operator
app.kubernetes.io/part-of: feast-helm-operator
app.kubernetes.io/managed-by: kustomize
name: manager-role
rules:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@ metadata:
app.kubernetes.io/name: clusterrolebinding
app.kubernetes.io/instance: manager-rolebinding
app.kubernetes.io/component: rbac
app.kubernetes.io/created-by: feast-operator
app.kubernetes.io/part-of: feast-operator
app.kubernetes.io/created-by: feast-helm-operator
app.kubernetes.io/part-of: feast-helm-operator
app.kubernetes.io/managed-by: kustomize
name: manager-rolebinding
roleRef:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@ metadata:
app.kubernetes.io/name: serviceaccount
app.kubernetes.io/instance: controller-manager-sa
app.kubernetes.io/component: rbac
app.kubernetes.io/created-by: feast-operator
app.kubernetes.io/part-of: feast-operator
app.kubernetes.io/created-by: feast-helm-operator
app.kubernetes.io/part-of: feast-helm-operator
app.kubernetes.io/managed-by: kustomize
name: controller-manager
namespace: system
File renamed without changes.
4 changes: 2 additions & 2 deletions infra/scripts/release/files_to_bump.txt
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ infra/charts/feast/README.md 11 68 69
infra/charts/feast-feature-server/Chart.yaml 5
infra/charts/feast-feature-server/README.md 3
infra/charts/feast-feature-server/values.yaml 12
infra/feast-operator/Makefile 6
infra/feast-operator/config/manager/kustomization.yaml 8
infra/feast-helm-operator/Makefile 6
infra/feast-helm-operator/config/manager/kustomization.yaml 8
java/pom.xml 38
ui/package.json 3
4 changes: 4 additions & 0 deletions sdk/python/feast/feature_view.py
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,10 @@
name=DUMMY_ENTITY_NAME,
join_keys=[DUMMY_ENTITY_ID],
)
DUMMY_ENTITY_FIELD = Field(
name=DUMMY_ENTITY_ID,
dtype=from_value_type(ValueType.STRING),
)


@typechecked
Expand Down
4 changes: 2 additions & 2 deletions sdk/python/feast/infra/materialization/kubernetes/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
FROM python:3.11-slim-bullseye AS build
FROM debian:11-slim AS build

RUN apt-get update && \
apt-get install --no-install-suggests --no-install-recommends --yes git
apt-get install --no-install-suggests --no-install-recommends --yes git python3 python3-pip

WORKDIR /app

Expand Down
5 changes: 4 additions & 1 deletion sdk/python/feast/infra/materialization/snowflake_engine.py
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,10 @@ class SnowflakeMaterializationEngineConfig(FeastConfigBaseModel):
""" Type selector"""

config_path: Optional[str] = os.path.expanduser("~/.snowsql/config")
""" Snowflake config path -- absolute path required (Cant use ~)"""
""" Snowflake snowsql config path -- absolute path required (Cant use ~)"""

connection_name: Optional[str] = None
""" Snowflake connector connection name -- typically defined in ~/.snowflake/connections.toml """

account: Optional[str] = None
""" Snowflake deployment identifier -- drop .snowflakecomputing.com"""
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,6 @@
RetrievalMetadata,
)
from feast.infra.registry.base_registry import BaseRegistry
from feast.infra.utils import aws_utils
from feast.repo_config import FeastConfigBaseModel, RepoConfig
from feast.saved_dataset import SavedDatasetStorage
from feast.type_map import spark_schema_to_np_dtypes
Expand Down Expand Up @@ -399,6 +398,8 @@ def to_remote_storage(self) -> List[str]:

return _list_files_in_folder(output_uri)
elif self._config.offline_store.staging_location.startswith("s3://"):
from feast.infra.utils import aws_utils

spark_compatible_s3_staging_location = (
self._config.offline_store.staging_location.replace(
"s3://", "s3a://"
Expand Down
5 changes: 4 additions & 1 deletion sdk/python/feast/infra/offline_stores/snowflake.py
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,10 @@ class SnowflakeOfflineStoreConfig(FeastConfigBaseModel):
""" Offline store type selector """

config_path: Optional[str] = os.path.expanduser("~/.snowsql/config")
""" Snowflake config path -- absolute path required (Cant use ~)"""
""" Snowflake snowsql config path -- absolute path required (Cant use ~)"""

connection_name: Optional[str] = None
""" Snowflake connector connection name -- typically defined in ~/.snowflake/connections.toml """

account: Optional[str] = None
""" Snowflake deployment identifier -- drop .snowflakecomputing.com """
Expand Down
5 changes: 4 additions & 1 deletion sdk/python/feast/infra/online_stores/snowflake.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,10 @@ class SnowflakeOnlineStoreConfig(FeastConfigBaseModel):
""" Online store type selector """

config_path: Optional[str] = os.path.expanduser("~/.snowsql/config")
""" Snowflake config path -- absolute path required (Can't use ~)"""
""" Snowflake snowsql config path -- absolute path required (Cant use ~)"""

connection_name: Optional[str] = None
""" Snowflake connector connection name -- typically defined in ~/.snowflake/connections.toml """

account: Optional[str] = None
""" Snowflake deployment identifier -- drop .snowflakecomputing.com """
Expand Down
5 changes: 4 additions & 1 deletion sdk/python/feast/infra/registry/snowflake.py
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,10 @@ class SnowflakeRegistryConfig(RegistryConfig):
""" Registry type selector """

config_path: Optional[str] = os.path.expanduser("~/.snowsql/config")
""" Snowflake config path -- absolute path required (Cant use ~) """
""" Snowflake snowsql config path -- absolute path required (Cant use ~)"""

connection_name: Optional[str] = None
""" Snowflake connector connection name -- typically defined in ~/.snowflake/connections.toml """

account: Optional[str] = None
""" Snowflake deployment identifier -- drop .snowflakecomputing.com """
Expand Down
31 changes: 28 additions & 3 deletions sdk/python/tests/unit/test_on_demand_python_transformation.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
RequestSource,
)
from feast.driver_test_data import create_driver_hourly_stats_df
from feast.feature_view import DUMMY_ENTITY_FIELD
from feast.field import Field
from feast.infra.online_stores.sqlite import SqliteOnlineStoreConfig
from feast.on_demand_feature_view import on_demand_feature_view
Expand All @@ -29,6 +30,8 @@
String,
UnixTimestamp,
_utc_now,
ValueType,
from_value_type,
)


Expand Down Expand Up @@ -60,7 +63,9 @@ def setUp(self):
path=driver_stats_path, allow_truncated_timestamps=True
)

driver = Entity(name="driver", join_keys=["driver_id"])
driver = Entity(
name="driver", join_keys=["driver_id"], value_type=ValueType.INT64
)

driver_stats_source = FileSource(
name="driver_hourly_stats_source",
Expand All @@ -82,6 +87,19 @@ def setUp(self):
source=driver_stats_source,
)

driver_stats_entity_less_fv = FeatureView(
name="driver_hourly_stats_no_entity",
entities=[],
ttl=timedelta(days=0),
schema=[
Field(name="conv_rate", dtype=Float32),
Field(name="acc_rate", dtype=Float32),
Field(name="avg_daily_trips", dtype=Int64),
],
online=True,
source=driver_stats_source,
)

@on_demand_feature_view(
sources=[driver_stats_fv],
schema=[Field(name="conv_rate_plus_acc_pandas", dtype=Float64)],
Expand Down Expand Up @@ -160,6 +178,7 @@ def python_singleton_view(inputs: dict[str, Any]) -> dict[str, Any]:
pandas_view,
python_view,
python_singleton_view,
driver_stats_entity_less_fv,
]
)

Expand All @@ -171,13 +190,19 @@ def python_singleton_view(inputs: dict[str, Any]) -> dict[str, Any]:
pandas_view,
python_view,
python_demo_view,
driver_stats_entity_less_fv,
]
)
self.store.write_to_online_store(
feature_view_name="driver_hourly_stats", df=driver_df
)
assert len(self.store.list_all_feature_views()) == 4
assert len(self.store.list_feature_views()) == 1
assert driver_stats_fv.entity_columns == [
Field(name=driver.join_key, dtype=from_value_type(driver.value_type))
]
assert driver_stats_entity_less_fv.entity_columns == [DUMMY_ENTITY_FIELD]

assert len(self.store.list_all_feature_views()) == 5
assert len(self.store.list_feature_views()) == 2
assert len(self.store.list_on_demand_feature_views()) == 3
assert len(self.store.list_stream_feature_views()) == 0

Expand Down
Loading

0 comments on commit 9aff889

Please sign in to comment.