You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: pkg/resourceinterpreter/default/thirdparty/resourcecustomizations/kubeflow.org/v1/PyTorchJob/customizations.yaml
+14-8Lines changed: 14 additions & 8 deletions
Original file line number
Diff line number
Diff line change
@@ -43,8 +43,12 @@ spec:
43
43
local components = {}
44
44
45
45
-- Master Component
46
-
local master_replicas = to_num(get(observedObj, {"spec", "pytorchReplicaSpecs", "Master", "replicas"}), 1)
47
-
local master_template = get(observedObj, {"spec", "pytorchReplicaSpecs", "Master", "template"})
46
+
local master_spec = get(observedObj, {"spec", "pytorchReplicaSpecs", "Master"})
47
+
if master_spec == nil then
48
+
return components
49
+
end
50
+
local master_replicas = to_num(master_spec.replicas, 1)
51
+
local master_template = master_spec.template
48
52
49
53
local master_requires = {}
50
54
if master_template ~= nil then
@@ -59,8 +63,12 @@ spec:
59
63
table.insert(components, masterComponent)
60
64
61
65
-- Worker Component
62
-
local worker_replicas = to_num(get(observedObj, {"spec", "pytorchReplicaSpecs", "Worker", "replicas"}), 1)
63
-
local worker_template = get(observedObj, {"spec", "pytorchReplicaSpecs", "Worker", "template"})
66
+
local worker_spec = get(observedObj, {"spec", "pytorchReplicaSpecs", "Worker"})
67
+
if worker_spec == nil then
68
+
return components
69
+
end
70
+
local worker_replicas = to_num(worker_spec.replicas, 1)
0 commit comments