mkuf / prind

print in docker - Deploy a containerized Klipper Stack for your 3D Printer
GNU General Public License v3.0
324 stars 82 forks source link

Question: how to check version of each component within Mainsail. #74

Closed GAZ082 closed 1 year ago

GAZ082 commented 1 year ago

Hello! Is there any way? The little icons in Mainsail just show a question mark in the version number.

Thanks!

mkuf commented 1 year ago

Hi There,

Klipper and Moonraker rely on the git history to be present to determine their Versions.
As the git directory is quite large (~300M for klipper) and is not required for operation it is removed from the runtime image to keep its size small. Klipper and Moonraker are therefore not able to determine their version, wich results in the ? being displayed.

I did some testing with sparse cloning the repository but klipper as well as moonraker did not display a valid version number in this case. So there is no workaround for this and versions will probably remain as they are, unless klipper and moonraker offer an external way to set the version at build time.

-Markus

mkuf commented 1 year ago

What you can do however is checking the version of the docker containers.
The label org.prind.image.version contains the upstream sha that represents the commit of the corresponding repository.

This commands lists the service, image and org.prind.image.version for all prind services.

  for container in $(docker ps -aqf "label=org.prind.service"); do
    echo "$(docker inspect --format '{{ index .Config.Labels "org.prind.service" }}' ${container}): $(docker inspect --format '{{ index .Config.Image }}' ${container}) $(docker inspect --format '{{ index .Config.Labels "org.prind.image.version"}}' ${container})"
  done

Output:

moonraker: mkuf/moonraker:latest v0.8.0
klipper: mkuf/klipper:latest 37315bf3365484c3ba6adef2b7da2b4464980e8a
traefik: traefik:v2.5 
klipperscreen: mkuf/klipperscreen:latest 059f1a8026588090d0ea205b02c0d0a9a8e2b80a
mobileraker_companion: ghcr.io/clon1998/mobileraker_companion:latest 
mainsail: ghcr.io/mainsail-crew/mainsail:edge 
init: busybox:latest 
webcam: mkuf/ustreamer:latest dde2190ac9b96795e58908a6b57b06b2842b1010