Skip to content

Commit a8386af

Browse files
authored
Merge branch 'release-2025.2' into revert-dlsps-to-3.1.0
2 parents ee09558 + e7db591 commit a8386af

File tree

3 files changed

+36
-34
lines changed

3 files changed

+36
-34
lines changed

cluster_analytics/Dockerfile

Lines changed: 35 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -40,8 +40,10 @@ RUN : \
4040
&& rm -rf scene_common \
4141
&& rm -f /tmp/requirements-build.txt
4242

43+
COPY ./tools/waitforbroker /tmp/tools/waitforbroker
44+
4345
# -------------- Cluster Analytics Runtime Stage --------------
44-
FROM scenescape-common-base-24-04 AS scenescape-cluster-analytics-runtime
46+
FROM python:3.12-slim AS scenescape-cluster-analytics-runtime
4547

4648
# Label image with description and metadata
4749
LABEL org.opencontainers.image.description="Intel® SceneScape's Scene Cluster Analytics Service"
@@ -53,51 +55,53 @@ LABEL org.opencontainers.image.documentation="https://github.com/open-edge-platf
5355
ARG USER_ID=1001
5456
ARG GROUP_ID=1001
5557
ARG CERTDOMAIN=scenescape.intel.com
56-
ARG PYTHON_VERSION=3.12
57-
58-
ENV PYTHON_VERSION=${PYTHON_VERSION}
5958
ENV WSUSER=scenescape
6059
ENV SCENESCAPE_HOME=/home/$WSUSER/SceneScape
61-
ENV BUILD_ENV_DIR=/tmp/venv
60+
ENV BUILD_ENV_DIR=/opt/venv
61+
6262
ENV DEBIAN_FRONTEND=noninteractive
6363
SHELL ["/bin/bash", "-o", "pipefail", "-c"]
6464

65-
RUN : \
66-
&& apt-get update \
67-
&& apt-get install -y --no-install-recommends \
65+
# Install only minimal runtime system dependencies
66+
RUN apt-get update && apt-get install -y --no-install-recommends \
6867
libgl1 \
69-
libopencv-contrib406t64 \
70-
libpython3.12 \
71-
netbase \
72-
&& rm -rf /usr/lib/x86_64-linux-gnu/libLLVM-15.so.1 \
73-
&& rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/*
68+
libglib2.0-0 \
69+
&& rm -rf /var/lib/apt/lists/*
7470

75-
RUN : \
76-
# delete ubuntu user if exists
77-
&& userdel -f -r ubuntu || true \
78-
# create scenescape user
79-
&& groupadd -g ${GROUP_ID} $WSUSER \
71+
# Create a venv (already optimized in slim images)
72+
RUN python3 -m venv $BUILD_ENV_DIR
73+
ENV PATH="$BUILD_ENV_DIR/bin:$PATH"
74+
75+
# Install core Python dependencies
76+
RUN pip install --no-cache-dir --upgrade pip numpy opencv-python-headless==4.6.0.66
77+
78+
# Copy compiled scene_common + fast_geometry from builder
79+
COPY --chown=$WSUSER:$WSUSER --from=scenescape-common-base-24-04 /usr/local/lib/python3.12/dist-packages/scene_common \
80+
$BUILD_ENV_DIR/lib/python3.12/site-packages/scene_common
81+
82+
COPY --chown=$WSUSER:$WSUSER --from=scenescape-common-base-24-04 /usr/local/lib/python3.12/dist-packages/fast_geometry \
83+
$BUILD_ENV_DIR/lib/python3.12/site-packages/fast_geometry
84+
85+
# Add non-root user
86+
RUN groupadd -g ${GROUP_ID} $WSUSER \
8087
&& useradd -r -m -u ${USER_ID} -g ${GROUP_ID} -s /bin/bash $WSUSER \
81-
&& usermod -a -G video,users $WSUSER \
82-
&& eval WSHOME=~$WSUSER \
83-
&& chmod a+rX "${WSHOME}"
88+
&& usermod -a -G video,users $WSUSER
8489

85-
# Install only required runtime dependencies
86-
COPY cluster_analytics/requirements-runtime.txt /tmp
87-
RUN : \
88-
&& pip3 install --break-system-packages --upgrade --no-cache-dir --ignore-installed -r /tmp/requirements-runtime.txt \
90+
# Install app runtime Python deps
91+
COPY cluster_analytics/requirements-runtime.txt /tmp/
92+
RUN pip install --no-cache-dir -r /tmp/requirements-runtime.txt \
8993
&& rm -rf /tmp/requirements-runtime.txt
9094

91-
# Install WebUI dependencies with hash verification
92-
COPY cluster_analytics/tools/webui/requirements-webui.txt /tmp
93-
RUN : \
94-
&& pip3 install --break-system-packages --no-cache-dir -r /tmp/requirements-webui.txt \
95+
# Install WebUI dependencies
96+
COPY cluster_analytics/tools/webui/requirements-webui.txt /tmp/
97+
RUN pip install --no-cache-dir -r /tmp/requirements-webui.txt \
9598
&& rm -rf /tmp/requirements-webui.txt
9699

97-
COPY --chown=$WSUSER:$WSUSER --from=scenescape-common-base-24-04 /usr/local/lib/python${PYTHON_VERSION}/dist-packages/fast_geometry /usr/local/lib/python${PYTHON_VERSION}/dist-packages/fast_geometry
98-
COPY --chown=$WSUSER:$WSUSER --from=scenescape-common-base-24-04 /usr/local/lib/python${PYTHON_VERSION}/dist-packages/scene_common /usr/local/lib/python${PYTHON_VERSION}/dist-packages/scene_common
100+
# Copy tools
101+
COPY --chown=$USER_ID:$GROUP_ID --from=scenescape-common-base-24-04 /tmp/tools/waitforbroker $SCENESCAPE_HOME/tools/waitforbroker
99102

100103
USER $USER_ID:$GROUP_ID
104+
HEALTHCHECK CMD true
101105

102106
# Copy source code
103107
COPY ./cluster_analytics/src /app

cluster_analytics/src/cluster_analytics_tracker.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -709,8 +709,7 @@ def _createTrackedCluster(self, scene_id: str, detection: Dict,
709709
velocity_analysis=detection['velocity_analysis'],
710710
object_ids=detection['object_ids'],
711711
dbscan_params=detection['dbscan_params'],
712-
detection_timestamp=timestamp,
713-
config=self.config
712+
detection_timestamp=timestamp
714713
)
715714

716715
def getActiveClusters(self, scene_id: Optional[str] = None,

mapping/Dockerfile

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,6 @@ RUN apt-get update && apt-get install -y --no-install-recommends \
5858
python3 \
5959
python3-pip \
6060
python-is-python3 \
61-
ffmpeg \
6261
git \
6362
libsm6 \
6463
libxext6 \

0 commit comments

Comments
 (0)