Skip to content

feat: add support for flexible temporary volume configuration in Helm chart [backport #1074] - #1075

Merged
kalbasit merged 1 commit into
release-0.9from
backport-1074-to-release-0.9
Mar 12, 2026
Merged

kalbasit merged 1 commit into
release-0.9from
backport-1074-to-release-0.9

Conversation

@kalbasit

Copy link
Copy Markdown
Owner

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:

  • 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.

… 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)
@kalbasit
kalbasit enabled auto-merge (squash) March 12, 2026 00:17
@dosubot dosubot Bot added size:L This PR changes 100-499 lines, ignoring generated files. helm labels Mar 12, 2026
@gemini-code-assist

Copy link
Copy Markdown
Contributor

Summary of Changes

Hello, 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

  • Flexible Temporary Volume Configuration: Introduced a new feature to the Helm chart allowing users to fully customize the temporary volume used for downloads and other transient tasks.
  • Storage Type Options: Enabled selection between volatile 'emptyDir' and persistent 'PersistentVolumeClaim' (PVC) storage for temporary volumes.
  • Customizable Volume Parameters: Allowed arbitrary configuration for both 'emptyDir' (e.g., 'medium: Memory', 'sizeLimit') and 'pvc' (e.g., 'size', 'storageClassName', 'annotations', 'selector', 'accessModes').
  • Component Integration: Integrated the new flexible temporary volume configuration across all relevant components, including Deployment, StatefulSet, FSCK CronJob, and Migration Job.
  • New Helm Templates and Tests: Added a new Helm helper template ('_helpers.tpl') and a dedicated PVC template ('temp-pvc.yaml') to manage temporary volumes, along with comprehensive unit tests for all configuration scenarios.
  • Updated Documentation: Updated the Helm chart documentation in the user guide and chart reference to reflect the new parameters and provide usage examples.
Changelog
  • charts/ncps/templates/_helpers.tpl
    • Added a new Helm helper 'ncps.tempVolume' to encapsulate the logic for rendering temporary volume configurations based on user-defined parameters.
  • charts/ncps/templates/deployment.yaml
    • Updated the Deployment manifest to utilize the new 'ncps.tempVolume' helper for configuring the temporary volume, replacing the previously hardcoded 'emptyDir'.
  • charts/ncps/templates/fsck-cronjob.yaml
    • Modified the FSCK CronJob manifest to use the 'ncps.tempVolume' helper for its temporary volume definition.
  • charts/ncps/templates/migration-job.yaml
    • Adjusted the Migration Job manifest to incorporate the 'ncps.tempVolume' helper for its temporary volume.
  • charts/ncps/templates/statefulset.yaml
    • Updated the StatefulSet manifest to dynamically configure the temporary volume using the 'ncps.tempVolume' helper.
  • charts/ncps/templates/temp-pvc.yaml
    • Introduced a new template to conditionally create a PersistentVolumeClaim for temporary storage when the 'pvc' type is selected and no existing claim is specified.
  • charts/ncps/tests/temp_volume_test.yaml
    • Added a new test suite with multiple test cases to validate the correct rendering of 'emptyDir' and 'pvc' temporary volume configurations under various scenarios.
  • charts/ncps/values.yaml
    • Extended the 'config.cache' section with a new 'tempVolume' object, allowing users to specify the volume type ('emptyDir' or 'pvc') and detailed configurations for each.
  • docs/docs/User Guide/Installation/Helm Chart.md
    • Appended a new section on 'Temporary Volume Configuration' with examples for using PVC and 'emptyDir' with memory medium.
  • docs/docs/User Guide/Installation/Helm Chart/Chart Reference.md
    • Expanded the chart reference table to include all new parameters related to 'config.cache.tempVolume' for both 'emptyDir' and 'pvc' types.
Activity
  • No specific review comments or activities were provided in the context.
Using Gemini Code Assist

The 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 /gemini <command> or @gemini-code-assist <command>. Below is a summary of the supported commands on the current page.

Feature Command Description
Code Review /gemini review Performs a code review for the current pull request in its current state.
Pull Request Summary /gemini summary Provides a summary of the current pull request in its current state.
Comment @gemini-code-assist Responds in comments when explicitly tagged, both in pull request comments and review comments.
Help /gemini help Displays a list of available commands.

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 .gemini/ folder in the base of the repository. Detailed instructions can be found here.

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

  1. Review the Privacy Notices, Generative AI Prohibited Use Policy, Terms of Service, and learn how to configure Gemini Code Assist in GitHub here. Gemini can make mistakes, so double check it and use code with caution. ↩

@kalbasit
kalbasit disabled auto-merge March 12, 2026 00:17
@kalbasit
kalbasit merged commit ee46bad into release-0.9 Mar 12, 2026
8 checks passed
@kalbasit
kalbasit deleted the backport-1074-to-release-0.9 branch March 12, 2026 00:17
@dosubot

dosubot Bot commented Mar 12, 2026

Copy link
Copy Markdown

Related Documentation

1 document(s) may need updating based on files changed in this PR:

kalbasit's Space

NAR File Download and Streaming
View 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
 

[Accept] [Decline]

Note: You must be authenticated to accept/decline updates.

How did I do? Any feedback?  Join Discord

@github-actions

Copy link
Copy Markdown
Contributor

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

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.

Comment on lines +270 to +276
{{- 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 }}

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

medium

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) -}}

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

medium

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

codecov Bot commented Mar 12, 2026 •

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 5.04%. Comparing base (7824bb2) to head (dd10c34).
⚠️ Report is 1 commits behind head on release-0.9.

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.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

helm size:L This PR changes 100-499 lines, ignoring generated files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant