@@ -11,16 +11,14 @@ jobs:
11
11
runs-on : ubuntu-latest
12
12
steps :
13
13
14
- - name : Get machine's IPv4 addresses for eth0 and docker0
14
+ - name : Get machine's first IPv4 address for eth0
15
15
id : ip
16
16
run : |
17
17
echo ::set-output name=ETHER::$(sudo ip addr show dev eth0 | egrep "^(\ )+inet\ " | head -1 | tr -s " " | cut -d " " -f 3 | cut -d "/" -f 1)
18
- echo ::set-output name=DOCKER::$(sudo ip addr show dev docker0 | egrep "^(\ )+inet\ " | head -1 | tr -s " " | cut -d " " -f 3 | cut -d "/" -f 1)
19
18
20
19
- name : Show the IPs via vars
21
20
run : |
22
21
echo "Ethernet IPv4 is: ${{ steps.ip.outputs.ETHER }}"
23
- echo "Docker IPv4 is: ${{ steps.branch_name.outputs.DOCKER }}"
24
22
25
23
- name : Checkout
26
24
uses : actions/checkout@v2
53
51
cache-from : type=local,src=/tmp/.buildx-cache/release
54
52
# this only reads from the cache
55
53
56
- - name : Experiment - elevated systemd action
57
- run : |
58
- sudo systemctl status docker.service
59
-
60
54
- name : Start proxy instance in docker
61
55
run : |
62
56
docker run -d --rm --name docker_registry_proxy \
65
59
-v $(pwd)/docker_mirror_certs:/ca \
66
60
sanity-check/docker-registry-proxy:latest
67
61
62
+ - name : Get the initial logs for the container into a file after 10s
63
+ run : |
64
+ echo "Sleeping 10s..."
65
+ sleep 10
66
+ docker logs docker_registry_proxy > initial_logs.txt
67
+
68
+ - uses : actions/upload-artifact@v2
69
+ with :
70
+ name : initial_logs
71
+ path : initial_logs.txt
72
+
68
73
- name : Wait for container to be up
69
74
timeout-minutes : 1
70
75
run : |
@@ -126,31 +131,46 @@ jobs:
126
131
done
127
132
echo "Container is up again..."
128
133
134
+ # This can be quite slow, since Github Actions runner Docker comes preloaded with a lot of images.
135
+ - name : Initial prune of all unused images from docker cache
136
+ timeout-minutes : 2
137
+ run : |
138
+ docker image prune --all --force
139
+
129
140
- name : First round of pulls
130
141
timeout-minutes : 2
131
142
run : |
132
- docker pull alpine:latest
143
+ docker pull alpine:3.6
133
144
docker pull k8s.gcr.io/pause:3.3
134
145
135
- - name : Complete docker purge
136
- timeout-minutes : 2
146
+ - name : Get the cold cache logs for the container into a file
147
+ run : |
148
+ docker logs docker_registry_proxy > cold_cache.txt
149
+
150
+ - uses : actions/upload-artifact@v2
151
+ with :
152
+ name : cold_cache
153
+ path : cold_cache.txt
154
+
155
+ - name : prune all unused images from docker cache again
156
+ timeout-minutes : 1
137
157
run : |
138
- docker system prune -a -f
158
+ docker image prune --all --force
139
159
140
160
- name : Second round of pulls
141
161
timeout-minutes : 2
142
162
run : |
143
- docker pull alpine:latest
163
+ docker pull alpine:3.6
144
164
docker pull k8s.gcr.io/pause:3.3
145
165
146
- - name : Get the docker logs for the container into a file
166
+ - name : Get the warm cache docker logs for the container into a file
147
167
run : |
148
- docker logs docker_registry_proxy > logs .txt
168
+ docker logs docker_registry_proxy > warm_cache .txt
149
169
150
170
- uses : actions/upload-artifact@v2
151
171
with :
152
- name : logs
153
- path : logs .txt
172
+ name : warm_cache
173
+ path : warm_cache .txt
154
174
155
175
- name : Finally stop proxy instance in docker
156
176
timeout-minutes : 1
0 commit comments