Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 9 additions & 0 deletions .github/workflows/_reusable-build-images.yml
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,15 @@ jobs:
with:
python-version: ${{ inputs.python-version }}
expose-github-runtime: 'true'
- name: Set DISABLE_CACHE_TO for PRs, no need to bloat the github cache
id: set-disable-cache-to
run: |
# Only enable cache-to on master/main
if [[ "${GITHUB_REF##*/}" == "master" || "${GITHUB_REF##*/}" == "main" ]]; then
echo "DISABLE_CACHE_TO=" >> $GITHUB_ENV
else
echo "DISABLE_CACHE_TO=1" >> $GITHUB_ENV
fi
- name: build backend images
if: ${{ inputs.build-backend }}
run: |
Expand Down
8 changes: 6 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -178,6 +178,9 @@ DOCKER_BUILDX_CACHE_FROM ?= /tmp/.buildx-cache
DOCKER_BUILDX_CACHE_TO ?= /tmp/.buildx-cache
DOCKER_TARGET_PLATFORMS ?= linux/amd64
comma := ,
DISABLE_CACHE_TO ?= 0
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

DOCKER_BUILD_CACHED_TO_DISABLED ?=0




define _docker_compose_build
$(eval INCLUDED_SERVICES := $(filter-out $(exclude), $(SERVICES_NAMES_TO_BUILD))) \
Expand Down Expand Up @@ -211,8 +214,9 @@ docker buildx bake --allow=fs.read=.. \
--file docker-compose-build.yml $(if $(target),$(target),$(INCLUDED_SERVICES)) \
$(if $(findstring -nc,$@),--no-cache,\
$(foreach service, $(SERVICES_NAMES_TO_BUILD),\
--set $(service).cache-to=type=gha$(comma)mode=max$(comma)scope=$(service) \
--set $(service).cache-from=type=gha$(comma)scope=$(service)) \
$(if $(DISABLE_CACHE_TO),,\
--set $(service).cache-to=type=gha$(comma)mode=max$(comma)scope=$(service) ) \
--set $(service).cache-from=type=gha$(comma)scope=$(service)) \
) &&\
popd;
endef
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,6 @@ class ContainerExecCommandFailedError(BaseContainerUtilsError):


_HTTP_404_NOT_FOUND: Final[int] = 404

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

? :-)

_logger = logging.getLogger(__name__)


Expand Down
Loading