You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@airflow.apache.org by "jason810496 (via GitHub)" <gi...@apache.org> on 2025/12/28 12:28:45 UTC

[PR] Refactor 'breeze k8s dev' command [airflow]

jason810496 opened a new pull request, #59869:
URL: https://github.com/apache/airflow/pull/59869

   
   
   related: #59747 
   
   ## Why
   
   It would be really nice to make `breeze k8s dev` as **ONE STEP command** to setup Airflow on Kubernetes development environment!
   
   Additionally, while testing out the new `breeze k8s dev --dags-path files/dags --deploy` command locally, I encounter some errors:
       
   1. `ImagePullBackOff` error due to hardcoded image tag as `latest`
       ```
       Generated skaffold config at /var/folders/r8/sq4khrmx1xnfc7rgqsznh1880000gn/T/skaffold_efl_nwvf/skaffold.yaml
       Generating tags...
        - ghcr.io/apache/airflow/main/prod/python3.10-kubernetes -> ghcr.io/apache/airflow/main/prod/python3.10-kubernetes:latest
       Checking cache...
        - ghcr.io/apache/airflow/main/prod/python3.10-kubernetes: Found Locally
       Tags used in deployment:
        - ghcr.io/apache/airflow/main/prod/python3.10-kubernetes -> ghcr.io/apache/airflow/main/prod/python3.10-kubernetes:1fffdd3281571b184d412cd6cae6e7d727c24c20aa94c3c5c4666bde8d3e29e6
       Starting deploy...
       Loading images into kind cluster nodes...
        - ghcr.io/apache/airflow/main/prod/python3.10-kubernetes:1fffdd3281571b184d412cd6cae6e7d727c24c20aa94c3c5c4666bde8d3e29e6 -> Found
       Images loaded in 194.644416ms
       Helm release airflow not installed. Installing...
       Error: INSTALLATION FAILED: failed post-install: 1 error occurred:
               * timed out waiting for the condition
       
       deploying "airflow": install: exit status 1
       ```
       https://github.com/GoogleContainerTools/skaffold/issues/6804
   
   2. Namespace not found error for Helm
       
       ```
       Stable repo is already added
       Good version of skaffold installed: 2.17.0 in /Users/jason/Desktop/airflow/.venv/bin
       Generating tags...
        - ghcr.io/apache/airflow/main/prod/python3.10-kubernetes -> ghcr.io/apache/airflow/main/prod/python3.10-kubernetes:latest
       Checking cache...
        - ghcr.io/apache/airflow/main/prod/python3.10-kubernetes: Found Locally
       Tags used in deployment:
        - ghcr.io/apache/airflow/main/prod/python3.10-kubernetes -> ghcr.io/apache/airflow/main/prod/python3.10-kubernetes:1fffdd3281571b184d412cd6cae6e7d727c24c20aa94c3c5c4666bde8d3e29e6
       Starting deploy...
       Loading images into kind cluster nodes...
        - ghcr.io/apache/airflow/main/prod/python3.10-kubernetes:1fffdd3281571b184d412cdLoaded
       Images loaded in 1 minute 7.202 seconds
       Helm release airflow not installed. Installing...
       Error: INSTALLATION FAILED: create: failed to create: namespaces "airflow" not found
       Cleaning up...
       Error: uninstall: Release not loaded: airflow: release: not found
       Cleaning up resources encountered an error, will continue to clean up other resources.
       deploying "airflow": install: exit status 1
       ```
      https://github.com/GoogleContainerTools/skaffold/issues/8515
   
   3. It's not an error, but the current `--dags-path` is default as `dags` related path instead of `files/dags` so we need to explicitly set to `files/dags` if we need to test out the same dags as `breeze start-airflow`.
       ```
       Stable repo is already added
       Good version of skaffold installed: 2.17.0 in /Users/jason/Desktop/airflow/.venv/bin
       Running skaffold without deploying Helm resources. If sync cannot find pods, rerun with --deploy.
       Generating tags...
        - ghcr.io/apache/airflow/main/prod/python3.10-kubernetes -> ghcr.io/apache/airflow/main/prod/python3.10-kubernetes:latest
       Checking cache...
        - ghcr.io/apache/airflow/main/prod/python3.10-kubernetes: Error checking cache.
       getting hash for artifact "ghcr.io/apache/airflow/main/prod/python3.10-kubernetes": getting dependencies for "ghcr.io/apache/airflow/main/prod/python3.10-kubernetes": pattern "dags/**" did not match any file
       ```
   
   ## What
   
   To fix the above errors:
   1. Add `setValueTemplates` skaffold config to resolve image instead of hardcoding as `latest` image tag to avoid `ImagePullBackOff` error.
   2. Add missing `deploy.helm.releases.createNamespace` skaffold config
   3. change default value of `--dags-path` from `dags` to `files/dags` (align as breeze container mount point)
      
   To make `breeze k8s dev` as one step command:
   - ask user whether to run `create-cluster` command if found that cluster hasn't been created.
   - if user run `breeze k8s create-cluster` command first, also show the hint of `breeze k8s dev` so that user don't need to run `breeze k8s configure-cluster`, `breeze k8s build-k8s-image` ... `breeze k8s deploy-airflow`.
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@airflow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] Refactor breeze k8s dev to enable one-step Kubernetes setup and fix Skaffold issues [airflow]

