kaxil commented on a change in pull request #7832: Add production image support
URL: https://github.com/apache/airflow/pull/7832#discussion_r400870181
 
 

 ##########
 File path: IMAGES.rst
 ##########
 @@ -0,0 +1,304 @@
+
+ .. Licensed to the Apache Software Foundation (ASF) under one
+or more contributor license agreements.  See the NOTICE file
+distributed with this work for additional information
+regarding copyright ownership.  The ASF licenses this file
+to you under the Apache License, Version 2.0 (the
+"License"); you may not use this file except in compliance
+with the License.  You may obtain a copy of the License at
+
+ ..   http://www.apache.org/licenses/LICENSE-2.0
+
+ .. Unless required by applicable law or agreed to in writing,
+software distributed under the License is distributed on an
+"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+KIND, either express or implied.  See the License for the
+specific language governing permissions and limitations
+under the License.
+
+.. contents:: :local:
+
+Airflow docker images
+=====================
+
+Airflow has two images (build from Dockerfiles):
+
+* CI image (Dockerfile.ci) - used for running tests and local development
+* Production image (Dockerfile) - used to run production-ready Airlfow 
installations
+
+Image naming conventions
+========================
+
+The images are named as follows:
+
+``apache/airflow:<BRANCH_OR_TAG>-python<PYTHON_MAJOR_MINOR_VERSION>[-ci][-manifest]``
+
+where:
+
+* BRANCH_OR_TAG - branch or tag used when creating the image. Examples: 
master, v1-10-test, 1.10.10
+  The ``master`` and ``v1-10-test`` labels are built from branches so they 
change over time. the 1.10.* and in
+  the future ``2.*`` labels are build from git tags and they are "fixed" once 
built.
+* PYTHON_MAJOR_MINOR_VERSION - version of python used to build the image. 
Examples: 3.5, 3.7
+* The ``-ci`` suffix is added for CI images
+* The ``-manifest`` is added for manifest images (see below for explanation of 
manifest images)
+
+Building docker images
+======================
+
+The easiest way to build those images is to use `<BREEZE.rst>`_.
+
+You can build the CI image using this command:
+
+.. code-block::
+
+  ./breeze build-image
+
+You can build production image using this command:
+
+.. code-block::
+
+  ./breeze build-image --production-image
+
+By adding ``--python <PYTHON_MAJOR_MINOR_VERSION>`` parameter you can build the
+image version for the chosen python version.
+
+The images are build with default extras - different extras for CI and 
production image and you
+can change the extras via the ``--extras`` parameters. You can see default 
extras used via
+``./breeze flags``.
+
+For example if you want to build python 3.7 version of production image with
+"all" extras installed you should run this command:
+
+.. code-block::
+
+  ./breeze build-image --python 3.7 --extras "all" --production-image
+
+The command that builds the CI image are optimized to minimize the time needed 
to rebuild the image when
+the source code of Airflow evolves. This means that if you already have the 
image locally downloaded and
+built, the scripts will determine whether the rebuild is needed in the first 
place. Then the scripts will
+make sure that minimal number of steps are executed to rebuild parts of the 
image (for example,
+PIP dependencies) and will give you an image consistent with the one used 
during Continuous Integration.
+
+The command that build the production image are optimised for size of the 
image.
 
 Review comment:
   ```suggestion
   The command that builds the production image is optimised for the size of 
the image.
   ```

----------------------------------------------------------------
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:
us...@infra.apache.org


With regards,
Apache Git Services

Reply via email to