Skip to content

Commit 95bbab0

Browse files
committed
test workflow, add logging, fixes
1 parent b4646a9 commit 95bbab0

File tree

1 file changed

+36
-16
lines changed

1 file changed

+36
-16
lines changed

.github/workflows/test.yaml

Lines changed: 36 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -11,16 +11,14 @@ jobs:
1111
runs-on: ubuntu-latest
1212
steps:
1313

14-
- name: Get machine's IPv4 addresses for eth0 and docker0
14+
- name: Get machine's first IPv4 address for eth0
1515
id: ip
1616
run: |
1717
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)
1918
2019
- name: Show the IPs via vars
2120
run: |
2221
echo "Ethernet IPv4 is: ${{ steps.ip.outputs.ETHER }}"
23-
echo "Docker IPv4 is: ${{ steps.branch_name.outputs.DOCKER }}"
2422
2523
- name: Checkout
2624
uses: actions/checkout@v2
@@ -53,10 +51,6 @@ jobs:
5351
cache-from: type=local,src=/tmp/.buildx-cache/release
5452
# this only reads from the cache
5553

56-
- name: Experiment - elevated systemd action
57-
run: |
58-
sudo systemctl status docker.service
59-
6054
- name: Start proxy instance in docker
6155
run: |
6256
docker run -d --rm --name docker_registry_proxy \
@@ -65,6 +59,17 @@ jobs:
6559
-v $(pwd)/docker_mirror_certs:/ca \
6660
sanity-check/docker-registry-proxy:latest
6761
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+
6873
- name: Wait for container to be up
6974
timeout-minutes: 1
7075
run: |
@@ -126,31 +131,46 @@ jobs:
126131
done
127132
echo "Container is up again..."
128133
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+
129140
- name: First round of pulls
130141
timeout-minutes: 2
131142
run: |
132-
docker pull alpine:latest
143+
docker pull alpine:3.6
133144
docker pull k8s.gcr.io/pause:3.3
134145
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
137157
run: |
138-
docker system prune -a -f
158+
docker image prune --all --force
139159
140160
- name: Second round of pulls
141161
timeout-minutes: 2
142162
run: |
143-
docker pull alpine:latest
163+
docker pull alpine:3.6
144164
docker pull k8s.gcr.io/pause:3.3
145165
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
147167
run: |
148-
docker logs docker_registry_proxy > logs.txt
168+
docker logs docker_registry_proxy > warm_cache.txt
149169
150170
- uses: actions/upload-artifact@v2
151171
with:
152-
name: logs
153-
path: logs.txt
172+
name: warm_cache
173+
path: warm_cache.txt
154174

155175
- name: Finally stop proxy instance in docker
156176
timeout-minutes: 1

0 commit comments

Comments
 (0)