Skip to content

High performance self-hosted photo and video management solution.

chore: build metadata for ML container (#15831)

bo0tzz882163f54542
diff --git a/machine-learning/Dockerfile b/machine-learning/Dockerfile
index df2b5b95fe..7dc206ab55 100644
--- a/machine-learning/Dockerfile
+++ b/machine-learning/Dockerfile
@@ -106,6 +106,22 @@ COPY --from=builder /opt/venv /opt/venv
COPY ann/ann.py /usr/src/ann/ann.py
COPY start.sh log_conf.json gunicorn_conf.py ./
COPY app .
+
+ARG BUILD_ID
+ARG BUILD_IMAGE
+ARG BUILD_SOURCE_REF
+ARG BUILD_SOURCE_COMMIT
+
+ENV IMMICH_BUILD=${BUILD_ID}
+ENV IMMICH_BUILD_URL=https://github.com/immich-app/immich/actions/runs/${BUILD_ID}
+ENV IMMICH_BUILD_IMAGE=${BUILD_IMAGE}
+ENV IMMICH_BUILD_IMAGE_URL=https://github.com/immich-app/immich/pkgs/container/immich-machine-learning
+ENV IMMICH_REPOSITORY=immich-app/immich
+ENV IMMICH_REPOSITORY_URL=https://github.com/immich-app/immich
+ENV IMMICH_SOURCE_REF=${BUILD_SOURCE_REF}
+ENV IMMICH_SOURCE_COMMIT=${BUILD_SOURCE_COMMIT}
+ENV IMMICH_SOURCE_URL=https://github.com/immich-app/immich/commit/${BUILD_SOURCE_COMMIT}
+
ENTRYPOINT ["tini", "--"]
CMD ["./start.sh"]
diff --git a/machine-learning/start.sh b/machine-learning/start.sh
index 552cca1f5e..d2f5b94dc3 100755
--- a/machine-learning/start.sh
+++ b/machine-learning/start.sh
@@ -1,5 +1,7 @@
#!/usr/bin/env sh
+echo "Initializing Immich ML $IMMICH_SOURCE_REF"
+
lib_path="/usr/lib/$(arch)-linux-gnu/libmimalloc.so.2"
# mimalloc seems to increase memory usage dramatically with openvino, need to investigate
if ! [ "$DEVICE" = "openvino" ]; then