Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 10 additions & 10 deletions src/backend/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -3,15 +3,15 @@ FROM public.ecr.aws/ubuntu/ubuntu:${OS}
ENV DEBIAN_FRONTEND=noninteractive
RUN apt-get update && apt-get install -y software-properties-common wget build-essential libffi-dev zlib1g-dev libssl-dev libsqlite3-dev gdb
RUN apt-get update
RUN wget https://www.python.org/ftp/python/3.9.23/Python-3.9.23.tgz
RUN tar -xzf Python-3.9.23.tgz
RUN cd Python-3.9.23 && \
RUN wget https://www.python.org/ftp/python/3.11.9/Python-3.11.9.tgz
RUN tar -xzf Python-3.11.9.tgz
RUN cd Python-3.11.9 && \
./configure --enable-optimizations --enable-shared && \
make -j$(nproc) && \
make install
RUN find / -name "libpython3.9.so.1.0" -print
RUN update-alternatives --install /usr/local/bin/python3 python3 /usr/local/bin/python3.9 1 \
&& update-alternatives --set python3 /usr/local/bin/python3.9
RUN find / -name "libpython3.11.so.1.0" -print
RUN update-alternatives --install /usr/local/bin/python3 python3 /usr/local/bin/python3.11 1 \
&& update-alternatives --set python3 /usr/local/bin/python3.11

RUN add-apt-repository ppa:ubuntu-toolchain-r/test -y && \
apt-get update && \
Expand All @@ -30,7 +30,7 @@ COPY edge_ml1_p_camera_management ./edge_ml1_p_camera_management
COPY edgeagent ./edgeagent
RUN ./edge_ml1_p_camera_management/prereqs_install.sh
RUN ./edge_ml1_p_camera_management/install_aravis.sh
RUN python3.9 -m grpc_tools.protoc --proto_path=./edgeagent --python_out=. --grpc_python_out=. edgeagent/edge-agent.proto
RUN python3.11 -m grpc_tools.protoc --proto_path=./edgeagent --python_out=. --grpc_python_out=. edgeagent/edge-agent.proto
RUN apt update -y
RUN apt-get install libssl1.1 -y
RUN apt update -y
Expand All @@ -39,7 +39,7 @@ RUN if [ "$OS" = "18.04" ] ; then \
apt install libavcodec-extra57i -y; \
fi

RUN find / -name "libpython3.9.so.1.0" -print
RUN find / -name "libpython3.11.so.1.0" -print

RUN apt clean -y

Expand All @@ -64,7 +64,7 @@ COPY alembic.ini ./
COPY dda_triton ./dda_triton
COPY lyra_anomalies_mask_utils ./lyra_anomalies_mask_utils
COPY lyra_science_processing_utils ./lyra_science_processing_utils
CMD ["python3.9", "app.py"]
CMD ["python3.11", "app.py"]

# Temporary to fix CVE-2024-24806 and CVE-2024-0553 until slim-buster base image is fixed
RUN apt-get update \
Expand All @@ -81,7 +81,7 @@ RUN apt-get update \
COPY edgemlsdk ./edgemlsdk
RUN ./edge_ml1_p_camera_management/install_edgemlsdk.sh
COPY dlr_disable_phone_home.py ./
RUN python3.9 dlr_disable_phone_home.py
RUN python3.11 dlr_disable_phone_home.py

#TODO:change to user to scope the permission. Currently needed to persist the TinyDB data
USER root
14 changes: 10 additions & 4 deletions src/backend/requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -5,14 +5,18 @@ opencv-python
urllib3==2.2.3
requests==2.32.3
python-dateutil==2.8.2
# Note: Jetson.GPIO - verify compatibility with Python 3.11 on your Jetson device
Jetson.GPIO==2.0.21
awsiotsdk==1.11.9
marshmallow==3.19.0
pyyaml==5.4.1
# Upgraded for Python 3.11 compatibility
pyyaml==6.0.1
grpcio==1.56.2
grpcio-tools==1.51.1
# Aligned with grpcio version
grpcio-tools==1.56.2
jsonschema==4.17.3
numpy==1.24.3
# Upgraded for better Python 3.11 support and optimization
numpy==1.26.4
Pillow==10.3.0
pycairo==1.23.0
PyGObject==3.42.2
Expand All @@ -21,6 +25,7 @@ psutil==5.9.5
fastapi==0.109.2
uvicorn==0.23.2
pydantic==2.1.1
# Note: dlr (Neo DLR) - verify Python 3.11 wheel availability; may require custom build
dlr==1.10.0
asgi-correlation-id==4.2.0
structlog==22.1.0
Expand All @@ -29,4 +34,5 @@ Deprecated==1.2.14
sqlalchemy==2.0.21
alembic==1.12.1
httpx==0.24.1
scikit-learn==1.0.2
# Upgraded for Python 3.11 support (minimum version 1.1.0 required for 3.11)
scikit-learn==1.3.2