@@ -139,13 +139,14 @@ def build_ray_cluster(cluster: "codeflare_sdk.ray.cluster.Cluster"):
139
139
"num-gpus" : str (head_gpu_count ),
140
140
"resources" : head_resources ,
141
141
},
142
- "template" : {
143
- "spec" : get_pod_spec (
142
+ "template" : V1PodTemplateSpec (
143
+ metadata = V1ObjectMeta (cluster .config .annotations ) if cluster .config .annotations else None ,
144
+ spec = get_pod_spec (
144
145
cluster ,
145
146
[get_head_container_spec (cluster )],
146
147
cluster .config .head_tolerations ,
147
- )
148
- } ,
148
+ ),
149
+ ) ,
149
150
},
150
151
"workerGroupSpecs" : [
151
152
{
@@ -159,11 +160,12 @@ def build_ray_cluster(cluster: "codeflare_sdk.ray.cluster.Cluster"):
159
160
"resources" : worker_resources ,
160
161
},
161
162
"template" : V1PodTemplateSpec (
163
+ metadata = V1ObjectMeta (cluster .config .annotations ) if cluster .config .annotations else None ,
162
164
spec = get_pod_spec (
163
165
cluster ,
164
166
[get_worker_container_spec (cluster )],
165
167
cluster .config .worker_tolerations ,
166
- )
168
+ ),
167
169
),
168
170
}
169
171
],
@@ -191,7 +193,7 @@ def build_ray_cluster(cluster: "codeflare_sdk.ray.cluster.Cluster"):
191
193
# Metadata related functions
192
194
def get_metadata (cluster : "codeflare_sdk.ray.cluster.Cluster" ):
193
195
"""
194
- The get_metadata() function builds and returns a V1ObjectMeta Object using cluster configurtation parameters
196
+ The get_metadata() function builds and returns a V1ObjectMeta Object using cluster configuration parameters
195
197
"""
196
198
object_meta = V1ObjectMeta (
197
199
name = cluster .config .name ,
@@ -203,7 +205,8 @@ def get_metadata(cluster: "codeflare_sdk.ray.cluster.Cluster"):
203
205
annotations = with_nb_annotations (cluster .config .annotations )
204
206
if annotations != {}:
205
207
object_meta .annotations = annotations # As annotations are not a guarantee they are appended to the metadata after creation.
206
- return object_meta
208
+
209
+ return object_meta
207
210
208
211
209
212
def get_labels (cluster : "codeflare_sdk.ray.cluster.Cluster" ):
0 commit comments