Skip to content

Commit 2cfe045

Browse files
SAASMLOPS-734 bytewax in-cluster config, custom labels, fix worker image wiz/deps
Signed-off-by: James Crabtree <james.crabtree@sailpoint.com>
1 parent 58aff34 commit 2cfe045

File tree

2 files changed

+12
-11
lines changed

2 files changed

+12
-11
lines changed

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: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -76,6 +76,7 @@
7676
"bowler", # Needed for automatic repo upgrades
7777
# FastAPI does not correctly pull starlette dependency on httpx see thread(https://github.com/tiangolo/fastapi/issues/5656).
7878
"httpx>=0.23.3",
79+
"pyOpenSSL"
7980
]
8081

8182
GCP_REQUIRED = [
@@ -93,7 +94,7 @@
9394
"hiredis>=2.0.0,<3",
9495
]
9596

96-
AWS_REQUIRED = ["boto3>=1.17.0,<2", "docker>=5.0.2"]
97+
AWS_REQUIRED = ["boto3>=1.17.0,<2", "docker>=5.0.2", "s3fs"]
9798

9899
BYTEWAX_REQUIRED = ["bytewax==0.15.1", "docker>=5.0.2", "kubernetes<=20.13.0"]
99100

0 commit comments

Comments
 (0)