Skip to content

Conversation

Copy link

Copilot AI commented Nov 1, 2025

Finish up the Helm chart implementation based on PR apache#47595

This PR implements dev mode support for the Airflow Helm chart to improve the Kubernetes development experience with automatic hot-reloading:

Plan:

  • Add devMode configuration to chart/values.yaml
  • Add devMode schema to chart/values.schema.json
  • Add helper templates for code mounts in chart/templates/_helpers.yaml
  • Create dev-mode-code-volume-claim.yaml for PVC
  • Create dev-mode-code-pre-install-hook.yaml for initialization
  • Update scheduler deployment to mount code PVC
  • Update webserver deployment to mount code PVC (fix bug from PR)
  • Update worker deployment to mount code PVC
  • Update triggerer deployment to mount code PVC
  • Update dag-processor deployment to mount code PVC
  • Update api-server deployment to mount code PVC
  • Add breeze k8s restart command
  • Update breeze configuration files
  • Test Helm chart validation
  • Run code review and security checks
  • Fix PVC creation timing issue
  • Add NFS server for shared code access with ReadWriteMany
  • Add --dev flag support for automatic hot-reloading

Validation Results:

  • ✅ Helm lint passes successfully
  • ✅ Templates render correctly with devMode enabled
  • ✅ PVC now created as regular resource (not hook) before pre-install hook runs
  • ✅ NFS server deployment and service created for shared code access
  • ✅ Code volumes are mounted in all components with ReadWriteMany access mode
  • ✅ --dev flag properly added to all Airflow components when devMode enabled
  • ✅ Templates correctly exclude dev-mode resources when devMode.enabled=false
  • ✅ PVC correctly skipped when existingClaim is specified
  • ✅ Code review passed with 1 minor grammar fix applied
  • ✅ CodeQL security scan completed with no issues

Changes:
The implementation adds:

  • devMode.enabled flag to enable/disable dev mode (automatically enabled in breeze deploy)
  • devMode.persistence configuration for PVC settings (size, storageClassName, existingClaim)
  • NFS server deployment and service for shared code volume across all pods
  • ReadWriteMany PVC backed by NFS for concurrent code access
  • Mounts for airflow-core, airflow-ctl, and task-sdk directories with readOnly access
  • Pre-install hook to initialize code directories with proper error handling
  • Automatic --dev flag added to all Airflow component commands when devMode is enabled:
    • scheduler: airflow scheduler --dev
    • webserver: airflow webserver --dev (Airflow <3.0)
    • workers: airflow celery worker --dev
    • triggerer: airflow triggerer --dev
    • dag-processor: airflow dag-processor --dev
    • api-server: airflow api-server --dev
  • Fixed bug in webserver-deployment.yaml where it checked .Values.devMode.persistence.enabled instead of .Values.devMode.enabled
  • Fixed timing issue: removed helm hooks from PVC so it's created as regular resource before hooks run
  • breeze k8s restart command to restart specific or all airflow components
  • Support for component-specific operations (all, scheduler, api-server, trigger, workers)
  • Helm hook annotations for proper lifecycle management

Benefits:

  • Significantly improves k8s test iteration process with automatic hot-reloading via --dev flag
  • Shared code volume accessible by all pods simultaneously via NFS with ReadWriteMany
  • Eliminates need to rebuild images for every code change
  • Only requires image rebuild when dependencies change
  • Code changes are automatically reloaded without manual intervention
  • Reduces development time and feedback loops dramatically
Original prompt

Based on apache#47595 PR, checkout a new branch to finish up the Helm chart


✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.

Copilot AI changed the title [WIP] Finish implementation of the Helm chart Complete Helm chart dev mode implementation from PR #47595 Nov 1, 2025
Copilot AI requested a review from jason810496 November 1, 2025 13:40
@jason810496
Copy link
Owner

@copilot I encounter "/opt/airflow/dags" not found error when deploy airflow, we need to ensure code PVC is already existed before we run the pre-install hook

Copy link
Author

Copilot AI commented Nov 2, 2025

@copilot I encounter "/opt/airflow/dags" not found error when deploy airflow, we need to ensure code PVC is already existed before we run the pre-install hook

