From 74a08cd82c23b6325519e280b0f0dbe6d58942a8 Mon Sep 17 00:00:00 2001 From: Gerald Pinder Date: Sat, 17 Feb 2024 14:36:19 -0500 Subject: [PATCH 1/3] feat: Make use of rpm-ostree cache After setting up the tmpfs mount for /var, rpm-ostree started to not have cache throughout the single build. This creates a cache for rpm-ostree that is tied to the specific recipe being built. This will allow subsequent builds of a recipe to be faster and not interfere with the cache of another recipe, especially if they are on different OS versions --- templates/Containerfile | 1 + 1 file changed, 1 insertion(+) diff --git a/templates/Containerfile b/templates/Containerfile index de88f455..1a0e9342 100644 --- a/templates/Containerfile +++ b/templates/Containerfile @@ -77,6 +77,7 @@ RUN \ --mount=type=bind,from=stage-config,src=/config,dst=/tmp/config,rw \ --mount=type=bind,from=stage-modules,src=/modules,dst=/tmp/modules,rw \ --mount=type=bind,from=stage-exports,src=/exports.sh,dst=/tmp/exports.sh \ + --mount=type=cache,dst=/var/cache/rpm-ostree,id=rpm-ostree-cache-{{ recipe.name }}-{{ recipe.image_version }} \ chmod +x /tmp/modules/{{ type }}/{{ type }}.sh \ && source /tmp/exports.sh && /tmp/modules/{{ type }}/{{ type }}.sh '{{ self::print_module_context(module) }}' {%- endif %} From 91e3e102e50df6979a263d597a2615a9343cea19 Mon Sep 17 00:00:00 2001 From: Gerald Pinder Date: Sat, 17 Feb 2024 15:22:57 -0500 Subject: [PATCH 2/3] Use locked sharing --- templates/Containerfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/templates/Containerfile b/templates/Containerfile index 1a0e9342..a313d6bf 100644 --- a/templates/Containerfile +++ b/templates/Containerfile @@ -77,7 +77,7 @@ RUN \ --mount=type=bind,from=stage-config,src=/config,dst=/tmp/config,rw \ --mount=type=bind,from=stage-modules,src=/modules,dst=/tmp/modules,rw \ --mount=type=bind,from=stage-exports,src=/exports.sh,dst=/tmp/exports.sh \ - --mount=type=cache,dst=/var/cache/rpm-ostree,id=rpm-ostree-cache-{{ recipe.name }}-{{ recipe.image_version }} \ + --mount=type=cache,dst=/var/cache/rpm-ostree,id=rpm-ostree-cache-{{ recipe.name }}-{{ recipe.image_version }},sharing=locked \ chmod +x /tmp/modules/{{ type }}/{{ type }}.sh \ && source /tmp/exports.sh && /tmp/modules/{{ type }}/{{ type }}.sh '{{ self::print_module_context(module) }}' {%- endif %} From 6cbd77f69725e5cfb673255d735d8f4c0d2e0400 Mon Sep 17 00:00:00 2001 From: Gerald Pinder Date: Sun, 18 Feb 2024 12:17:54 -0500 Subject: [PATCH 3/3] Fix whitespace --- templates/Containerfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/templates/Containerfile b/templates/Containerfile index 995c31a7..18d27c12 100644 --- a/templates/Containerfile +++ b/templates/Containerfile @@ -81,7 +81,7 @@ RUN \ --mount=type=bind,from=stage-modules,src=/modules,dst=/tmp/modules,rw \ {%- endif %} --mount=type=bind,from=stage-exports,src=/exports.sh,dst=/tmp/exports.sh \ - --mount=type=cache,dst=/var/cache/rpm-ostree,id=rpm-ostree-cache-{{ recipe.name }}-{{ recipe.image_version }},sharing=locked \ + --mount=type=cache,dst=/var/cache/rpm-ostree,id=rpm-ostree-cache-{{ recipe.name }}-{{ recipe.image_version }},sharing=locked \ chmod +x /tmp/modules/{{ type }}/{{ type }}.sh \ && source /tmp/exports.sh && /tmp/modules/{{ type }}/{{ type }}.sh '{{ self::print_module_context(module) }}' {%- endif %}