-
Notifications
You must be signed in to change notification settings - Fork 32
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
deps-conda #1072
base: master
Are you sure you want to change the base?
deps-conda #1072
Conversation
- factor `get-conda` out of `deps-cuda` so it can run independently - add `deps-conda` as alternative to `deps-ubuntu`: installing system dependencies (including Python) for core - when doing `make deps-cuda` or `make deps-conda` and there is not `conda` already installed, run `make get-conda`
Thanks for this PR, it nicely illustrated some things for me. Definitely going to look into using conda myself. |
This works like a charm, both in Docker and natively. With micromamba installed and Considering that we want to future-proof OCR-D, we should really consider switching to conda/mamba for the system dependencies. It isn't even an either-or-situation, it's still possible to install geos etc. via apt-get (and we might want to retain One thing I noticed is that pyenv and micromamba interfere with each other, i.e. one has to make sure how to avoid (i.e. document to use just one of) venv, pyenv, conda etc. being used at the same time. We could also add a |
Yes, since conda cannot run "inside" a venv (only reverse), we would not be able to support installing into an existing venv/pyenv anymore (only an existing conda env). But that's a small price to pay IMO. Regarding ocrd_all, if we are afraid of breaking too much at the same time, we could (for a while at least) support both options, perhaps configuring with a makefile variable, say And indeed, switching to conda in ocrd_all only makes sense once we have BTW, one more benefit of conda over venv is that we can re-use downloaded packages, even if they are in different (think: sub-) envs. Which is necessary as long as we don't container/service-compartmentalise ocrd_all. (And once that is done, sharing of layers can help save disk space, if utilised properly.)
Then I am more in favour of rewriting the existing |
This starts Conda with
deps-conda
as a replacement for Apt withdeps-ubuntu
to install system dependencies.System dependencies should be encapsulated better than via fixed Linux distributions in OCR-D. Long ago I expressed my conviction that we can find some existing universal mechanism for porting. IMHO Conda fits that description quite well.
So the idea is to allow OCR-D modules to express their system requirements in a
deps-conda
rule, which will runconda install ...
. Of course, modules could do even more and provide a full conda build (i.e.build.sh
andmeta.yaml
) and have the Makefile simply delegate to that.For example, the
ocrd/tesserocr
Dockerfile could be as simple aswhere that would simply be defined as
deps-conda: conda install -c conda-forge tesseract leptonica
(which would give us an up to date libtesseract against which
pip install tesserocr
will compile).To make that work, this PR lays the foundation in
ocrd/core
:deps-conda
ruleTechically, we could separate the second commit (i.e. switching from
apt
toconda
in the Dockerfiles) and save it for another day (when we have the courage).