Fixed in commit 93abea8. The code PVC was incorrectly configured as a helm pre-install hook, which caused timing issues where the init-dev-code Job tried to mount the PVC before it was fully bound.

Changed the PVC to be a regular resource (like the logs PVC) by removing the helm.sh/hook annotations. Now the PVC is created and bound during the normal resource creation phase, before any pre-install hooks run. This ensures the PVC is ready when the init-dev-code Job executes.

Also added the existingClaim check to match the logs PVC pattern.

@github-actions
Copy link

This pull request has been automatically marked as stale because it has not had recent activity. It will be closed in 5 days if no further activity occurs. Thank you for your contributions.

@github-actions github-actions bot added the Stale label Dec 18, 2025
@github-actions github-actions bot closed this Dec 23, 2025
@jason810496 jason810496 reopened this Dec 23, 2025
@github-actions github-actions bot removed the Stale label Dec 24, 2025
@jason810496 jason810496 force-pushed the copilot/finish-helm-chart-implementation branch 2 times, most recently from 51838fd to 792e0e7 Compare December 24, 2025 13:22
Copilot AI and others added 5 commits December 24, 2025 21:23
Co-authored-by: jason810496 <68415893+jason810496@users.noreply.github.com>
Co-authored-by: jason810496 <68415893+jason810496@users.noreply.github.com>
…nstall hook runs

The code PVC was using helm.sh/hook annotations which caused it to be
created as a hook resource. This led to timing issues where the
pre-install hook Job tried to mount the PVC before it was fully bound.

Changes:
- Removed helm.sh/hook and helm.sh/hook-weight annotations from code PVC
- Made code PVC a regular resource (like logs PVC) so it's created before hooks
- Added condition to skip PVC creation when existingClaim is specified

This ensures the PVC is created and bound before the init-dev-code Job runs.

Co-authored-by: jason810496 <68415893+jason810496@users.noreply.github.com>
@jason810496 jason810496 force-pushed the copilot/finish-helm-chart-implementation branch 3 times, most recently from 77fd940 to 0465b2f Compare December 24, 2025 13:44
Copy link
Owner

@jason810496 jason810496 left a comment

Choose a reason for hiding this comment

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

@copilot

  • add a new NFS Server setup for airflow_code_volume_claim with ReadWriteMany access when devMode.enabled
  • remove reload_code breeze command
  • add --dev flag for each Airflow components if when devMode.enabled

…flag support

- Added NFS server deployment and service for dev mode code sharing
- Updated code PVC to use ReadWriteMany access mode with NFS backend
- Removed reload-code breeze command as requested
- Added --dev flag to all Airflow component commands when devMode is enabled:
  - scheduler: airflow scheduler --dev
  - webserver: airflow webserver --dev (Airflow <3.0)
  - workers: airflow celery worker --dev
  - triggerer: airflow triggerer --dev
  - dag-processor: airflow dag-processor --dev
  - api-server: airflow api-server --dev
- Fixed scheduler deployment missing endif for serviceAccountToken block

Co-authored-by: jason810496 <68415893+jason810496@users.noreply.github.com>
Copy link
Author

Copilot AI commented Dec 24, 2025

@copilot

  • add a new NFS Server setup for airflow_code_volume_claim with ReadWriteMany access when devMode.enabled...

Completed all requested changes in commit dc234f7:

  1. ✅ Added NFS Server setup with deployment and service for airflow_code_volume_claim with ReadWriteMany access mode
  2. ✅ Removed reload-code breeze command
  3. ✅ Added --dev flag for all Airflow components when devMode.enabled:
    • scheduler: airflow scheduler --dev
    • webserver: airflow webserver --dev (Airflow <3.0)
    • workers: airflow celery worker --dev
    • triggerer: airflow triggerer --dev
    • dag-processor: airflow dag-processor --dev
    • api-server: airflow api-server --dev

The NFS server enables ReadWriteMany access so all pods can share the code volume for hot-reloading with the --dev flag.

Copilot AI changed the title Complete Helm chart dev mode implementation from PR #47595 Complete Helm chart dev mode implementation from PR #47595 with NFS and hot-reload support Dec 24, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants