danielafekhume-neo opened a new issue, #39967:
URL: https://github.com/apache/airflow/issues/39967

   ### Apache Airflow version
   
   2.9.1
   
   ### If "Other Airflow 2 version" selected, which one?
   
   _No response_
   
   ### What happened?
   
   Building the Airflow Image with Dockerfile
   
   Requirements.txt file contains packages:
   
`apache-airflow[async,celery,cncf.kubernetes,databricks,dbt.cloud,http,ssh,statsd,jdbc,password,postgres,redis,s3,slack,sentry,google-auth,amazon]==${AIRFLOW_VERSION}`
   ```
   RUN pip install -r ${AIRFLOW_HOME}/requirements.txt /   
   --constraint 
"https://raw.githubusercontent.com/apache/airflow/constraints-${AIRFLOW_VERSION}/constraints-${PYTHON_MINOR_VERSION}.txt";
   ```
   
   AIRFLOW_VERSION==2.9.1
   PYTHON_MINOR_VERSION==3.9
   
   
   
   
   
   ### What you think should happen instead?
   
   The image should successfully build. 
   it is built when the constraints flag is removed but with the flag it fails 
with the following error:
   ```
   ERROR: Cannot install apache-airflow-providers-databricks because these 
package versions have conflicting dependencies.
   
   The conflict is caused by:
       databricks-sql-connector 2.9.6 depends on numpy>=1.16.6; python_version 
>= "3.7" and python_version < "3.11"
       The user requested (constraint) numpy==1.26.4
   
   To fix this you could try to:
   1. loosen the range of package versions you've specified
   2. remove package versions to allow pip attempt to solve the dependency 
conflict
   
   ERROR: ResolutionImpossible: for help visit 
https://pip.pypa.io/en/latest/topics/dependency-resolution/#dealing-with-dependency-conflicts
   The command '/bin/sh -c pip install -r 
${AIRFLOW_HOME}/requirements-airflow.txt         --constraint 
"[https://raw.githubusercontent.com/apache/airflow/constraints-${AIRFLOW_VERSION}/constraints-${PYTHON_MINOR_VERSION}.txt](https://raw.githubusercontent.com/apache/airflow/constraints-$%7BAIRFLOW_VERSION%7D/constraints-$%7BPYTHON_MINOR_VERSION%7D.txt)"'
 returned a non-zero code: 1
   make: *** [Makefile:8: build] Error 1
   ```
   
   ### How to reproduce
   
   ```
   ARG PYTHON_MINOR_VERSION
   
   FROM pythonimage
   LABEL version="2.1"
   
   # Never prompts the user for choices on installation/configuration of 
packages
   ENV DEBIAN_FRONTEND=noninteractive
   ENV TERM=linux
   
   # Airflow
   ARG AIRFLOW_VERSION
   ENV AIRFLOW_HOME=/usr/local/airflow
   ENV AIRFLOW_GPL_UNIDECODE=yes
   
   # celery config
   ARG CELERY_REDIS_VERSION=4.4.7
   
   # Define en_US.
   ENV LANGUAGE en_US.UTF-8
   ENV LANG en_US.UTF-8
   ENV LC_ALL en_US.UTF-8
   ENV LC_CTYPE en_US.UTF-8
   ENV LC_MESSAGES en_US.UTF-8
   ENV LC_ALL en_US.UTF-8
   
   ARG GITHUB_ACTION=false
   COPY requirements.txt ${AIRFLOW_HOME}/requirements.txt
   
   RUN apt-get update
   RUN apt-get -y upgrade
   RUN apt-get -y --no-install-recommends install \
            build-essential \
            python3-pip \
            python3-requests \
            python3-dev \
            python3-venv \
         python3-distutils \
            default-mysql-client \
            default-libmysqlclient-dev \
            apt-utils \
            rsync \
            netcat \
            locales \
            gnupg
   
   RUN sed -i 's/^# en_US.UTF-8 UTF-8$/en_US.UTF-8 UTF-8/g' /etc/locale.gen
   RUN locale-gen
   RUN update-locale LANG=en_US.UTF-8 LC_ALL=en_US.UTF-8
   RUN useradd -ms /bin/bash -d ${AIRFLOW_HOME} airflow
   # install virtual environment
   RUN python3 -m venv ${AIRFLOW_HOME}/venv
   
   # activate virtual environment
   RUN . ${AIRFLOW_HOME}/venv/bin/activate
   
   # Airflow packages
   RUN pip install -U pip setuptools
   RUN pip install -r ${AIRFLOW_HOME}/requirements.txt /   
   --constraint 
"https://raw.githubusercontent.com/apache/airflow/constraints-${AIRFLOW_VERSION}/constraints-${PYTHON_MINOR_VERSION}.txt";
   RUN pip freeze
   
   # Clean installation
   RUN apt clean
   RUN rm -rf \
         /tmp/* \
         /var/tmp/* \
         /var/lib/apt/lists/* \
         /usr/share/man \
         /usr/share/doc \
         /usr/share/doc-base
   RUN if [ $GITHUB_ACTION = true ] ; then echo "Ignoring remove shell for 
GitHub Actions." ; else remove-shell /bin/sh /bin/bash /bin/rbash /bin/dash ; fi
   RUN apt-get -y remove build-essential
   RUN apt-get -y remove mariadb-client-10.3 mariadb-client-core-10.3 
mariadb-common
   RUN apt-get -y remove python3-pip python3-urllib3 python3-dev
   RUN apt-get -y --purge autoremove
   ```
   
   ### Operating System
   
   Linux-Debian
   
   ### Versions of Apache Airflow Providers
   
   Requirements.txt:
   
`apache-airflow[async,celery,cncf.kubernetes,databricks,dbt.cloud,http,ssh,statsd,jdbc,password,postgres,redis,s3,slack,sentry,google-auth,amazon]==${AIRFLOW_VERSION}`
   ```
   
   Installing
   ```
   RUN pip install -r ${AIRFLOW_HOME}/requirements.txt /   
   --constraint 
"https://raw.githubusercontent.com/apache/airflow/constraints-${AIRFLOW_VERSION}/constraints-${PYTHON_MINOR_VERSION}.txt";
   ```
   
   ### Deployment
   
   Other Docker-based deployment
   
   ### Deployment details
   
   CI via Github Actions
   
   ### Anything else?
   
   <img width="786" alt="image" 
src="https://github.com/apache/airflow/assets/98522271/fdcc0909-d99b-4227-834e-236132286c59";>
   
   
   ### Are you willing to submit PR?
   
   - [ ] Yes I am willing to submit a PR!
   
   ### Code of Conduct
   
   - [X] I agree to follow this project's [Code of 
Conduct](https://github.com/apache/airflow/blob/main/CODE_OF_CONDUCT.md)
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to