docker-stacks icon indicating copy to clipboard operation
docker-stacks copied to clipboard

[ENH] - Remove inkscape

Open benz0li opened this issue 3 years ago • 9 comments

What docker image(s) is this feature applicable to?

minimal-notebook

What changes are you proposing?

Remove inkscape from minimal-notebook.

How does this affect the user?

Smaller size; less dependencies.

Images based on minimal-notebook will profit, too.

Anything else?

See also https://github.com/JuliaLang/IJulia.jl/pull/1038#issuecomment-1194523666 on how to configure IPython and IRkernel

to output both image/svg+xml and application/pdf plot formats in the notebook file:

  • image/svg+xml for plot display in the browser + HTML conversion using SVG instead of PNG
  • application/pdf for direct PDF conversion

ℹ️ With application/pdf plot format in the notebook file, inkscape is not required for PDF conversion using nbconvert.

👉 I am asking for help @JuliaLang as I have not found solution for IJulia yet.


Possible side-effect of using image/svg+xml + application/pdf instead of image/png: See https://nbviewer.org/github/mgeier/python-audio/blob/master/plotting/matplotlib-inline-defaults.ipynb.

benz0li avatar Jul 25 '22 20:07 benz0li

Do you think some users are expecting the PDF functionality in the minimal-notebook?

Bidek56 avatar Jul 26 '22 12:07 Bidek56

Do you think some users are expecting the PDF functionality in the minimal-notebook?

Not necessarily.

But all dependencies other than pandoc (base-notebook) required by nbconvert are installed in the minimal-notebook: https://github.com/jupyter/docker-stacks/blob/0be9e335026b21a452c888481ab6341dcdd183a5/minimal-notebook/Dockerfile#L31-L35

inkscape (79.2 MB) depends on many other packages (109 MB) including python2. Getting rid of inkspace would reduce

  1. the image size by 178.2 MB and
  2. the number of packages by 1+86

benz0li avatar Jul 26 '22 13:07 benz0li

ℹ️ The minimal-notebook currently contains three versions of python:

  1. /opt/conda/bin/python3.10
  2. /usr/bin/python3.8
    • required by texlive-xetex
  3. /usr/bin/python2.7
    • required by inkscape

👉 To further optimize the minimal-notebook: texlive-xetex, texlive-fonts-recommended and texlive-plain-generic could be replaced by a variation of TinyTeX.

benz0li avatar Jul 26 '22 13:07 benz0li

@benz0li I would suggest creating a PR and see what the community reaction is to this change.

Bidek56 avatar Jul 26 '22 13:07 Bidek56

I would tag @parente on this PR since he added inkscape based on this issue.

Bidek56 avatar Jul 26 '22 13:07 Bidek56

We have a test for nbconvert https://github.com/jupyter/docker-stacks/blob/main/tests/minimal-notebook/test_nbconvert.py. I guess if it works without Inkscape, then we should be fine removing it.

mathbunnyru avatar Jul 26 '22 18:07 mathbunnyru

@benz0li I would suggest creating a PR and see what the community reaction is to this change.

I am maintaining my own Docker Stacks based on Debian, Python-only, including code-server. ℹ️ Just sharing my findings with the community. It is up the developers @jupyter what to do.

benz0li avatar Jul 27 '22 05:07 benz0li

To me, the findings in https://github.com/jupyter/docker-stacks/issues/1754#issuecomment-1195484696 is a very strong case for removing inkscape.

For the sustainability of this project, cleaning up legacy packages parts as times goes is relevant. I figure anything that installs dedicated python versions is extra costly and if users depending on such could switch to something else it would be impactful.

It seems to me that inkscapes is a vector graphics graphical editor, not sure how it makes sense to provide that in this container unless its used with a remote desktop setup.

consideRatio avatar Jul 27 '22 07:07 consideRatio

@mathbunnyru @consideRatio If you remove inkscape, do not forget to configure IPython and IRkernel to output both image/svg+xml and application/pdf plot formats in the notebook file.
ℹ️ See https://github.com/JuliaLang/IJulia.jl/pull/1038#issuecomment-1194523666 for more information.

👉 And https://nbviewer.org/github/mgeier/python-audio/blob/master/plotting/matplotlib-inline-defaults.ipynb about possible side-effects.

I have not found solution for IJulia yet.

benz0li avatar Jul 27 '22 07:07 benz0li

Fixed in https://github.com/jupyter/docker-stacks/pull/1765

mathbunnyru avatar Aug 20 '22 06:08 mathbunnyru