Skip to content

Commit

Permalink
Revert "Implement Health checks (#178)" (#179)
Browse files Browse the repository at this point in the history
This reverts commit 56e14f5.
  • Loading branch information
mkuf authored Nov 11, 2024
1 parent 56e14f5 commit 76aadf3
Show file tree
Hide file tree
Showing 10 changed files with 4 additions and 95 deletions.
1 change: 0 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/).
## [Unreleased]
### Added
* klipper & moonraker: generate version file during build to correctly display versions
* klipper, moonraker & ustreamer: add healthchecks to container images
### Fixed
### Changed
### Removed
Expand Down
3 changes: 0 additions & 3 deletions docker/klipper/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -39,9 +39,6 @@ RUN groupadd klipper --gid 1000 \
RUN mkdir -p printer_data/run printer_data/gcodes printer_data/logs printer_data/config \
&& chown -R klipper:klipper /opt/*

COPY --chown=klipper:klipper health.py ./
HEALTHCHECK --interval=5s CMD ["python3", "/opt/health.py"]

COPY --chown=klipper:klipper --from=build /opt/klipper ./klipper
COPY --chown=klipper:klipper --from=build /opt/venv ./venv

Expand Down
9 changes: 1 addition & 8 deletions docker/klipper/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -118,11 +118,4 @@ none
|`build-hostmcu`|Based on `mcu`: Build the klipper_mcu binary|No|
|`run`|Default runtime Image for klippy|Yes|
|`tools`|Build Tools for MCU code compilation|Yes|
|`hostmcu`|Runtime Image for the klipper_mcu binary|Yes|

## Healthcheck
`/opt/health.py` gets executed every 5s inside the container.
The script does the following:
* queries klippers `info` endpoint via its unix socket
* Checks if state is `ready`
* If one of the above requirements is not `ready`, the script exits with a failure state to indicate the container is unhealthy
|`hostmcu`|Runtime Image for the klipper_mcu binary|Yes|
22 changes: 0 additions & 22 deletions docker/klipper/health.py

This file was deleted.

4 changes: 0 additions & 4 deletions docker/moonraker/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,6 @@ RUN apt update \
systemd \
sudo \
git \
jq \
&& apt clean

WORKDIR /opt
Expand All @@ -49,9 +48,6 @@ RUN groupadd moonraker --gid 1000 \
RUN mkdir -p printer_data/run printer_data/gcodes printer_data/logs printer_data/database printer_data/config \
&& chown -R moonraker:moonraker /opt/*

COPY --chown=moonraker:moonraker health.sh ./
HEALTHCHECK --interval=5s CMD ["bash", "/opt/health.sh"]

COPY --chown=moonraker:moonraker --from=build /opt/moonraker ./moonraker
COPY --chown=moonraker:moonraker --from=build /opt/venv ./venv

Expand Down
12 changes: 1 addition & 11 deletions docker/moonraker/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -84,14 +84,4 @@ services:
|Target|Description|Pushed|
|---|---|---|
|`build`|Pull Upstream Codebase and build python venv|No|
|`run`|Default runtime Image|Yes|

## Healthcheck
`/opt/health.sh` gets executed every 5s inside the container.
The script does the following:
* queries the `/server/info` endpoint of moonraker
* Performs the following checks
* Number of failed moonraker_components = 0
* klippy_connected is `true`
* klippy_state is `ready`
* If one of the above requirements is not met, the script exits with a failure state to indicate the container is unhealthy
|`run`|Default runtime Image|Yes|
17 changes: 0 additions & 17 deletions docker/moonraker/health.sh

This file was deleted.

7 changes: 1 addition & 6 deletions docker/ustreamer/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -39,23 +39,18 @@ RUN apt update \
libbsd0 \
libgpiod2 \
v4l-utils \
curl \
jq \
&& apt clean

WORKDIR /opt
RUN groupadd ustreamer --gid 1000 \
&& useradd ustreamer --uid 1000 --gid ustreamer \
&& usermod ustreamer --append --groups video

COPY --chown=ustreamer:ustreamer health.sh ./
HEALTHCHECK --interval=5s CMD ["bash", "/opt/health.sh"]

COPY --chown=ustreamer:ustreamer --from=build /opt/ustreamer/src/ustreamer.bin ./ustreamer

## Start ustreamer
USER ustreamer
EXPOSE 8080
ENTRYPOINT ["/opt/ustreamer"]
ENTRYPOINT [ "/opt/ustreamer"]
CMD ["--host=0.0.0.0", "--port=8080"]

11 changes: 1 addition & 10 deletions docker/ustreamer/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -51,13 +51,4 @@ none
|Target|Description|Pushed|
|---|---|---|
|`build`|Pull Upstream Codebase and build application|No|
|`run`|Default runtime Image|Yes|

## Healthcheck
`/opt/health.sh` gets executed every 5s inside the container.
The script does the following:
* gets the JSON structure with the state of the server
* Checks the following values
* `.ok` is set to `true`, which indicates ustreamer is working
* `.result.source.online` is set to `true`, which indicates the source (webcam) is returning an image rather than `NO SIGNAL`
* If one of the above requirements is not met, the script exits with a failure state to indicate the container is unhealthy
|`run`|Default runtime Image|Yes|
13 changes: 0 additions & 13 deletions docker/ustreamer/health.sh

This file was deleted.

0 comments on commit 76aadf3

Please sign in to comment.