From effe76f2516deebd53887ac630ceba694b4deb60 Mon Sep 17 00:00:00 2001 From: Koushik Dutta Date: Mon, 20 Mar 2023 13:30:10 -0700 Subject: [PATCH] docker: update massive nvidia build --- docker/Dockerfile.full | 2 +- docker/Dockerfile.nvidia | 51 ++++---------------------- docker/docker-build-nvidia.sh | 18 +-------- docker/template/Dockerfile.full.header | 2 +- 4 files changed, 12 insertions(+), 61 deletions(-) diff --git a/docker/Dockerfile.full b/docker/Dockerfile.full index 92d6700f0..b966c0494 100644 --- a/docker/Dockerfile.full +++ b/docker/Dockerfile.full @@ -65,7 +65,7 @@ RUN python3 -m pip install --upgrade pip # pyvips is broken on x86 due to mismatch ffi # https://stackoverflow.com/questions/62658237/it-seems-that-the-version-of-the-libffi-library-seen-at-runtime-is-different-fro RUN pip install --force-reinstall --no-binary :all: cffi -RUN python3 -m pip install aiofiles debugpy typing_extensions typing psutil +RUN python3 -m pip install aiofiles debugpy typing_extensions psutil ################################################################ # End section generated from template/Dockerfile.full.header diff --git a/docker/Dockerfile.nvidia b/docker/Dockerfile.nvidia index a4f5ed727..9bf385603 100644 --- a/docker/Dockerfile.nvidia +++ b/docker/Dockerfile.nvidia @@ -1,33 +1,4 @@ -ARG BASE="18-bullseye-full" -FROM koush/scrypted-common:${BASE} - -# avahi advertiser support -RUN apt-get -y install \ - libnss-mdns \ - avahi-discover \ - libavahi-compat-libdnssd-dev - -# copy configurations and scripts -COPY fs / - -# s6 process supervisor -ARG S6_OVERLAY_VERSION=3.1.1.2 -ENV S6_CMD_WAIT_FOR_SERVICES_MAXTIME=0 -ENV S6_KEEP_ENV=1 -RUN case "$(uname -m)" in \ - x86_64) S6_ARCH='x86_64';; \ - armv7l) S6_ARCH='armhf';; \ - aarch64) S6_ARCH='aarch64';; \ - *) echo "Your system architecture isn't supported."; exit 1 ;; \ - esac \ - && cd /tmp \ - && set -x \ - && curl -SLOf https://github.com/just-containers/s6-overlay/releases/download/v${S6_OVERLAY_VERSION}/s6-overlay-noarch.tar.xz \ - && tar -C / -Jxpf /tmp/s6-overlay-noarch.tar.xz \ - && curl -SLOf https://github.com/just-containers/s6-overlay/releases/download/v${S6_OVERLAY_VERSION}/s6-overlay-${S6_ARCH}.tar.xz \ - && tar -C / -Jxpf /tmp/s6-overlay-${S6_ARCH}.tar.xz - -ENTRYPOINT ["/init"] +FROM koush/18-bullseye-full.s6 WORKDIR / @@ -42,16 +13,10 @@ RUN conda install -c conda-forge cudatoolkit=11.2.2 cudnn=8.1.0 ENV CONDA_PREFIX=/opt/conda ENV LD_LIBRARY_PATH=$LD_LIBRARY_PATH:$CONDA_PREFIX/lib/ -# cache bust -ADD "https://www.random.org/cgi-bin/randbyte?nbytes=10&format=h" skipcache -ARG SCRYPTED_INSTALL_VERSION="latest" -RUN test -n "$SCRYPTED_INSTALL_VERSION" -RUN npx -y scrypted@latest install-server ${SCRYPTED_INSTALL_VERSION} -WORKDIR /server - -# this prevents node from preferring ipv6 addresses locally on -# networks with busted ipv6 setups. -# https://github.com/nodejs/node/issues/41145#issuecomment-992948130 -ENV NODE_OPTIONS="--dns-result-order=ipv4first" - -CMD npm --prefix /server exec scrypted-serve +# this is a copy pasta, seems to need a reinstall. +# python pip +RUN python3 -m pip install --upgrade pip +# pyvips is broken on x86 due to mismatch ffi +# https://stackoverflow.com/questions/62658237/it-seems-that-the-version-of-the-libffi-library-seen-at-runtime-is-different-fro +RUN python3 -m pip install --force-reinstall --no-binary :all: cffi +RUN python3 -m pip install aiofiles debugpy typing_extensions psutil diff --git a/docker/docker-build-nvidia.sh b/docker/docker-build-nvidia.sh index 39f2a5529..d3d19379a 100755 --- a/docker/docker-build-nvidia.sh +++ b/docker/docker-build-nvidia.sh @@ -1,17 +1,3 @@ -./template/generate-dockerfile.sh +./docker-build.sh -set -x - -NODE_VERSION=18 -BUILDPACK_DEPS_BASE=bullseye -FLAVOR=full -BASE=$NODE_VERSION-$BUILDPACK_DEPS_BASE-$FLAVOR -echo $BASE -SUPERVISOR=.nvidia -SUPERVISOR_BASE=$BASE$SUPERVISOR - -docker build -t koush/scrypted-common:$BASE -f Dockerfile.$FLAVOR \ - --build-arg NODE_VERSION=$NODE_VERSION --build-arg BUILDPACK_DEPS_BASE=$BUILDPACK_DEPS_BASE . && \ -\ -docker build -t koush/scrypted:$SUPERVISOR_BASE -f Dockerfile$SUPERVISOR \ - --build-arg BASE=$BASE . +docker build -t koush/scrypted:18-bullseye-full.nvidia -f Dockerfile.nvidia diff --git a/docker/template/Dockerfile.full.header b/docker/template/Dockerfile.full.header index 6e9600d88..2cd5ca473 100644 --- a/docker/template/Dockerfile.full.header +++ b/docker/template/Dockerfile.full.header @@ -62,7 +62,7 @@ RUN python3 -m pip install --upgrade pip # pyvips is broken on x86 due to mismatch ffi # https://stackoverflow.com/questions/62658237/it-seems-that-the-version-of-the-libffi-library-seen-at-runtime-is-different-fro RUN pip install --force-reinstall --no-binary :all: cffi -RUN python3 -m pip install aiofiles debugpy typing_extensions typing psutil +RUN python3 -m pip install aiofiles debugpy typing_extensions psutil ################################################################ # End section generated from template/Dockerfile.full.header