GitHub user dattatejaofficial created a discussion: Airflow DAGs fail with 
ModuleNotFoundError for internal package when using Astro Runtime Docker Image

I am running Apache Airflow using Astronomer Astro Runtime in Docker. The 
Airflow UI starts correctly, but DAG parsing fails with:

`ModuleNotFoundError: No module named 'currentsystem'` 
Here currentsystem is the system I am building currently. This is an internal 
Python Package from the same repository.

Project Structure
repo-root/
│
├── setup.py
├── currentsystem/          # internal python package
│   └── __init__.py
│
├── monitoring/              # airflow project directory
│   └── dags/
│       └── monitoring_pipeline.py
│
└── Dockerfile

The existing Dockerfile consists of `FROM 
quay.io/astronomer/astro-runtime:13.4.0` & later updated to

FROM quay.io/astronomer/astro-runtime:13.4.0

WORKDIR /usr/local/airflow

COPY setup.py ./
COPY currentsystem/ ./currentsystem/
COPY monitoring/ ./monitoring/

RUN pip install -e .

ENV AIRFLOW__CORE__DAGS_FOLDER=/usr/local/airflow/monitoring/dags

Is there a recommended way in Astro Runtime to:

- include an internal Python package from the same repo.
- make it importable inside DAGs.

GitHub link: https://github.com/apache/airflow/discussions/61399

----
This is an automatically sent email for [email protected].
To unsubscribe, please send an email to: [email protected]

Reply via email to