Skip to content

Commit dca0cd7

Browse files
committed
Pull TiDB Docker images in parallel
Use background processes to pull tidb, pd, and tikv images simultaneously, then wait for all pulls to complete. This reduces image pull time from sequential (3x pull time) to parallel (max pull time). After pulling, we still use Buildx to cache the images for future runs.
1 parent a65619a commit dca0cd7

File tree

1 file changed

+19
-3
lines changed

1 file changed

+19
-3
lines changed

.github/workflows/main.yml

Lines changed: 19 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -209,7 +209,23 @@ jobs:
209209
if: contains(matrix.target, 'tidb')
210210
uses: docker/setup-buildx-action@v3
211211

212-
- name: Pull and cache TiDB Docker images using Buildx
212+
- name: Pull TiDB Docker images in parallel
213+
if: contains(matrix.target, 'tidb')
214+
run: |
215+
VERSION="${{ steps.extract-tidb-version.outputs.version }}"
216+
echo "Pulling TiDB component images for v${VERSION} in parallel..."
217+
218+
# Pull all three images in parallel
219+
docker pull pingcap/tidb:v${VERSION} &
220+
docker pull pingcap/pd:v${VERSION} &
221+
docker pull pingcap/tikv:v${VERSION} &
222+
223+
# Wait for all pulls to complete
224+
wait
225+
226+
echo "All TiDB component images pulled successfully"
227+
228+
- name: Cache TiDB Docker images using Buildx
213229
if: contains(matrix.target, 'tidb')
214230
uses: docker/build-push-action@v5
215231
continue-on-error: false
@@ -224,7 +240,7 @@ jobs:
224240
cache-from: type=gha,scope=tidb-v${{ steps.extract-tidb-version.outputs.version }}
225241
cache-to: type=gha,mode=max,scope=tidb-v${{ steps.extract-tidb-version.outputs.version }}
226242

227-
- name: Pull and cache PD Docker image using Buildx
243+
- name: Cache PD Docker image using Buildx
228244
if: contains(matrix.target, 'tidb')
229245
uses: docker/build-push-action@v5
230246
continue-on-error: false
@@ -239,7 +255,7 @@ jobs:
239255
cache-from: type=gha,scope=pd-v${{ steps.extract-tidb-version.outputs.version }}
240256
cache-to: type=gha,mode=max,scope=pd-v${{ steps.extract-tidb-version.outputs.version }}
241257

242-
- name: Pull and cache TiKV Docker image using Buildx
258+
- name: Cache TiKV Docker image using Buildx
243259
if: contains(matrix.target, 'tidb')
244260
uses: docker/build-push-action@v5
245261
continue-on-error: false

0 commit comments

Comments
 (0)