Skip to content

Commit 28a14f9

Browse files
authored
[TimeSeries]: Reduced image size and removed oneAPI tool kit (open-edge-platform#845)
focuses on reducing the Docker image size and removing the oneAPI toolkit while updating the Time Series Analytics microservice. The changes include significant code refactoring to improve logging practices, updating Python dependencies, and modifying the Docker build process for optimization. Standardized logging format throughout the codebase to use parameterized logging instead of f-strings Updated Python dependencies and removed oneAPI toolkit from Docker configuration Refactored code structure and improved documentation with proper docstrings Signed-off-by: Vellaisamy, Sathyendran <[email protected]>
1 parent 7b17977 commit 28a14f9

File tree

3 files changed

+11
-19
lines changed

3 files changed

+11
-19
lines changed

microservices/time-series-analytics/Dockerfile

Lines changed: 6 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -11,10 +11,10 @@ FROM kapacitor:$KAPACITOR_VERSION
1111
# Install Python and necessary packages in a single layer, minimize image size
1212
RUN apt-get update && \
1313
apt-get install -y --no-install-recommends \
14-
python3 python3-pip git ca-certificates && \
14+
python3 python3-pip git ca-certificates intel-gpu-tools && \
1515
python3 -m pip install --no-cache-dir --upgrade pip && \
1616
apt-get purge -y --auto-remove && \
17-
rm -rf /var/lib/apt/lists/*
17+
rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/* /root/.cache/pip
1818

1919
WORKDIR /app
2020

@@ -26,6 +26,7 @@ RUN git clone --depth 1 --filter=blob:none --sparse --branch v${KAPACITOR_VERSIO
2626
mv /tmp/kapacitor/udf/agent/py /app/kapacitor_python && \
2727
rm -rf /tmp/kapacitor
2828

29+
# Install Intel GPU tools and clean up
2930
RUN apt-get update && apt-get install -y --no-install-recommends intel-gpu-tools
3031

3132
RUN export no_proxy= && \
@@ -47,12 +48,6 @@ RUN export no_proxy= && \
4748
apt-get clean && \
4849
rm -rf /var/lib/apt/lists/*
4950

50-
RUN wget https://registrationcenter-download.intel.com/akdlm/IRC_NAS/cca951e1-31e7-485e-b300-fe7627cb8c08/intel-oneapi-base-toolkit-2025.1.0.651_offline.sh
51-
52-
RUN sh ./intel-oneapi-base-toolkit-2025.1.0.651_offline.sh -a --silent --cli --eula accept
53-
54-
RUN apt update && apt install -y cmake pkg-config build-essential
55-
5651
ARG TIMESERIES_UID
5752
ARG TIMESERIES_USER_NAME
5853
ARG PYTHON_VERSION
@@ -100,7 +95,7 @@ RUN if [ "$COPYLEFT_SOURCES" = "true" ]; then \
10095
# Get source code for installed Python packages with copyleft licenses \
10196
mkdir -p /copyleft_sources/python && \
10297
cd /copyleft_sources/python && \
103-
apt-get update && apt-get install -y --no-install-recommends gcc build-essential libffi-dev python3-dev && \
98+
apt-get update && apt-get install -y --no-install-recommends gcc libffi-dev python3-dev && \
10499
# Download python package sources with relevant licenses \
105100
pip3 freeze | cut -d= -f1 | while read pkg; do \
106101
meta=$(pip3 show $pkg 2>/dev/null); \
@@ -110,7 +105,7 @@ RUN if [ "$COPYLEFT_SOURCES" = "true" ]; then \
110105
pip3 download --no-binary :all: $pkg || true; \
111106
fi; \
112107
done; \
113-
apt-get remove --purge -y gcc build-essential libffi-dev python3-dev; \
108+
apt-get remove --purge -y gcc libffi-dev python3-dev; \
114109
fi
115110

116111
WORKDIR /app
@@ -124,4 +119,4 @@ USER $TIMESERIES_USER_NAME
124119
# Simple healthcheck to verify container is running
125120
HEALTHCHECK --interval=5m CMD exit 0
126121

127-
ENTRYPOINT ["bash", "-c", "source /opt/intel/oneapi/setvars.sh && python3 main.py"]
122+
ENTRYPOINT ["python3", "main.py"]

microservices/time-series-analytics/docker/.env

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,6 @@ timeseries_no_proxy=localhost,127.0.0.1
2626

2727
KAPACITOR_PORT=9092
2828
LOG_LEVEL=INFO
29-
TIME_SERIES_ANALYTICS_IMAGE=intel/ia-time-series-analytics-microservice:1.0.0
29+
TIME_SERIES_ANALYTICS_IMAGE=intel/ia-time-series-analytics-microservice:1.1.0
3030
# Please provide the suffix for the image version you want to use like rc1, rc2, git hash id etc.
3131
IMAGE_SUFFIX=""
Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,10 @@
11
scikit-learn-intelex==2025.7.0
22
scikit-learn==1.6.1
3-
dpcpp-cpp-rt==2025.1.1
4-
dpctl==0.20.2
5-
protobuf==6.31.1
6-
modin==0.32.0
7-
tomlkit==0.13.2
83
asyncua==1.1.5
9-
fastapi==0.115.12
4+
fastapi==0.116.1
105
uvicorn==0.34.0
116
influxdb==5.3.2
127
requests==2.32.4
13-
numpy==2.2.6
8+
tomlkit==0.13.2
9+
protobuf==6.31.1
10+
dpctl==0.20.2

0 commit comments

Comments
 (0)