-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(tippecanoe): add command line to airflow
- Loading branch information
Showing
3 changed files
with
51 additions
and
0 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 |
---|---|---|
@@ -1,3 +1,16 @@ | ||
FROM quay.io/astronomer/astro-runtime:11.8.0 | ||
|
||
ENV DATA_DIR=data_tiles | ||
|
||
RUN mkdir -p $DATA_DIR | ||
|
||
# Install tippecanoe | ||
RUN git clone https://github.com/mapbox/tippecanoe.git /home/astro/tippecanoe | ||
USER root | ||
WORKDIR /home/astro/tippecanoe | ||
RUN make && make install | ||
USER astro | ||
WORKDIR /usr/local/airflow | ||
|
||
RUN mkdir /home/astro/.dbt | ||
COPY ./dbt_profile.yml /home/astro/.dbt/profiles.yml |
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 |
---|---|---|
|
@@ -9,3 +9,10 @@ g++ | |
wget | ||
p7zip-full | ||
postgresql-client | ||
cmake | ||
wget | ||
git | ||
ca-certificates | ||
build-essential | ||
libsqlite3-dev | ||
zlib1g-dev |
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,31 @@ | ||
import subprocess | ||
|
||
import pytest | ||
|
||
|
||
def test_missing_command_is_not_available(): | ||
""" | ||
Teste qu'une commande inexistante retourne une erreur FileNotFoundError | ||
""" | ||
|
||
command_not_found = False | ||
|
||
try: | ||
subprocess.run(["not_a_command"], check=True) | ||
except FileNotFoundError: | ||
command_not_found = True | ||
|
||
if not command_not_found: | ||
pytest.fail("La commande not_a_command n'a pas retourné d'erreur") | ||
|
||
|
||
def test_tippecanoe_cli_is_available(): | ||
""" | ||
Teste si le cli tippecanoe est disponible depuis la commande tippecanoe | ||
""" | ||
try: | ||
subprocess.run(["tippecanoe", "--help"], check=True) | ||
except FileNotFoundError: | ||
pytest.fail("La commande tippecanoe n'est pas disponible") | ||
except subprocess.CalledProcessError as e: | ||
pytest.fail(f"La commande tippecanoe a retourné une erreur: {e}") |