From 13560e782ee5a2d98a303ee459ae9a0daae1f2d6 Mon Sep 17 00:00:00 2001 From: NULL Date: Thu, 8 Feb 2024 22:41:50 +0200 Subject: [PATCH] Add yamllint action (#110) --- .github/workflows/image-build-klipper.yaml | 2 +- .../workflows/image-build-klipperscreen.yaml | 2 +- .github/workflows/image-build-moonraker.yaml | 2 +- .github/workflows/image-build-ustreamer.yaml | 2 +- .github/workflows/image-docs-klipper.yaml | 2 +- .../workflows/image-docs-klipperscreen.yaml | 2 +- .github/workflows/image-docs-moonraker.yaml | 2 +- .github/workflows/image-docs-ustreamer.yaml | 2 +- .github/workflows/pr-yamllint.yaml | 11 ++++++ .../template-image-docs-workflow.yaml | 20 +++++------ .yamllint.yaml | 9 +++++ config/octoprint.yaml | 4 +-- ...ocker-compose.custom.glances.override.yaml | 14 ++++++-- ...e.custom.moonraker-timelapse.override.yaml | 17 ++++++--- ...cker-compose.custom.multiple-printers.yaml | 35 +++++++++++++++---- custom/docker-compose.custom.portainer.yaml | 17 +++++++-- ...ompose.custom.unique-uid-gid.override.yaml | 18 +++++++--- docker-compose.extra.calibrate-shaper.yaml | 2 +- docker-compose.extra.make.yaml | 2 +- docker-compose.extra.simulavr.yaml | 10 ++++-- docker-compose.override.yaml | 11 ++++-- docker-compose.yaml | 8 +++-- 22 files changed, 143 insertions(+), 51 deletions(-) create mode 100644 .github/workflows/pr-yamllint.yaml create mode 100644 .yamllint.yaml diff --git a/.github/workflows/image-build-klipper.yaml b/.github/workflows/image-build-klipper.yaml index bc27c4a..646ff32 100644 --- a/.github/workflows/image-build-klipper.yaml +++ b/.github/workflows/image-build-klipper.yaml @@ -10,4 +10,4 @@ jobs: app: klipper secrets: DOCKERHUB_USERNAME: ${{ secrets.DOCKERHUB_USERNAME }} - DOCKERHUB_TOKEN: ${{ secrets.DOCKERHUB_TOKEN }} \ No newline at end of file + DOCKERHUB_TOKEN: ${{ secrets.DOCKERHUB_TOKEN }} diff --git a/.github/workflows/image-build-klipperscreen.yaml b/.github/workflows/image-build-klipperscreen.yaml index 62e999a..d3a8636 100644 --- a/.github/workflows/image-build-klipperscreen.yaml +++ b/.github/workflows/image-build-klipperscreen.yaml @@ -10,4 +10,4 @@ jobs: app: klipperscreen secrets: DOCKERHUB_USERNAME: ${{ secrets.DOCKERHUB_USERNAME }} - DOCKERHUB_TOKEN: ${{ secrets.DOCKERHUB_TOKEN }} \ No newline at end of file + DOCKERHUB_TOKEN: ${{ secrets.DOCKERHUB_TOKEN }} diff --git a/.github/workflows/image-build-moonraker.yaml b/.github/workflows/image-build-moonraker.yaml index c2d17b7..14685e8 100644 --- a/.github/workflows/image-build-moonraker.yaml +++ b/.github/workflows/image-build-moonraker.yaml @@ -10,4 +10,4 @@ jobs: app: moonraker secrets: DOCKERHUB_USERNAME: ${{ secrets.DOCKERHUB_USERNAME }} - DOCKERHUB_TOKEN: ${{ secrets.DOCKERHUB_TOKEN }} \ No newline at end of file + DOCKERHUB_TOKEN: ${{ secrets.DOCKERHUB_TOKEN }} diff --git a/.github/workflows/image-build-ustreamer.yaml b/.github/workflows/image-build-ustreamer.yaml index 748dc6b..5c46b4b 100644 --- a/.github/workflows/image-build-ustreamer.yaml +++ b/.github/workflows/image-build-ustreamer.yaml @@ -10,4 +10,4 @@ jobs: app: ustreamer secrets: DOCKERHUB_USERNAME: ${{ secrets.DOCKERHUB_USERNAME }} - DOCKERHUB_TOKEN: ${{ secrets.DOCKERHUB_TOKEN }} \ No newline at end of file + DOCKERHUB_TOKEN: ${{ secrets.DOCKERHUB_TOKEN }} diff --git a/.github/workflows/image-docs-klipper.yaml b/.github/workflows/image-docs-klipper.yaml index fff928d..a961424 100644 --- a/.github/workflows/image-docs-klipper.yaml +++ b/.github/workflows/image-docs-klipper.yaml @@ -15,4 +15,4 @@ jobs: short-description: "Klipper is a 3d-Printer firmware." secrets: DOCKERHUB_USERNAME: ${{ secrets.DOCKERHUB_USERNAME }} - DOCKERHUB_TOKEN: ${{ secrets.DOCKERHUB_TOKEN }} \ No newline at end of file + DOCKERHUB_TOKEN: ${{ secrets.DOCKERHUB_TOKEN }} diff --git a/.github/workflows/image-docs-klipperscreen.yaml b/.github/workflows/image-docs-klipperscreen.yaml index 3dc69f8..86ca904 100644 --- a/.github/workflows/image-docs-klipperscreen.yaml +++ b/.github/workflows/image-docs-klipperscreen.yaml @@ -15,4 +15,4 @@ jobs: short-description: "KlipperScreen is a touchscreen GUI that interfaces with Klipper via Moonraker." secrets: DOCKERHUB_USERNAME: ${{ secrets.DOCKERHUB_USERNAME }} - DOCKERHUB_TOKEN: ${{ secrets.DOCKERHUB_TOKEN }} \ No newline at end of file + DOCKERHUB_TOKEN: ${{ secrets.DOCKERHUB_TOKEN }} diff --git a/.github/workflows/image-docs-moonraker.yaml b/.github/workflows/image-docs-moonraker.yaml index cfe2c51..8c995da 100644 --- a/.github/workflows/image-docs-moonraker.yaml +++ b/.github/workflows/image-docs-moonraker.yaml @@ -15,4 +15,4 @@ jobs: short-description: "Web API used to interact with the 3D printing firmware Klipper." secrets: DOCKERHUB_USERNAME: ${{ secrets.DOCKERHUB_USERNAME }} - DOCKERHUB_TOKEN: ${{ secrets.DOCKERHUB_TOKEN }} \ No newline at end of file + DOCKERHUB_TOKEN: ${{ secrets.DOCKERHUB_TOKEN }} diff --git a/.github/workflows/image-docs-ustreamer.yaml b/.github/workflows/image-docs-ustreamer.yaml index ccff048..90d7d89 100644 --- a/.github/workflows/image-docs-ustreamer.yaml +++ b/.github/workflows/image-docs-ustreamer.yaml @@ -15,4 +15,4 @@ jobs: short-description: "µStreamer is a lightweight and very quick server to stream MJPEG video" secrets: DOCKERHUB_USERNAME: ${{ secrets.DOCKERHUB_USERNAME }} - DOCKERHUB_TOKEN: ${{ secrets.DOCKERHUB_TOKEN }} \ No newline at end of file + DOCKERHUB_TOKEN: ${{ secrets.DOCKERHUB_TOKEN }} diff --git a/.github/workflows/pr-yamllint.yaml b/.github/workflows/pr-yamllint.yaml new file mode 100644 index 0000000..d212cda --- /dev/null +++ b/.github/workflows/pr-yamllint.yaml @@ -0,0 +1,11 @@ +name: YAML Lint + +on: pull_request + +jobs: + yamllint: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + - name: Run yamllint + uses: reviewdog/action-yamllint@v1 diff --git a/.github/workflows/template-image-docs-workflow.yaml b/.github/workflows/template-image-docs-workflow.yaml index d5752c8..e5c11fe 100644 --- a/.github/workflows/template-image-docs-workflow.yaml +++ b/.github/workflows/template-image-docs-workflow.yaml @@ -20,13 +20,13 @@ jobs: image-docs: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v4 - - name: "Update Docker Hub Description" - uses: peter-evans/dockerhub-description@v3 - with: - username: ${{ secrets.DOCKERHUB_USERNAME }} - password: ${{ secrets.DOCKERHUB_TOKEN }} - repository: ${{ secrets.DOCKERHUB_USERNAME }}/${{ inputs.app }} - short-description: ${{ inputs.short-description }} - readme-filepath: ./docker/${{ inputs.app }}/README.md - enable-url-completion: true \ No newline at end of file + - uses: actions/checkout@v4 + - name: "Update Docker Hub Description" + uses: peter-evans/dockerhub-description@v3 + with: + username: ${{ secrets.DOCKERHUB_USERNAME }} + password: ${{ secrets.DOCKERHUB_TOKEN }} + repository: ${{ secrets.DOCKERHUB_USERNAME }}/${{ inputs.app }} + short-description: ${{ inputs.short-description }} + readme-filepath: ./docker/${{ inputs.app }}/README.md + enable-url-completion: true diff --git a/.yamllint.yaml b/.yamllint.yaml new file mode 100644 index 0000000..37ada86 --- /dev/null +++ b/.yamllint.yaml @@ -0,0 +1,9 @@ +extends: default + +rules: + document-start: + present: false + line-length: + max: 180 + truthy: + check-keys: false diff --git a/config/octoprint.yaml b/config/octoprint.yaml index bbe1a90..b917708 100644 --- a/config/octoprint.yaml +++ b/config/octoprint.yaml @@ -1,10 +1,10 @@ serial: additionalPorts: - - /opt/printer_data/run/klipper.tty + - /opt/printer_data/run/klipper.tty autoconnect: true port: /opt/printer_data/run/klipper.tty webcam: snapshot: http://webcam:8080/snapshot stream: /webcam/stream accessControl: - userfile: /octoprint/octoprint/users.yaml \ No newline at end of file + userfile: /octoprint/octoprint/users.yaml diff --git a/custom/docker-compose.custom.glances.override.yaml b/custom/docker-compose.custom.glances.override.yaml index 85ec63d..ed1a492 100644 --- a/custom/docker-compose.custom.glances.override.yaml +++ b/custom/docker-compose.custom.glances.override.yaml @@ -12,14 +12,22 @@ ## * https://github.com/nicolargo/glances is used to generate and display metrics ## ## Setup -## 1. Add your personal config to this file and copy it to the root of the repository, overwriting the existing docker-compose.override.yaml +## 1. Add your personal config to this file and copy it to the root of the repository, +## overwriting the existing docker-compose.override.yaml ## 2. start the stack as described in the main readme using profiles of your choice ## Ustreamer base Service x-ustreamer-svc: &ustreamer-svc image: mkuf/ustreamer:latest restart: unless-stopped - command: --host=0.0.0.0 --port=8080 --slowdown --device=/dev/webcam --resolution=1280x960 --format=MJPEG --desired-fps=30 + command: > + --host=0.0.0.0 + --port=8080 + --slowdown + --device=/dev/webcam + --resolution=1280x960 + --format=MJPEG + --desired-fps=30 ## Add your personal config here services: @@ -54,4 +62,4 @@ services: traefik.http.routers.webcam.rule: PathPrefix(`/webcam`) traefik.http.routers.webcam.entrypoints: web traefik.http.middlewares.webcam.stripprefix.prefixes: /webcam - traefik.http.routers.webcam.middlewares: webcam \ No newline at end of file + traefik.http.routers.webcam.middlewares: webcam diff --git a/custom/docker-compose.custom.moonraker-timelapse.override.yaml b/custom/docker-compose.custom.moonraker-timelapse.override.yaml index ea554ba..731d50f 100644 --- a/custom/docker-compose.custom.moonraker-timelapse.override.yaml +++ b/custom/docker-compose.custom.moonraker-timelapse.override.yaml @@ -14,20 +14,29 @@ ## * timelapses will be saved to `/opt/timelapse` on the host machine ## ## Setup -## 1. Add the gcode macros provided by moonraker-timelapse to your printers configuration file https://github.com/mainsail-crew/moonraker-timelapse/blob/main/klipper_macro/timelapse.cfg +## 1. Add the gcode macros provided by moonraker-timelapse to your printers configuration file +## https://github.com/mainsail-crew/moonraker-timelapse/blob/main/klipper_macro/timelapse.cfg ## 2. Add the following to your moonraker.conf ## ``` ## [timelapse] ## output_path: /opt/timelapse/ ## ``` -## 3. Add your personal config to this file and copy it to the root of the repository, overwriting the existing docker-compose.override.yaml +## 3. Add your personal config to this file and copy it to the root of the repository, +## overwriting the existing docker-compose.override.yaml ## 4. start the stack as described in the main readme using mainsail or fluidd as profile ## Ustreamer base Service x-ustreamer-svc: &ustreamer-svc image: mkuf/ustreamer:latest restart: unless-stopped - command: --host=0.0.0.0 --port=8080 --slowdown --device=/dev/webcam --resolution=1280x960 --format=MJPEG --desired-fps=30 + command: > + --host=0.0.0.0 + --port=8080 + --slowdown + --device=/dev/webcam + --resolution=1280x960 + --format=MJPEG + --desired-fps=30 ## Add your personal config here services: @@ -68,4 +77,4 @@ services: traefik.http.routers.webcam.rule: PathPrefix(`/webcam`) traefik.http.routers.webcam.entrypoints: web traefik.http.middlewares.webcam.stripprefix.prefixes: /webcam - traefik.http.routers.webcam.middlewares: webcam \ No newline at end of file + traefik.http.routers.webcam.middlewares: webcam diff --git a/custom/docker-compose.custom.multiple-printers.yaml b/custom/docker-compose.custom.multiple-printers.yaml index 9ed3520..51a16cb 100644 --- a/custom/docker-compose.custom.multiple-printers.yaml +++ b/custom/docker-compose.custom.multiple-printers.yaml @@ -1,6 +1,6 @@ ## Usecase: Run multiple Printers on the same Host ## -## Assumptions: +## Assumptions: ## * I have two printers ## * One is called printer1, the other one printer2 ## * printer1 is using serial port /dev/ttyUSB0 and webcam /dev/video0 @@ -55,7 +55,14 @@ x-moonraker-svc: &moonraker-svc x-ustreamer-svc: &ustreamer-svc image: mkuf/ustreamer:latest restart: unless-stopped - command: --host=0.0.0.0 --port=8080 --slowdown --device=/dev/webcam --resolution=1280x960 --format=MJPEG --desired-fps=30 + command: > + --host=0.0.0.0 + --port=8080 + --slowdown + --device=/dev/webcam + --resolution=1280x960 + --format=MJPEG + --desired-fps=30 ## Service Definitions services: @@ -64,13 +71,20 @@ services: ## Access api via port 8101/tcp and webcam via 8102/tcp printer1-klipper: <<: *klipper-svc - command: -I printer_data/run/printer1.klipper.tty -a printer_data/run/printer1.klipper.sock printer_data/config/printer1.cfg -l printer_data/logs/printer1.klippy.log + command: > + -I printer_data/run/printer1.klipper.tty + -a printer_data/run/printer1.klipper.sock + printer_data/config/printer1.cfg + -l printer_data/logs/printer1.klippy.log labels: org.prind.service: klipper org.prind.printer: printer1 printer1-moonraker: <<: *moonraker-svc - command: -d printer_data -c printer_data/config/printer1.moonraker.conf -l printer_data/logs/printer1.moonraker.log + command: > + -d printer_data + -c printer_data/config/printer1.moonraker.conf + -l printer_data/logs/printer1.moonraker.log ports: - 8101:7125 labels: @@ -90,13 +104,20 @@ services: ## Access api via port 8201/tcp and webcam via 8202/tcp printer2-klipper: <<: *klipper-svc - command: -I printer_data/run/printer2.klipper.tty -a printer_data/run/printer2.klipper.sock printer_data/config/printer2.cfg -l printer_data/logs/printer2.klippy.log + command: > + -I printer_data/run/printer2.klipper.tty + -a printer_data/run/printer2.klipper.sock + printer_data/config/printer2.cfg + -l printer_data/logs/printer2.klippy.log labels: org.prind.service: klipper org.prind.printer: printer2 printer2-moonraker: <<: *moonraker-svc - command: -d printer_data -c printer_data/config/printer2.moonraker.conf -l printer_data/logs/printer2.moonraker.log + command: > + -d printer_data + -c printer_data/config/printer2.moonraker.conf + -l printer_data/logs/printer2.moonraker.log ports: - 8201:7125 labels: @@ -124,4 +145,4 @@ services: volumes: run: gcode: - log: \ No newline at end of file + log: diff --git a/custom/docker-compose.custom.portainer.yaml b/custom/docker-compose.custom.portainer.yaml index aae7816..e4010b7 100644 --- a/custom/docker-compose.custom.portainer.yaml +++ b/custom/docker-compose.custom.portainer.yaml @@ -29,7 +29,11 @@ services: depends_on: init: condition: service_completed_successfully - command: -I printer_data/run/klipper.tty -a printer_data/run/klipper.sock printer_data/config/printer.cfg -l printer_data/logs/klippy.log + command: > + -I printer_data/run/klipper.tty + -a printer_data/run/klipper.sock + printer_data/config/printer.cfg + -l printer_data/logs/klippy.log volumes: - /dev:/dev - ./config:/opt/printer_data/config @@ -70,7 +74,14 @@ services: webcam: image: mkuf/ustreamer:latest restart: unless-stopped - command: --host=0.0.0.0 --port=8080 --slowdown --device=/dev/webcam --resolution=1280x960 --format=MJPEG --desired-fps=30 + command: > + --host=0.0.0.0 + --port=8080 + --slowdown + --device=/dev/webcam + --resolution=1280x960 + --format=MJPEG + --desired-fps=30 devices: - /dev/video0:/dev/webcam labels: @@ -111,7 +122,7 @@ services: - "80:80" restart: unless-stopped volumes: - - "/var/run/docker.sock:/var/run/docker.sock:ro" + - "/var/run/docker.sock:/var/run/docker.sock:ro" labels: org.prind.service: traefik diff --git a/custom/docker-compose.custom.unique-uid-gid.override.yaml b/custom/docker-compose.custom.unique-uid-gid.override.yaml index 4f490e7..ac60b60 100644 --- a/custom/docker-compose.custom.unique-uid-gid.override.yaml +++ b/custom/docker-compose.custom.unique-uid-gid.override.yaml @@ -12,17 +12,25 @@ ## * init container will set the permissions to the new UID/GID ## ## Setup -## 1. Add your personal config to this file and copy it to the root of the repository, overwriting the existing docker-compose.override.yaml -## 2. Replace the example UID and GID of '4242' in the 'dockerfile_inline' block of the klipper and moonraker services, +## 1. Add your personal config to this file and copy it to the root of the repository, +## overwriting the existing docker-compose.override.yaml +## 2. Replace the example UID and GID of '4242' in the 'dockerfile_inline' block of the klipper and moonraker services, ## as well as in the command of the init service with your specific requirements. ## Make sure to use the identical UIDs/GIDs in klipper and moonraker. -## 3. start the stack as described in the main readme using a profile of your choice. +## 3. start the stack as described in the main readme using a profile of your choice. ## Ustreamer base Service x-ustreamer-svc: &ustreamer-svc image: mkuf/ustreamer:latest restart: unless-stopped - command: --host=0.0.0.0 --port=8080 --slowdown --device=/dev/webcam --resolution=1280x960 --format=MJPEG --desired-fps=30 + command: > + --host=0.0.0.0 + --port=8080 + --slowdown + --device=/dev/webcam + --resolution=1280x960 + --format=MJPEG + --desired-fps=30 ## Add your personal config here services: @@ -60,4 +68,4 @@ services: traefik.http.routers.webcam.rule: PathPrefix(`/webcam`) traefik.http.routers.webcam.entrypoints: web traefik.http.middlewares.webcam.stripprefix.prefixes: /webcam - traefik.http.routers.webcam.middlewares: webcam \ No newline at end of file + traefik.http.routers.webcam.middlewares: webcam diff --git a/docker-compose.extra.calibrate-shaper.yaml b/docker-compose.extra.calibrate-shaper.yaml index c4e8e5d..541314b 100644 --- a/docker-compose.extra.calibrate-shaper.yaml +++ b/docker-compose.extra.calibrate-shaper.yaml @@ -4,4 +4,4 @@ services: entrypoint: python3 /opt/klipper/scripts/calibrate_shaper.py working_dir: /opt/resonances volumes: - - ./resonances:/opt/resonances \ No newline at end of file + - ./resonances:/opt/resonances diff --git a/docker-compose.extra.make.yaml b/docker-compose.extra.make.yaml index 75f35df..819b34e 100644 --- a/docker-compose.extra.make.yaml +++ b/docker-compose.extra.make.yaml @@ -8,4 +8,4 @@ services: volumes: - /dev:/dev - ./config/build.config:/opt/klipper/.config - - ./out:/opt/klipper/out \ No newline at end of file + - ./out:/opt/klipper/out diff --git a/docker-compose.extra.simulavr.yaml b/docker-compose.extra.simulavr.yaml index 9043e77..1194b9d 100644 --- a/docker-compose.extra.simulavr.yaml +++ b/docker-compose.extra.simulavr.yaml @@ -6,7 +6,7 @@ services: build: context: docker/klipper target: build-simulavr - args: + args: VERSION: master privileged: true volumes: @@ -14,7 +14,7 @@ services: - run:/opt/printer_data/run labels: org.prind.service: simulavr - + ## Reconfigure Klipper service for simulavr klipper: depends_on: @@ -22,4 +22,8 @@ services: condition: service_completed_successfully simulavr: condition: service_started - command: -I printer_data/run/klipper.tty -a printer_data/run/klipper.sock printer_data/config/printer-simulavr.cfg -l printer_data/logs/klippy.log \ No newline at end of file + command: > + -I printer_data/run/klipper.tty + -a printer_data/run/klipper.sock + printer_data/config/printer-simulavr.cfg + -l printer_data/logs/klippy.log diff --git a/docker-compose.override.yaml b/docker-compose.override.yaml index 6ccc66b..76490e6 100644 --- a/docker-compose.override.yaml +++ b/docker-compose.override.yaml @@ -2,7 +2,14 @@ x-ustreamer-svc: &ustreamer-svc image: mkuf/ustreamer:latest restart: unless-stopped - command: --host=0.0.0.0 --port=8080 --slowdown --device=/dev/webcam --resolution=1280x960 --format=MJPEG --desired-fps=30 + command: > + --host=0.0.0.0 + --port=8080 + --slowdown + --device=/dev/webcam + --resolution=1280x960 + --format=MJPEG + --desired-fps=30 ## Add your personal config here services: @@ -17,4 +24,4 @@ services: traefik.http.routers.webcam.rule: PathPrefix(`/webcam`) traefik.http.routers.webcam.entrypoints: web traefik.http.middlewares.webcam.stripprefix.prefixes: /webcam - traefik.http.routers.webcam.middlewares: webcam \ No newline at end of file + traefik.http.routers.webcam.middlewares: webcam diff --git a/docker-compose.yaml b/docker-compose.yaml index 7106711..f10dca1 100644 --- a/docker-compose.yaml +++ b/docker-compose.yaml @@ -12,7 +12,11 @@ services: depends_on: init: condition: service_completed_successfully - command: -I printer_data/run/klipper.tty -a printer_data/run/klipper.sock printer_data/config/printer.cfg -l printer_data/logs/klippy.log + command: > + -I printer_data/run/klipper.tty + -a printer_data/run/klipper.sock + printer_data/config/printer.cfg + -l printer_data/logs/klippy.log volumes: - /dev:/dev - ./config:/opt/printer_data/config @@ -196,7 +200,7 @@ services: - "80:80" restart: unless-stopped volumes: - - "/var/run/docker.sock:/var/run/docker.sock:ro" + - "/var/run/docker.sock:/var/run/docker.sock:ro" labels: org.prind.service: traefik