Skip to content

Commit

Permalink
Add a healthcheck for Weston containers
Browse files Browse the repository at this point in the history
Users may choose to rely on this healthcheck in order to prevent
race conditions where an application is started faster than Weston,
leading to errors where the application cannot find a display.

This also may fix bugs for users that may have implemented retry-logic
in their application layer. These users can safely delete this logic
and rely on this declarative healthcheck instead.

Signed-off-by: Leonardo Held <leonardo.held@toradex.com>
  • Loading branch information
leonheldattoradex committed Feb 2, 2024
1 parent 4431d4d commit 07833f9
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 4 deletions.
3 changes: 3 additions & 0 deletions debian-docker-images/am62/weston-am62/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,9 @@ RUN usermod -a -G input torizon
# See https://github.com/kennylevinsen/seatd/blob/a803ba0502cccf147eec7fbcacd11c5b8643c0e0/man/seatd-launch.1.scd
RUN chmod u+s /usr/bin/seatd-launch

HEALTHCHECK --interval=1s --timeout=5s --start-period=0s --retries=3 \
CMD find /tmp/1000-runtime-dir -maxdepth 1 -type s -name 'wayland-*' -print -quit | grep -q .

WORKDIR /home/torizon

ENTRYPOINT ["/usr/bin/entry.sh"]
3 changes: 3 additions & 0 deletions debian-docker-images/imx8/weston-imx8/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,9 @@ RUN usermod -a -G input torizon
# See https://github.com/kennylevinsen/seatd/blob/a803ba0502cccf147eec7fbcacd11c5b8643c0e0/man/seatd-launch.1.scd
RUN chmod u+s /usr/bin/seatd-launch

HEALTHCHECK --interval=1s --timeout=5s --start-period=0s --retries=3 \
CMD find /tmp/1000-runtime-dir -maxdepth 1 -type s -name 'wayland-*' -print -quit | grep -q .

WORKDIR /home/torizon

ENTRYPOINT ["/usr/bin/entry.sh"]
8 changes: 4 additions & 4 deletions debian-docker-images/upstream/qt5-wayland-examples/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -3,14 +3,14 @@

ARG BASE_NAME=qt5-wayland
ARG IMAGE_TAG=3
ARG DOCKER_REGISTRY=torizon

ARG DOCKER_REGISTRY=docker.io
ARG DOCKER_NAMESPACE=torizon
ARG QT5_EXAMPLES_DEBIAN
# Uncomment the line below if building outside of the context of GitLab CI
# ARG QT5_EXAMPLES_DEBIAN=1
ARG QT5_EXAMPLES_DEBIAN=1
ARG QT5_EXAMPLES_DEBIAN_INSTALL=${QT5_EXAMPLES_DEBIAN:+"qtbase5-examples qtdeclarative5-examples"}

FROM $DOCKER_REGISTRY/torizon/$BASE_NAME:$IMAGE_TAG AS base
FROM $DOCKER_REGISTRY/$DOCKER_NAMESPACE/$BASE_NAME:$IMAGE_TAG AS base
ARG QT5_EXAMPLES_DEBIAN_INSTALL

RUN apt-get -y update && apt-get install -y --no-install-recommends \
Expand Down
3 changes: 3 additions & 0 deletions debian-docker-images/upstream/weston/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,9 @@ RUN usermod -a -G input torizon
# See https://github.com/kennylevinsen/seatd/blob/a803ba0502cccf147eec7fbcacd11c5b8643c0e0/man/seatd-launch.1.scd
RUN chmod u+s /usr/bin/seatd-launch

HEALTHCHECK --interval=1s --timeout=5s --start-period=0s --retries=3 \
CMD find /tmp/1000-runtime-dir -maxdepth 1 -type s -name 'wayland-*' -print -quit | grep -q .

WORKDIR /home/torizon

ENTRYPOINT ["/usr/bin/entry.sh"]

0 comments on commit 07833f9

Please sign in to comment.