test workflow, add logging, fixes

pull/52/head
Ricardo Pardini 2020-10-08 15:14:37 +02:00
parent b4646a91ce
commit 95bbab0f93
1 changed files with 36 additions and 16 deletions

View File

@ -11,16 +11,14 @@ jobs:
runs-on: ubuntu-latest runs-on: ubuntu-latest
steps: steps:
- name: Get machine's IPv4 addresses for eth0 and docker0 - name: Get machine's first IPv4 address for eth0
id: ip id: ip
run: | run: |
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) 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)
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)
- name: Show the IPs via vars - name: Show the IPs via vars
run: | run: |
echo "Ethernet IPv4 is: ${{ steps.ip.outputs.ETHER }}" echo "Ethernet IPv4 is: ${{ steps.ip.outputs.ETHER }}"
echo "Docker IPv4 is: ${{ steps.branch_name.outputs.DOCKER }}"
- name: Checkout - name: Checkout
uses: actions/checkout@v2 uses: actions/checkout@v2
@ -53,10 +51,6 @@ jobs:
cache-from: type=local,src=/tmp/.buildx-cache/release cache-from: type=local,src=/tmp/.buildx-cache/release
# this only reads from the cache # this only reads from the cache
- name: Experiment - elevated systemd action
run: |
sudo systemctl status docker.service
- name: Start proxy instance in docker - name: Start proxy instance in docker
run: | run: |
docker run -d --rm --name docker_registry_proxy \ docker run -d --rm --name docker_registry_proxy \
@ -65,6 +59,17 @@ jobs:
-v $(pwd)/docker_mirror_certs:/ca \ -v $(pwd)/docker_mirror_certs:/ca \
sanity-check/docker-registry-proxy:latest sanity-check/docker-registry-proxy:latest
- name: Get the initial logs for the container into a file after 10s
run: |
echo "Sleeping 10s..."
sleep 10
docker logs docker_registry_proxy > initial_logs.txt
- uses: actions/upload-artifact@v2
with:
name: initial_logs
path: initial_logs.txt
- name: Wait for container to be up - name: Wait for container to be up
timeout-minutes: 1 timeout-minutes: 1
run: | run: |
@ -126,31 +131,46 @@ jobs:
done done
echo "Container is up again..." echo "Container is up again..."
# This can be quite slow, since Github Actions runner Docker comes preloaded with a lot of images.
- name: Initial prune of all unused images from docker cache
timeout-minutes: 2
run: |
docker image prune --all --force
- name: First round of pulls - name: First round of pulls
timeout-minutes: 2 timeout-minutes: 2
run: | run: |
docker pull alpine:latest docker pull alpine:3.6
docker pull k8s.gcr.io/pause:3.3 docker pull k8s.gcr.io/pause:3.3
- name: Complete docker purge - name: Get the cold cache logs for the container into a file
timeout-minutes: 2
run: | run: |
docker system prune -a -f docker logs docker_registry_proxy > cold_cache.txt
- uses: actions/upload-artifact@v2
with:
name: cold_cache
path: cold_cache.txt
- name: prune all unused images from docker cache again
timeout-minutes: 1
run: |
docker image prune --all --force
- name: Second round of pulls - name: Second round of pulls
timeout-minutes: 2 timeout-minutes: 2
run: | run: |
docker pull alpine:latest docker pull alpine:3.6
docker pull k8s.gcr.io/pause:3.3 docker pull k8s.gcr.io/pause:3.3
- name: Get the docker logs for the container into a file - name: Get the warm cache docker logs for the container into a file
run: | run: |
docker logs docker_registry_proxy > logs.txt docker logs docker_registry_proxy > warm_cache.txt
- uses: actions/upload-artifact@v2 - uses: actions/upload-artifact@v2
with: with:
name: logs name: warm_cache
path: logs.txt path: warm_cache.txt
- name: Finally stop proxy instance in docker - name: Finally stop proxy instance in docker
timeout-minutes: 1 timeout-minutes: 1