Skip to content

[DX-4553] Add docker build cache dance#1608

Open
kalverra wants to merge 10 commits into
mainfrom
cacheDance
Open

[DX-4553] Add docker build cache dance#1608
kalverra wants to merge 10 commits into
mainfrom
cacheDance

Conversation

@kalverra

@kalverra kalverra commented Jul 24, 2026

Copy link
Copy Markdown
Contributor

Fix --mount=type=cache

Use the buildkit-cache-dance action to properly enable caching docker layers with --mount=type=cache in CI. See Docker docs on caching for more info.

Consolidate Caching Inputs

1. Unified cache-mode Enum Preset

  • Consolidated docker-restore-cache and docker-save-cache into a single cache-mode input parameter with standard presets:
    • auto (Default): Save on push/schedule, restore on pull_request and other events.
    • read-write (or true): Force save and restore.
    • read-only: Restore cache only.
    • write-only: Save cache only.
    • off (or false): Disable GHA layer caching.

2. Auto-Inferred buildkit-cache-dance via cache-map

  • Callers no longer need to specify cache-dance: "true" explicitly. Providing a non-empty cache-map automatically enables buildkit-cache-dance.
  • cache-map added as the standard input name, with cache-dance-cache-map retained as a backward-compatible fallback alias.

@kalverra
kalverra marked this pull request as ready for review July 24, 2026 15:43
@kalverra
kalverra requested a review from a team as a code owner July 24, 2026 15:43
@kalverra
kalverra requested review from erikburt and jmank88 July 24, 2026 15:43
Comment thread actions/ctf-build-image/action.yml Outdated
Comment thread actions/ctf-build-image/scripts/test-cache-event-overrides.sh
Comment thread actions/build-push-docker/action.yml Outdated
Comment thread actions/build-push-docker/scripts/test-cache-dance-config.sh
Comment thread actions/build-push-docker/action.yml Fixed
Comment thread actions/ctf-build-image/action.yml Fixed
Comment thread actions/build-push-docker/action.yml Fixed

@erikburt erikburt left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Would like to see the /chainlink pr tested against the new changes too.

Comment on lines +139 to +148
cache-dance:
description: |
Deprecated: Explicitly enable/disable buildkit-cache-dance. If unset, cache-dance is automatically enabled when cache-map is provided.
required: false
default: ""
cache-dance-cache-map:
description: |
Deprecated alias for cache-map.
required: false
default: ""

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

These are "deprecated" but they were never released in the first place.

module="github.com/smartcontractkit/${dep}"
else
module="${dep}"
fi

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Is there a use-case for supporting arbitrary overrides, if not I think limiting it to smartcontractkit deps makes the most sense to me.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants