Miretpl commented on code in PR #73082: URL: https://github.com/apache/airflow/pull/73082#discussion_r4097925553
########## chart/docs/migrate-to-git-dag-bundle.rst: ########## @@ -0,0 +1,221 @@ +.. Licensed to the Apache Software Foundation (ASF) under one + or more contributor license agreements. See the NOTICE file + distributed with this work for additional information + regarding copyright ownership. The ASF licenses this file + to you under the Apache License, Version 2.0 (the + "License"); you may not use this file except in compliance + with the License. You may obtain a copy of the License at + + .. http://www.apache.org/licenses/LICENSE-2.0 + + .. Unless required by applicable law or agreed to in writing, + software distributed under the License is distributed on an + "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + KIND, either express or implied. See the License for the + specific language governing permissions and limitations + under the License. + +.. _git_sync_to_git_dag_bundle: + +Migrating from Git-Sync to GitDagBundle +======================================= + +This guide is for users of the Git-Sync sidecar (``dags.gitSync``) in Helm Chart 1.x. +The Git-Sync sidecar is planned for removal in Helm Chart 2.0 in favour of the +Airflow-native :class:`~airflow.providers.git.bundles.git.GitDagBundle`. + +What is changing +---------------- + +With Git-Sync, a ``git-sync`` container ran as a sidecar (or init container) on the +scheduler, dag processor, worker and triggerer pods, keeping a shared DAG folder up +to date from a git repository. Review Comment: ```suggestion Airflow components pods keep a shared DAG folder up to date from a git repository. ``` It depends on the persistence setting. Having it more general resolved the issues of being precise, but still it is true. ########## chart/docs/migrate-to-git-dag-bundle.rst: ########## @@ -0,0 +1,221 @@ +.. Licensed to the Apache Software Foundation (ASF) under one + or more contributor license agreements. See the NOTICE file + distributed with this work for additional information + regarding copyright ownership. The ASF licenses this file + to you under the Apache License, Version 2.0 (the + "License"); you may not use this file except in compliance + with the License. You may obtain a copy of the License at + + .. http://www.apache.org/licenses/LICENSE-2.0 + + .. Unless required by applicable law or agreed to in writing, + software distributed under the License is distributed on an + "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + KIND, either express or implied. See the License for the + specific language governing permissions and limitations + under the License. + +.. _git_sync_to_git_dag_bundle: + +Migrating from Git-Sync to GitDagBundle +======================================= + +This guide is for users of the Git-Sync sidecar (``dags.gitSync``) in Helm Chart 1.x. +The Git-Sync sidecar is planned for removal in Helm Chart 2.0 in favour of the +Airflow-native :class:`~airflow.providers.git.bundles.git.GitDagBundle`. + +What is changing +---------------- + +With Git-Sync, a ``git-sync`` container ran as a sidecar (or init container) on the +scheduler, dag processor, worker and triggerer pods, keeping a shared DAG folder up +to date from a git repository. + +With ``GitDagBundle``, syncing moves into Airflow itself. The Dag Processor clones +the repository once into a local bare repository and refreshes it every +``refresh_interval`` seconds. Task execution resolves DAG code from versioned +bundles, so workers always run the code version the Dag Processor recorded. No +sidecar containers and no shared ``ReadWriteMany`` volume are needed for syncing. + +Differences to be aware of before migrating: + +* Git-Sync synced a single repository per deployment (multiple repositories required + an "umbrella" repository with submodules). ``dagProcessor.dagBundleConfigList`` + accepts multiple bundles, so each repository simply becomes its own bundle. +* ``GitDagBundle`` supports versioning: changing a SHA-pinned ``tracking_ref`` is a configuration change and + only takes effect once the Dag Processor restarts and reloads its configuration. + Promoting to a *new* SHA can also require the bundle's local storage to be + cleared first (for example by letting the pod be recreated) — see + `GH-71388 <https://github.com/apache/airflow/issues/71388>`_. +* ``dags.persistence`` was often enabled only to give Git-Sync a shared volume. It + is not needed for ``GitDagBundle`` and can be disabled if nothing else uses it. + +Prerequisites +------------- + +* Helm Chart 1.x on Airflow 3 (DAG bundles are an Airflow 3 feature). +* The ``apache-airflow-providers-git`` provider package must be installed in the + image you deploy, along with the ``git`` binary (the ``git`` binary is + pre-installed in the official ``apache/airflow`` images starting from Airflow + 3.0.2). If you build a custom slim image, add the provider to it. + +Value mapping +------------- + +.. list-table:: + :header-rows: 1 + :widths: 40 60 + + * - Git-Sync (``dags.gitSync.*``) + - GitDagBundle (``dagProcessor.dagBundleConfigList[].kwargs``) + * - ``repo`` — the clone URL + - ``repo_url``. Alternatively, store the repository URL in the ``host`` field + of a ``git`` connection and reference it with ``git_conn_id``. + * - ``branch`` (git-sync v3) / ``ref`` (git-sync v4) — branch, tag or hash to + check out + - ``tracking_ref`` — accepts a branch, tag or full commit SHA. + * - ``rev`` (git-sync v3) + - ``tracking_ref``. To follow the tip of a branch, set ``tracking_ref`` to + the branch name. + * - ``subPath`` — subdirectory with DAGs + - ``subdir`` + * - ``period`` — sync interval as a Go duration string (for example ``"5s"``) + - ``refresh_interval`` — sync interval in seconds (integer, for example + ``300``) + * - ``credentialsSecret`` (``GITSYNC_USERNAME`` / ``GITSYNC_PASSWORD``) Review Comment: ```suggestion * - ``credentialsSecret`` (``GITSYNC_USERNAME``, ``GIT_SYNC_USERNAME``, ``GITSYNC_PASSWORD``, ``GIT_SYNC_PASSWORD``) ``` ########## chart/docs/migrate-to-git-dag-bundle.rst: ########## @@ -0,0 +1,221 @@ +.. Licensed to the Apache Software Foundation (ASF) under one + or more contributor license agreements. See the NOTICE file + distributed with this work for additional information + regarding copyright ownership. The ASF licenses this file + to you under the Apache License, Version 2.0 (the + "License"); you may not use this file except in compliance + with the License. You may obtain a copy of the License at + + .. http://www.apache.org/licenses/LICENSE-2.0 + + .. Unless required by applicable law or agreed to in writing, + software distributed under the License is distributed on an + "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + KIND, either express or implied. See the License for the + specific language governing permissions and limitations + under the License. + +.. _git_sync_to_git_dag_bundle: + +Migrating from Git-Sync to GitDagBundle +======================================= + +This guide is for users of the Git-Sync sidecar (``dags.gitSync``) in Helm Chart 1.x. +The Git-Sync sidecar is planned for removal in Helm Chart 2.0 in favour of the +Airflow-native :class:`~airflow.providers.git.bundles.git.GitDagBundle`. + +What is changing +---------------- + +With Git-Sync, a ``git-sync`` container ran as a sidecar (or init container) on the +scheduler, dag processor, worker and triggerer pods, keeping a shared DAG folder up +to date from a git repository. + +With ``GitDagBundle``, syncing moves into Airflow itself. The Dag Processor clones +the repository once into a local bare repository and refreshes it every +``refresh_interval`` seconds. Task execution resolves DAG code from versioned +bundles, so workers always run the code version the Dag Processor recorded. No +sidecar containers and no shared ``ReadWriteMany`` volume are needed for syncing. + +Differences to be aware of before migrating: + +* Git-Sync synced a single repository per deployment (multiple repositories required + an "umbrella" repository with submodules). ``dagProcessor.dagBundleConfigList`` + accepts multiple bundles, so each repository simply becomes its own bundle. +* ``GitDagBundle`` supports versioning: changing a SHA-pinned ``tracking_ref`` is a configuration change and + only takes effect once the Dag Processor restarts and reloads its configuration. + Promoting to a *new* SHA can also require the bundle's local storage to be + cleared first (for example by letting the pod be recreated) — see + `GH-71388 <https://github.com/apache/airflow/issues/71388>`_. +* ``dags.persistence`` was often enabled only to give Git-Sync a shared volume. It + is not needed for ``GitDagBundle`` and can be disabled if nothing else uses it. + +Prerequisites +------------- + +* Helm Chart 1.x on Airflow 3 (DAG bundles are an Airflow 3 feature). Review Comment: ```suggestion * Latest Helm Chart 1.x release with Airflow 3 (DAG bundles are an Airflow 3 feature). ``` ########## chart/docs/migrate-to-git-dag-bundle.rst: ########## @@ -0,0 +1,221 @@ +.. Licensed to the Apache Software Foundation (ASF) under one + or more contributor license agreements. See the NOTICE file + distributed with this work for additional information + regarding copyright ownership. The ASF licenses this file + to you under the Apache License, Version 2.0 (the + "License"); you may not use this file except in compliance + with the License. You may obtain a copy of the License at + + .. http://www.apache.org/licenses/LICENSE-2.0 + + .. Unless required by applicable law or agreed to in writing, + software distributed under the License is distributed on an + "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + KIND, either express or implied. See the License for the + specific language governing permissions and limitations + under the License. + +.. _git_sync_to_git_dag_bundle: + +Migrating from Git-Sync to GitDagBundle +======================================= + +This guide is for users of the Git-Sync sidecar (``dags.gitSync``) in Helm Chart 1.x. +The Git-Sync sidecar is planned for removal in Helm Chart 2.0 in favour of the +Airflow-native :class:`~airflow.providers.git.bundles.git.GitDagBundle`. + +What is changing +---------------- + +With Git-Sync, a ``git-sync`` container ran as a sidecar (or init container) on the +scheduler, dag processor, worker and triggerer pods, keeping a shared DAG folder up +to date from a git repository. + +With ``GitDagBundle``, syncing moves into Airflow itself. The Dag Processor clones +the repository once into a local bare repository and refreshes it every +``refresh_interval`` seconds. Task execution resolves DAG code from versioned +bundles, so workers always run the code version the Dag Processor recorded. No +sidecar containers and no shared ``ReadWriteMany`` volume are needed for syncing. + +Differences to be aware of before migrating: + +* Git-Sync synced a single repository per deployment (multiple repositories required + an "umbrella" repository with submodules). ``dagProcessor.dagBundleConfigList`` + accepts multiple bundles, so each repository simply becomes its own bundle. +* ``GitDagBundle`` supports versioning: changing a SHA-pinned ``tracking_ref`` is a configuration change and + only takes effect once the Dag Processor restarts and reloads its configuration. + Promoting to a *new* SHA can also require the bundle's local storage to be + cleared first (for example by letting the pod be recreated) — see + `GH-71388 <https://github.com/apache/airflow/issues/71388>`_. +* ``dags.persistence`` was often enabled only to give Git-Sync a shared volume. It + is not needed for ``GitDagBundle`` and can be disabled if nothing else uses it. + +Prerequisites +------------- + +* Helm Chart 1.x on Airflow 3 (DAG bundles are an Airflow 3 feature). +* The ``apache-airflow-providers-git`` provider package must be installed in the + image you deploy, along with the ``git`` binary (the ``git`` binary is + pre-installed in the official ``apache/airflow`` images starting from Airflow + 3.0.2). If you build a custom slim image, add the provider to it. + +Value mapping +------------- + +.. list-table:: + :header-rows: 1 + :widths: 40 60 + + * - Git-Sync (``dags.gitSync.*``) + - GitDagBundle (``dagProcessor.dagBundleConfigList[].kwargs``) + * - ``repo`` — the clone URL + - ``repo_url``. Alternatively, store the repository URL in the ``host`` field + of a ``git`` connection and reference it with ``git_conn_id``. + * - ``branch`` (git-sync v3) / ``ref`` (git-sync v4) — branch, tag or hash to + check out + - ``tracking_ref`` — accepts a branch, tag or full commit SHA. + * - ``rev`` (git-sync v3) + - ``tracking_ref``. To follow the tip of a branch, set ``tracking_ref`` to + the branch name. + * - ``subPath`` — subdirectory with DAGs + - ``subdir`` + * - ``period`` — sync interval as a Go duration string (for example ``"5s"``) + - ``refresh_interval`` — sync interval in seconds (integer, for example + ``300``) + * - ``credentialsSecret`` (``GITSYNC_USERNAME`` / ``GITSYNC_PASSWORD``) + - ``git_conn_id`` — an Airflow ``git`` connection whose login/password hold + the username and access token. See :ref:`git_sync_to_git_dag_bundle:auth` + below. + * - ``sshKeySecret`` / ``sshKey`` (``gitSshKey``) + - ``git_conn_id`` — a ``git`` connection with the SSH private key in the + ``private_key`` extra (inline key) or ``key_file`` extra (path to a key + file). + * - ``knownHosts`` + - ``git_conn_id`` — a ``git`` connection with the ``known_hosts_file`` and + ``strict_host_key_checking`` extras. + * - ``depth``, ``maxFailures``, probes, ``resources``, ``env`` + - No equivalent. There are no sidecar containers to tune: ``GitDagBundle`` + keeps one full bare clone and fetches from it, and refresh failures are + retried internally. + +.. _git_sync_to_git_dag_bundle:auth: + +Authentication +-------------- + +``GitDagBundle`` authenticates through a standard Airflow connection of type +``git`` (``kwargs.git_conn_id``), or needs no connection at all for public +repositories when ``repo_url`` is given directly. + +For a private repository over HTTPS with a personal access token, create the +connection from a Kubernetes secret managed by the chart: Review Comment: Can't it be done via Airflow Connection? ########## chart/docs/migrate-to-git-dag-bundle.rst: ########## @@ -0,0 +1,221 @@ +.. Licensed to the Apache Software Foundation (ASF) under one + or more contributor license agreements. See the NOTICE file + distributed with this work for additional information + regarding copyright ownership. The ASF licenses this file + to you under the Apache License, Version 2.0 (the + "License"); you may not use this file except in compliance + with the License. You may obtain a copy of the License at + + .. http://www.apache.org/licenses/LICENSE-2.0 + + .. Unless required by applicable law or agreed to in writing, + software distributed under the License is distributed on an + "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + KIND, either express or implied. See the License for the + specific language governing permissions and limitations + under the License. + +.. _git_sync_to_git_dag_bundle: + +Migrating from Git-Sync to GitDagBundle +======================================= + +This guide is for users of the Git-Sync sidecar (``dags.gitSync``) in Helm Chart 1.x. +The Git-Sync sidecar is planned for removal in Helm Chart 2.0 in favour of the +Airflow-native :class:`~airflow.providers.git.bundles.git.GitDagBundle`. + +What is changing +---------------- + +With Git-Sync, a ``git-sync`` container ran as a sidecar (or init container) on the +scheduler, dag processor, worker and triggerer pods, keeping a shared DAG folder up +to date from a git repository. + +With ``GitDagBundle``, syncing moves into Airflow itself. The Dag Processor clones +the repository once into a local bare repository and refreshes it every +``refresh_interval`` seconds. Task execution resolves DAG code from versioned +bundles, so workers always run the code version the Dag Processor recorded. No +sidecar containers and no shared ``ReadWriteMany`` volume are needed for syncing. + +Differences to be aware of before migrating: + +* Git-Sync synced a single repository per deployment (multiple repositories required + an "umbrella" repository with submodules). ``dagProcessor.dagBundleConfigList`` + accepts multiple bundles, so each repository simply becomes its own bundle. +* ``GitDagBundle`` supports versioning: changing a SHA-pinned ``tracking_ref`` is a configuration change and + only takes effect once the Dag Processor restarts and reloads its configuration. + Promoting to a *new* SHA can also require the bundle's local storage to be + cleared first (for example by letting the pod be recreated) — see + `GH-71388 <https://github.com/apache/airflow/issues/71388>`_. +* ``dags.persistence`` was often enabled only to give Git-Sync a shared volume. It + is not needed for ``GitDagBundle`` and can be disabled if nothing else uses it. + +Prerequisites +------------- + +* Helm Chart 1.x on Airflow 3 (DAG bundles are an Airflow 3 feature). +* The ``apache-airflow-providers-git`` provider package must be installed in the + image you deploy, along with the ``git`` binary (the ``git`` binary is + pre-installed in the official ``apache/airflow`` images starting from Airflow + 3.0.2). If you build a custom slim image, add the provider to it. + +Value mapping +------------- + +.. list-table:: + :header-rows: 1 + :widths: 40 60 + + * - Git-Sync (``dags.gitSync.*``) + - GitDagBundle (``dagProcessor.dagBundleConfigList[].kwargs``) + * - ``repo`` — the clone URL + - ``repo_url``. Alternatively, store the repository URL in the ``host`` field + of a ``git`` connection and reference it with ``git_conn_id``. + * - ``branch`` (git-sync v3) / ``ref`` (git-sync v4) — branch, tag or hash to + check out + - ``tracking_ref`` — accepts a branch, tag or full commit SHA. + * - ``rev`` (git-sync v3) + - ``tracking_ref``. To follow the tip of a branch, set ``tracking_ref`` to + the branch name. + * - ``subPath`` — subdirectory with DAGs + - ``subdir`` + * - ``period`` — sync interval as a Go duration string (for example ``"5s"``) + - ``refresh_interval`` — sync interval in seconds (integer, for example + ``300``) + * - ``credentialsSecret`` (``GITSYNC_USERNAME`` / ``GITSYNC_PASSWORD``) + - ``git_conn_id`` — an Airflow ``git`` connection whose login/password hold + the username and access token. See :ref:`git_sync_to_git_dag_bundle:auth` + below. + * - ``sshKeySecret`` / ``sshKey`` (``gitSshKey``) + - ``git_conn_id`` — a ``git`` connection with the SSH private key in the + ``private_key`` extra (inline key) or ``key_file`` extra (path to a key + file). + * - ``knownHosts`` + - ``git_conn_id`` — a ``git`` connection with the ``known_hosts_file`` and + ``strict_host_key_checking`` extras. + * - ``depth``, ``maxFailures``, probes, ``resources``, ``env`` + - No equivalent. There are no sidecar containers to tune: ``GitDagBundle`` + keeps one full bare clone and fetches from it, and refresh failures are + retried internally. + +.. _git_sync_to_git_dag_bundle:auth: + +Authentication +-------------- + +``GitDagBundle`` authenticates through a standard Airflow connection of type +``git`` (``kwargs.git_conn_id``), or needs no connection at all for public Review Comment: It is not clear what `(``kwargs.git_conn_id``)` means. -- 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: [email protected] For queries about this service, please contact Infrastructure at: [email protected]
