Skip to content

Commit 0e168d7

Browse files
razvandervoeti
andauthored
distributed docker build cache (#735)
* feat: use docker build cache * update docker cache url * add inline cache backend * remove inline cache * feat(docker): add docker cache registry * more cache props * update image-tools version * add caching to split actions --------- Co-authored-by: dervoeti <lukas.voetmand@stackable.tech>
1 parent 518ffac commit 0e168d7

File tree

2 files changed

+20
-3
lines changed

2 files changed

+20
-3
lines changed

.github/actions/build/action.yml

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ inputs:
1010
required: true
1111
image-tools-version:
1212
description: The Stackable image-tools version
13-
default: 0.0.8
13+
default: 0.0.10
1414
outputs:
1515
image-name:
1616
description: This is the full image name before the tag (left of ':')
@@ -40,6 +40,14 @@ runs:
4040
shell: bash
4141
run: pip install image-tools-stackabletech==${{ inputs.image-tools-version }}
4242

43+
# Needed if you pass the --cache argument to the bake command below
44+
- name: Login to the docker build cache registry
45+
uses: docker/login-action@0d4c9c5ea7693da7b068278f7b52bda2a190a446 # v3.2.0
46+
with:
47+
registry: build-repo.stackable.tech:8083
48+
username: github
49+
password: ${{ secrets.BUILD_CACHE_NEXUS_PASSWORD }}
50+
4351
- name: Build image using bake
4452
shell: bash
4553
run: |
@@ -49,7 +57,8 @@ runs:
4957
--product ${{ inputs.product-name }}=${{ inputs.product-version }} \
5058
--image-version "0.0.0-dev-${ARCH}" \
5159
--architecture "linux/${ARCH}" \
52-
--export-tags-file bake-target-tags
60+
--export-tags-file bake-target-tags \
61+
--cache
5362
5463
- name: Setup Environment Variables
5564
id: image_info

conf.py

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -76,4 +76,12 @@
7676
"zookeeper": {"id": "62552b0aadd9d54d56cda11d"},
7777
}
7878

79-
cache: list[str] = []
79+
cache = [
80+
{
81+
"type": "registry",
82+
"ref_prefix": "build-repo.stackable.tech:8083/sandbox/cache",
83+
"mode": "max",
84+
"compression": "zstd",
85+
"ignore-error": "true",
86+
},
87+
]

0 commit comments

Comments
 (0)