more progress

This commit is contained in:
Nicholas Page 2024-05-09 17:06:51 -07:00
parent fcd1fa7468
commit ab95391057
5 changed files with 51 additions and 17 deletions

View File

@ -115,6 +115,10 @@ FROM base AS wheels
ARG DEBIAN_FRONTEND ARG DEBIAN_FRONTEND
ARG TARGETARCH ARG TARGETARCH
RUN --mount=type=bind,source=docker/tensorrt/install_python_39.sh,target=/deps/install_python_39.sh \
--mount=type=cache,target=/root/.ccache \
/deps/install_python_39.sh
# Use a separate container to build wheels to prevent build dependencies in final image # Use a separate container to build wheels to prevent build dependencies in final image
RUN apt-get -qq update \ RUN apt-get -qq update \
&& apt-get -qq install -y \ && apt-get -qq install -y \
@ -128,8 +132,6 @@ RUN apt-get -qq update \
tee /etc/apt/sources.list.d/debian-bullseye-nonfree.list \ tee /etc/apt/sources.list.d/debian-bullseye-nonfree.list \
&& apt-get -qq update \ && apt-get -qq update \
&& apt-get -qq install -y \ && apt-get -qq install -y \
python3.9 \
python3.9-dev \
# opencv dependencies # opencv dependencies
build-essential cmake git pkg-config libgtk-3-dev \ build-essential cmake git pkg-config libgtk-3-dev \
libavcodec-dev libavformat-dev libswscale-dev libv4l-dev \ libavcodec-dev libavformat-dev libswscale-dev libv4l-dev \
@ -142,7 +144,7 @@ RUN apt-get -qq update \
rm -rf /var/lib/apt/lists/* rm -rf /var/lib/apt/lists/*
# Ensure python3 defaults to python3.9 # Ensure python3 defaults to python3.9
RUN update-alternatives --install /usr/bin/python3 python3 /usr/bin/python3.9 1 # RUN update-alternatives --install /usr/bin/python3 python3 /usr/bin/python3.9 1
RUN wget -q https://bootstrap.pypa.io/get-pip.py -O get-pip.py \ RUN wget -q https://bootstrap.pypa.io/get-pip.py -O get-pip.py \
&& python3 get-pip.py "pip" && python3 get-pip.py "pip"

View File

@ -4,13 +4,28 @@ set -euxo pipefail
apt-get -qq update apt-get -qq update
if [ -e /usr/local/cuda-12.2 ]; then
apt-get update && \
apt-get install wget build-essential ccache clang cmake pkg-config -y
wget https://www.python.org/ftp/python/3.9.6/Python-3.9.6.tgz
tar -xf Python-3.9.6.tgz
cd Python-3.9.6
./configure --enable-optimizations
make altinstall
else
apt-get -qq update \
&& apt-get -qq install -y --no-install-recommends \
python3.9 \
&& rm -rf /var/lib/apt/lists/*
fi
apt-get -qq install --no-install-recommends -y \ apt-get -qq install --no-install-recommends -y \
apt-transport-https \ apt-transport-https \
gnupg \ gnupg \
wget \ wget \
procps vainfo \ procps vainfo \
unzip locales tzdata libxml2 xz-utils \ unzip locales tzdata libxml2 xz-utils \
python3.9 \
python3-pip \ python3-pip \
curl \ curl \
jq \ jq \

View File

@ -8,14 +8,17 @@ FROM ${BASE_IMAGE} AS build-wheels
ARG DEBIAN_FRONTEND ARG DEBIAN_FRONTEND
# Use a separate container to build wheels to prevent build dependencies in final image # Use a separate container to build wheels to prevent build dependencies in final image
RUN apt-get -qq update \ RUN --mount=type=bind,source=docker/tensorrt/install_python_39.sh,target=/deps/install_python_39.sh \
&& apt-get -qq install -y --no-install-recommends \ --mount=type=cache,target=/root/.ccache \
python3.9 python3.9-dev \ /deps/install_python_39.sh
wget build-essential cmake git \ #RUN apt-get -qq update \
&& rm -rf /var/lib/apt/lists/* # && apt-get -qq install -y --no-install-recommends \
# python3.9 python3.9-dev \
# wget build-essential cmake git \
# && rm -rf /var/lib/apt/lists/*
# Ensure python3 defaults to python3.9 # Ensure python3 defaults to python3.9
RUN update-alternatives --install /usr/bin/python3 python3 /usr/bin/python3.9 1 # RUN update-alternatives --install /usr/bin/python3 python3 /usr/bin/python3.9 1
RUN wget -q https://bootstrap.pypa.io/get-pip.py -O get-pip.py \ RUN wget -q https://bootstrap.pypa.io/get-pip.py -O get-pip.py \
&& python3 get-pip.py "pip" && python3 get-pip.py "pip"

View File

@ -27,13 +27,7 @@ if [ -e /usr/local/cuda-12.2 ]; then
apt-get update apt-get update
apt-get install nvidia-l4t-jetson-multimedia-api -y apt-get install nvidia-l4t-jetson-multimedia-api -o Dpkg::Options::="--force-confold" --force-yes -y
wget https://www.python.org/ftp/python/3.9.6/Python-3.9.6.tgz
tar -xf Python-3.9.6.tgz
cd Python-3.9.6
./configure --enable-optimizations
sudo make altinstall
elif [ -e /usr/local/cuda-10.2 ]; then elif [ -e /usr/local/cuda-10.2 ]; then
# assume Jetpack 4.X # assume Jetpack 4.X
wget -q https://developer.nvidia.com/embedded/L4T/r32_Release_v5.0/T186/Jetson_Multimedia_API_R32.5.0_aarch64.tbz2 -O jetson_multimedia_api.tbz2 wget -q https://developer.nvidia.com/embedded/L4T/r32_Release_v5.0/T186/Jetson_Multimedia_API_R32.5.0_aarch64.tbz2 -O jetson_multimedia_api.tbz2

View File

@ -0,0 +1,20 @@
if [ -e /usr/local/cuda-12.2 ]; then
apt-get update && \
apt-get install wget build-essential ccache clang cmake pkg-config -y
wget https://www.python.org/ftp/python/3.9.6/Python-3.9.6.tgz
tar -xf Python-3.9.6.tgz
cd Python-3.9.6
./configure --enable-optimizations
make altinstall
update-alternatives --install /usr/bin/python3 python3 /usr/local/bin/python3.9 1
else
apt-get -qq update \
&& apt-get -qq install -y --no-install-recommends \
python3.9 python3.9-dev \
wget build-essential cmake git \
&& rm -rf /var/lib/apt/lists/*
update-alternatives --install /usr/bin/python3 python3 /usr/bin/python3.9 1
fi