Skip to content

Commit 8985d6e

Browse files
SAASMLOPS-734 bytewax in-cluster config, custom labels, fix worker image deps
Signed-off-by: James Crabtree <james.crabtree@sailpoint.com>
1 parent fa600fe commit 8985d6e

2 files changed

Lines changed: 11 additions & 11 deletions

File tree

sdk/python/feast/infra/materialization/contrib/bytewax/bytewax_materialization_engine.py

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -61,6 +61,9 @@ class BytewaxMaterializationEngineConfig(FeastConfigBaseModel):
6161
include_security_context_capabilities: bool = True
6262
""" (optional) Include security context capabilities in the init and job container spec """
6363

64+
labels: dict = {}
65+
""" (optional) additional labels to append to kubernetes objects """
66+
6467

6568
class BytewaxMaterializationEngine(BatchMaterializationEngine):
6669
def __init__(
@@ -82,7 +85,7 @@ def __init__(
8285
self.online_store = online_store
8386

8487
# TODO: Configure k8s here
85-
k8s_config.load_kube_config()
88+
k8s_config.load_config()
8689

8790
self.k8s_client = client.api_client.ApiClient()
8891
self.v1 = client.CoreV1Api(self.k8s_client)
@@ -196,14 +199,13 @@ def _create_configuration_map(self, job_id, paths, feature_view, namespace):
196199
{"paths": paths, "feature_view": feature_view.name}
197200
)
198201

202+
labels = {"feast-bytewax-materializer": "configmap"}
199203
configmap_manifest = {
200204
"kind": "ConfigMap",
201205
"apiVersion": "v1",
202206
"metadata": {
203207
"name": f"feast-{job_id}",
204-
"labels": {
205-
"feast-bytewax-materializer": "configmap",
206-
},
208+
"labels": {**labels, **self.batch_engine_config.labels},
207209
},
208210
"data": {
209211
"feature_store.yaml": feature_store_configuration,
@@ -260,15 +262,15 @@ def _create_job_definition(self, job_id, namespace, pods, env):
260262
"drop": ["ALL"],
261263
}
262264

265+
job_labels = {"feast-bytewax-materializer": "job"}
266+
pod_labels = {"feast-bytewax-materializer": "pod"}
263267
job_definition = {
264268
"apiVersion": "batch/v1",
265269
"kind": "Job",
266270
"metadata": {
267271
"name": f"dataflow-{job_id}",
268272
"namespace": namespace,
269-
"labels": {
270-
"feast-bytewax-materializer": "job",
271-
},
273+
"labels": {**job_labels, **self.batch_engine_config.labels},
272274
},
273275
"spec": {
274276
"ttlSecondsAfterFinished": 3600,
@@ -278,9 +280,7 @@ def _create_job_definition(self, job_id, namespace, pods, env):
278280
"template": {
279281
"metadata": {
280282
"annotations": self.batch_engine_config.annotations,
281-
"labels": {
282-
"feast-bytewax-materializer": "pod",
283-
},
283+
"labels": {**pod_labels, **self.batch_engine_config.labels},
284284
},
285285
"spec": {
286286
"restartPolicy": "Never",

setup.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -98,7 +98,7 @@
9898
"hiredis>=2.0.0,<3",
9999
]
100100

101-
AWS_REQUIRED = ["boto3>=1.17.0,<2", "docker>=5.0.2"]
101+
AWS_REQUIRED = ["boto3>=1.17.0,<2", "docker>=5.0.2", "s3fs"]
102102

103103
BYTEWAX_REQUIRED = ["bytewax==0.15.1", "docker>=5.0.2", "kubernetes<=20.13.0"]
104104

0 commit comments

Comments
 (0)