Repository navigation
feat: add support for flexible temporary volume configuration in Helm chart [backport #1074] - #1075
Conversation
… chart (#1074) This adds a new feature to the Helm chart allowing users to fully customize the temporary volume used for downloads and other transient tasks. Users can now choose between volatile (emptyDir) and persistent (PVC) storage and provide arbitrary configurations for either. Detailed changes: - Added config.cache.tempVolume with support for both 'emptyDir' and 'pvc' types. - Separated volatile and persistent configuration blocks for better clarity. - All components (Deployment, StatefulSet, FSCK CronJob, Migration Job) now use the new flexible volume configuration. - Supports setting medium: Memory for emptyDir and full resource/selector control for PVC. - Updated Helm chart documentation in 'docs/docs' with new parameters and examples. - Added comprehensive unit tests in 'charts/ncps/tests/temp_volume_test.yaml' to cover all configuration scenarios. (cherry picked from commit ca93121)
Summary of ChangesHello, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed! This pull request significantly enhances the Helm chart by introducing a highly flexible temporary volume configuration. Users can now choose between volatile 'emptyDir' volumes and persistent 'PersistentVolumeClaim' (PVC) storage for transient tasks, with extensive customization options for each type. This change provides greater control over resource allocation and storage behavior, improving adaptability to various deployment environments and performance requirements. Highlights
Changelog
Activity
Using Gemini Code AssistThe full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips. Invoking Gemini You can request assistance from Gemini at any point by creating a comment using either
Customization To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a Limitations & Feedback Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for GitHub and other Google products, sign up here. You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension. Footnotes
|
|
Related Documentation 1 document(s) may need updating based on files changed in this PR: kalbasit's Space NAR File Download and StreamingView Suggested Changes@@ -183,6 +183,40 @@
```
ncps serve --cache-temp-path=/var/tmp/ncps
```
+
+#### Helm Chart Volume Configuration
+
+When deploying via Helm chart, the underlying volume for the temporary directory can be configured using `config.cache.tempVolume`. This provides flexible storage options tailored to different deployment environments:
+
+- **Default behavior**: Uses `emptyDir` (volatile storage) that is deleted when the pod restarts
+- **Persistent storage**: For nodes with limited ephemeral storage, configure a persistent volume claim (PVC) using `config.cache.tempVolume.type: pvc`
+- **Memory-backed storage**: For faster performance, use memory-backed `emptyDir` with `config.cache.tempVolume.emptyDir.medium: Memory` (requires sufficient pod memory allocation)
+
+Example configuration:
+
+```yaml
+config:
+ cache:
+ tempVolume:
+ type: pvc # or emptyDir
+ pvc:
+ size: 50Gi
+ storageClassName: fast-ssd
+```
+
+For memory-backed ephemeral storage:
+
+```yaml
+config:
+ cache:
+ tempVolume:
+ type: emptyDir
+ emptyDir:
+ medium: Memory
+ sizeLimit: 4Gi
+```
+
+Full configuration details, including support for existing PVCs, access modes, annotations, and selectors, are available in the Helm Chart documentation.
### Concurrency Considerations
Note: You must be authenticated to accept/decline updates. |
There was a problem hiding this comment.
Code Review
This pull request introduces a valuable feature for flexibly configuring the temporary volume in the Helm chart, allowing for both emptyDir and pvc types. The changes are well-structured, with a new helper template, corresponding value updates, comprehensive tests, and clear documentation. My review includes a couple of suggestions to improve the robustness of the new templates by adding guards against potential nil values in the configuration, which will prevent template rendering errors in edge cases.
| {{- if eq .Values.config.cache.tempVolume.type "pvc" }} | ||
| persistentVolumeClaim: | ||
| claimName: {{ .Values.config.cache.tempVolume.pvc.existingClaim | default (printf "%s-temp" (include "ncps.fullname" .)) }} | ||
| {{- else }} | ||
| emptyDir: | ||
| {{- toYaml .Values.config.cache.tempVolume.emptyDir | nindent 4 }} | ||
| {{- end }} |
There was a problem hiding this comment.
To improve robustness, it's good practice to ensure .Values.config.cache.tempVolume exists before accessing its properties. If a user sets config.cache.tempVolume to null in their values, the template will fail. Guarding access and providing a default for the emptyDir configuration will make the helper more resilient.
{{- if and .Values.config.cache.tempVolume (eq .Values.config.cache.tempVolume.type "pvc") }}
persistentVolumeClaim:
claimName: {{ .Values.config.cache.tempVolume.pvc.existingClaim | default (printf "%s-temp" (include "ncps.fullname" .)) }}
{{- else }}
emptyDir:
{{- toYaml ( .Values.config.cache.tempVolume.emptyDir | default dict ) | nindent 4 }}
{{- end }}
| @@ -0,0 +1,27 @@ | |||
| {{- if and (eq .Values.config.cache.tempVolume.type "pvc") (not .Values.config.cache.tempVolume.pvc.existingClaim) -}} | |||
There was a problem hiding this comment.
To improve robustness, it's good practice to ensure .Values.config.cache.tempVolume exists before accessing its properties. If a user sets config.cache.tempVolume to null in their values, the template will fail. Adding a check for .Values.config.cache.tempVolume will prevent this.
{{- if and .Values.config.cache.tempVolume (eq .Values.config.cache.tempVolume.type "pvc") (not .Values.config.cache.tempVolume.pvc.existingClaim) -}}
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## release-0.9 #1075 +/- ##
===========================================
Coverage 5.04% 5.04%
===========================================
Files 6 6
Lines 436 436
===========================================
Hits 22 22
Misses 410 410
Partials 4 4 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
Bot-based backport to
release-0.9, triggered by a label in #1074.This adds a new feature to the Helm chart allowing users to fully
customize the temporary volume used for downloads and other transient
tasks. Users can now choose between volatile (emptyDir) and persistent
(PVC) storage and provide arbitrary configurations for either.
Detailed changes:
'pvc' types.
clarity.
now use the new flexible volume configuration.
resource/selector control for PVC.
and examples.
'charts/ncps/tests/temp_volume_test.yaml' to cover all configuration
scenarios.