Simplify package management for python services (#120)
This PR does a few things: 1. **Removes unnecessary Python dependencies currently being installed for `emailservice`** There are quite a few packages being installed that aren't actual dependencies. 2. **Removes a number of related, also unnecessary system-level dependencies for `emailservice`** These were a result of the Python dependencies that are unnecessary. 3. **Pins all of the sub-dependencies for `loadgenerator`** This is good practice to ensure that things don't break one day in the future when a newer version of an unpinned sub-dependenency is released. 4. **Compile all Python dependencies from `requirements.in` files** This is mostly bookkeeping. It allows us to only specify the top-level dependencies we care about in the requirements.in files, which are then compiled to frozen dependencies in the requirements.txt files. This ensures that we only install the dependencies we need, and that we're not missing any unpinned sub-dependencies. It also makes it more clear where our sub-dependencies are coming from. 5. **Switch to -slim images from -alpine** Python's built distribution format (wheel) is incompatible with alpine-based images, causing dependencies like `grpcio` to be compiled from scratch, rather than from a pre-built wheel. This should improve or possibly fix #58, while keeping the image size roughly the same: ``` emailservice latest d1b818eabe05 6 seconds ago 286MB loadgenerator latest 4d9b5acbfbbb 6 seconds ago 125MB ```
This commit is contained in:
parent
823e993104
commit
aaf2f8717d
6 changed files with 64 additions and 65 deletions
|
@ -1,14 +1,10 @@
|
|||
FROM python:3-alpine as base
|
||||
FROM python:3-slim as base
|
||||
|
||||
FROM base as builder
|
||||
|
||||
RUN apk add --update --no-cache \
|
||||
gcc \
|
||||
linux-headers \
|
||||
make \
|
||||
musl-dev \
|
||||
python-dev \
|
||||
g++
|
||||
RUN apt-get -qq update \
|
||||
&& apt-get install -y --no-install-recommends \
|
||||
g++
|
||||
|
||||
COPY requirements.txt .
|
||||
|
||||
|
|
1
src/loadgenerator/requirements.in
Normal file
1
src/loadgenerator/requirements.in
Normal file
|
@ -0,0 +1 @@
|
|||
locustio==0.8.1
|
|
@ -1,2 +1,23 @@
|
|||
#
|
||||
# This file is autogenerated by pip-compile
|
||||
# To update, run:
|
||||
#
|
||||
# pip-compile --output-file requirements.txt requirements.in
|
||||
#
|
||||
certifi==2018.11.29 # via requests
|
||||
chardet==3.0.4 # via requests
|
||||
click==7.0 # via flask
|
||||
flask==1.0.2 # via locustio
|
||||
gevent==1.4.0 # via locustio
|
||||
greenlet==0.4.15 # via gevent
|
||||
idna==2.8 # via requests
|
||||
itsdangerous==1.1.0 # via flask
|
||||
jinja2==2.10 # via flask
|
||||
locustio==0.8.1
|
||||
pyzmq==17.0.0
|
||||
markupsafe==1.1.0 # via jinja2
|
||||
msgpack-python==0.5.6 # via locustio
|
||||
pyzmq==17.0.0 # via locustio
|
||||
requests==2.21.0 # via locustio
|
||||
six==1.12.0 # via locustio
|
||||
urllib3==1.24.1 # via requests
|
||||
werkzeug==0.14.1 # via flask
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue