You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@airflow.apache.org by GitBox <gi...@apache.org> on 2022/03/23 17:46:06 UTC

[GitHub] [airflow] potiuk opened a new pull request #22492: Converts Dockerfiles to be standalone

potiuk opened a new pull request #22492:
URL: https://github.com/apache/airflow/pull/22492


   This change is one of the biggest optimizations to the Dockerfiles
   that from the very beginning was a goal, but it has been enabled
   by switching to buildkit and recent relase of support for
   the 1.4 dockerfile syntax. This syntax introduced two features:
   
   * heredocs
   * links for COPY commands
   
   Both changes allows to solve multiple problems:
   
   * COPY for build scripts suffer from permission problems. Depending
     on umask setting of the host, the scripts could have different
     group permissions and invalidate docker cache. Inlining the
     scripts (automatically by pre-commit) gets rid of the problem
     completely
   
   * COPY --link allows to optimize and parallelize builds for
     Dockerfile.ci embedded source code. This should speed up
     not only building the images locally but also it will allow
     to use more efficiently cache for the CI builds (in case no
     source code change, the builds will use pre-cached layers from
     the cache more efficiently (and in parallel)
   
   * The PROD Dockerfile is now completely standalone. You do not
     need to have any folders or files to build Airlfow image. At
     the same time the versatility and support for multiple ways
     on how you can build the image (as described in
     https://airflow.apache.org/docs/docker-stack/build.html is
     maintained (this was a goal from the very beginning of the
     PROD Dockerfile but it was not easily achievable - heredocs
     allow to inline scripts that are used for the build and the
     pre-commits will make sure that there is one source of truth
     and nicely editable scripts for both PROD and CI Dockerfile.
   
   The last point is really cool, because it allows our users to
   build custom dockerfiles without checking out the code of
   Airflow, it is enough to download the latest released
   Dockerfile and they can easily build the image.
   
   Overall - this change will vastly optimize build speed for
   both PROD and CI images in multiple scenarios.
   
   <!--
   Thank you for contributing! Please make sure that your code changes
   are covered with tests. And in case of new features or big changes
   remember to adjust the documentation.
   
   Feel free to ping committers for the review!
   
   In case of existing issue, reference it using one of the following:
   
   closes: #ISSUE
   related: #ISSUE
   
   How to write a good git commit message:
   http://chris.beams.io/posts/git-commit/
   -->
   
   ---
   **^ Add meaningful description above**
   
   Read the **[Pull Request Guidelines](https://github.com/apache/airflow/blob/main/CONTRIBUTING.rst#pull-request-guidelines)** for more information.
   In case of fundamental code change, Airflow Improvement Proposal ([AIP](https://cwiki.apache.org/confluence/display/AIRFLOW/Airflow+Improvements+Proposals)) is needed.
   In case of a new dependency, check compliance with the [ASF 3rd Party License Policy](https://www.apache.org/legal/resolved.html#category-x).
   In case of backwards incompatible changes please leave a note in [UPDATING.md](https://github.com/apache/airflow/blob/main/UPDATING.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: commits-unsubscribe@airflow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [airflow] potiuk commented on pull request #22492: Converts Dockerfiles to be standalone

Posted by GitBox <gi...@apache.org>.
potiuk commented on pull request #22492:
URL: https://github.com/apache/airflow/pull/22492#issuecomment-1079959880


   I think we can merge this one (Regardless of the answer of legal). 


-- 
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: commits-unsubscribe@airflow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [airflow] potiuk commented on a change in pull request #22492: Converts Dockerfiles to be standalone

Posted by GitBox <gi...@apache.org>.
potiuk commented on a change in pull request #22492:
URL: https://github.com/apache/airflow/pull/22492#discussion_r833996439



##########
File path: scripts/ci/pre_commit/pre_commit_inline_scripts_in_docker.py
##########
@@ -0,0 +1,59 @@
+#!/usr/bin/env python3
+# 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.
+from os import listdir
+from pathlib import Path
+from typing import List
+
+AIRFLOW_SOURCES_DIR = Path(__file__).parent.parent.parent.parent
+
+
+def insert_content(file_path: Path, content: List[str], header: str, footer: str, file_name: str):
+    text = file_path.read_text().splitlines(keepends=True)
+    replacing = False
+    result: List[str] = []
+    for line in text:
+        if line.startswith(f"{header}{file_name}"):
+            replacing = True
+            result.append(line)
+            result += content
+        if line.startswith(footer):
+            replacing = False
+        if not replacing:
+            result.append(line)
+        file_path.write_text("".join(result))
+
+
+if __name__ == '__main__':
+    DOCKERFILE_FILE = AIRFLOW_SOURCES_DIR / 'Dockerfile'
+    DOCKERFILE_CI_FILE = AIRFLOW_SOURCES_DIR / 'Dockerfile.ci'
+    SCRIPTS_DOCKER_DIR = AIRFLOW_SOURCES_DIR / 'scripts' / 'docker'
+
+    for file in [DOCKERFILE_FILE, DOCKERFILE_CI_FILE]:
+        for script in listdir(SCRIPTS_DOCKER_DIR):
+            script_content = (SCRIPTS_DOCKER_DIR / script).read_text().splitlines(keepends=True)
+            no_comments_script_content = [
+                line for line in script_content if not line.startswith("#") or line.startswith("#!")

Review comment:
       Removing comments make the generated Dockerfile content smaller, but I am checking with legal if this not too much (the scripts inside the Dockerfile will have licence information stripped off).




-- 
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: commits-unsubscribe@airflow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [airflow] potiuk commented on pull request #22492: Converts Dockerfiles to be standalone

Posted by GitBox <gi...@apache.org>.
potiuk commented on pull request #22492:
URL: https://github.com/apache/airflow/pull/22492#issuecomment-1076638446


   Hello everyone. This is I think the last "serious" optimization of the way our Dockerfiles are constructed - enabled by "dockerfile:1.4" finally released few weeks ago. I was waiting for it to complete what I wanted to achieve from the very beginnig of my `Dockerfiles` journey, and I am happy we got there finally :) .
   
   Wth this one a lot of problems we had with caching and speed of rebuildong the images on various machines will be gone and we will still continue having a very versatile and flexible `Dockerfile` - only that customizing the image will be now WAY easier, as it will only require downloading the single `Dockerfile` which is self-contained now and way faster to rebuild in many circumstances.
   
   Looking forward to merging it soon - together with #22225  it shoudl vastly improve waiting time of `Breeze` users and speed up the CI image builds significantly.
   


-- 
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: commits-unsubscribe@airflow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [airflow] potiuk commented on pull request #22492: Converts Dockerfiles to be standalone

Posted by GitBox <gi...@apache.org>.
potiuk commented on pull request #22492:
URL: https://github.com/apache/airflow/pull/22492#issuecomment-1078973114


   I'd love to merge it. It will make our builds and Breeze Much faster with caching issues :)


-- 
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: commits-unsubscribe@airflow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [airflow] potiuk commented on pull request #22492: Converts Dockerfiles to be standalone

Posted by GitBox <gi...@apache.org>.
potiuk commented on pull request #22492:
URL: https://github.com/apache/airflow/pull/22492#issuecomment-1079778206


   I'd really love that one to be merged. Finishing AIP-26 will be way easier with it :) https://cwiki.apache.org/confluence/display/AIRFLOW/AIP-26+Production-ready+Airflow+Docker+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.

To unsubscribe, e-mail: commits-unsubscribe@airflow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [airflow] potiuk commented on pull request #22492: Converts Dockerfiles to be standalone

Posted by GitBox <gi...@apache.org>.
potiuk commented on pull request #22492:
URL: https://github.com/apache/airflow/pull/22492#issuecomment-1076659294


   (and I could split some of those changes but not many BTW). They are all very tightly connected I am afraid.


-- 
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: commits-unsubscribe@airflow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [airflow] potiuk merged pull request #22492: Converts Dockerfiles to be standalone

Posted by GitBox <gi...@apache.org>.
potiuk merged pull request #22492:
URL: https://github.com/apache/airflow/pull/22492


   


-- 
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: commits-unsubscribe@airflow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [airflow] potiuk commented on a change in pull request #22492: Converts Dockerfiles to be standalone

Posted by GitBox <gi...@apache.org>.
potiuk commented on a change in pull request #22492:
URL: https://github.com/apache/airflow/pull/22492#discussion_r833584268



##########
File path: docs/docker-stack/docker-examples/customizing/add-build-essential-custom.sh
##########
@@ -19,11 +19,16 @@
 # This is an example docker build script. It is not intended for PRODUCTION use
 set -euo pipefail
 AIRFLOW_SOURCES="$(cd "$(dirname "${BASH_SOURCE[0]}")/../../../../" && pwd)"
-cd "${AIRFLOW_SOURCES}"
+

Review comment:
       Here you can see (I tested it  :)). That you can build customized images of Airlfow by just copying the Dockerfile and running the right `docker build` command. No more need to have Airlfow sources around. Just `Dockerfile` and you are good (while you can still fully customize it with the ``--build-args``.




-- 
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: commits-unsubscribe@airflow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [airflow] potiuk commented on a change in pull request #22492: Converts Dockerfiles to be standalone

Posted by GitBox <gi...@apache.org>.
potiuk commented on a change in pull request #22492:
URL: https://github.com/apache/airflow/pull/22492#discussion_r833587516



##########
File path: scripts/ci/libraries/_permissions.sh
##########
@@ -1,53 +0,0 @@
-#!/usr/bin/env bash

Review comment:
       No need to mess around with permissions any more :)




-- 
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: commits-unsubscribe@airflow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [airflow] potiuk commented on a change in pull request #22492: Converts Dockerfiles to be standalone

Posted by GitBox <gi...@apache.org>.
potiuk commented on a change in pull request #22492:
URL: https://github.com/apache/airflow/pull/22492#discussion_r833588345



##########
File path: scripts/ci/libraries/_build_images.sh
##########
@@ -662,6 +661,7 @@ function build_images::build_prod_images() {
         --build-arg AIRFLOW_PRE_CACHED_PIP_PACKAGES="${AIRFLOW_PRE_CACHED_PIP_PACKAGES}" \
         --build-arg INSTALL_FROM_PYPI="${INSTALL_FROM_PYPI}" \
         --build-arg INSTALL_FROM_DOCKER_CONTEXT_FILES="${INSTALL_FROM_DOCKER_CONTEXT_FILES}" \
+        --build-arg DOCKER_CONTEXT_FILES="docker-context-files" \

Review comment:
       @bowrna - that's something for the new Breeze to add :)




-- 
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: commits-unsubscribe@airflow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [airflow] potiuk commented on a change in pull request #22492: Converts Dockerfiles to be standalone

Posted by GitBox <gi...@apache.org>.
potiuk commented on a change in pull request #22492:
URL: https://github.com/apache/airflow/pull/22492#discussion_r833993351



##########
File path: docs/docker-stack/changelog.rst
##########
@@ -0,0 +1,174 @@
+ .. 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.
+
+Dockerfile Changelog
+====================
+
+he ``Dockerfile`` does not strictly follow the `SemVer <https://semver.org/>`_ approach of

Review comment:
       This has been pointed out. Fixing the changes done by @jedcunningham  - wait few minutes please @mik-laj :)




-- 
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: commits-unsubscribe@airflow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [airflow] potiuk commented on pull request #22492: Converts Dockerfiles to be standalone

Posted by GitBox <gi...@apache.org>.
potiuk commented on pull request #22492:
URL: https://github.com/apache/airflow/pull/22492#issuecomment-1077318126


   Thanks @jedcunningham as usual :) ❤️ 


-- 
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: commits-unsubscribe@airflow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [airflow] Bowrna commented on pull request #22492: Converts Dockerfiles to be standalone

Posted by GitBox <gi...@apache.org>.
Bowrna commented on pull request #22492:
URL: https://github.com/apache/airflow/pull/22492#issuecomment-1077487594


   @potiuk Could you explain to me how inlining the script will remove the permission problem?


-- 
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: commits-unsubscribe@airflow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [airflow] potiuk commented on a change in pull request #22492: Converts Dockerfiles to be standalone

Posted by GitBox <gi...@apache.org>.
potiuk commented on a change in pull request #22492:
URL: https://github.com/apache/airflow/pull/22492#discussion_r833581458



##########
File path: Dockerfile
##########
@@ -58,6 +58,1035 @@ ARG AIRFLOW_VERSION_SPECIFICATION=""
 
 # By default PIP has progress bar but you can disable it.
 ARG PIP_PROGRESS_BAR="on"
+

Review comment:
       As you see below - this part is fully automatically updated during the pre-commit. The "source of truth" is in "scripts/ci/docker" which allows to easily edit (and even run those scripts. Here I just inline them in order to make the Dockerfile fully 'standalone".




-- 
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: commits-unsubscribe@airflow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [airflow] potiuk commented on pull request #22492: Converts Dockerfiles to be standalone

Posted by GitBox <gi...@apache.org>.
potiuk commented on pull request #22492:
URL: https://github.com/apache/airflow/pull/22492#issuecomment-1076650709


   cc: @Bowrna  - this one results in a few changes to the part you do on the prod image building #21956 . I've done some of them here, but some more changes are needed to bring the changes also to the python PROD Build too:
   
   * I removed "fix_group_permissions" part - from both the old Breeze and the new one (so you do not need to do anything for that one). This is a good example of "code is not an asset but liability" - by inlining the scripts I could finally get rid of all the permission problems that various host configuration could cause and rebuilding the image with cache will be much more predictable, but also we could get rid of the "not-very-reliable" code that I added to workaround that problem before (not very succesfully often) :).  - inlining the scripts to the image solves it completely
   
   * There is a need to add few changes (you will see it there) 
      --build-arg DOCKERF_CONTEXT_FILES="docker-context-files" needs to be added in "prod build" command
      --cache:max should be added also in the CI image (because it is multi-segment image now)
   
   
   


-- 
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: commits-unsubscribe@airflow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [airflow] potiuk commented on pull request #22492: Converts Dockerfiles to be standalone

Posted by GitBox <gi...@apache.org>.
potiuk commented on pull request #22492:
URL: https://github.com/apache/airflow/pull/22492#issuecomment-1078254622


   Green :) 


-- 
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: commits-unsubscribe@airflow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [airflow] potiuk commented on pull request #22492: Converts Dockerfiles to be standalone

Posted by GitBox <gi...@apache.org>.
potiuk commented on pull request #22492:
URL: https://github.com/apache/airflow/pull/22492#issuecomment-1079960228


   I'd love to get that one and #22225  in order to:
   
   a) speed up all PRs by 10 minutes (cache)
   b) make main succeed back (now all main builds are timing out on trying to build arm images with emulation.


-- 
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: commits-unsubscribe@airflow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [airflow] potiuk commented on a change in pull request #22492: Converts Dockerfiles to be standalone

Posted by GitBox <gi...@apache.org>.
potiuk commented on a change in pull request #22492:
URL: https://github.com/apache/airflow/pull/22492#discussion_r833585998



##########
File path: docs/docker-stack/docker-examples/customizing/own-requirements.sh
##########
@@ -0,0 +1,42 @@
+#!/usr/bin/env bash
+# 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.
+
+# This is an example docker build script. It is not intended for PRODUCTION use
+set -euo pipefail
+AIRFLOW_SOURCES="$(cd "$(dirname "${BASH_SOURCE[0]}")/../../../../" && pwd)"
+TEMP_DOCKER_DIR=$(mktemp -d)
+pushd "${TEMP_DOCKER_DIR}"
+
+cp "${AIRFLOW_SOURCES}/Dockerfile" "${TEMP_DOCKER_DIR}"
+# [START build]
+mkdir -p docker-context-files
+
+cat <<EOF >./docker-context-files/requirements.txt

Review comment:
       This has been a popular request. Now, with the inlined Dockerfile, you can just create folder, drop your `requirements.txt` in  and run `docker build . --build-arg DOCKER_CONTEXT_FILES=docker-context-files` to get super-optimized image with your own requirements.
   
   And you can choose different folder too. It does not have to be `docker-context-files`. It could be `.` as well.




-- 
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: commits-unsubscribe@airflow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [airflow] potiuk commented on a change in pull request #22492: Converts Dockerfiles to be standalone

Posted by GitBox <gi...@apache.org>.
potiuk commented on a change in pull request #22492:
URL: https://github.com/apache/airflow/pull/22492#discussion_r833585998



##########
File path: docs/docker-stack/docker-examples/customizing/own-requirements.sh
##########
@@ -0,0 +1,42 @@
+#!/usr/bin/env bash
+# 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.
+
+# This is an example docker build script. It is not intended for PRODUCTION use
+set -euo pipefail
+AIRFLOW_SOURCES="$(cd "$(dirname "${BASH_SOURCE[0]}")/../../../../" && pwd)"
+TEMP_DOCKER_DIR=$(mktemp -d)
+pushd "${TEMP_DOCKER_DIR}"
+
+cp "${AIRFLOW_SOURCES}/Dockerfile" "${TEMP_DOCKER_DIR}"
+# [START build]
+mkdir -p docker-context-files
+
+cat <<EOF >./docker-context-files/requirements.txt

Review comment:
       This has been a popular request. Now, with the inlined Dockerfile, you can just create folder, drop your `requirements.txt in  and run `docker build . --build-arg DOCKER_CONTEXT_FILES=docker-context-files`` to get super-optimized image with your own requirements.




-- 
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: commits-unsubscribe@airflow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [airflow] potiuk commented on a change in pull request #22492: Converts Dockerfiles to be standalone

Posted by GitBox <gi...@apache.org>.
potiuk commented on a change in pull request #22492:
URL: https://github.com/apache/airflow/pull/22492#discussion_r834018556



##########
File path: scripts/ci/pre_commit/pre_commit_inline_scripts_in_docker.py
##########
@@ -0,0 +1,59 @@
+#!/usr/bin/env python3
+# 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.
+from os import listdir
+from pathlib import Path
+from typing import List
+
+AIRFLOW_SOURCES_DIR = Path(__file__).parent.parent.parent.parent
+
+
+def insert_content(file_path: Path, content: List[str], header: str, footer: str, file_name: str):
+    text = file_path.read_text().splitlines(keepends=True)
+    replacing = False
+    result: List[str] = []
+    for line in text:
+        if line.startswith(f"{header}{file_name}"):
+            replacing = True
+            result.append(line)
+            result += content
+        if line.startswith(footer):
+            replacing = False
+        if not replacing:
+            result.append(line)
+        file_path.write_text("".join(result))
+
+
+if __name__ == '__main__':
+    DOCKERFILE_FILE = AIRFLOW_SOURCES_DIR / 'Dockerfile'
+    DOCKERFILE_CI_FILE = AIRFLOW_SOURCES_DIR / 'Dockerfile.ci'
+    SCRIPTS_DOCKER_DIR = AIRFLOW_SOURCES_DIR / 'scripts' / 'docker'
+
+    for file in [DOCKERFILE_FILE, DOCKERFILE_CI_FILE]:
+        for script in listdir(SCRIPTS_DOCKER_DIR):
+            script_content = (SCRIPTS_DOCKER_DIR / script).read_text().splitlines(keepends=True)
+            no_comments_script_content = [
+                line for line in script_content if not line.startswith("#") or line.startswith("#!")

Review comment:
       I started discussion in https://lists.apache.org/thread/jjhfk95ch12qskynlvxqzd9n77o7152r




-- 
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: commits-unsubscribe@airflow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [airflow] potiuk commented on pull request #22492: Converts Dockerfiles to be standalone

Posted by GitBox <gi...@apache.org>.
potiuk commented on pull request #22492:
URL: https://github.com/apache/airflow/pull/22492#issuecomment-1077919122


   Now it shoudl be **REALLY** Green :)


-- 
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: commits-unsubscribe@airflow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [airflow] mik-laj commented on a change in pull request #22492: Converts Dockerfiles to be standalone

Posted by GitBox <gi...@apache.org>.
mik-laj commented on a change in pull request #22492:
URL: https://github.com/apache/airflow/pull/22492#discussion_r833992458



##########
File path: docs/docker-stack/changelog.rst
##########
@@ -0,0 +1,174 @@
+ .. 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.
+
+Dockerfile Changelog
+====================
+
+he ``Dockerfile`` does not strictly follow the `SemVer <https://semver.org/>`_ approach of

Review comment:
       ```suggestion
   The ``Dockerfile`` does not strictly follow the `SemVer <https://semver.org/>`_ approach of
   ```




-- 
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: commits-unsubscribe@airflow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [airflow] potiuk commented on pull request #22492: Converts Dockerfiles to be standalone

Posted by GitBox <gi...@apache.org>.
potiuk commented on pull request #22492:
URL: https://github.com/apache/airflow/pull/22492#issuecomment-1076868721


   We need to merge #22492 in order to get this PR green. I've added a better error messaging for that case (the build shoudl fail now with a better error message).


-- 
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: commits-unsubscribe@airflow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [airflow] Bowrna edited a comment on pull request #22492: Converts Dockerfiles to be standalone

Posted by GitBox <gi...@apache.org>.
Bowrna edited a comment on pull request #22492:
URL: https://github.com/apache/airflow/pull/22492#issuecomment-1077487594


   @potiuk Could you explain to me(or point to docs) how inlining the script will remove the permission problem? thank you


-- 
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: commits-unsubscribe@airflow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [airflow] potiuk commented on pull request #22492: Converts Dockerfiles to be standalone

Posted by GitBox <gi...@apache.org>.
potiuk commented on pull request #22492:
URL: https://github.com/apache/airflow/pull/22492#issuecomment-1077513722


   When scripts are inlined, they are created by the docker engine COPY <<"EOF" does it.  This means that they are created with the default permissions of the engine (always the same in all engines). 
   
   When the files were copied from the host (originally) permissions were copied from whatever was in the host. And this depended on umask setting in the host (and potentially on git configuration during the checkout). Practically, you could either have g+ or g- depending if your umask was 0002 or 0022 (those are most typical umask settings out there). 
   
   Additionally there was another problem on Windows. When you check out code on windows filesystem, you also loose executable bit. This we handled by explicitly adding +x when needed. In case of inlining we would have to so it anyway (for example you can see we do it for 'pip' inlined in Docker file).


-- 
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: commits-unsubscribe@airflow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [airflow] jedcunningham commented on a change in pull request #22492: Converts Dockerfiles to be standalone

Posted by GitBox <gi...@apache.org>.
jedcunningham commented on a change in pull request #22492:
URL: https://github.com/apache/airflow/pull/22492#discussion_r833767053



##########
File path: docs/docker-stack/build.rst
##########
@@ -345,6 +351,44 @@ The following example adds ``test_dag.py`` to your image in the ``/opt/airflow/d
 Customizing the image
 ---------------------
 
+.. warning::
+    BREAKING CHANGE! As of Airflow 2.3.0 you need to use
+    `Buildkit <https://docs.docker.com/develop/develop-images/build_enhancements/>`_ to build customized
+    Airflow Docker image. We are using new features of Building (and ``dockerfile:1.4`` syntax)
+    to make our image faster to build and ``standalone`` - i.e. not needing any extra files from
+    Airflow in order to be build. As of Airflow 2.3.0, the ``Dockerfile`` that is released with Airflow
+    does not need any extra folders or files and can be copied and used from any folder.
+    Previously you needed to copy Airflow sources together with the Dockerfile as some scripts were
+    needed to make it works. You also need to use ``DOCKER_CONTEXT_FILES`` build arg if you want to
+    use your own custom files during the build (see
+    :ref:`Using docker context files <using-docker-context-files>` for details)
+
+.. note::
+    You can usually use the latest ``Dockerfile`` released by Airflow to build previous Airflow versions.
+    Note however, that there are slight changes in the Dockerfile and entrypoint scripts that can make it
+    behaves slightly differently, depending which Dockerfile version you used. Details of what has changed
+    in each of the released versions of Docker image can be found in the :doc:`Changelog <changelog>`.
+
+Prerequisites for building customized docker image:
+
+* You need to enable `Buildkit <https://docs.docker.com/develop/develop-images/build_enhancements/>`_ to
+  build the image. This can be done by setting ``DOCKER_BUILDKIT=1`` as an environment variable
+  or by installing `the buildx plugin <https://docs.docker.com/buildx/working-with-buildx/>`_
+  and running ``docker buildx build`` command.
+
+* You need to have a new Docker installed to handle ``1.4`` syntax of the Dockerfile.
+  Docker version ``20.10.7`` and above is known to work.
+
+Before attempting to customize the image, you need to download flexible and customizable ``Airflow Dockerfile``
+You can extract the officially released version of the Dockerfile from the
+`released sources <https://airflow.apache.org/docs/apache-airflow/stable/installation/installing-from-sources.html>`_
+You can also conveniently download the latest released version
+`from GitHub <https://raw.githubusercontent.com/apache/airflow/|version|/Dockerfile>`_. You can save it
+in any directory - there is no need for any other files to be present there. If you wish to use your own
+files (for example custom configuration of ``pip`` or your own ``requirements`` or custom dependencies,
+you need to use ``DOCKER_CONTEXT_FILES`` build arg and place the files in the directory pointed at by
+the arg (see :ref:`Using docker context files <using-docker-context-files>` for details)

Review comment:
       ```suggestion
   the arg (see :ref:`Using docker context files <using-docker-context-files>` for details).
   ```

##########
File path: docs/docker-stack/build.rst
##########
@@ -345,6 +351,44 @@ The following example adds ``test_dag.py`` to your image in the ``/opt/airflow/d
 Customizing the image
 ---------------------
 
+.. warning::
+    BREAKING CHANGE! As of Airflow 2.3.0 you need to use
+    `Buildkit <https://docs.docker.com/develop/develop-images/build_enhancements/>`_ to build customized
+    Airflow Docker image. We are using new features of Building (and ``dockerfile:1.4`` syntax)
+    to make our image faster to build and ``standalone`` - i.e. not needing any extra files from
+    Airflow in order to be build. As of Airflow 2.3.0, the ``Dockerfile`` that is released with Airflow
+    does not need any extra folders or files and can be copied and used from any folder.
+    Previously you needed to copy Airflow sources together with the Dockerfile as some scripts were
+    needed to make it works. You also need to use ``DOCKER_CONTEXT_FILES`` build arg if you want to
+    use your own custom files during the build (see
+    :ref:`Using docker context files <using-docker-context-files>` for details)

Review comment:
       ```suggestion
       :ref:`Using docker context files <using-docker-context-files>` for details).
   ```

##########
File path: docs/docker-stack/changelog.rst
##########
@@ -0,0 +1,174 @@
+ .. 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.
+
+Dockerfile Changelog
+====================
+
+he ``Dockerfile`` does not strictly follow the `SemVer <https://semver.org/>`_ approach of

Review comment:
       ```suggestion
   The ``Dockerfile`` does not strictly follow the `SemVer <https://semver.org/>`_ approach of
   ```

##########
File path: docs/docker-stack/changelog.rst
##########
@@ -0,0 +1,174 @@
+ .. 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.
+
+Dockerfile Changelog
+====================
+
+he ``Dockerfile`` does not strictly follow the `SemVer <https://semver.org/>`_ approach of
+Apache Airflow when it comes to features and backwards compatibility. While Airflow code strictly
+follows it, the ``Dockerfile`` is really a way to conveniently package Airflow using standard container
+approach, occasionally there are some changes in the building process or in the entrypoint of the image
+that require slight adaptation.
+
+The Changelog below describes the changes introduced in each version of the docker images released by

Review comment:
       ```suggestion
   The changelog below describes the changes introduced in each version of the docker images released by
   ```

##########
File path: docs/docker-stack/build.rst
##########
@@ -428,6 +469,57 @@ right version of python base image:
 * ``--build-arg PYTHON_BASE_IMAGE="python:3.7-slim-buster`` uses buster version of Debian (Debian 10)
 * ``--build-arg PYTHON_BASE_IMAGE="python:3.7-slim-bullseye`` uses bullseye version of Debian (Debian 11)
 
+.. _using-docker-context-files:
+
+Using docker-context-files
+--------------------------
+
+When customizing the image, you can optionally make Airflow install custom binaries or provider custom
+configuration for your pip in ``docker-context-files``. In order to enable it, you need to add
+``--build-arg DOCKER_CONTEXT_FILES=docker-context-files`` build arg when you build the image.
+You can pass any subdirectory of your docker context, it will always be mapped to ``/docker-context-files``
+during the build.
+
+You can use ``docker-context-files`` for the following purposes:
+
+* you can place ``requirements.txt`` in the ``docker-context-file`` and additional ``pip`` packages
+  specified there will be installed during the build.
+
+* you can place ``pip.conf`` and ``.piprc`` in the ``docker-context-files`` folder and they will be used
+  for all ``pip`` commands (for example you can configure your own sources or authentication mechanisms)
+
+* you can place .whl packages that you downloaded and install them with ``INSTALL_DOCKER_CONTEXT_FILES`` set
+  to ``true`` ( see: :ref:`image-build-secure-environments`). It's useful if you build the image in
+  restricted security environments
+
+Example command on how you can use the ``docker-context-files`` to add your own dependencies from the
+``requirements.txt``:
+
+.. exampleinclude:: docker-examples/customizing/own-requirements.sh
+    :language: bash
+    :start-after: [START build]
+    :end-before: [END build]
+
+.. note::
+  You can also pass ``--build-arg DOCKER_CONTEXT_FILES=.`` if you want to place your ``requirements.txt``
+  in main directory without creating a dedicated folder, however this is a good practice to keep any files
+  that you copy to the image context in a sub-folder. This makes it easier to separate things that
+  are used on the host from those that are passed to the Docker. Of course, by default when you run
+  ``docker build .`` the whole folder is available as "Docker build context" and sent to the docker
+  engine, but the ``DOCKER_CONTEXT_FILES`` are always copied to the ``build`` segment of the image so
+  copying all your local folder might unnecessarily increase time needed to build the image and your
+  cache will be invalidated every time any of the files in your local folder change.
+
+.. warning::
+  BREAKING CHANGE! As of Airflow 2.3.0 you need to specify additional flag:
+  ``--build-arg DOCKER_CONTEXT_Files=docker-context-files`` in order to use the files placed
+  in ``docker-context-files``. Previously that switch was not needed. Unfortunately this change is needed
+  in order to enable ``Dockerfile`` as standalone Dockerfile without any extra files. As of Airflow 2.3.0
+  the ``Dockerfile`` that is released with Airflow does not need any extra folders or files and can
+  be copied and used from any folder. Previously you needed to copy Airflow sources together with the
+  Dockerfile as some scripts were needed to make it works. With Airflow 2.3.0, we are using ``Buildkit``

Review comment:
       ```suggestion
     Dockerfile as some scripts were needed to make it work. With Airflow 2.3.0, we are using ``Buildkit``
   ```

##########
File path: docs/docker-stack/changelog.rst
##########
@@ -0,0 +1,174 @@
+ .. 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.
+
+Dockerfile Changelog
+====================
+
+he ``Dockerfile`` does not strictly follow the `SemVer <https://semver.org/>`_ approach of
+Apache Airflow when it comes to features and backwards compatibility. While Airflow code strictly
+follows it, the ``Dockerfile`` is really a way to conveniently package Airflow using standard container
+approach, occasionally there are some changes in the building process or in the entrypoint of the image
+that require slight adaptation.
+
+The Changelog below describes the changes introduced in each version of the docker images released by
+the Airflow team.
+
+:note: The changelog below concerns only the convenience production images released at
+       `Airflow DockerHub <https://hub.docker.com/r/apache/airflow>`_ . The images that are released
+       There are usually built using the ``Dockerfile`` released together with Airflow. However You are
+       free to take latest released ``Dockerfile`` from Airflow and use it to build an image for
+       any Airflow version from ``Airflow 2`` line. There is no guarantee that it works, but if it does
+       then you can use latest features from that image to build the previous Airflow versions.
+
+:warning: Some of the images below (as noted in the Changelog) have been regenerated using newer
+       ``Dockerfiles``. This happens when there is a breaking change that invalidates already released images
+       and the images need regeneration. This has happened already when MySQL changed the keys they
+       used to release their packages: `Issue here <https://github.com/apache/airflow/issues/20911>`_
+       and 2.1 images are all regenerated using the 2.2 ``Dockerfile``. This is a rare event and
+       we do it only when we have no choice because of external factors. In such case, newer version of

Review comment:
       ```suggestion
          we do it only when we have no choice because of external factors. In such case, the newer version of
   ```

##########
File path: docs/docker-stack/build.rst
##########
@@ -428,6 +469,57 @@ right version of python base image:
 * ``--build-arg PYTHON_BASE_IMAGE="python:3.7-slim-buster`` uses buster version of Debian (Debian 10)
 * ``--build-arg PYTHON_BASE_IMAGE="python:3.7-slim-bullseye`` uses bullseye version of Debian (Debian 11)
 
+.. _using-docker-context-files:
+
+Using docker-context-files
+--------------------------
+
+When customizing the image, you can optionally make Airflow install custom binaries or provider custom
+configuration for your pip in ``docker-context-files``. In order to enable it, you need to add
+``--build-arg DOCKER_CONTEXT_FILES=docker-context-files`` build arg when you build the image.
+You can pass any subdirectory of your docker context, it will always be mapped to ``/docker-context-files``
+during the build.
+
+You can use ``docker-context-files`` for the following purposes:
+
+* you can place ``requirements.txt`` in the ``docker-context-file`` and additional ``pip`` packages

Review comment:
       ```suggestion
   * you can place ``requirements.txt`` in the ``docker-context-file`` folder and any additional ``pip`` packages
   ```

##########
File path: docs/docker-stack/build.rst
##########
@@ -345,6 +351,44 @@ The following example adds ``test_dag.py`` to your image in the ``/opt/airflow/d
 Customizing the image
 ---------------------
 
+.. warning::
+    BREAKING CHANGE! As of Airflow 2.3.0 you need to use
+    `Buildkit <https://docs.docker.com/develop/develop-images/build_enhancements/>`_ to build customized
+    Airflow Docker image. We are using new features of Building (and ``dockerfile:1.4`` syntax)
+    to make our image faster to build and ``standalone`` - i.e. not needing any extra files from

Review comment:
       ```suggestion
       to make our image faster to build and "standalone" - i.e. not needing any extra files from
   ```

##########
File path: docs/docker-stack/build.rst
##########
@@ -428,6 +469,57 @@ right version of python base image:
 * ``--build-arg PYTHON_BASE_IMAGE="python:3.7-slim-buster`` uses buster version of Debian (Debian 10)
 * ``--build-arg PYTHON_BASE_IMAGE="python:3.7-slim-bullseye`` uses bullseye version of Debian (Debian 11)
 
+.. _using-docker-context-files:
+
+Using docker-context-files
+--------------------------
+
+When customizing the image, you can optionally make Airflow install custom binaries or provider custom
+configuration for your pip in ``docker-context-files``. In order to enable it, you need to add
+``--build-arg DOCKER_CONTEXT_FILES=docker-context-files`` build arg when you build the image.
+You can pass any subdirectory of your docker context, it will always be mapped to ``/docker-context-files``
+during the build.
+
+You can use ``docker-context-files`` for the following purposes:
+
+* you can place ``requirements.txt`` in the ``docker-context-file`` and additional ``pip`` packages
+  specified there will be installed during the build.
+
+* you can place ``pip.conf`` and ``.piprc`` in the ``docker-context-files`` folder and they will be used
+  for all ``pip`` commands (for example you can configure your own sources or authentication mechanisms)
+
+* you can place .whl packages that you downloaded and install them with ``INSTALL_DOCKER_CONTEXT_FILES`` set

Review comment:
       ```suggestion
   * you can place ``.whl`` packages that you downloaded and install them with ``INSTALL_DOCKER_CONTEXT_FILES`` set
   ```

##########
File path: docs/docker-stack/build.rst
##########
@@ -345,6 +351,44 @@ The following example adds ``test_dag.py`` to your image in the ``/opt/airflow/d
 Customizing the image
 ---------------------
 
+.. warning::
+    BREAKING CHANGE! As of Airflow 2.3.0 you need to use
+    `Buildkit <https://docs.docker.com/develop/develop-images/build_enhancements/>`_ to build customized
+    Airflow Docker image. We are using new features of Building (and ``dockerfile:1.4`` syntax)
+    to make our image faster to build and ``standalone`` - i.e. not needing any extra files from
+    Airflow in order to be build. As of Airflow 2.3.0, the ``Dockerfile`` that is released with Airflow
+    does not need any extra folders or files and can be copied and used from any folder.
+    Previously you needed to copy Airflow sources together with the Dockerfile as some scripts were
+    needed to make it works. You also need to use ``DOCKER_CONTEXT_FILES`` build arg if you want to
+    use your own custom files during the build (see
+    :ref:`Using docker context files <using-docker-context-files>` for details)
+
+.. note::
+    You can usually use the latest ``Dockerfile`` released by Airflow to build previous Airflow versions.
+    Note however, that there are slight changes in the Dockerfile and entrypoint scripts that can make it
+    behaves slightly differently, depending which Dockerfile version you used. Details of what has changed

Review comment:
       ```suggestion
       behave slightly differently, depending which Dockerfile version you used. Details of what has changed
   ```

##########
File path: docs/docker-stack/build.rst
##########
@@ -345,6 +351,44 @@ The following example adds ``test_dag.py`` to your image in the ``/opt/airflow/d
 Customizing the image
 ---------------------
 
+.. warning::
+    BREAKING CHANGE! As of Airflow 2.3.0 you need to use
+    `Buildkit <https://docs.docker.com/develop/develop-images/build_enhancements/>`_ to build customized
+    Airflow Docker image. We are using new features of Building (and ``dockerfile:1.4`` syntax)
+    to make our image faster to build and ``standalone`` - i.e. not needing any extra files from
+    Airflow in order to be build. As of Airflow 2.3.0, the ``Dockerfile`` that is released with Airflow
+    does not need any extra folders or files and can be copied and used from any folder.
+    Previously you needed to copy Airflow sources together with the Dockerfile as some scripts were
+    needed to make it works. You also need to use ``DOCKER_CONTEXT_FILES`` build arg if you want to
+    use your own custom files during the build (see
+    :ref:`Using docker context files <using-docker-context-files>` for details)
+
+.. note::
+    You can usually use the latest ``Dockerfile`` released by Airflow to build previous Airflow versions.
+    Note however, that there are slight changes in the Dockerfile and entrypoint scripts that can make it
+    behaves slightly differently, depending which Dockerfile version you used. Details of what has changed
+    in each of the released versions of Docker image can be found in the :doc:`Changelog <changelog>`.
+
+Prerequisites for building customized docker image:
+
+* You need to enable `Buildkit <https://docs.docker.com/develop/develop-images/build_enhancements/>`_ to
+  build the image. This can be done by setting ``DOCKER_BUILDKIT=1`` as an environment variable
+  or by installing `the buildx plugin <https://docs.docker.com/buildx/working-with-buildx/>`_
+  and running ``docker buildx build`` command.
+
+* You need to have a new Docker installed to handle ``1.4`` syntax of the Dockerfile.
+  Docker version ``20.10.7`` and above is known to work.
+
+Before attempting to customize the image, you need to download flexible and customizable ``Airflow Dockerfile``

Review comment:
       ```suggestion
   Before attempting to customize the image, you need to download the flexible and customizable Airflow ``Dockerfile``.
   ```

##########
File path: docs/docker-stack/build.rst
##########
@@ -345,6 +351,44 @@ The following example adds ``test_dag.py`` to your image in the ``/opt/airflow/d
 Customizing the image
 ---------------------
 
+.. warning::
+    BREAKING CHANGE! As of Airflow 2.3.0 you need to use
+    `Buildkit <https://docs.docker.com/develop/develop-images/build_enhancements/>`_ to build customized
+    Airflow Docker image. We are using new features of Building (and ``dockerfile:1.4`` syntax)
+    to make our image faster to build and ``standalone`` - i.e. not needing any extra files from
+    Airflow in order to be build. As of Airflow 2.3.0, the ``Dockerfile`` that is released with Airflow
+    does not need any extra folders or files and can be copied and used from any folder.
+    Previously you needed to copy Airflow sources together with the Dockerfile as some scripts were
+    needed to make it works. You also need to use ``DOCKER_CONTEXT_FILES`` build arg if you want to
+    use your own custom files during the build (see
+    :ref:`Using docker context files <using-docker-context-files>` for details)
+
+.. note::
+    You can usually use the latest ``Dockerfile`` released by Airflow to build previous Airflow versions.
+    Note however, that there are slight changes in the Dockerfile and entrypoint scripts that can make it
+    behaves slightly differently, depending which Dockerfile version you used. Details of what has changed
+    in each of the released versions of Docker image can be found in the :doc:`Changelog <changelog>`.
+
+Prerequisites for building customized docker image:
+
+* You need to enable `Buildkit <https://docs.docker.com/develop/develop-images/build_enhancements/>`_ to
+  build the image. This can be done by setting ``DOCKER_BUILDKIT=1`` as an environment variable
+  or by installing `the buildx plugin <https://docs.docker.com/buildx/working-with-buildx/>`_
+  and running ``docker buildx build`` command.
+
+* You need to have a new Docker installed to handle ``1.4`` syntax of the Dockerfile.
+  Docker version ``20.10.7`` and above is known to work.
+
+Before attempting to customize the image, you need to download flexible and customizable ``Airflow Dockerfile``
+You can extract the officially released version of the Dockerfile from the
+`released sources <https://airflow.apache.org/docs/apache-airflow/stable/installation/installing-from-sources.html>`_

Review comment:
       ```suggestion
   `released sources <https://airflow.apache.org/docs/apache-airflow/stable/installation/installing-from-sources.html>`_.
   ```

##########
File path: docs/docker-stack/changelog.rst
##########
@@ -0,0 +1,174 @@
+ .. 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.
+
+Dockerfile Changelog
+====================
+
+he ``Dockerfile`` does not strictly follow the `SemVer <https://semver.org/>`_ approach of
+Apache Airflow when it comes to features and backwards compatibility. While Airflow code strictly
+follows it, the ``Dockerfile`` is really a way to conveniently package Airflow using standard container
+approach, occasionally there are some changes in the building process or in the entrypoint of the image

Review comment:
       ```suggestion
   approach, so occasionally there are some changes in the building process or in the entrypoint of the image
   ```

##########
File path: docs/docker-stack/changelog.rst
##########
@@ -0,0 +1,174 @@
+ .. 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.
+
+Dockerfile Changelog
+====================
+
+he ``Dockerfile`` does not strictly follow the `SemVer <https://semver.org/>`_ approach of
+Apache Airflow when it comes to features and backwards compatibility. While Airflow code strictly
+follows it, the ``Dockerfile`` is really a way to conveniently package Airflow using standard container

Review comment:
       ```suggestion
   follows it, the ``Dockerfile`` is really a way to conveniently packaged Airflow using standard container
   ```

##########
File path: docs/docker-stack/build.rst
##########
@@ -428,6 +469,57 @@ right version of python base image:
 * ``--build-arg PYTHON_BASE_IMAGE="python:3.7-slim-buster`` uses buster version of Debian (Debian 10)
 * ``--build-arg PYTHON_BASE_IMAGE="python:3.7-slim-bullseye`` uses bullseye version of Debian (Debian 11)
 
+.. _using-docker-context-files:
+
+Using docker-context-files
+--------------------------
+
+When customizing the image, you can optionally make Airflow install custom binaries or provider custom

Review comment:
       ```suggestion
   When customizing the image, you can optionally make Airflow install custom binaries or provide custom
   ```

##########
File path: docs/docker-stack/changelog.rst
##########
@@ -0,0 +1,174 @@
+ .. 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.
+
+Dockerfile Changelog
+====================
+
+he ``Dockerfile`` does not strictly follow the `SemVer <https://semver.org/>`_ approach of
+Apache Airflow when it comes to features and backwards compatibility. While Airflow code strictly
+follows it, the ``Dockerfile`` is really a way to conveniently package Airflow using standard container
+approach, occasionally there are some changes in the building process or in the entrypoint of the image
+that require slight adaptation.
+
+The Changelog below describes the changes introduced in each version of the docker images released by
+the Airflow team.
+
+:note: The changelog below concerns only the convenience production images released at
+       `Airflow DockerHub <https://hub.docker.com/r/apache/airflow>`_ . The images that are released
+       There are usually built using the ``Dockerfile`` released together with Airflow. However You are

Review comment:
       ```suggestion
          there are usually built using the ``Dockerfile`` released together with Airflow. However you are
   ```

##########
File path: docs/docker-stack/build.rst
##########
@@ -345,6 +351,44 @@ The following example adds ``test_dag.py`` to your image in the ``/opt/airflow/d
 Customizing the image
 ---------------------
 
+.. warning::
+    BREAKING CHANGE! As of Airflow 2.3.0 you need to use
+    `Buildkit <https://docs.docker.com/develop/develop-images/build_enhancements/>`_ to build customized
+    Airflow Docker image. We are using new features of Building (and ``dockerfile:1.4`` syntax)
+    to make our image faster to build and ``standalone`` - i.e. not needing any extra files from
+    Airflow in order to be build. As of Airflow 2.3.0, the ``Dockerfile`` that is released with Airflow
+    does not need any extra folders or files and can be copied and used from any folder.
+    Previously you needed to copy Airflow sources together with the Dockerfile as some scripts were
+    needed to make it works. You also need to use ``DOCKER_CONTEXT_FILES`` build arg if you want to

Review comment:
       ```suggestion
       needed to make it work. You also need to use ``DOCKER_CONTEXT_FILES`` build arg if you want to
   ```

##########
File path: docs/docker-stack/changelog.rst
##########
@@ -0,0 +1,174 @@
+ .. 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.
+
+Dockerfile Changelog
+====================
+
+he ``Dockerfile`` does not strictly follow the `SemVer <https://semver.org/>`_ approach of
+Apache Airflow when it comes to features and backwards compatibility. While Airflow code strictly
+follows it, the ``Dockerfile`` is really a way to conveniently package Airflow using standard container
+approach, occasionally there are some changes in the building process or in the entrypoint of the image
+that require slight adaptation.
+
+The Changelog below describes the changes introduced in each version of the docker images released by
+the Airflow team.
+
+:note: The changelog below concerns only the convenience production images released at
+       `Airflow DockerHub <https://hub.docker.com/r/apache/airflow>`_ . The images that are released
+       There are usually built using the ``Dockerfile`` released together with Airflow. However You are
+       free to take latest released ``Dockerfile`` from Airflow and use it to build an image for
+       any Airflow version from ``Airflow 2`` line. There is no guarantee that it works, but if it does
+       then you can use latest features from that image to build the previous Airflow versions.
+
+:warning: Some of the images below (as noted in the Changelog) have been regenerated using newer

Review comment:
       ```suggestion
   :warning: Some of the images below (as noted in the changelog) have been regenerated using newer
   ```

##########
File path: docs/docker-stack/build.rst
##########
@@ -428,6 +469,57 @@ right version of python base image:
 * ``--build-arg PYTHON_BASE_IMAGE="python:3.7-slim-buster`` uses buster version of Debian (Debian 10)
 * ``--build-arg PYTHON_BASE_IMAGE="python:3.7-slim-bullseye`` uses bullseye version of Debian (Debian 11)
 
+.. _using-docker-context-files:
+
+Using docker-context-files
+--------------------------
+
+When customizing the image, you can optionally make Airflow install custom binaries or provider custom
+configuration for your pip in ``docker-context-files``. In order to enable it, you need to add
+``--build-arg DOCKER_CONTEXT_FILES=docker-context-files`` build arg when you build the image.
+You can pass any subdirectory of your docker context, it will always be mapped to ``/docker-context-files``
+during the build.
+
+You can use ``docker-context-files`` for the following purposes:
+
+* you can place ``requirements.txt`` in the ``docker-context-file`` and additional ``pip`` packages
+  specified there will be installed during the build.
+
+* you can place ``pip.conf`` and ``.piprc`` in the ``docker-context-files`` folder and they will be used
+  for all ``pip`` commands (for example you can configure your own sources or authentication mechanisms)
+
+* you can place .whl packages that you downloaded and install them with ``INSTALL_DOCKER_CONTEXT_FILES`` set
+  to ``true`` ( see: :ref:`image-build-secure-environments`). It's useful if you build the image in
+  restricted security environments
+
+Example command on how you can use the ``docker-context-files`` to add your own dependencies from the
+``requirements.txt``:
+
+.. exampleinclude:: docker-examples/customizing/own-requirements.sh
+    :language: bash
+    :start-after: [START build]
+    :end-before: [END build]
+
+.. note::
+  You can also pass ``--build-arg DOCKER_CONTEXT_FILES=.`` if you want to place your ``requirements.txt``
+  in main directory without creating a dedicated folder, however this is a good practice to keep any files
+  that you copy to the image context in a sub-folder. This makes it easier to separate things that
+  are used on the host from those that are passed to the Docker. Of course, by default when you run

Review comment:
       ```suggestion
     are used on the host from those that are passed in Docker context. Of course, by default when you run
   ```

##########
File path: docs/docker-stack/changelog.rst
##########
@@ -0,0 +1,174 @@
+ .. 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.
+
+Dockerfile Changelog
+====================
+
+he ``Dockerfile`` does not strictly follow the `SemVer <https://semver.org/>`_ approach of
+Apache Airflow when it comes to features and backwards compatibility. While Airflow code strictly
+follows it, the ``Dockerfile`` is really a way to conveniently package Airflow using standard container
+approach, occasionally there are some changes in the building process or in the entrypoint of the image
+that require slight adaptation.
+
+The Changelog below describes the changes introduced in each version of the docker images released by
+the Airflow team.
+
+:note: The changelog below concerns only the convenience production images released at
+       `Airflow DockerHub <https://hub.docker.com/r/apache/airflow>`_ . The images that are released
+       There are usually built using the ``Dockerfile`` released together with Airflow. However You are
+       free to take latest released ``Dockerfile`` from Airflow and use it to build an image for
+       any Airflow version from ``Airflow 2`` line. There is no guarantee that it works, but if it does

Review comment:
       ```suggestion
          any Airflow version from the ``Airflow 2`` line. There is no guarantee that it works, but if it does
   ```

##########
File path: docs/docker-stack/changelog.rst
##########
@@ -0,0 +1,174 @@
+ .. 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.
+
+Dockerfile Changelog
+====================
+
+he ``Dockerfile`` does not strictly follow the `SemVer <https://semver.org/>`_ approach of
+Apache Airflow when it comes to features and backwards compatibility. While Airflow code strictly
+follows it, the ``Dockerfile`` is really a way to conveniently package Airflow using standard container
+approach, occasionally there are some changes in the building process or in the entrypoint of the image
+that require slight adaptation.
+
+The Changelog below describes the changes introduced in each version of the docker images released by
+the Airflow team.
+
+:note: The changelog below concerns only the convenience production images released at
+       `Airflow DockerHub <https://hub.docker.com/r/apache/airflow>`_ . The images that are released
+       There are usually built using the ``Dockerfile`` released together with Airflow. However You are
+       free to take latest released ``Dockerfile`` from Airflow and use it to build an image for
+       any Airflow version from ``Airflow 2`` line. There is no guarantee that it works, but if it does
+       then you can use latest features from that image to build the previous Airflow versions.
+
+:warning: Some of the images below (as noted in the Changelog) have been regenerated using newer
+       ``Dockerfiles``. This happens when there is a breaking change that invalidates already released images
+       and the images need regeneration. This has happened already when MySQL changed the keys they
+       used to release their packages: `Issue here <https://github.com/apache/airflow/issues/20911>`_
+       and 2.1 images are all regenerated using the 2.2 ``Dockerfile``. This is a rare event and

Review comment:
       ```suggestion
          and 2.1 images were all regenerated using the 2.2 ``Dockerfile``. This is a rare event and
   ```

##########
File path: docs/docker-stack/changelog.rst
##########
@@ -0,0 +1,174 @@
+ .. 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.
+
+Dockerfile Changelog
+====================
+
+he ``Dockerfile`` does not strictly follow the `SemVer <https://semver.org/>`_ approach of
+Apache Airflow when it comes to features and backwards compatibility. While Airflow code strictly
+follows it, the ``Dockerfile`` is really a way to conveniently package Airflow using standard container
+approach, occasionally there are some changes in the building process or in the entrypoint of the image
+that require slight adaptation.
+
+The Changelog below describes the changes introduced in each version of the docker images released by
+the Airflow team.
+
+:note: The changelog below concerns only the convenience production images released at
+       `Airflow DockerHub <https://hub.docker.com/r/apache/airflow>`_ . The images that are released
+       There are usually built using the ``Dockerfile`` released together with Airflow. However You are
+       free to take latest released ``Dockerfile`` from Airflow and use it to build an image for
+       any Airflow version from ``Airflow 2`` line. There is no guarantee that it works, but if it does
+       then you can use latest features from that image to build the previous Airflow versions.
+
+:warning: Some of the images below (as noted in the Changelog) have been regenerated using newer
+       ``Dockerfiles``. This happens when there is a breaking change that invalidates already released images
+       and the images need regeneration. This has happened already when MySQL changed the keys they
+       used to release their packages: `Issue here <https://github.com/apache/airflow/issues/20911>`_

Review comment:
       ```suggestion
          used to release their packages (`#20911 <https://github.com/apache/airflow/issues/20911>`_)
   ```




-- 
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: commits-unsubscribe@airflow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [airflow] potiuk commented on pull request #22492: Converts Dockerfiles to be standalone

Posted by GitBox <gi...@apache.org>.
potiuk commented on pull request #22492:
URL: https://github.com/apache/airflow/pull/22492#issuecomment-1077317639


   All language corrections by @jedcunningham fixed :). Also I think all the "checks" shoudl be fix and the build should succeed this time.


-- 
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: commits-unsubscribe@airflow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [airflow] potiuk commented on a change in pull request #22492: Converts Dockerfiles to be standalone

Posted by GitBox <gi...@apache.org>.
potiuk commented on a change in pull request #22492:
URL: https://github.com/apache/airflow/pull/22492#discussion_r833585998



##########
File path: docs/docker-stack/docker-examples/customizing/own-requirements.sh
##########
@@ -0,0 +1,42 @@
+#!/usr/bin/env bash
+# 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.
+
+# This is an example docker build script. It is not intended for PRODUCTION use
+set -euo pipefail
+AIRFLOW_SOURCES="$(cd "$(dirname "${BASH_SOURCE[0]}")/../../../../" && pwd)"
+TEMP_DOCKER_DIR=$(mktemp -d)
+pushd "${TEMP_DOCKER_DIR}"
+
+cp "${AIRFLOW_SOURCES}/Dockerfile" "${TEMP_DOCKER_DIR}"
+# [START build]
+mkdir -p docker-context-files
+
+cat <<EOF >./docker-context-files/requirements.txt

Review comment:
       This has been a popular request. Now, with the inlined Dockerfile, you can just create folder, drop your `requirements.txt` in  and run `docker build . --build-arg DOCKER_CONTEXT_FILES=docker-context-files` to get super-optimized image with your own requirements.




-- 
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: commits-unsubscribe@airflow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [airflow] potiuk commented on a change in pull request #22492: Converts Dockerfiles to be standalone

Posted by GitBox <gi...@apache.org>.
potiuk commented on a change in pull request #22492:
URL: https://github.com/apache/airflow/pull/22492#discussion_r833588595



##########
File path: scripts/ci/libraries/_build_images.sh
##########
@@ -447,7 +446,7 @@ function build_images::build_ci_image() {
         # we need to login to docker registry so that we can push cache there
         build_images::login_to_docker_registry
         docker_ci_directive+=(
-            "--cache-to=type=registry,ref=${AIRFLOW_CI_IMAGE}:cache"
+            "--cache-to=type=registry,ref=${AIRFLOW_CI_IMAGE}:cache,mode=max"

Review comment:
       @Bowrna  and that too.




-- 
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: commits-unsubscribe@airflow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [airflow] potiuk commented on pull request #22492: Converts Dockerfiles to be standalone

Posted by GitBox <gi...@apache.org>.
potiuk commented on pull request #22492:
URL: https://github.com/apache/airflow/pull/22492#issuecomment-1076652433


   cc: @dstandish @kaxil @jedcunningham @mik-laj  - this one also contains something that I promised some time ago - detailed changelog for all 2.* Dockerfiles. I tried to describe in detail what was changed in which version but it might need some clarifications as I have too many assumptions on my Head. Any comments are appreciated. 


-- 
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: commits-unsubscribe@airflow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [airflow] github-actions[bot] commented on pull request #22492: Converts Dockerfiles to be standalone

Posted by GitBox <gi...@apache.org>.
github-actions[bot] commented on pull request #22492:
URL: https://github.com/apache/airflow/pull/22492#issuecomment-1079977630


   The PR most likely needs to run full matrix of tests because it modifies parts of the core of Airflow. However, committers might decide to merge it quickly and take the risk. If they don't merge it quickly - please rebase it to the latest main at your convenience, or amend the last commit of the PR, and push it with --force-with-lease.


-- 
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: commits-unsubscribe@airflow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org