-
Notifications
You must be signed in to change notification settings - Fork 714
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
298d12e
commit 5dce9df
Showing
17 changed files
with
2,098 additions
and
6 deletions.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
/git | ||
*.workspace | ||
dags/**/*.pyc | ||
/.idea | ||
/logs | ||
/db-data |
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 @@ | ||
1.0.0 |
Empty file.
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,48 @@ | ||
""" | ||
Code that goes along with the Airflow located at: | ||
http://airflow.readthedocs.org/en/latest/tutorial.html | ||
""" | ||
from airflow import DAG | ||
from airflow.operators.bash_operator import BashOperator | ||
from datetime import datetime, timedelta | ||
|
||
|
||
default_args = { | ||
"owner": "airflow", | ||
"depends_on_past": False, | ||
"start_date": datetime(2015, 6, 1), | ||
"email": ["[email protected]"], | ||
"email_on_failure": False, | ||
"email_on_retry": False, | ||
"retries": 1, | ||
"retry_delay": timedelta(minutes=5), | ||
# 'queue': 'bash_queue', | ||
# 'pool': 'backfill', | ||
# 'priority_weight': 10, | ||
# 'end_date': datetime(2016, 1, 1), | ||
} | ||
|
||
dag = DAG("tutorial", default_args=default_args, schedule_interval=timedelta(1)) | ||
|
||
# t1, t2 and t3 are examples of tasks created by instantiating operators | ||
t1 = BashOperator(task_id="print_date", bash_command="date", dag=dag) | ||
|
||
t2 = BashOperator(task_id="sleep", bash_command="sleep 5", retries=3, dag=dag) | ||
|
||
templated_command = """ | ||
{% for i in range(5) %} | ||
echo "{{ ds }}" | ||
echo "{{ macros.ds_add(ds, 7)}}" | ||
echo "{{ params.my_param }}" | ||
{% endfor %} | ||
""" | ||
|
||
t3 = BashOperator( | ||
task_id="templated", | ||
bash_command=templated_command, | ||
params={"my_param": "Parameter I passed in"}, | ||
dag=dag, | ||
) | ||
|
||
t2.set_upstream(t1) | ||
t3.set_upstream(t1) |
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,39 @@ | ||
# VERSION 1.10 | ||
# AUTHOR: Subash Canapathy | ||
# DESCRIPTION: Amazon MWAA Local Dev Environment | ||
# BUILD: docker build --rm -t amazon/mwaa-local . | ||
|
||
FROM amazonlinux | ||
LABEL maintainer="amazon" | ||
|
||
# Airflow | ||
ARG AIRFLOW_VERSION=1.10.12 | ||
ARG AIRFLOW_USER_HOME=/usr/local/airflow | ||
ARG AIRFLOW_DEPS="" | ||
ARG PYTHON_DEPS="" | ||
ARG SYSTEM_DEPS="" | ||
ARG INDEX_URL="" | ||
ENV AIRFLOW_HOME=${AIRFLOW_USER_HOME} | ||
|
||
COPY script/bootstrap.sh /bootstrap.sh | ||
COPY script/systemlibs.sh /systemlibs.sh | ||
COPY config/constraints.txt /constraints.txt | ||
COPY config/requirements.txt /requirements.txt | ||
|
||
RUN chmod u+x /systemlibs.sh && /systemlibs.sh | ||
RUN chmod u+x /bootstrap.sh && /bootstrap.sh | ||
|
||
# Post bootstrap to avoid expensive docker rebuilds | ||
COPY script/entrypoint.sh /entrypoint.sh | ||
COPY config/airflow.cfg ${AIRFLOW_USER_HOME}/airflow.cfg | ||
COPY config/webserver_config.py ${AIRFLOW_USER_HOME}/webserver_config.py | ||
|
||
RUN chown -R airflow: ${AIRFLOW_USER_HOME} | ||
RUN chmod +x /entrypoint.sh | ||
|
||
EXPOSE 8080 5555 8793 | ||
|
||
USER airflow | ||
WORKDIR ${AIRFLOW_USER_HOME} | ||
ENTRYPOINT ["/entrypoint.sh"] | ||
CMD ["local-runner"] |
Oops, something went wrong.