Skip to content

Commit

Permalink
setup: pip-compile based pinned dependencies
Browse files Browse the repository at this point in the history
Pins all dependencies via pip-compile and amends installation procedure
to used pinned packages. The package versions will be updated from time
to time via dedicated upgrade campaigns. Addresses reanahub/reana#322.

Signed-off-by: Tibor Šimko <tibor.simko@cern.ch>
  • Loading branch information
tiborsimko committed Jul 14, 2020
1 parent 61d3b7e commit e20b3e9
Show file tree
Hide file tree
Showing 7 changed files with 64 additions and 23 deletions.
4 changes: 2 additions & 2 deletions .travis.yml
@@ -1,5 +1,5 @@
# This file is part of REANA.
# Copyright (C) 2018 CERN.
# Copyright (C) 2018, 2020 CERN.
#
# REANA is free software; you can redistribute it and/or modify it
# under the terms of the MIT License; see LICENSE file for more details.
Expand All @@ -24,7 +24,7 @@ services:
- docker

before_install:
- pip install -r requirements-dev.txt
- pip install -r requirements.txt
- travis_retry pip install --upgrade pip setuptools py
- travis_retry pip install twine wheel coveralls

Expand Down
1 change: 1 addition & 0 deletions CHANGES.rst
Expand Up @@ -4,6 +4,7 @@ Changes
Version master (UNRELEASED)
---------------------------

- Pins all Python dependencies allowing to easily rebuild component images at later times.
- Allows to execute workflow from specified step.
- Allows specifying unpacked Docker images as workflow step requirement.
- Adds ``kubernetes_uid`` field.
Expand Down
27 changes: 13 additions & 14 deletions Dockerfile
@@ -1,34 +1,33 @@
# This file is part of REANA.
# Copyright (C) 2018, 2019 CERN.
# Copyright (C) 2018, 2019, 2020 CERN.
#
# REANA is free software; you can redistribute it and/or modify it
# under the terms of the MIT License; see LICENSE file for more details.

# Install base image and its dependencies
FROM python:3.6-slim

ENV TERM=xterm
RUN apt update && \
apt install -y vim-tiny && \
pip install --upgrade pip

COPY CHANGES.rst README.rst setup.py /code/
COPY reana_workflow_engine_serial/version.py /code/reana_workflow_engine_serial/
# Install dependencies
COPY requirements.txt /code/
RUN pip install -r /code/requirements.txt

# Copy cluster component source code
WORKDIR /code
RUN pip install requirements-builder && \
requirements-builder -l pypi setup.py | pip install -r /dev/stdin && \
pip uninstall -y requirements-builder

COPY . /code

# Debug off by default
# Are we debugging?
ARG DEBUG=0
RUN if [ "${DEBUG}" -gt 0 ]; then pip install -r requirements-dev.txt; pip install -e .; else pip install .; fi;
RUN if [ "${DEBUG}" -gt 0 ]; then pip install pip install -e ".[debug]"; else pip install .; fi;

# Building with locally-checked-out shared modules?
RUN if test -e modules/reana-commons; then pip install -e modules/reana-commons --upgrade; fi
# Are we building with locally-checked-out shared modules?
RUN if test -e modules/reana-commons; then pip install -e modules/reana-commons[kubernetes] --upgrade; fi

# Check if there are broken requirements
RUN pip check

ENV PYTHONPATH=/workdir
# Set useful environment variables
ENV TERM=xterm \
PYTHONPATH=/workdir
4 changes: 2 additions & 2 deletions MANIFEST.in
@@ -1,5 +1,5 @@
# This file is part of REANA.
# Copyright (C) 2018 CERN.
# Copyright (C) 2018, 2020 CERN.
#
# REANA is free software; you can redistribute it and/or modify it
# under the terms of the MIT License; see LICENSE file for more details.
Expand All @@ -8,9 +8,9 @@ include .dockerignore
include LICENSE
include *.rst
include *.sh
include *.txt
include *.yaml
include pytest.ini
include requirements-dev.txt
include Dockerfile
prune docs/_build
recursive-include reana_workflow_engine_serial *.py
Expand Down
4 changes: 0 additions & 4 deletions requirements-dev.txt

This file was deleted.

44 changes: 44 additions & 0 deletions requirements.txt
@@ -0,0 +1,44 @@
#
# This file is autogenerated by pip-compile
# To update, run:
#
# pip-compile
#
amqp==2.6.0 # via kombu
attrs==19.3.0 # via jsonschema
bravado-core==5.17.0 # via bravado
bravado==10.3.2 # via reana-commons
certifi==2020.6.20 # via requests
chardet==3.0.4 # via requests
checksumdir==1.1.9 # via reana-commons
click==7.1.2 # via reana-commons, reana-workflow-engine-serial (setup.py)
idna==2.10 # via jsonschema, requests
importlib-metadata==1.7.0 # via jsonschema, kombu
jsonpointer==2.0 # via jsonschema
jsonref==0.2 # via bravado-core
jsonschema[format]==3.2.0 # via bravado-core, reana-commons
kombu==4.6.11 # via reana-commons
mock==4.0.2 # via reana-commons
monotonic==1.5 # via bravado
msgpack-python==0.5.6 # via bravado
msgpack==1.0.0 # via bravado-core
pyrsistent==0.16.0 # via jsonschema
python-dateutil==2.8.1 # via bravado, bravado-core
pytz==2020.1 # via bravado-core
pyyaml==5.3.1 # via bravado, bravado-core, reana-commons
reana-commons==0.7.0.dev20200625 # via reana-workflow-engine-serial (setup.py)
requests==2.24.0 # via bravado
rfc3987==1.3.8 # via jsonschema
simplejson==3.17.0 # via bravado, bravado-core
six==1.15.0 # via bravado, bravado-core, jsonschema, pyrsistent, python-dateutil
strict-rfc3339==0.7 # via jsonschema
swagger-spec-validator==2.7.3 # via bravado-core
typing-extensions==3.7.4.2 # via bravado
urllib3==1.25.9 # via requests
vine==1.3.0 # via amqp
webcolors==1.11.1 # via jsonschema
werkzeug==1.0.1 # via reana-commons
zipp==3.1.0 # via importlib-metadata

# The following packages are considered to be unsafe in a requirements file:
# setuptools
3 changes: 2 additions & 1 deletion setup.py
@@ -1,7 +1,7 @@
# -*- coding: utf-8 -*-
#
# This file is part of REANA.
# Copyright (C) 2018, 2019 CERN.
# Copyright (C) 2018, 2019, 2020 CERN.
#
# REANA is free software; you can redistribute it and/or modify it
# under the terms of the MIT License; see LICENSE file for more details.
Expand All @@ -23,6 +23,7 @@
]

extras_require = {
"debug": ["wdb", "ipdb", "Flask-DebugToolbar",],
"docs": ["Sphinx>=1.4.4", "sphinx-rtd-theme>=0.1.9",],
"tests": tests_require,
}
Expand Down

0 comments on commit e20b3e9

Please sign in to comment.