Skip to content

Commit

Permalink
Pins dependencies checking hashes with pip-tools
Browse files Browse the repository at this point in the history
  • Loading branch information
daniel-j-h committed May 30, 2019
1 parent aa57aaa commit a5ea73c
Show file tree
Hide file tree
Showing 7 changed files with 390 additions and 72 deletions.
2 changes: 1 addition & 1 deletion .dockerignore
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
*
!deps
!requirements.txt
!robosat
!config
!rs
9 changes: 3 additions & 6 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,21 +14,18 @@ matrix:
addons:
apt:
sources: ['deadsnakes']
packages: ['python3.6', 'python3.6-dev', 'python3.6-tk', 'python3.6-venv', 'build-essential', 'libboost-python-dev', 'libexpat1-dev', 'zlib1g-dev', 'libbz2-dev', 'libspatialindex-dev']
packages: ['python3.6', 'python3.6-pip', 'python3.6-venv', 'libspatialindex-dev', 'libglib2.0-0']

before_install:
- curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo apt-key add -
- sudo add-apt-repository "deb [arch=amd64] https://download.docker.com/linux/ubuntu $(lsb_release -cs) stable"
- sudo apt-get update && sudo apt-get -y install docker-ce

- sudo update-alternatives --install /usr/bin/python3 python3 /usr/bin/python3.6 10
- python3 -m venv .env && . .env/bin/activate
- python3 -m pip install pip==19.1.1

install:
- python -m pip install pip==19.1.1 pip-tools==3.7.0
- python -m piptools sync
- python -m pip install https://download.pytorch.org/whl/cpu/torch-1.1.0-cp36-cp36m-linux_x86_64.whl
- python -m pip install https://download.pytorch.org/whl/cpu/torchvision-0.3.0-cp36-cp36m-linux_x86_64.whl
- python -m pip install -r deps/requirements-lock.txt --quiet

script:
- python -m pytest
Expand Down
46 changes: 0 additions & 46 deletions deps/requirements-lock.txt

This file was deleted.

17 changes: 9 additions & 8 deletions docker/Dockerfile.cpu
Original file line number Diff line number Diff line change
Expand Up @@ -2,20 +2,21 @@ FROM ubuntu:18.04

WORKDIR /usr/src/app

ENV LANG="C.UTF-8" LC_ALL="C.UTF-8" PATH="/opt/venv/bin:$PATH"
ENV LANG="C.UTF-8" LC_ALL="C.UTF-8" PATH="/opt/venv/bin:$PATH" PIP_NO_CACHE_DIR="false"

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 && \
RUN apt-get update && DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends \
python3 python3-pip python3-venv libspatialindex-c4v5 libglib2.0-0 && \
rm -rf /var/lib/apt/lists/*

COPY requirements.txt .

RUN python3 -m venv /opt/venv && \
python3 -m pip install pip==19.1.1 pip-tools==3.7.0 && \
python3 -m piptools sync

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

RUN python3 -c "from torchvision.models import resnet50; resnet50(True)"

COPY . .
Expand Down
17 changes: 9 additions & 8 deletions docker/Dockerfile.gpu
Original file line number Diff line number Diff line change
Expand Up @@ -2,20 +2,21 @@ FROM nvidia/cuda:10.1-cudnn7-runtime

WORKDIR /usr/src/app

ENV LANG="C.UTF-8" LC_ALL="C.UTF-8" PATH="/opt/venv/bin:$PATH"
ENV LANG="C.UTF-8" LC_ALL="C.UTF-8" PATH="/opt/venv/bin:$PATH" PIP_NO_CACHE_DIR="false"

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 && \
RUN apt-get update && DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends \
python3 python3-pip python3-venv libspatialindex-c4v5 libglib2.0-0 && \
rm -rf /var/lib/apt/lists/*

COPY requirements.txt .

RUN python3 -m venv /opt/venv && \
python3 -m pip install pip==19.1.1 pip-tools==3.7.0 && \
python3 -m piptools sync

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

RUN python3 -c "from torchvision.models import resnet50; resnet50(True)"

COPY . .
Expand Down
4 changes: 1 addition & 3 deletions deps/requirements.txt → requirements.in
Original file line number Diff line number Diff line change
@@ -1,9 +1,7 @@
torch
torchvision
numpy
pillow
scipy
opencv-contrib-python
opencv-contrib-python-headless
tqdm
flask
requests
Expand Down
Loading

0 comments on commit a5ea73c

Please sign in to comment.