Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions helm/templates/deployment-vllm-multi.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -371,7 +371,11 @@ spec:
- name: ucx-port
containerPort: 9999
{{- include "chart.probes" . | indent 10 }}
{{- if $modelSpec.resources }}
resources: {{ toYaml $modelSpec.resources | nindent 12 }}
{{- else }}
resources: {{- include "chart.resources" $modelSpec | nindent 12 }}
{{- end }}
Comment on lines +374 to +378
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

To make the template more concise and avoid repeating the resources: key, you can use the ternary function to conditionally define the resource content in a variable. This improves readability and maintainability by reducing code duplication.

          {{- $resourceContent := ternary (toYaml $modelSpec.resources) (include "chart.resources" $modelSpec) $modelSpec.resources }}
          resources: {{- $resourceContent | nindent 12 }}

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In my opinion the proposed change by gemini does not increase readability. However, I will happily apply it if that is the preferred way to go. @YuhanLiu11 or @zerofishnoodles what do you think?

{{- if or (hasKey $modelSpec "pvcStorage") (and $modelSpec.vllmConfig (hasKey $modelSpec.vllmConfig "tensorParallelSize")) (hasKey $modelSpec "chatTemplate") (hasKey $modelSpec "extraVolumeMounts") }}
volumeMounts:
{{- end }}
Expand Down