Posted by "jason810496 (via GitHub)" <gi...@apache.org>.
jason810496 commented on code in PR #59869:
URL: https://github.com/apache/airflow/pull/59869#discussion_r2650118051


##########
dev/breeze/src/airflow_breeze/commands/kubernetes_commands.py:
##########
@@ -319,10 +322,17 @@ def _create_cluster(
             kubeconfig_file = get_kubeconfig_file(python=python, kubernetes_version=kubernetes_version)
             (KUBERNETES_TEST_PATH / ".env").write_text(f"KUBECONFIG={quote(kubeconfig_file.as_posix())}\n")
             get_console(output=output).print(f"[success]KinD cluster {cluster_name} created!\n")
-            get_console(output=output).print(
-                "\n[warning]NEXT STEP:[/][info] You might now configure your cluster by:\n"
-            )
-            get_console(output=output).print("\nbreeze k8s configure-cluster\n")
+
+            if show_hints:
+                get_console(output=output).print(
+                    "\n[warning]NEXT STEP:[/][info] You might now configure your cluster by:\n"

Review Comment:
   ```suggestion
                       "\n[warning]NEXT STEP:[/][info] You may now configure your cluster by:\n"
   ```



##########
dev/breeze/src/airflow_breeze/commands/kubernetes_commands.py:
##########
@@ -319,10 +322,17 @@ def _create_cluster(
             kubeconfig_file = get_kubeconfig_file(python=python, kubernetes_version=kubernetes_version)
             (KUBERNETES_TEST_PATH / ".env").write_text(f"KUBECONFIG={quote(kubeconfig_file.as_posix())}\n")
             get_console(output=output).print(f"[success]KinD cluster {cluster_name} created!\n")
-            get_console(output=output).print(
-                "\n[warning]NEXT STEP:[/][info] You might now configure your cluster by:\n"
-            )
-            get_console(output=output).print("\nbreeze k8s configure-cluster\n")
+
+            if show_hints:
+                get_console(output=output).print(
+                    "\n[warning]NEXT STEP:[/][info] You might now configure your cluster by:\n"

Review Comment:
   ```suggestion
                       "\n[warning]NEXT STEP:[/][info] You may now configure your cluster by:\n"
   ```



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@airflow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] Refactor breeze k8s dev to enable one-step Kubernetes setup and fix Skaffold issues [airflow]

Posted by "roykoand (via GitHub)" <gi...@apache.org>.
roykoand commented on code in PR #59869:
URL: https://github.com/apache/airflow/pull/59869#discussion_r2649958628


##########
dev/breeze/src/airflow_breeze/commands/kubernetes_commands.py:
##########
@@ -319,10 +322,17 @@ def _create_cluster(
             kubeconfig_file = get_kubeconfig_file(python=python, kubernetes_version=kubernetes_version)
             (KUBERNETES_TEST_PATH / ".env").write_text(f"KUBECONFIG={quote(kubeconfig_file.as_posix())}\n")
             get_console(output=output).print(f"[success]KinD cluster {cluster_name} created!\n")
-            get_console(output=output).print(
-                "\n[warning]NEXT STEP:[/][info] You might now configure your cluster by:\n"
-            )
-            get_console(output=output).print("\nbreeze k8s configure-cluster\n")
+
+            if show_hints:
+                get_console(output=output).print(
+                    "\n[warning]NEXT STEP:[/][info] You might now configure your cluster by:\n"

Review Comment:
   I know this comes from previously written code, but the wording feels a bit odd. Maybe “You can now” or “You may now” would be a better choice.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@airflow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] Refactor breeze k8s dev to enable one-step Kubernetes setup and fix Skaffold issues [airflow]

Posted by "github-actions[bot] (via GitHub)" <gi...@apache.org>.
github-actions[bot] commented on PR #59869:
URL: https://github.com/apache/airflow/pull/59869#issuecomment-3696066361

   ### Backport failed to create: v3-1-test. View the failure log <a href='https://github.com/apache/airflow/actions/runs/20570351941'> Run details </a>
   
   <table>
       <tr>
           <th>Status</th>
           <th>Branch</th>
           <th>Result</th>
       </tr>
       <tr>
           <td>❌</td>
           <td>v3-1-test</td>
           <td><a href="https://github.com/apache/airflow/commit/33671b8afbbd6e40d80b60bd5dade457c7d9bd2f"><img src='https://img.shields.io/badge/Commit-33671b8-red' alt='Commit Link'></a></td>
       </tr>
   </table>
   
   You can attempt to backport this manually by running:
   
   ```bash
   cherry_picker 33671b8 v3-1-test
   ```
   
   This should apply the commit to the v3-1-test branch and leave the commit in conflict state marking
   the files that need manual conflict resolution.
   
   After you have resolved the conflicts, you can continue the backport process by running:
   
   ```bash
   cherry_picker --continue
   ```
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@airflow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] Refactor breeze k8s dev to enable one-step Kubernetes setup and fix Skaffold issues [airflow]

Posted by "potiuk (via GitHub)" <gi...@apache.org>.
potiuk commented on code in PR #59869:
URL: https://github.com/apache/airflow/pull/59869#discussion_r2650629032


##########
dev/breeze/src/airflow_breeze/commands/kubernetes_commands.py:
##########
@@ -319,10 +322,17 @@ def _create_cluster(
             kubeconfig_file = get_kubeconfig_file(python=python, kubernetes_version=kubernetes_version)
             (KUBERNETES_TEST_PATH / ".env").write_text(f"KUBECONFIG={quote(kubeconfig_file.as_posix())}\n")
             get_console(output=output).print(f"[success]KinD cluster {cluster_name} created!\n")
-            get_console(output=output).print(
-                "\n[warning]NEXT STEP:[/][info] You might now configure your cluster by:\n"
-            )
-            get_console(output=output).print("\nbreeze k8s configure-cluster\n")
+
+            if show_hints:
+                get_console(output=output).print(
+                    "\n[warning]NEXT STEP:[/][info] You might now configure your cluster by:\n"

Review Comment:
   Feel free to create a PR to fix all those wordings 



##########
dev/breeze/src/airflow_breeze/commands/kubernetes_commands.py:
##########
@@ -319,10 +322,17 @@ def _create_cluster(
             kubeconfig_file = get_kubeconfig_file(python=python, kubernetes_version=kubernetes_version)
             (KUBERNETES_TEST_PATH / ".env").write_text(f"KUBECONFIG={quote(kubeconfig_file.as_posix())}\n")
             get_console(output=output).print(f"[success]KinD cluster {cluster_name} created!\n")
-            get_console(output=output).print(
-                "\n[warning]NEXT STEP:[/][info] You might now configure your cluster by:\n"
-            )
-            get_console(output=output).print("\nbreeze k8s configure-cluster\n")
+
+            if show_hints:
+                get_console(output=output).print(
+                    "\n[warning]NEXT STEP:[/][info] You might now configure your cluster by:\n"

Review Comment:
   Feel free to create a PR to fix all those wordings 



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@airflow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] Refactor breeze k8s dev to enable one-step Kubernetes setup and fix Skaffold issues [airflow]

Posted by "potiuk (via GitHub)" <gi...@apache.org>.
potiuk commented on code in PR #59869:
URL: https://github.com/apache/airflow/pull/59869#discussion_r2650629066


##########
dev/breeze/src/airflow_breeze/commands/kubernetes_commands.py:
##########
@@ -319,10 +322,17 @@ def _create_cluster(
             kubeconfig_file = get_kubeconfig_file(python=python, kubernetes_version=kubernetes_version)
             (KUBERNETES_TEST_PATH / ".env").write_text(f"KUBECONFIG={quote(kubeconfig_file.as_posix())}\n")
             get_console(output=output).print(f"[success]KinD cluster {cluster_name} created!\n")
-            get_console(output=output).print(
-                "\n[warning]NEXT STEP:[/][info] You might now configure your cluster by:\n"
-            )
-            get_console(output=output).print("\nbreeze k8s configure-cluster\n")
+
+            if show_hints:
+                get_console(output=output).print(
+                    "\n[warning]NEXT STEP:[/][info] You might now configure your cluster by:\n"

Review Comment:
   Feel free to create a PR to fix all those wordings 



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@airflow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] Refactor breeze k8s dev to enable one-step Kubernetes setup and fix Skaffold issues [airflow]

Posted by "potiuk (via GitHub)" <gi...@apache.org>.
potiuk merged PR #59869:
URL: https://github.com/apache/airflow/pull/59869


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@airflow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] Refactor breeze k8s dev to enable one-step Kubernetes setup and fix Skaffold issues [airflow]

Posted by "potiuk (via GitHub)" <gi...@apache.org>.
potiuk commented on PR #59869:
URL: https://github.com/apache/airflow/pull/59869#issuecomment-3697508020

   No need to backport 


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@airflow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org