Ver Fonte

build: link the 2.12.0 database client, and pin it so a bump is visible

The daemon on zeus is 2.12.0; the containers were still linking client 2.11.3,
a month after 2.12.0 was published. The client is backward compatible so
nothing was broken - it simply could not use anything the newer one added.

Pinned via DB_CLIENT_VERSION because unpinned is how it went stale. apt's
install layer caches, so a newer client in the repository changed nothing at
all: the first rebuild here produced 2.11.3 again from cache. A pinned version
is a declared fact, busts the layer when bumped, and makes a version the
repository does not have a build failure rather than a quietly old client. The
runtime stage pins the same value - a runtime library older than the one the
binaries were linked against surfaces as a missing symbol at startup, not at
build time.

build.sh also looked for the repository at /data/smartbotics-deb-repo, which no
longer exists; the checkout moved under /data/dev/smartbotics/ with the other
projects. It failed on reading RepoPass, which reads like a credential problem
rather than a moved path. Both locations are tried now.

Verified: client 2.12.0-1 against daemon 2.12.0, services healthy, runner
registered with all 87 nodes, node suite 103 passed and the C++ tests green.
fszontagh há 1 mês atrás
pai
commit
fc1a09abf6
3 ficheiros alterados com 34 adições e 4 exclusões
  1. 14 1
      packaging/Dockerfile.base
  2. 6 1
      packaging/Dockerfile.build
  3. 14 2
      packaging/build.sh

+ 14 - 1
packaging/Dockerfile.base

@@ -16,6 +16,17 @@ RUN apt-get update && apt-get install -y --no-install-recommends ca-certificates
 # SmartBotics APT repository (for libsmartbotic-db-client-dev)
 ARG REPO_USER=callerai
 ARG REPO_PASS
+
+# Pinned deliberately. Unpinned, the apt layer caches and a newer client in the
+# repository changes nothing at all - the image kept installing 2.11.3 for a
+# month after 2.12.0 was published, and nothing said so. Pinning makes the
+# version a declared fact, busts the layer when it is bumped, and turns a
+# missing version into a build failure instead of a silently old client.
+#
+# Keep this at the version the daemon runs. The client is backward compatible,
+# so a newer daemon with an older client works - it just cannot use anything
+# the newer one added.
+ARG DB_CLIENT_VERSION=2.12.0-1
 COPY packaging/smartbotics-repo.gpg /usr/share/keyrings/smartbotics-repo.gpg
 RUN echo "deb [signed-by=/usr/share/keyrings/smartbotics-repo.gpg] https://repository.smartbotics.ai trixie main" \
         > /etc/apt/sources.list.d/smartbotics.list \
@@ -23,7 +34,9 @@ RUN echo "deb [signed-by=/usr/share/keyrings/smartbotics-repo.gpg] https://repos
         "$REPO_USER" "$REPO_PASS" > /etc/apt/auth.conf.d/smartbotics.conf \
     && chmod 600 /etc/apt/auth.conf.d/smartbotics.conf \
     && apt-get update \
-    && apt-get install -y --no-install-recommends libsmartbotic-db-client-dev \
+    && apt-get install -y --no-install-recommends \
+        libsmartbotic-db-client-dev=${DB_CLIENT_VERSION} \
+        libsmartbotic-db-client=${DB_CLIENT_VERSION} \
     && rm -rf /var/lib/apt/lists/* \
     && rm -f /etc/apt/auth.conf.d/smartbotics.conf \
     && rm -f /etc/apt/sources.list.d/smartbotics.list

+ 6 - 1
packaging/Dockerfile.build

@@ -92,6 +92,11 @@ FROM debian:trixie-slim AS runtime
 
 ENV DEBIAN_FRONTEND=noninteractive
 
+# Same version as the builder installed - a runtime library older than the one
+# the binaries were linked against is the kind of mismatch that surfaces as a
+# missing symbol at startup rather than at build time.
+ARG DB_CLIENT_VERSION=2.12.0-1
+
 ARG REPO_USER=callerai
 ARG REPO_PASS
 COPY packaging/smartbotics-repo.gpg /usr/share/keyrings/smartbotics-repo.gpg
@@ -107,7 +112,7 @@ RUN apt-get update && apt-get install -y --no-install-recommends ca-certificates
     && chmod 600 /etc/apt/auth.conf.d/smartbotics.conf \
     && apt-get update \
     && apt-get install -y --no-install-recommends \
-        libsmartbotic-db-client \
+        libsmartbotic-db-client=${DB_CLIENT_VERSION} \
         libssl3t64 libprotobuf32t64 libgrpc++1.51t64 libspdlog1.15 libfmt10 \
         libuuid1 libcurl4t64 zlib1g libbrotli1 libwebsockets19t64 \
         libmariadb3 libpq5 \

+ 14 - 2
packaging/build.sh

@@ -16,7 +16,17 @@ cd "$PROJECT_DIR"
 BASE_IMAGE_NAME="smartbotic-automation-build-base:debian13"
 OUTPUT_DIR="${PROJECT_DIR}/dist/debian13"
 BUILD_JOBS="${BUILD_JOBS:-$(nproc)}"
-DEB_REPO_DIR="${DEB_REPO_DIR:-/data/smartbotics-deb-repo}"
+# The repository checkout moved under /data/dev/<org>/ with the other projects;
+# the old top-level path no longer exists, and build.sh failed at the credential
+# read rather than at anything to do with building. Both are tried so a machine
+# that still has the old layout keeps working.
+DEB_REPO_DIR="${DEB_REPO_DIR:-}"
+if [ -z "$DEB_REPO_DIR" ]; then
+    for candidate in /data/dev/smartbotics/smartbotics-deb-repo /data/smartbotics-deb-repo; do
+        if [ -f "$candidate/.env" ]; then DEB_REPO_DIR="$candidate"; break; fi
+    done
+    DEB_REPO_DIR="${DEB_REPO_DIR:-/data/dev/smartbotics/smartbotics-deb-repo}"
+fi
 
 RED='\033[0;31m'; GREEN='\033[0;32m'; YELLOW='\033[1;33m'; BLUE='\033[0;34m'; NC='\033[0m'
 log_info()    { echo -e "${BLUE}[INFO]${NC} $1"; }
@@ -56,7 +66,9 @@ Options:
 
 Environment:
   BUILD_JOBS           Parallel build jobs (default: nproc)
-  DEB_REPO_DIR         Path to smartbotics-deb-repo (default: /data/smartbotics-deb-repo)
+  DEB_REPO_DIR         Path to smartbotics-deb-repo (default: the first of
+                       /data/dev/smartbotics/smartbotics-deb-repo or
+                       /data/smartbotics-deb-repo that has a .env)
 EOF
             exit 0 ;;
         *) VERSION="$1"; shift ;;