From c2fd35d875155d858a60542edabb9df59587e1f8 Mon Sep 17 00:00:00 2001 From: oOraph <13552058+oOraph@users.noreply.github.com> Date: Thu, 11 Apr 2024 19:31:48 +0200 Subject: [PATCH] Dev/mask ldconfig output v2 (#1716) wrap text-generation-launcher in docker image mask ldconfig failures to user (no need in most cases anyway) --------- Signed-off-by: Raphael Glon Co-authored-by: Raphael Glon --- Dockerfile | 4 +++- launcher/src/main.rs | 10 ---------- tgi-entrypoint.sh | 5 +++++ 3 files changed, 8 insertions(+), 11 deletions(-) create mode 100755 tgi-entrypoint.sh diff --git a/Dockerfile b/Dockerfile index 0bc5f8d9..c2ae4c85 100644 --- a/Dockerfile +++ b/Dockerfile @@ -245,5 +245,7 @@ ENTRYPOINT ["./entrypoint.sh"] # Final image FROM base -ENTRYPOINT ["text-generation-launcher"] +COPY ./tgi-entrypoint.sh /tgi-entrypoint.sh + +ENTRYPOINT ["/tgi-entrypoint.sh"] CMD ["--json-output"] diff --git a/launcher/src/main.rs b/launcher/src/main.rs index 3f810023..836b0381 100644 --- a/launcher/src/main.rs +++ b/launcher/src/main.rs @@ -1217,16 +1217,6 @@ fn terminate(process_name: &str, mut process: Child, timeout: Duration) -> io::R } fn main() -> Result<(), LauncherError> { - match Command::new("ldconfig").spawn() { - Ok(_) => {} - Err(err) => { - tracing::warn!( - "Unable to refresh ldconfig cache. Skipping (useless in most cases). Details {:?}", - err - ) - } - } - // Pattern match configuration let args: Args = Args::parse(); diff --git a/tgi-entrypoint.sh b/tgi-entrypoint.sh new file mode 100755 index 00000000..ea94dcd9 --- /dev/null +++ b/tgi-entrypoint.sh @@ -0,0 +1,5 @@ +#!/bin/bash + +ldconfig 2>/dev/null || echo 'unable to refresh ld cache, not a big deal in most cases' + +text-generation-launcher $@