diff --git a/.github/cleanup-runner.sh b/.github/cleanup-runner.sh new file mode 100755 index 00000000..93407983 --- /dev/null +++ b/.github/cleanup-runner.sh @@ -0,0 +1,53 @@ +#!/usr/bin/env bash + +function info () { + echo >&2 "===]> Info: $* "; +} + +info "Remove unneeded stuff from GitHub Actions Runner..." + + +# 11,2 GiB [###################################] /android +info "Removing Android SDK from /usr/local/lib/android..." +rm -rf /usr/local/lib/android + +# 6,1 GiB [###################################] /hostedtoolcache + +# 2,7 GiB [###################################] /CodeQL +# 1,3 GiB [################# ] /go +# 1,2 GiB [############### ] /Python +# 499,0 MiB [###### ] /PyPy +# 372,6 MiB [#### ] /node +# 60,9 MiB [ ] /Ruby +# 16,0 KiB [ ] /Java_Temurin-Hotspot_jdk + +info "Removing CodeQL..." +rm -rf /opt/hostedtoolcache/CodeQL +info "Removing go..." +rm -rf /opt/hostedtoolcache/go + +# 1,3 GiB [###################################] /jvm + +info "Removing jvm..." +rm -rf /usr/lib/jvm + +# 1,1 GiB [###################################] /powershell + +# rm -rf /usr/local/share/powershell + +# 2,7 GiB [###################################] /dotnet + +info "Removing dotnet core..." +rm -rf /usr/share/dotnet + +# 1,6 GiB [###################################] /swift + +info "Removing swift..." +rm -rf /usr/share/swift + +info "Removing all docker images..." +# shellcheck disable=SC2046 +docker rmi $(docker images | awk '{print $3}') + +info "Cleaning up docker storage..." +docker system prune -f --volumes diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 7cf1a1c9..0d5b73af 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -26,6 +26,9 @@ jobs: # Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it - uses: actions/checkout@v2 + - name: "Runner storage cleanup" + run: ./.github/cleanup-runner.sh + - name: "Build fedora-systemd image..." run: docker build -t fedora_systemd:latest . diff --git a/playbooks/vms.yml b/playbooks/vms.yml index 42f695d9..094917a5 100644 --- a/playbooks/vms.yml +++ b/playbooks/vms.yml @@ -64,7 +64,7 @@ - servers/apps/jenkins - name: Cleanup Docker - hosts: clevo + hosts: clevo:!gw1:!vpn1 become: true tasks: - name: Cleanup Docker diff --git a/roles/servers/apps/adguard-home/templates/docker-compose.yml b/roles/servers/apps/adguard-home/templates/docker-compose.yml index b9b4c83a..7034c9af 100644 --- a/roles/servers/apps/adguard-home/templates/docker-compose.yml +++ b/roles/servers/apps/adguard-home/templates/docker-compose.yml @@ -17,6 +17,10 @@ services: # - NET_ADMIN network_mode: "host" restart: always + logging: + driver: "json-file" + options: + max-size: "250m" # expose: # - '3000' # - '53' diff --git a/roles/servers/apps/agentdvr/docker-compose.yml b/roles/servers/apps/agentdvr/docker-compose.yml index d254d12f..b89c4755 100644 --- a/roles/servers/apps/agentdvr/docker-compose.yml +++ b/roles/servers/apps/agentdvr/docker-compose.yml @@ -30,7 +30,10 @@ services: TZ: "Europe/Warsaw" # iHD, i965 LIBVA_DRIVER_NAME: "iHD" - + logging: + driver: "json-file" + options: + max-size: "250m" # docker run -it -p 8090:8090 -p 3478:3478/udp -p 50000-50010:50000-50010/udp \ # -v /appdata/ispyagentdvr/config/:/agent/Media/XML/ \ -v /appdata/ispyagentdvr/media/:/agent/Media/WebServerRoot/Media/ \ -v /appdata/ispyagentdvr/commands:/agent/Commands/ \ # -e TZ=America/Los_Angeles \ --name agentdvr doitandbedone/ispyagentdv diff --git a/roles/servers/apps/coredns/templates/docker-compose.yml b/roles/servers/apps/coredns/templates/docker-compose.yml index 5d910d66..8b805257 100644 --- a/roles/servers/apps/coredns/templates/docker-compose.yml +++ b/roles/servers/apps/coredns/templates/docker-compose.yml @@ -15,3 +15,7 @@ services: volumes: - './config:/etc/coredns' command: ["-conf", "/etc/coredns/Corefile"] + logging: + driver: "json-file" + options: + max-size: "250m" diff --git a/roles/servers/apps/deluge/docker-compose.yml b/roles/servers/apps/deluge/docker-compose.yml index c93fd866..b29b094e 100644 --- a/roles/servers/apps/deluge/docker-compose.yml +++ b/roles/servers/apps/deluge/docker-compose.yml @@ -18,3 +18,7 @@ services: - 8112:8112 # webui - 6881:6881 - 6881:6881/udp + logging: + driver: "json-file" + options: + max-size: "250m" diff --git a/roles/servers/apps/frigate/docker-compose.yml b/roles/servers/apps/frigate/docker-compose.yml index 1a959076..45be1e38 100644 --- a/roles/servers/apps/frigate/docker-compose.yml +++ b/roles/servers/apps/frigate/docker-compose.yml @@ -31,3 +31,7 @@ services: FRIGATE_RTSP_PASSWORD: "password" # iHD, i965 LIBVA_DRIVER_NAME: "iHD" + logging: + driver: "json-file" + options: + max-size: "250m" diff --git a/roles/servers/apps/home-assistant/templates/docker-compose.yml b/roles/servers/apps/home-assistant/templates/docker-compose.yml index 0dd0ad3a..ff6d182f 100644 --- a/roles/servers/apps/home-assistant/templates/docker-compose.yml +++ b/roles/servers/apps/home-assistant/templates/docker-compose.yml @@ -21,6 +21,10 @@ services: # - /dev/ttyUSB0:/dev/ttyUSB0 ports: - '8123:8123' + logging: + driver: "json-file" + options: + max-size: "250m" mosquitto: container_name: mosquitto # https://hub.docker.com/_/eclipse-mosquitto @@ -33,3 +37,7 @@ services: - '1883:1883' - '9001:9001' restart: always + logging: + driver: "json-file" + options: + max-size: "250m" diff --git a/roles/servers/apps/jenkins/templates/docker-compose.yml b/roles/servers/apps/jenkins/templates/docker-compose.yml index 7406994f..42dbd654 100644 --- a/roles/servers/apps/jenkins/templates/docker-compose.yml +++ b/roles/servers/apps/jenkins/templates/docker-compose.yml @@ -37,5 +37,8 @@ services: - '{{ jenkins_ssh_path }}:/root/.ssh' - '{{ jenkins_home }}:/var/jenkins_home' - /var/run/docker.sock:/var/run/docker.sock - + logging: + driver: "json-file" + options: + max-size: "250m" # mkdir -p ./jenkins_home; chown -R 1000:1000 ./jenkins_home diff --git a/roles/servers/apps/nginx/templates/docker-compose.yml b/roles/servers/apps/nginx/templates/docker-compose.yml index 33d37661..ee2917b2 100644 --- a/roles/servers/apps/nginx/templates/docker-compose.yml +++ b/roles/servers/apps/nginx/templates/docker-compose.yml @@ -19,6 +19,10 @@ services: - './config/backend-not-found.html:/var/www/error_page/backend-not-found.html' - '/etc/ssl/le:/etc/ssl/le' - './config/dhparam.pem:/etc/nginx/dhparam.pem' + logging: + driver: "json-file" + options: + max-size: "250m" # app: # # https://hub.docker.com/_/nginx # image: httpd:2 diff --git a/roles/servers/apps/pi-hole/docker-compose.yml b/roles/servers/apps/pi-hole/docker-compose.yml index 68cf25e7..56942301 100644 --- a/roles/servers/apps/pi-hole/docker-compose.yml +++ b/roles/servers/apps/pi-hole/docker-compose.yml @@ -22,3 +22,7 @@ services: cap_add: - NET_ADMIN restart: always + logging: + driver: "json-file" + options: + max-size: "250m"