@@ -139,13 +139,16 @@ 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 )
144
+ if cluster .config .annotations
145
+ else None ,
146
+ spec = get_pod_spec (
144
147
cluster ,
145
148
[get_head_container_spec (cluster )],
146
149
cluster .config .head_tolerations ,
147
- )
148
- } ,
150
+ ),
151
+ ) ,
149
152
},
150
153
"workerGroupSpecs" : [
151
154
{
@@ -159,11 +162,14 @@ def build_ray_cluster(cluster: "codeflare_sdk.ray.cluster.Cluster"):
159
162
"resources" : worker_resources ,
160
163
},
161
164
"template" : V1PodTemplateSpec (
165
+ metadata = V1ObjectMeta (cluster .config .annotations )
166
+ if cluster .config .annotations
167
+ else None ,
162
168
spec = get_pod_spec (
163
169
cluster ,
164
170
[get_worker_container_spec (cluster )],
165
171
cluster .config .worker_tolerations ,
166
- )
172
+ ),
167
173
),
168
174
}
169
175
],
@@ -191,7 +197,7 @@ def build_ray_cluster(cluster: "codeflare_sdk.ray.cluster.Cluster"):
191
197
# Metadata related functions
192
198
def get_metadata (cluster : "codeflare_sdk.ray.cluster.Cluster" ):
193
199
"""
194
- The get_metadata() function builds and returns a V1ObjectMeta Object using cluster configurtation parameters
200
+ The get_metadata() function builds and returns a V1ObjectMeta Object using cluster configuration parameters
195
201
"""
196
202
object_meta = V1ObjectMeta (
197
203
name = cluster .config .name ,
@@ -203,6 +209,7 @@ def get_metadata(cluster: "codeflare_sdk.ray.cluster.Cluster"):
203
209
annotations = with_nb_annotations (cluster .config .annotations )
204
210
if annotations != {}:
205
211
object_meta .annotations = annotations # As annotations are not a guarantee they are appended to the metadata after creation.
212
+
206
213
return object_meta
207
214
208
215
0 commit comments