Running Docker version 20.10.1, build 831ebea on Linux Mint 20 Ulyana. It is a machine learning model serving application that runs with flask (WSGI), celery (task queue) and redis (message broker). This is how the docker file looks like.
FROM python:3.6.9
WORKDIR /app
COPY ./Models ./Models
COPY ./src ./src
COPY pip_requirements.txt ./
COPY run_manager.sh ./
ENV C_FORCE_ROOT='true'
ENV PATH="/root/.local/bin:${PATH}"
RUN echo 'debconf debconf/frontend select Noninteractive' | debconf-set-selections \
&& apt-get --assume-yes update \
&& apt-get --assume-yes install --no-install-recommends apt-utils \
&& apt-get --assume-yes upgrade \
&& apt-get --assume-yes install libsnappy-dev \
&& apt-get --assume-yes install redis-server \
&& apt-get --assume-yes install python3-celery \
&& python3 -m pip install --user --no-warn-script-location --requirement pip_requirements.txt \
&& rm pip_requirements.txt
EXPOSE 7000
As you can see, the python packages are installed from pip, and one of the necessary packages is fastparquet==0.3.2
.
The image was building and the container was running just perfectly…till about a week back. Then just today, this error happened, particularly when the pip installer was collecting fastparquet.
ERROR: Command errored out with exit status 1:
command: /usr/local/bin/python3 -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/tmp/pip-install-3zptxm6d/fastparquet/setup.py'"'"'; __file__='"'"'/tmp/pip-install-3zptxm6d/fastparquet/setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(__file__);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' egg_info --egg-base /tmp/pip-install-3zptxm6d/fastparquet/pip-egg-info
cwd: /tmp/pip-install-3zptxm6d/fastparquet/
Complete output (68 lines):
Traceback (most recent call last):
File "/usr/local/lib/python3.6/site-packages/setuptools/sandbox.py", line 154, in save_modules
yield saved
File "/usr/local/lib/python3.6/site-packages/setuptools/sandbox.py", line 195, in setup_context
yield
File "/usr/local/lib/python3.6/site-packages/setuptools/sandbox.py", line 250, in run_setup
_execfile(setup_script, ns)
File "/usr/local/lib/python3.6/site-packages/setuptools/sandbox.py", line 45, in _execfile
exec(code, globals, locals)
File "/tmp/easy_install-3cxu7pbx/numpy-1.20.0rc2/setup.py", line 30, in <module>
else:
RuntimeError: Python version >= 3.7 required.
My question: Is not docker supposed to maintain the versions of the libraries and install the exact same versions in any machine when the image is being built? Even if somehow the latest version of fastparquet is incompatible with Python<3.7, why would I need to change the environment when I am in docker container and using the same version of fastparquet as before?
From my rather rudimentary knowledge of docker, I was operating under the assumption that any docker file being built today in my Linux-Mint Desktop, will build exactly the same way in any Linux box that has dockerd running, even decade from today, no matter what new dependency library upgrades appeared meanwhile. Is not that the reason we use docker? So any pointer around this area would be helpful, particularly, why the same dockerfile working in 2020 is breaking in 2021 (yes, this is my first docker build of the year, and happy new year everyone).