forked from apache/airflow
-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
first version of the celery executor
- Loading branch information
Krishna Puttaswamy
committed
Oct 26, 2014
1 parent
5f94760
commit 67020e5
Showing
7 changed files
with
89 additions
and
1 deletion.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,6 @@ | ||
from base_executor import LocalExecutor | ||
from base_executor import SequentialExecutor | ||
from base_executor import CeleryExecutor | ||
|
||
DEFAULT_EXECUTOR = SequentialExecutor() | ||
# DEFAULT_EXECUTOR = CeleryExecutor() |
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,18 @@ | ||
import subprocess | ||
import time | ||
import logging | ||
from celery import Celery | ||
|
||
# to start the celery worker, run the command: | ||
# "celery -A airflow.executors.celery_worker worker --loglevel=info" | ||
|
||
app = Celery('airflow.executors.celery_worker', backend='amqp', broker='amqp://') | ||
|
||
@app.task (name='airflow.executors.celery_worker.execute_command') | ||
def execute_command(command): | ||
logging.info("Executing command in Celery " + command) | ||
try: | ||
subprocess.Popen(command, shell=True).wait() | ||
except Exception as e: | ||
raise e | ||
return True |
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 |
---|---|---|
|
@@ -15,3 +15,5 @@ sphinx | |
sphinx_rtd_theme | ||
sqlalchemy | ||
thrift | ||
celery | ||
hive-thrift-py |