Docker image issue
deepcoder opened this issue · 9 comments
I am getting the following error:
VersionConflict: (typing-extensions 4.2.0 (/opt/conda/lib/python3.9/site-packages), Requirement.parse('typing-extensions<4.0.0,>=3.10.0'))
from:
from traffic.data import opensky
using the following steps to build and run in docker:
# Dockerfile.
# traffic
# 202205061416
# https://traffic-viz.github.io/user_guide/docker.html
FROM jupyter/minimal-notebook
USER jovyan
RUN conda install -c conda-forge traffic
docker build -f Dockerfile -t jupyter/traffic:latest .
docker run -it -p 8888:8888 --name jupyter_traffic jupyter/traffic:latest
Can you direct me to the correct steps to resolve?
This should be fixed in latest release 2.7.0. Can you upgrade your traffic library?
If I am reading the changes to pyproject.toml correctly:
https://github.com/xoolive/traffic/commits/master/pyproject.toml
the version of this file at conda-forge is the 2.7.0 release and this is the package that causes the error when I do the docker build. The version of pyproject.toml that you committed yesterday seems to bump the version requirement range up to 5.0. However this does not appear to be in the 2.7.0 package you have a conda-forge.
I was unable to figure out how build a docker image from the current github content.
This is the 2.7.0 tag: https://github.com/xoolive/traffic/blob/34b982eaf9076291f1e9d71b91c79d77cb1f0470/pyproject.toml (with correct versions)
I didn't try the Docker build, could you paste your full Dockerfile? (unless what you paste above is all there is in your file, please double check)
I am not sure I'll have time to look at it next week, but I'll definitely document it further on the website, so be sure your input is welcome!
Actually, I just tried following these instructions: https://traffic-viz.github.io/user_guide/docker.html (I am not so familiar with Docker and I actually didn't write that part) and I must say it worked: I got traffic 2.7.0 running in the docker... Not sure how I can help here.
You may try the following image:
docker pull xoolive/traffic:2.7.0
I looked into the issue and found two interesting things.
It apparently makes a difference if you install traffic in the container with conda or mamba. If I use conda install
in my dockerfile I get the version conflict, if I install it with mamba install
it runs a bit further and I get a different error. If I run a clean container and run
import traffic; print(traffic.__version__)
I get
ERROR 1: PROJ: proj_create_from_database: Open of /opt/conda/share/proj failed
This seems to be a known issue, as discussed here.
It seems that the issue with PROJ is due to the conda base environment not being properly initialized. I'll try to see if I can find a fix it.
@xoolive, do you have an idea why there is a different behaviour when installing with conda and mamba?
Thank you @rmonstein for your insight. No indeed as it was a bit slow I switched to mamba on my side, but I have no idea why the behaviour would be different...
I created a PR that solves PROJ issue and includes an updated documentation and dockerfile (both the dockerfile and the documentation use mamba now to speed-up the creation of the conda environment).
Unfortunately, I don't really know why conda install
and mamba install
don't produce the same result.