Skip to content

Commit

Permalink
Add logging settings to docker-compose files + fix ci by adding clean…
Browse files Browse the repository at this point in the history
…up agent task (#25)
  • Loading branch information
mikeeq authored Oct 17, 2023
1 parent 3209213 commit 30365f5
Show file tree
Hide file tree
Showing 12 changed files with 97 additions and 3 deletions.
53 changes: 53 additions & 0 deletions .github/cleanup-runner.sh
Original file line number Diff line number Diff line change
@@ -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
3 changes: 3 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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 .

Expand Down
2 changes: 1 addition & 1 deletion playbooks/vms.yml
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@
- servers/apps/jenkins

- name: Cleanup Docker
hosts: clevo
hosts: clevo:!gw1:!vpn1
become: true
tasks:
- name: Cleanup Docker
Expand Down
4 changes: 4 additions & 0 deletions roles/servers/apps/adguard-home/templates/docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,10 @@ services:
# - NET_ADMIN
network_mode: "host"
restart: always
logging:
driver: "json-file"
options:
max-size: "250m"
# expose:
# - '3000'
# - '53'
Expand Down
5 changes: 4 additions & 1 deletion roles/servers/apps/agentdvr/docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
4 changes: 4 additions & 0 deletions roles/servers/apps/coredns/templates/docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,3 +15,7 @@ services:
volumes:
- './config:/etc/coredns'
command: ["-conf", "/etc/coredns/Corefile"]
logging:
driver: "json-file"
options:
max-size: "250m"
4 changes: 4 additions & 0 deletions roles/servers/apps/deluge/docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,3 +18,7 @@ services:
- 8112:8112 # webui
- 6881:6881
- 6881:6881/udp
logging:
driver: "json-file"
options:
max-size: "250m"
4 changes: 4 additions & 0 deletions roles/servers/apps/frigate/docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -31,3 +31,7 @@ services:
FRIGATE_RTSP_PASSWORD: "password"
# iHD, i965
LIBVA_DRIVER_NAME: "iHD"
logging:
driver: "json-file"
options:
max-size: "250m"
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -33,3 +37,7 @@ services:
- '1883:1883'
- '9001:9001'
restart: always
logging:
driver: "json-file"
options:
max-size: "250m"
5 changes: 4 additions & 1 deletion roles/servers/apps/jenkins/templates/docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
4 changes: 4 additions & 0 deletions roles/servers/apps/nginx/templates/docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
4 changes: 4 additions & 0 deletions roles/servers/apps/pi-hole/docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,3 +22,7 @@ services:
cap_add:
- NET_ADMIN
restart: always
logging:
driver: "json-file"
options:
max-size: "250m"

0 comments on commit 30365f5

Please sign in to comment.