-
Notifications
You must be signed in to change notification settings - Fork 1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Clean docker image cache #1636
Clean docker image cache #1636
Changes from all commits
032014e
c3d0ad2
10889fd
8f0375a
96ebf42
db8403e
90a5345
b041c00
9580444
a34ac47
6613f78
1b3eae9
4275382
618f25a
100a9cd
4b9056b
315a85b
ed3c264
446d630
6821a28
9e95a8a
02840b1
7e31d65
926f4d7
344e1d4
e91ac12
ba6e088
49025e8
a647bb3
16b09ab
c8d8a72
591f340
c331bd0
f48b22b
900843d
76ecdd5
b69d4a6
df2ddcc
3ff1cdd
bd89cc8
39ef510
d389953
b676bac
b1473c9
83ff113
33dfbb7
316af58
425d30b
763280a
3afbaef
cb97ba1
b33edc8
7a1fdf1
a8beed9
2e445d9
5b51db1
b0ce76c
918bb7f
c629951
ccfc0bf
0f3fa24
b60a283
901cb66
251002b
fedeb17
004f95b
10168be
dc811cf
3dfe77d
619c8d0
12ca211
a91c1e1
be2e809
1c84e33
1319fe7
9424c2e
cddd550
f8d34f2
31d2fb8
fa9fd09
22f3f51
bb44f4b
9714f2c
0f9cb3d
6e60174
78c5575
5eb5c51
48f7cb0
8a18085
e4cab39
ba4cab0
bbc6e30
0e9f1ad
8a5243c
cbf83c4
3dd0260
1408d44
2925ee1
af3a12b
f5a27dc
494454a
add0f67
b6a4b45
00a559d
882f9c1
6c9071e
09c10bb
3615396
116c199
f1447cd
14b165b
3ce8fac
41eaa8d
4f89298
ee1031d
f6707d5
9930c7d
0043006
4e292ec
3129276
1c90fc2
fa0888a
ab680d1
4023ca3
7ed7f5d
3be81b7
dd710ec
4fdd06a
bf61054
f059697
013cc6a
13ff3b3
88021bb
dcf4e62
a600c69
3f1a180
85ca441
65acfe6
5526b50
0c131b5
af8a8ee
9c74e14
a410606
8c38ece
dcb8fb4
73e9765
1a3a4d9
926d2b0
02737d4
24defb8
14c9780
719ccbc
5784dfa
ecf13b8
658a5f6
f6c0b43
dacd84d
ef76c9e
81d571f
4eb0e3c
1b165a1
9201dc9
8e72ad6
e16b685
81779ee
8a6b3a3
8979a5a
1348cb6
d1d62ee
256332d
eb55382
4a88031
ca5dde4
0b18c29
818ab9f
3244dae
b7af072
816e44c
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
name: restore-docker-images | ||
description: upload docker images | ||
runs: | ||
using: "composite" | ||
steps: | ||
|
||
- name: restore images if cache matches | ||
uses: actions/cache/restore@v4 | ||
id: images-cache | ||
with: | ||
path: /tmp/docker/images | ||
key: docker-images-github-cache-${{ hashFiles('**/current-images.txt') }} | ||
|
||
- name: pull docker images | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. if cache is not present, issue It also replaces the |
||
shell: bash | ||
if: steps.images-cache.outputs.cache-hit != 'true' | ||
run: | | ||
echo 'start pulling common images' | ||
mkdir -p /tmp/docker/images | ||
result=$(find . -name 'current-images.txt') | ||
while read line; do | ||
docker pull "$line" | ||
replace_slash=$(tr '/' '-' <<< "$line") | ||
docker save "${line}" > "/tmp/docker/images/${replace_slash}.tar" | ||
done <$result | ||
|
||
- name: save docker images | ||
id: save-docker-images | ||
uses: actions/cache/save@v4 | ||
if: steps.images-cache.outputs.cache-hit != 'true' | ||
with: | ||
path: | | ||
/tmp/docker/images | ||
key: docker-images-github-cache-${{ hashFiles('**/current-images.txt') }} | ||
|
||
- name: print images | ||
shell: bash | ||
run: | | ||
echo 'printing images' | ||
ls /tmp/docker/images | ||
|
||
|
This file was deleted.
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -33,6 +33,7 @@ | |
|
||
import org.springframework.cloud.kubernetes.commons.discovery.EndpointNameAndNamespace; | ||
import org.springframework.cloud.kubernetes.integration.tests.commons.Commons; | ||
import org.springframework.cloud.kubernetes.integration.tests.commons.Images; | ||
import org.springframework.cloud.kubernetes.integration.tests.commons.Phase; | ||
import org.springframework.cloud.kubernetes.integration.tests.commons.fabric8_client.Util; | ||
import org.springframework.core.ParameterizedTypeReference; | ||
|
@@ -73,6 +74,8 @@ static void beforeAll() throws Exception { | |
Commons.validateImage(IMAGE_NAME, K3S); | ||
Commons.loadSpringCloudKubernetesImage(IMAGE_NAME, K3S); | ||
|
||
Images.loadBusybox(K3S); | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. load from either |
||
|
||
util = new Util(K3S); | ||
|
||
util.createNamespace(NAMESPACE_A); | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
a new stage that basically does this:
docker-images-cache-${{ hashFiles('**/current-images.txt') }}
use it and restore to/tmp/docker/images
current-images.txt
line by line. For each of those lines, do adocker pull
then adocker save
to/tmp/docker/images
/tmp/docker/images