From 8eba477b205e666f55e6141d8a269b6d53fb975b Mon Sep 17 00:00:00 2001 From: "Gerber, Mike" Date: Fri, 15 Jan 2021 20:22:37 +0100 Subject: [PATCH] =?UTF-8?q?=F0=9F=9A=A7=20Support=20CUDA?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Dockerfile-core-cuda10.0 | 51 ++++++++++++++++++++++++++++++++++++++++ Dockerfile-core-cuda10.1 | 51 ++++++++++++++++++++++++++++++++++++++++ 2 files changed, 102 insertions(+) create mode 100644 Dockerfile-core-cuda10.0 create mode 100644 Dockerfile-core-cuda10.1 diff --git a/Dockerfile-core-cuda10.0 b/Dockerfile-core-cuda10.0 new file mode 100644 index 0000000..0d1aada --- /dev/null +++ b/Dockerfile-core-cuda10.0 @@ -0,0 +1,51 @@ +FROM nvidia/cuda:10.0-cudnn7-runtime-ubuntu18.04 + +ARG PIP_INSTALL="pip install --no-cache-dir --use-feature=2020-resolver" +ARG OCRD_VERSION_MINIMUM="2.18.1" +ENV LC_ALL=C.UTF-8 LANG=C.UTF-8 +ENV PIP_DEFAULT_TIMEOUT=120 + + +RUN echo "APT::Acquire::Retries \"3\";" > /etc/apt/apt.conf.d/80-retries && \ + apt-get update && \ + apt-get install -y \ + curl xz-utils \ + build-essential python3-dev \ +# For get-pip.py: + python3-distutils \ +# For add-apt-repository: + software-properties-common \ +# XML utils + libxml2-utils \ + xmlstarlet \ + && \ + apt-get clean && \ + rm -rf /var/lib/apt/lists/* + + +# Set up OCR-D logging +RUN echo "setOverrideLogLevel(os.getenv('LOG_LEVEL', 'INFO'))" >/etc/ocrd_logging.py + + +# Install pip (and setuptools) +# We use get-pip.py here to avoid +# a. having to upgrade from Ubuntu's pip +# b. the dreaded "old script wrapper" error message +RUN curl -sSL https://bootstrap.pypa.io/get-pip.py -o get-pip.py && \ + python3 get-pip.py && \ + rm -f get-pip.py + + +# Install pip installable-stuff +RUN ${PIP_INSTALL} \ + "ocrd >= ${OCRD_VERSION_MINIMUM}" + + +# Check pip dependencies +RUN pip check + + +WORKDIR /data + +# Default command +CMD ['ocrd'] diff --git a/Dockerfile-core-cuda10.1 b/Dockerfile-core-cuda10.1 new file mode 100644 index 0000000..5317497 --- /dev/null +++ b/Dockerfile-core-cuda10.1 @@ -0,0 +1,51 @@ +FROM nvidia/cuda:10.1-cudnn7-runtime-ubuntu18.04 + +ARG PIP_INSTALL="pip install --no-cache-dir --use-feature=2020-resolver" +ARG OCRD_VERSION_MINIMUM="2.18.1" +ENV LC_ALL=C.UTF-8 LANG=C.UTF-8 +ENV PIP_DEFAULT_TIMEOUT=120 + + +RUN echo "APT::Acquire::Retries \"3\";" > /etc/apt/apt.conf.d/80-retries && \ + apt-get update && \ + apt-get install -y \ + curl xz-utils \ + build-essential python3-dev \ +# For get-pip.py: + python3-distutils \ +# For add-apt-repository: + software-properties-common \ +# XML utils + libxml2-utils \ + xmlstarlet \ + && \ + apt-get clean && \ + rm -rf /var/lib/apt/lists/* + + +# Set up OCR-D logging +RUN echo "setOverrideLogLevel(os.getenv('LOG_LEVEL', 'INFO'))" >/etc/ocrd_logging.py + + +# Install pip (and setuptools) +# We use get-pip.py here to avoid +# a. having to upgrade from Ubuntu's pip +# b. the dreaded "old script wrapper" error message +RUN curl -sSL https://bootstrap.pypa.io/get-pip.py -o get-pip.py && \ + python3 get-pip.py && \ + rm -f get-pip.py + + +# Install pip installable-stuff +RUN ${PIP_INSTALL} \ + "ocrd >= ${OCRD_VERSION_MINIMUM}" + + +# Check pip dependencies +RUN pip check + + +WORKDIR /data + +# Default command +CMD ['ocrd']