potiuk commented on code in PR #45314:
URL: https://github.com/apache/airflow/pull/45314#discussion_r1900218150


##########
dev/breeze/src/airflow_breeze/commands/ci_image_commands.py:
##########
@@ -981,3 +981,113 @@ def rebuild_or_pull_ci_image_if_needed(command_params: 
ShellParams | BuildCiPara
         run_build_ci_image(
             ci_image_params=ci_image_params, 
param_description=ci_image_params.python, output=None
         )
+
+
+@ci_image.command(name="export-mount-cache")
[email protected](
+    "--cache-file",
+    required=True,
+    type=click.Path(exists=False, dir_okay=False, file_okay=True, 
path_type=Path),
+    help="Path to the file where cache is going to be exported",
+)
+@option_dry_run
+@option_verbose
+def export_mount_cache(
+    cache_file: Path,
+):
+    """
+    Export content of the the mount cache to a directory.
+    """
+    perform_environment_checks()
+    dockerfile = """
+    # syntax=docker/dockerfile:1.4
+    FROM python:3.9-slim-bookworm
+    ARG TARGETARCH
+    ARG DEPENDENCY_CACHE_EPOCH="0"
+    RUN 
--mount=type=cache,id=ci-$TARGETARCH-$DEPENDENCY_CACHE_EPOCH,target=/root/.cache/
 \
+    tar -C /root/.cache/ -czf /root/.cache.tar.gz .
+    """
+
+    dockerfile_ci_content = (AIRFLOW_SOURCES_ROOT / 
"Dockerfile.ci").read_text()
+    dependency_cache_epoch = 
dockerfile_ci_content.split("DEPENDENCY_CACHE_EPOCH=")[1].split("\n")[0]

Review Comment:
   Replaced.



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

To unsubscribe, e-mail: [email protected]

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

Reply via email to