From 15b1d30cca01c6fea07c5067790cf8d3c338b953 Mon Sep 17 00:00:00 2001 From: David Date: Thu, 12 Oct 2023 11:38:07 +0200 Subject: [PATCH] skiped pre-commit errors, removed setup files, added docker --- docker/Dockerfile | 4 ++++ docker/docker-compose.yml | 26 ++++++++++++++++++++++++++ docker/requirements.txt | 3 +++ prefect_dbt_flow/__init__.py | 16 ++++++++++------ 4 files changed, 43 insertions(+), 6 deletions(-) create mode 100644 docker/Dockerfile create mode 100644 docker/docker-compose.yml create mode 100644 docker/requirements.txt diff --git a/docker/Dockerfile b/docker/Dockerfile new file mode 100644 index 0000000..146b823 --- /dev/null +++ b/docker/Dockerfile @@ -0,0 +1,4 @@ +FROM prefecthq/prefect:2.10.17-python3.11 + +COPY ./requirements.txt ./requirements.txt +RUN pip install -r requirements.txt \ No newline at end of file diff --git a/docker/docker-compose.yml b/docker/docker-compose.yml new file mode 100644 index 0000000..ed6fe25 --- /dev/null +++ b/docker/docker-compose.yml @@ -0,0 +1,26 @@ +version: "3.1" + +services: + data-db: + image: postgres:15.2-alpine + restart: always + environment: + - POSTGRES_USER=postgres + - POSTGRES_PASSWORD=pass123 + - POSTGRES_DB=data + expose: + - 5432 + + server: + build: + context: . + dockerfile: ./Dockerfile + restart: always + entrypoint: ["/opt/prefect/entrypoint.sh", "prefect", "server", "start"] + environment: + - PREFECT_UI_URL=http://127.0.0.0:4200/api + - PREFECT_API_URL=http://127.0.0.1:4200/api + - PREFECT_SERVER_API_HOST=0.0.0.0 + - PREFECT_API_DATABASE_CONNECTION_URL=sqlite+aiosqlite:////opt/prefect/prefect.db + ports: + - 4200:4200 \ No newline at end of file diff --git a/docker/requirements.txt b/docker/requirements.txt new file mode 100644 index 0000000..000a70b --- /dev/null +++ b/docker/requirements.txt @@ -0,0 +1,3 @@ +dbt-postgres==1.6.5 +prefect +prefect-dbt-flow \ No newline at end of file diff --git a/prefect_dbt_flow/__init__.py b/prefect_dbt_flow/__init__.py index 04eae83..8d63712 100644 --- a/prefect_dbt_flow/__init__.py +++ b/prefect_dbt_flow/__init__.py @@ -1,8 +1,12 @@ """Prefect dbt flow initialization""" +# isort: skip_file +# ruff: noqa: F401 +# fmt: off from prefect_dbt_flow.dbt import ( - DbtDagOptions, - DbtNode, - DbtProfile, - DbtProject, -) # ruff: skip -from prefect_dbt_flow.flow import dbt_flow # noqa: F401 + DbtDagOptions, + DbtNode, + DbtProfile, + DbtProject + ) +from prefect_dbt_flow.flow import dbt_flow +# fmt: on