-
Notifications
You must be signed in to change notification settings - Fork 14.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add Local and Sequential Executors to Doc #8084
Merged
Merged
Changes from all commits
Commits
Show all changes
8 commits
Select commit
Hold shift + click to select a range
1f82038
Add Local and Sequential Executor docs to Executor section
xinbinhuang 7466a02
fixup! Add Local and Sequential Executor docs to Executor section
xinbinhuang 84c23a2
fixup! fixup! Add Local and Sequential Executor docs to Executor section
xinbinhuang fc70ba1
fixup! fixup! fixup! Add Local and Sequential Executor docs to Execut…
xinbinhuang 8cd1205
Reorder excutors doc based on complexity
xinbinhuang 2227c2c
fixup! fixup! fixup! fixup! Add Local and Sequential Executor docs to…
xinbinhuang da65585
fixup! fixup! fixup! fixup! fixup! Add Local and Sequential Executor …
xinbinhuang e92ccda
Remove empty leading lines from docs/executor/sequential.rst
xinbinhuang File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -16,6 +16,7 @@ | |
under the License. | ||
|
||
|
||
.. _executor:CeleryExecutor: | ||
|
||
Celery Executor | ||
=============== | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -16,6 +16,7 @@ | |
under the License. | ||
|
||
|
||
.. _executor:DaskExecutor: | ||
|
||
Dask Executor | ||
============= | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,49 @@ | ||
.. 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. | ||
|
||
|
||
.. _executor:LocalExecutor: | ||
|
||
Local Executor | ||
============== | ||
|
||
:class:`~airflow.executors.local_executor.LocalExecutor` runs tasks by spawning processes in a controlled fashion in different modes. | ||
|
||
Given that BaseExecutor has the option to receive a ``parallelism`` parameter to limit the number of process spawned, | ||
when this parameter is ``0`` the number of processes that LocalExecutor can spawn is unlimited. | ||
|
||
The following strategies are implemented: | ||
|
||
- | **Unlimited Parallelism** (``self.parallelism == 0``): In this strategy, LocalExecutor will | ||
| spawn a process every time ``execute_async`` is called, that is, every task submitted to the | ||
| :class:`~airflow.executors.local_executor.LocalExecutor` will be executed in its own process. Once the task is executed and the | ||
| result stored in the ``result_queue``, the process terminates. There is no need for a | ||
| ``task_queue`` in this approach, since as soon as a task is received a new process will be | ||
| allocated to the task. Processes used in this strategy are of class :class:`~airflow.executors.local_executor.LocalWorker`. | ||
|
||
- | **Limited Parallelism** (``self.parallelism > 0``): In this strategy, the :class:`~airflow.executors.local_executor.LocalExecutor` spawns | ||
| the number of processes equal to the value of ``self.parallelism`` at ``start`` time, | ||
| using a ``task_queue`` to coordinate the ingestion of tasks and the work distribution among | ||
| the workers, which will take a task as soon as they are ready. During the lifecycle of | ||
| the LocalExecutor, the worker processes are running waiting for tasks, once the | ||
| LocalExecutor receives the call to shutdown the executor a poison token is sent to the | ||
| workers to terminate them. Processes used in this strategy are of class :class:`~airflow.executors.local_executor.QueuedLocalWorker`. | ||
|
||
Arguably, :class:`~airflow.executors.sequential_executor.SequentialExecutor` could be thought as a ``LocalExecutor`` with limited | ||
parallelism of just 1 worker, i.e. ``self.parallelism = 1``. | ||
This option could lead to the unification of the executor implementations, running | ||
locally, into just one :class:`~airflow.executors.local_executor.LocalExecutor` with multiple modes. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
.. 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. | ||
|
||
|
||
.. _executor:SequentialExecutor: | ||
|
||
Sequential Executor | ||
=================== | ||
|
||
The :class:`~airflow.executors.sequential_executor.SequentialExecutor` is the default executor when you first install ``airflow``. | ||
It is the only executor that can be used with ``sqlite`` since ``sqlite`` doesn't support multiple connections. | ||
This executor will only run one task instance at a time. For production use case, please use other executors. |
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you add similar annotations for other executors?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done!