From 54e20dc37924bf474ce5aa8f3181b458e05997ce Mon Sep 17 00:00:00 2001 From: "Daniel J. Hofmann" Date: Tue, 28 May 2019 22:47:12 +0200 Subject: [PATCH] Updates dependency management in docker images --- deps/requirements-lock.txt | 16 +++++++++------- deps/requirements.txt | 1 + docker/Dockerfile.cpu | 19 +++++++++---------- docker/Dockerfile.gpu | 20 +++++++++----------- 4 files changed, 28 insertions(+), 28 deletions(-) diff --git a/deps/requirements-lock.txt b/deps/requirements-lock.txt index fc75b03b..bcca3766 100644 --- a/deps/requirements-lock.txt +++ b/deps/requirements-lock.txt @@ -7,21 +7,22 @@ Click==7.0 click-plugins==1.1.1 cligj==0.5.0 cycler==0.10.0 -Flask==1.0.2 +Flask==1.0.3 geojson==2.4.1 idna==2.8 +importlib-metadata==0.15 itsdangerous==1.1.0 Jinja2==2.10.1 kiwisolver==1.1.0 MarkupSafe==1.1.1 -matplotlib==3.0.3 +matplotlib==3.1.0 mercantile==1.0.4 more-itertools==7.0.0 -numpy==1.16.3 +numpy==1.16.4 opencv-contrib-python==4.1.0.25 osmium==2.15.2 Pillow==6.0.0 -pluggy==0.11.0 +pluggy==0.12.0 py==1.8.0 pyparsing==2.4.0 pyproj==2.1.3 @@ -30,15 +31,16 @@ python-dateutil==2.8.0 rasterio==1.0.23 requests==2.22.0 Rtree==0.8.3 -scipy==1.2.1 +scipy==1.3.0 Shapely==1.6.4.post2 six==1.12.0 snuggs==1.4.6 supermercado==0.0.5 toml==0.10.0 torch==1.1.0 -torchvision==0.2.2.post3 +torchvision==0.3.0 tqdm==4.32.1 -urllib3==1.25.2 +urllib3==1.25.3 wcwidth==0.1.7 Werkzeug==0.15.4 +zipp==0.5.1 diff --git a/deps/requirements.txt b/deps/requirements.txt index 1c403232..de42ea2e 100644 --- a/deps/requirements.txt +++ b/deps/requirements.txt @@ -1,3 +1,4 @@ +torch torchvision numpy pillow diff --git a/docker/Dockerfile.cpu b/docker/Dockerfile.cpu index 263397f7..cb06b7c3 100644 --- a/docker/Dockerfile.cpu +++ b/docker/Dockerfile.cpu @@ -1,15 +1,17 @@ FROM ubuntu:18.04 -ARG TCH=1.1.0 -ARG PY=36 - WORKDIR /usr/src/app -RUN apt-get update -qq && \ - DEBIAN_FRONTEND=noninteractive apt-get install -qq -y -o quiet=1 \ - python3 python3-dev python3-tk python3-pip libspatialindex-c4v5 libsm6 +ENV LANG="C.UTF-8" LC_ALL="C.UTF-8" PATH="/opt/venv/bin:$PATH" + +RUN apt-get update && DEBIAN_FRONTEND=noninteractive apt-get install -y \ + python3 python3-pip python3-venv libspatialindex-c4v5 libsm6 libxrender1 libxext6 && \ + python3 -m venv /opt/venv && \ + python3 -m pip install pip==19.1.1 && \ + rm -rf /var/lib/apt/lists/* -RUN python3 -m pip install http://download.pytorch.org/whl/cpu/torch-${TCH}-cp${PY}-cp${PY}m-linux_x86_64.whl +RUN python3 -m pip install https://download.pytorch.org/whl/cpu/torch-1.1.0-cp36-cp36m-linux_x86_64.whl && \ + python3 -m pip install https://download.pytorch.org/whl/cpu/torchvision-0.3.0-cp36-cp36m-linux_x86_64.whl COPY deps/requirements-lock.txt deps/requirements-lock.txt RUN python3 -m pip install -r deps/requirements-lock.txt @@ -18,8 +20,5 @@ RUN python3 -c "from torchvision.models import resnet50; resnet50(True)" COPY . . -ENV LANG C.UTF-8 -ENV LC_ALL C.UTF-8 - ENTRYPOINT ["/usr/src/app/rs"] CMD ["-h"] diff --git a/docker/Dockerfile.gpu b/docker/Dockerfile.gpu index b85a3ebe..d0c0f6e8 100644 --- a/docker/Dockerfile.gpu +++ b/docker/Dockerfile.gpu @@ -1,16 +1,17 @@ FROM nvidia/cuda:10.1-cudnn7-runtime -ARG TCH=1.1.0 -ARG PY=36 -ARG CU=100 - WORKDIR /usr/src/app -RUN apt-get update -qq && \ - DEBIAN_FRONTEND=noninteractive apt-get install -qq -y -o quiet=1 \ - python3 python3-dev python3-tk python3-pip libspatialindex-c4v5 libsm6 +ENV LANG="C.UTF-8" LC_ALL="C.UTF-8" PATH="/opt/venv/bin:$PATH" + +RUN apt-get update && DEBIAN_FRONTEND=noninteractive apt-get install -y \ + python3 python3-pip python3-venv libspatialindex-c4v5 libsm6 libxrender1 libxext6 && \ + python3 -m venv /opt/venv && \ + python3 -m pip install pip==19.1.1 && \ + rm -rf /var/lib/apt/lists/* -RUN python3 -m pip install http://download.pytorch.org/whl/cu${CU}/torch-${TCH}-cp${PY}-cp${PY}m-linux_x86_64.whl +RUN python3 -m pip install https://download.pytorch.org/whl/cu100/torch-1.1.0-cp36-cp36m-linux_x86_64.whl && \ + python3 -m pip install https://download.pytorch.org/whl/cu100/torchvision-0.3.0-cp36-cp36m-linux_x86_64.whl COPY deps/requirements-lock.txt deps/requirements-lock.txt RUN python3 -m pip install -r deps/requirements-lock.txt @@ -19,8 +20,5 @@ RUN python3 -c "from torchvision.models import resnet50; resnet50(True)" COPY . . -ENV LANG C.UTF-8 -ENV LC_ALL C.UTF-8 - ENTRYPOINT ["/usr/src/app/rs"] CMD ["-h"]