From 930819461e37d95552ddeb17ed0e0d515e5a775f Mon Sep 17 00:00:00 2001 From: Lukasz Przychodzien <38146332+lprzychodzien@users.noreply.github.com> Date: Mon, 20 Apr 2026 21:07:50 -0400 Subject: [PATCH] fix: fresh setup fix --- airflow/Dockerfile | 18 ++++++++++++++++-- airflow/requirements.txt | 1 + docker-compose.yml | 6 ++---- 3 files changed, 19 insertions(+), 6 deletions(-) diff --git a/airflow/Dockerfile b/airflow/Dockerfile index 3e723548..66332d10 100644 --- a/airflow/Dockerfile +++ b/airflow/Dockerfile @@ -1,5 +1,19 @@ FROM apache/airflow:2.5.1 -COPY requirements.txt . +USER root -RUN pip install --no-cache-dir -r requirements.txt +# google-cloud-bigquery pulls in Shapely; wheels still expect libgeos_c at runtime. +RUN apt-get update \ + && apt-get install -y --no-install-recommends libgeos-c1v5 \ + && apt-get clean \ + && rm -rf /var/lib/apt/lists/* + +USER airflow + +COPY --chown=airflow:root requirements.txt . + +# Postgres 10+ often uses SCRAM-SHA-256; the stock Airflow 2.5 image can ship +# psycopg2 linked against libpq < 10. Remove the base wheel first so pip does one +# clean install (avoids a force-reinstall temp tree that spikes disk use). +RUN pip uninstall -y psycopg2 psycopg2-binary 2>/dev/null || true \ + && pip install --no-cache-dir -r requirements.txt diff --git a/airflow/requirements.txt b/airflow/requirements.txt index ba4ed3cd..19e55deb 100644 --- a/airflow/requirements.txt +++ b/airflow/requirements.txt @@ -1,6 +1,7 @@ # Any change made here should accompany an increment # to the image version on line 5 of docker-compose.yml +psycopg2-binary>=2.9.9,<3 dbt-core dbt-postgres apache-airflow[google] diff --git a/docker-compose.yml b/docker-compose.yml index 7e6b4337..c17ddda9 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -1,7 +1,7 @@ x-airflow-common: &airflow-common build: context: ./airflow - image: sagerx_airflow:v0.0.2718 # versioning allows a rebuild of docker image where necessary + image: sagerx_airflow:v0.0.2721 # versioning allows a rebuild of docker image where necessary networks: - airflow-dbt-network env_file: @@ -47,9 +47,7 @@ services: - ./postgres:/docker-entrypoint-initdb.d - ./airflow/data:/opt/airflow/data - ./airflow/extracts:/opt/airflow/extracts - build: - context: . - shm_size: "4gb" + shm_size: "4gb" marimo: build: