@@ -138,13 +138,16 @@ def build_ray_cluster(cluster: "codeflare_sdk.ray.cluster.Cluster"):
138138 "num-gpus" : str (head_gpu_count ),
139139 "resources" : head_resources ,
140140 },
141- "template" : {
142- "spec" : get_pod_spec (
141+ "template" : V1PodTemplateSpec (
142+ metadata = V1ObjectMeta (cluster .config .annotations )
143+ if cluster .config .annotations
144+ else None ,
145+ spec = get_pod_spec (
143146 cluster ,
144147 [get_head_container_spec (cluster )],
145148 cluster .config .head_tolerations ,
146- )
147- } ,
149+ ),
150+ ) ,
148151 },
149152 "workerGroupSpecs" : [
150153 {
@@ -158,11 +161,14 @@ def build_ray_cluster(cluster: "codeflare_sdk.ray.cluster.Cluster"):
158161 "resources" : worker_resources ,
159162 },
160163 "template" : V1PodTemplateSpec (
164+ metadata = V1ObjectMeta (cluster .config .annotations )
165+ if cluster .config .annotations
166+ else None ,
161167 spec = get_pod_spec (
162168 cluster ,
163169 [get_worker_container_spec (cluster )],
164170 cluster .config .worker_tolerations ,
165- )
171+ ),
166172 ),
167173 }
168174 ],
@@ -215,7 +221,7 @@ def build_ray_cluster(cluster: "codeflare_sdk.ray.cluster.Cluster"):
215221# Metadata related functions
216222def get_metadata (cluster : "codeflare_sdk.ray.cluster.Cluster" ):
217223 """
218- The get_metadata() function builds and returns a V1ObjectMeta Object using cluster configurtation parameters
224+ The get_metadata() function builds and returns a V1ObjectMeta Object using cluster configuration parameters
219225 """
220226 object_meta = V1ObjectMeta (
221227 name = cluster .config .name ,
@@ -227,6 +233,7 @@ def get_metadata(cluster: "codeflare_sdk.ray.cluster.Cluster"):
227233 annotations = with_nb_annotations (cluster .config .annotations )
228234 if annotations != {}:
229235 object_meta .annotations = annotations # As annotations are not a guarantee they are appended to the metadata after creation.
236+
230237 return object_meta
231238
232239
0 commit comments