From b110d36e8350742b096d8de7f61d218ba0a192ea Mon Sep 17 00:00:00 2001 From: "Alexis A." Date: Wed, 11 Dec 2024 16:39:40 +0100 Subject: [PATCH] feat(tippecanoe): add command line to airflow --- airflow/Dockerfile | 20 ++++++++++++++++++++ airflow/dags/tippecanoe.py | 21 +++++++++++++++++++++ airflow/packages.txt | 7 +++++++ 3 files changed, 48 insertions(+) create mode 100644 airflow/dags/tippecanoe.py diff --git a/airflow/Dockerfile b/airflow/Dockerfile index 85b090ea7..44d914594 100644 --- a/airflow/Dockerfile +++ b/airflow/Dockerfile @@ -1,3 +1,23 @@ FROM quay.io/astronomer/astro-runtime:11.8.0 + +ENV DATA_DIR=data_tiles + +# Create data directory +RUN mkdir -p $DATA_DIR + +# Tippecanoe +RUN git clone https://github.com/mapbox/tippecanoe.git /home/astro/tippecanoe +USER root + +WORKDIR /home/astro/tippecanoe +RUN make && make install +WORKDIR / + +# Tippecanoe now requires features from the 2011 C++ standard. + +USER astro + + + RUN mkdir /home/astro/.dbt COPY ./dbt_profile.yml /home/astro/.dbt/profiles.yml diff --git a/airflow/dags/tippecanoe.py b/airflow/dags/tippecanoe.py new file mode 100644 index 000000000..6c646e3ad --- /dev/null +++ b/airflow/dags/tippecanoe.py @@ -0,0 +1,21 @@ +from airflow.decorators import dag, task +from pendulum import datetime + + +@dag( + start_date=datetime(2024, 1, 1), + schedule="@once", + catchup=False, + doc_md=__doc__, + max_active_runs=1, + default_args={"owner": "Alexis Athlani", "retries": 3}, +) +def tippecanoe_test(): + @task.bash + def test_command() -> str: + return "tippecanoe --help" + + test_command() + + +tippecanoe_test() diff --git a/airflow/packages.txt b/airflow/packages.txt index 6b84fcfa2..8a58407a3 100644 --- a/airflow/packages.txt +++ b/airflow/packages.txt @@ -9,3 +9,10 @@ g++ wget p7zip-full postgresql-client +cmake +wget +git +ca-certificates +build-essential +libsqlite3-dev +zlib1g-dev