-
Notifications
You must be signed in to change notification settings - Fork 41
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
Allow selecting installed optional dependencies in Docker build #548
Conversation
Codecov Report
@@ Coverage Diff @@
## master #548 +/- ##
=======================================
Coverage 99.49% 99.49%
=======================================
Files 80 80
Lines 5313 5313
=======================================
Hits 5286 5286
Misses 27 27 Continue to review full report at Codecov.
|
What about fasttext? It will be installed regardless of this setting, right? |
Yes, that's true, I thought it would not be installed... Or at least not available right away. Hmm, I don't if its copying from builder stage can be controlled this way conveniently enough. |
I don't think always including fasttext is a very big deal, this PR is still a big improvement. That said, I think it could be possible to avoid installing fasttext by making the if [[ $optional_dependencies =~ "fasttext" ]]; then pip install --no-cache-dir fasttext==0.9.2; fi (perhaps the The ARG declaration needs to be moved earlier of course. The COPY command would then copy an empty /usr/local/lib/python3.8 directory from the builder image. |
Kudos, SonarCloud Quality Gate passed! |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
I added a section of customizing Docker image to Wiki: https://github.com/NatLibFi/Annif/wiki/Usage-with-Docker#customizing-docker-image |
Currently we provide a Dockerfile and an image in quay.io with dependencies for all the optional features.
If someone does not need all the features, but e.g. uses only Omikuji backend and would like build their own image (e.g. for smaller size), they could edit the Dockerfile dropping the unwanted (Python) dependencies from the pip install command. However, using
--build-arg
option ofdocker build
provides a way to pass the user-defined list of dependencies to install that overrides the default list:A user wanting to have a Docker image to use with Xtransfomer could add
pecos
to the default list in build time.