readthedocs / readthedocs-docker-images

Docker image definitions used by Read the Docs
115 stars 70 forks source link

Using apt-get to install other dependencies #114

Closed jakirkham closed 3 years ago

jakirkham commented 4 years ago

Is it or would it be possible to install other system-level dependencies with apt-get?

stsewd commented 4 years ago

Yes, but we don't allow executing arbitrary commands in the build process. But if you are using sphinx, you can run those commands in the conf.py file.

humitos commented 4 years ago

If the dependency is widely used for building documentation, we usually install it in our own image and make a new release after some time.

As @stsewd mentioned, we don't allow executing arbitrary commands. The usage of conf.py is a hack to our current process and it's not supported --although, it could work/be enough in your case.

jakirkham commented 4 years ago

It seems like "widely used" might be subjective. For instance libnuma is widely used in the HPC space, but it might not be something you want to add to the container. We can imagine other such examples.

So my question is could we provide a file with a list of dependencies we would like to have apt-get installed for us. This avoids arbitrary commands being run, but still allows users some flexibility here.

It sounds like the answer to this question is not today. Though users may be able to hack around this. Does this seem like the sort of thing that could be in scope in the future?

sergei-maertens commented 4 years ago

This is also relevant for use, we require libgdal for the Sphinx build. It looks like we'll be able to work around it by making the call in conf.py, but an option in the config file to specify a list of package names to install would be great!

jakirkham commented 4 years ago

@sergei-maertens, have you looked at Conda? RTD supports that already and there is a package for GDAL there.

sergei-maertens commented 4 years ago

I didn't, will do when it becomes relevant again!

razvnane commented 4 years ago

Yes, but we don't allow executing arbitrary commands in the build process. But if you are using sphinx, you can run those commands in the conf.py file.

Is there a way to install bison >=3.0 and flex >=2.6 as prerequisites to the build process?

jakirkham commented 4 years ago

Also would checkout Conda support, @razvnane ๐Ÿ™‚

felix-hilden commented 3 years ago

Just to pile on: I would also like this feature, and the requirement file for other packages sounds like a reasonable suggestion. I don't need arbitrary commands either. My attempt was using graphviz for generating images which I would loathe to have in the repository. In addition to a Python package, it requires executables available in the Ubuntu repositories. There seems to be an Conda package available, but haven't really tipped my toes into that world.

Thanks for the conf.py hack though ๐Ÿ˜… I guess installing things in the same process doesn't suffer nearly as much on Linux as it does on Windows, the PATH not updating and the binaries being generally all over the place instead of a single folder.

jakirkham commented 3 years ago

Thereโ€™s also a Conda package for Graphviz if you want to give that a try, Felix ๐Ÿ™‚

humitos commented 3 years ago

Hi! I suggest you to subscribe to this PR https://github.com/readthedocs/readthedocs.org/pull/8065/ that implements a new config in .readthedocs.yaml that allow users to install packages via APT. Once it gets merged and deployed you will be able to install these packages by yourself.