@@ -79,6 +79,7 @@ async def run(self):
7979
8080 try :
8181 await kubernetes_asyncio .config .load_kube_config (config_file = karmada_api_kubeconfig )
82+ logger .info (f" Karmada api config Loaded with external kubeconfig: { karmada_api_kubeconfig } " )
8283 except kubernetes_asyncio .config .ConfigException :
8384 logger .error (f"Error loading karmada api config with external kubeconfig: { karmada_api_kubeconfig } " )
8485 return
@@ -94,19 +95,19 @@ async def run(self):
9495
9596 q_info = self .r .pop (self .r .ml_q )
9697 q_info = q_info .replace ("'" , '"' )
97- print (q_info )
98+ logger . debug (q_info )
9899 data_queue = json .loads (q_info )
99- if 'MLSysOpsApplication ' not in data_queue :
100+ if 'MLSysOpsApp ' not in data_queue :
100101 # probably it is removal
101- print (f"fffff { data_queue .keys ()} " )
102+ logger . debug (f"DataKeys { data_queue .keys ()} " )
102103 for key in data_queue .keys ():
103104 model_id = key
104105 else :
105- model_id = data_queue ["MLSysOpsApplication " ]["mlsysops-id " ]
106- data_queue ['MLSysOpsApplication ' ]['name' ] = data_queue ['MLSysOpsApplication ' ]['name' ] + "-" + model_id
106+ model_id = data_queue ["MLSysOpsApp " ]["components" ][ 0 ][ "metadata" ][ "uid " ]
107+ data_queue ['MLSysOpsApp ' ]['name' ] = data_queue ['MLSysOpsApp ' ]['name' ] + "-" + model_id
107108 try :
108- comp_name = data_queue ["MLSysOpsApplication " ]["components" ][0 ]["Component" ]["name" ]
109- cluster_id = data_queue ["MLSysOpsApplication " ]["clusterPlacement" ]["clusterID" ][0 ]
109+ comp_name = data_queue ["MLSysOpsApp " ]["components" ][0 ]["Component" ]["name" ]
110+ cluster_id = data_queue ["MLSysOpsApp " ]["clusterPlacement" ]["clusterID" ][0 ]
110111
111112 self .r .update_dict_value ("ml_location" , model_id , cluster_id )
112113 except KeyError :
@@ -116,7 +117,7 @@ async def run(self):
116117 group = "mlsysops.eu"
117118 version = "v1"
118119 plural = "mlsysopsapps"
119- namespace = "default "
120+ namespace = "mlsysops "
120121 name = model_id
121122
122123 if self .r .get_dict_value ("endpoint_hash" , model_id ) == "To_be_removed" :
@@ -133,7 +134,7 @@ async def run(self):
133134 logger .debug (f"Custom Resource '{ name } ' deleted successfully." )
134135 await self .message_queue .put ({
135136 "event" : "application_removed" ,
136- "payload" : data_dict
137+ "payload" : data_queue
137138 }
138139 )
139140 self .r .update_dict_value ("endpoint_hash" , model_id , "Removed" )
@@ -161,10 +162,10 @@ async def run(self):
161162 await self .message_queue .put (
162163 {
163164 "event" : "application_submitted" ,
164- "payload" : file_content
165+ "payload" : data_queue
165166 }
166167 )
167-
168+
168169 logger .debug (f"Creating or updating Custom Resource: { name } " )
169170 try :
170171 current_resource = await custom_api .get_namespaced_custom_object (
0 commit comments