-
Notifications
You must be signed in to change notification settings - Fork 999
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: Custom Docker image for Bytewax batch materialization (#3099)
Dockerfile and instructions for building a custom Bytewax image. Signed-off-by: Dan Herrera <[email protected]> Signed-off-by: Dan Herrera <[email protected]>
- Loading branch information
Showing
5 changed files
with
73 additions
and
3 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
29 changes: 29 additions & 0 deletions
29
sdk/python/feast/infra/materialization/contrib/bytewax/Dockerfile
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,29 @@ | ||
FROM python:3.9-slim-bullseye AS build | ||
|
||
RUN apt-get update && \ | ||
apt-get install --no-install-suggests --no-install-recommends --yes git | ||
|
||
WORKDIR /bytewax | ||
|
||
# Copy dataflow code | ||
COPY sdk/python/feast/infra/materialization/contrib/bytewax/bytewax_materialization_dataflow.py /bytewax | ||
COPY sdk/python/feast/infra/materialization/contrib/bytewax/dataflow.py /bytewax | ||
|
||
# Copy entrypoint | ||
COPY sdk/python/feast/infra/materialization/contrib/bytewax/entrypoint.sh /bytewax | ||
|
||
# Copy necessary parts of the Feast codebase | ||
COPY sdk/python sdk/python | ||
COPY protos protos | ||
COPY go go | ||
COPY setup.py setup.py | ||
COPY pyproject.toml pyproject.toml | ||
COPY README.md README.md | ||
|
||
# Install Feast for AWS with Bytewax dependencies | ||
# We need this mount thingy because setuptools_scm needs access to the | ||
# git dir to infer the version of feast we're installing. | ||
# https://github.com/pypa/setuptools_scm#usage-from-docker | ||
# I think it also assumes that this dockerfile is being built from the root of the directory. | ||
RUN --mount=source=.git,target=.git,type=bind pip3 install --no-cache-dir -e '.[aws,gcp,bytewax]' | ||
|
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
22 changes: 22 additions & 0 deletions
22
sdk/python/feast/infra/materialization/contrib/bytewax/dataflow.py
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,22 @@ | ||
import yaml | ||
|
||
from feast import FeatureStore, RepoConfig | ||
from feast.infra.materialization.contrib.bytewax.bytewax_materialization_dataflow import ( | ||
BytewaxMaterializationDataflow, | ||
) | ||
|
||
if __name__ == "__main__": | ||
with open("/var/feast/feature_store.yaml") as f: | ||
feast_config = yaml.safe_load(f) | ||
|
||
with open("/var/feast/bytewax_materialization_config.yaml") as b: | ||
bytewax_config = yaml.safe_load(b) | ||
|
||
config = RepoConfig(**feast_config) | ||
store = FeatureStore(config=config) | ||
|
||
job = BytewaxMaterializationDataflow( | ||
config, | ||
store.get_feature_view(bytewax_config["feature_view"]), | ||
bytewax_config["paths"], | ||
) |
4 changes: 4 additions & 0 deletions
4
sdk/python/feast/infra/materialization/contrib/bytewax/entrypoint.sh
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,4 @@ | ||
#!/bin/sh | ||
|
||
cd /bytewax | ||
python dataflow.py |