[ 
https://issues.apache.org/jira/browse/AIRFLOW-5389?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16921061#comment-16921061
 ] 

ASF GitHub Bot commented on AIRFLOW-5389:
-----------------------------------------

potiuk commented on pull request #5989: [AIRFLOW-5389] better organized scripts 
for building CI docker deps
URL: https://github.com/apache/airflow/pull/5989
 
 
   Make sure you have checked _all_ steps below.
   
   ### Jira
   
   - [x] My PR addresses the following [Airflow 
Jira](https://issues.apache.org/jira/browse/AIRFLOW/) issues and references 
them in the PR title. For example, "\[AIRFLOW-XXX\] My Airflow PR"
     - https://issues.apache.org/jira/browse/AIRFLOW-5389
   
   ### Description
   
   - [x] Here are some details about my PR, including screenshots of any UI 
changes:
   
   The scripts to add external deps and build test list are now separated out 
and better organized (and build is faster).
   
   ### Tests
   
   - [x] My PR adds the following unit tests __OR__ does not need testing for 
this extremely good reason:
   
   ### Commits
   
   - [x] My commits all reference Jira issues in their subject lines, and I 
have squashed multiple commits if they address the same issue. In addition, my 
commits follow the guidelines from "[How to write a good git commit 
message](http://chris.beams.io/posts/git-commit/)":
     1. Subject is separated from body by a blank line
     1. Subject is limited to 50 characters (not including Jira issue reference)
     1. Subject does not end with a period
     1. Subject uses the imperative mood ("add", not "adding")
     1. Body wraps at 72 characters
     1. Body explains "what" and "why", not "how"
   
   ### Documentation
   
   - [x] In case of new functionality, my PR adds documentation that describes 
how to use it.
     - All the public functions and the classes in the PR contain docstrings 
that explain what it does
     - If you implement backwards incompatible changes, please leave a note in 
the [Updating.md](https://github.com/apache/airflow/blob/master/UPDATING.md) so 
we can assign it to a appropriate release
   
   ### Code Quality
   
   - [x] Passes `flake8`
   
 
----------------------------------------------------------------
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]


> Better organised/faster build for external dependencies in ci build
> -------------------------------------------------------------------
>
>                 Key: AIRFLOW-5389
>                 URL: https://issues.apache.org/jira/browse/AIRFLOW-5389
>             Project: Apache Airflow
>          Issue Type: Improvement
>          Components: ci
>    Affects Versions: 2.0.0, 1.10.5
>            Reporter: Jarek Potiuk
>            Priority: Major
>
> There are several entries with if's for CI image in the Dockerfile. They have 
> weird syntax and they are slow (each if line is separately evaluated while 
> Docker build).
> They can be moved to bash scripts and replaced with single RUN command (one 
> per CI deps and one for main file). Then we will also use the power of 
> shellcheck to verify those scripts.
> In the future, we also think about unifying the dockerfiles later one 
> (production/CI/SLIM without multi-staging) and removing installation of 
> hive/hadoop/minicluster to separate images. This might be first step to do so.
> Examples of the current code:
> CI deps:
> {code:java}
> RUN \
> if [[ "${APT_DEPS_IMAGE}" == "airflow-apt-deps-ci" ]]; then \
>  mkdir -pv ${HADOOP_HOME} \
>  && mkdir -pv ${HIVE_HOME} \
>  && mkdir /tmp/minicluster \
>  && mkdir -pv /user/hive/warehouse \
>  && chmod -R 777 ${HIVE_HOME} \
>  && chmod -R 777 /user/ \
>  ;\
> fi
> # Install Hadoop
> # --absolute-names is a work around to avoid this issue 
> https://github.com/docker/hub-feedback/issues/727
> RUN \
> if [[ "${APT_DEPS_IMAGE}" == "airflow-apt-deps-ci" ]]; then \
>     
> HADOOP_URL=${HADOOP_URL}hadoop-${HADOOP_VERSION}-${HADOOP_DISTRO}${HADOOP_DISTRO_VERSION}.tar.gz
>  \
>     && HADOOP_TMP_FILE=/tmp/hadoop.tar.gz \
>     && curl -sL ${HADOOP_URL} > ${HADOOP_TMP_FILE} \
>     && tar xzf ${HADOOP_TMP_FILE} --absolute-names --strip-components 1 -C 
> ${HADOOP_HOME} \
>     && rm ${HADOOP_TMP_FILE} \
>     ;\
> fi{code}
>  
> main:
> {code:java}
> if [[ "${APT_DEPS_IMAGE}" == "airflow-apt-deps-ci" ]]; then \
> chmod +x "${HOME}/run-tests-complete" "${HOME}/run-tests" && \
> chown "${AIRFLOW_USER}.${AIRFLOW_USER}" "${HOME}/.bashrc" \
>  "${HOME}/run-tests-complete" "${HOME}/run-tests"; \
> fi
> {code}
>  



--
This message was sent by Atlassian Jira
(v8.3.2#803003)

Reply via email to