Skip to content

Commit

Permalink
fix(controller): incorrect cpu/mem resources calculation (#1477)
Browse files Browse the repository at this point in the history
Signed-off-by: Derek Wang <[email protected]>
(cherry picked from commit 0c53e8a)
  • Loading branch information
whynowy committed Jan 23, 2024
1 parent 7ffb521 commit 266cb22
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 9 deletions.
4 changes: 2 additions & 2 deletions pkg/apis/numaflow/v1alpha1/pipeline_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -252,7 +252,7 @@ func (p Pipeline) GetDaemonDeploymentObj(req GetDaemonDeploymentReq) (*appv1.Dep
Name: CtrMain,
Image: req.Image,
ImagePullPolicy: req.PullPolicy,
Resources: standardResources,
Resources: *standardResources.DeepCopy(),
Env: envVars,
Args: []string{"daemon-server", "--isbsvc-type=" + string(req.ISBSvcType)},
}
Expand Down Expand Up @@ -335,7 +335,7 @@ func (p Pipeline) getDaemonPodInitContainer(req GetDaemonDeploymentReq) corev1.C
Env: envVars,
Image: req.Image,
ImagePullPolicy: req.PullPolicy,
Resources: standardResources,
Resources: *standardResources.DeepCopy(),
Args: []string{"isbsvc-validate", "--isbsvc-type=" + string(req.ISBSvcType)},
}
c.Args = append(c.Args, "--buffers="+strings.Join(p.GetAllBuffers(), ","))
Expand Down
2 changes: 1 addition & 1 deletion pkg/apis/numaflow/v1alpha1/redis_buffer_service.go
Original file line number Diff line number Diff line change
Expand Up @@ -410,7 +410,7 @@ redis_exporter`},
spec.Template.Spec.InitContainers = []corev1.Container{
{
Name: "volume-permissions",
Resources: standardResources,
Resources: *standardResources.DeepCopy(),
SecurityContext: &corev1.SecurityContext{RunAsUser: &runAsUser0},
VolumeMounts: []corev1.VolumeMount{{Name: req.PvcNameIfNeeded, MountPath: "/data"}},
Image: req.InitContainerImage,
Expand Down
4 changes: 2 additions & 2 deletions pkg/apis/numaflow/v1alpha1/side_inputs.go
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,7 @@ func (si SideInput) getInitContainer(pipeline Pipeline, req GetSideInputDeployme
Env: req.Env,
Image: req.Image,
ImagePullPolicy: req.PullPolicy,
Resources: standardResources,
Resources: *standardResources.DeepCopy(),
Args: []string{"isbsvc-validate", "--isbsvc-type=" + string(req.ISBSvcType)},
}
c.Args = append(c.Args, "--side-inputs-store="+pipeline.GetSideInputsStoreName())
Expand Down Expand Up @@ -144,7 +144,7 @@ func (si SideInput) getNumaContainer(pipeline Pipeline, req GetSideInputDeployme
Env: envVars,
Image: req.Image,
ImagePullPolicy: req.PullPolicy,
Resources: standardResources,
Resources: *standardResources.DeepCopy(),
Args: []string{"side-inputs-manager", "--isbsvc-type=" + string(req.ISBSvcType), "--side-inputs-store=" + pipeline.GetSideInputsStoreName()},
}
if x := pipeline.Spec.Templates; x != nil && x.SideInputsManagerTemplate != nil && x.SideInputsManagerTemplate.ContainerTemplate != nil {
Expand Down
8 changes: 4 additions & 4 deletions pkg/apis/numaflow/v1alpha1/vertex_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -224,7 +224,7 @@ func (v Vertex) GetPodSpec(req GetVertexPodSpecReq) (*corev1.PodSpec, error) {
env: envVars,
image: req.Image,
imagePullPolicy: req.PullPolicy,
resources: standardResources,
resources: *standardResources.DeepCopy(),
volumeMounts: volumeMounts,
})
if err != nil {
Expand Down Expand Up @@ -276,7 +276,7 @@ func (v Vertex) GetPodSpec(req GetVertexPodSpecReq) (*corev1.PodSpec, error) {
Env: req.Env,
Image: req.Image,
ImagePullPolicy: req.PullPolicy,
Resources: standardResources,
Resources: *standardResources.DeepCopy(),
Args: []string{"side-inputs-synchronizer", "--isbsvc-type=" + string(req.ISBSvcType), "--side-inputs-store=" + req.SideInputsStoreName, "--side-inputs=" + strings.Join(v.Spec.SideInputs, ",")},
}
sideInputsWatcher.Env = append(sideInputsWatcher.Env, v.commonEnvs()...)
Expand Down Expand Up @@ -321,7 +321,7 @@ func (v Vertex) getInitContainers(req GetVertexPodSpecReq) []corev1.Container {
Env: envVars,
Image: req.Image,
ImagePullPolicy: req.PullPolicy,
Resources: standardResources,
Resources: *standardResources.DeepCopy(),
Args: []string{"isbsvc-validate", "--isbsvc-type=" + string(req.ISBSvcType)},
},
}
Expand All @@ -331,7 +331,7 @@ func (v Vertex) getInitContainers(req GetVertexPodSpecReq) []corev1.Container {
Env: envVars,
Image: req.Image,
ImagePullPolicy: req.PullPolicy,
Resources: standardResources,
Resources: *standardResources.DeepCopy(),
Args: []string{"side-inputs-init", "--isbsvc-type=" + string(req.ISBSvcType), "--side-inputs-store=" + req.SideInputsStoreName, "--side-inputs=" + strings.Join(v.Spec.SideInputs, ",")},
})
}
Expand Down

0 comments on commit 266cb22

Please sign in to comment.