potiuk commented on a change in pull request #4937: [AIRFLOW-4116] 
Multi-staging includes CI image [Step 2/3]
URL: https://github.com/apache/airflow/pull/4937#discussion_r290119796
 
 

 ##########
 File path: Dockerfile
 ##########
 @@ -125,16 +239,19 @@ RUN echo "Pip version: ${PIP_VERSION}"
 
 RUN pip install --upgrade pip==${PIP_VERSION}
 
+# We are copying everything with airflow:airflow user:group even if we use 
root to run the scripts
+# This is fine as root user will be able to use those dirs anyway.
+
 # Airflow sources change frequently but dependency configuration won't change 
that often
 # We copy setup.py and other files needed to perform setup of dependencies
 # This way cache here will only be invalidated if any of the
 # version/setup configuration change but not when airflow sources change
-COPY --chown=airflow:airflow setup.py /opt/airflow/setup.py
-COPY --chown=airflow:airflow setup.cfg /opt/airflow/setup.cfg
+COPY --chown=airflow:airflow setup.py ${AIRFLOW_HOME}/setup.py
+COPY --chown=airflow:airflow setup.cfg ${AIRFLOW_HOME}/setup.cfg
 
-COPY --chown=airflow:airflow airflow/version.py /opt/airflow/airflow/version.py
-COPY --chown=airflow:airflow airflow/__init__.py 
/opt/airflow/airflow/__init__.py
-COPY --chown=airflow:airflow airflow/bin/airflow 
/opt/airflow/airflow/bin/airflow
+COPY --chown=airflow:airflow airflow/version.py 
${AIRFLOW_HOME}/airflow/version.py
 
 Review comment:
   Hey @ashb - so just to verify If understand correctly - we want to separate 
sources (we need them to run tests) from AIRFLOW_HOME (where logs and dags are 
stored):
   * HOME -> the usual HOME of user (either /home/airflow or /root in CI)
   * AIRFLOW_HOME -> ${HOME}/airflow ( /dags and /logs are subdirectories )
   * AIRFLOW_SOURCES (i propose to name it this way) -> /opt/airflow - this is 
where mounted sources of airflow should be.
   
   Is my understanding correct ?
   

----------------------------------------------------------------
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.
 
For queries about this service, please contact Infrastructure at:
[email protected]


With regards,
Apache Git Services

Reply via email to