2323from feast .infra .registry .base_registry import BaseRegistry
2424from feast .repo_config import FeastConfigBaseModel
2525from feast .stream_feature_view import StreamFeatureView
26- from feast .utils import _get_column_names
26+ from feast .utils import _get_column_names , get_default_yaml_file_path
2727
2828from .bytewax_materialization_job import BytewaxMaterializationJob
2929
@@ -157,9 +157,6 @@ def _create_kubernetes_job(self, job_id, paths, feature_view):
157157 # Create a k8s configmap with information needed by bytewax
158158 self ._create_configuration_map (job_id , paths , feature_view , self .namespace )
159159
160- # Create the k8s service definition, used for bytewax communication
161- self ._create_service_definition (job_id , self .namespace )
162-
163160 # Create the k8s job definition
164161 self ._create_job_definition (
165162 job_id ,
@@ -175,14 +172,10 @@ def _create_kubernetes_job(self, job_id, paths, feature_view):
175172 def _create_configuration_map (self , job_id , paths , feature_view , namespace ):
176173 """Create a Kubernetes configmap for this job"""
177174
178- feature_store_configuration = yaml .dump (
179- yaml .safe_load (
180- self .repo_config .json (
181- exclude = {"repo_path" },
182- exclude_unset = True ,
183- )
184- )
185- )
175+ repo_path = self .repo_config .repo_path
176+ assert repo_path
177+ feature_store_path = get_default_yaml_file_path (repo_path )
178+ feature_store_configuration = feature_store_path .read_text ()
186179
187180 materialization_config = yaml .dump (
188181 {"paths" : paths , "feature_view" : feature_view .name }
@@ -204,41 +197,6 @@ def _create_configuration_map(self, job_id, paths, feature_view, namespace):
204197 body = configmap_manifest ,
205198 )
206199
207- def _create_service_definition (self , job_id , namespace ):
208- """Creates a kubernetes service definition.
209-
210- This service definition is created to allow bytewax workers
211- to communicate with each other.
212- """
213- service_definition = {
214- "apiVersion" : "v1" ,
215- "kind" : "Service" ,
216- "metadata" : {
217- "name" : f"dataflow-{ job_id } " ,
218- "namespace" : namespace ,
219- },
220- "spec" : {
221- "clusterIP" : "None" ,
222- "clusterIPs" : ["None" ],
223- "internalTrafficPolicy" : "Cluster" ,
224- "ipFamilies" : ["IPv4" ],
225- "ipFamilyPolicy" : "SingleStack" ,
226- "ports" : [
227- {
228- "name" : "worker" ,
229- "port" : 9999 ,
230- "protocol" : "TCP" ,
231- "targetPort" : 9999 ,
232- }
233- ],
234- "selector" : {"job-name" : f"dataflow-{ job_id } " },
235- "sessionAffinity" : "None" ,
236- "type" : "ClusterIP" ,
237- },
238- }
239-
240- utils .create_from_dict (self .k8s_client , service_definition )
241-
242200 def _create_job_definition (self , job_id , namespace , pods , env ):
243201 """Create a kubernetes job definition."""
244202 job_env = [
@@ -269,10 +227,6 @@ def _create_job_definition(self, job_id, namespace, pods, env):
269227 "name" : "BYTEWAX_KEEP_CONTAINER_ALIVE" ,
270228 "value" : "false" ,
271229 },
272- {
273- "name" : "BYTEWAX_HOSTFILE_PATH" ,
274- "value" : "/etc/bytewax/hostfile.txt" ,
275- },
276230 {
277231 "name" : "BYTEWAX_STATEFULSET_NAME" ,
278232 "value" : f"dataflow-{ job_id } " ,
@@ -299,11 +253,6 @@ def _create_job_definition(self, job_id, namespace, pods, env):
299253 "subdomain" : f"dataflow-{ job_id } " ,
300254 "initContainers" : [
301255 {
302- "command" : [
303- "sh" ,
304- "-c" ,
305- f'set -ex\n # Generate hostfile.txt.\n echo "dataflow-{ job_id } -0.dataflow-{ job_id } .{ namespace } .svc.cluster.local:9999" > /etc/bytewax/hostfile.txt\n replicas=$(($BYTEWAX_REPLICAS-1))\n x=1\n while [ $x -le $replicas ]\n do\n echo "dataflow-{ job_id } -$x.dataflow-{ job_id } .{ namespace } .svc.cluster.local:9999" >> /etc/bytewax/hostfile.txt\n x=$(( $x + 1 ))\n done' ,
306- ],
307256 "env" : [
308257 {
309258 "name" : "BYTEWAX_REPLICAS" ,
0 commit comments