-
Notifications
You must be signed in to change notification settings - Fork 181
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
Updated OSGeo recipes #708
Conversation
/cc @ranchodeluxe as well, who was working with R folks :) |
It depends on the library at hand but most of them (and for some time now) encode the major version. So then the distros generalize and let you have one version as a -dev to build against but multiple to run. Random example from my 23.04 box:
|
Looks great to me from a glance, thanks! |
@eitsupi apologies again for my issues with the bash linter -- any pointers on that? |
thanks a lot @cboettig this is awesome, sadly I can't pursue trying it atm but will be back into it in a few weeks |
I think I have fixed all the points pointed out by shellcheck. |
I've built and used this and found no problems. I'd like to see it come out of "experimental" I always found that unsettling, to me the point of docker is to be able to easily get recent builds without affecting anyone else so I don't see any danger. I like seeing more of the python supported (because a personal goal for me is to have these deps on an equal footing, without proliferating versions on a system), but to me the system deps are more important than any of the python or R installs, I'm just more comfy with the latter so I'm not worried about R packages, but I think getting all python packages going is probably out of scope. The biggest issue with R and Python on the same system is having reticulate support, which requires building Python from source now (and I think that's clearly out of scope of this recipe as well). |
@mdsumner Thanks for testing this!
What does mean "more of the python supported"? Unfortunately, I think it would be unrealistic to do that with this repository as Python support is very difficult to achieve.
Is this true? |
|
But shouldn't be... |
I meant I can now get osgeo.gdal going after GDAL is built from source. I'm very much not clear on how python package installs are supposed to work, but that very small basis of all the R packages that use it and the core Python package is extremely important to me. I used sys path to add the installed osgeo.gdal/osr/ogr family to work in this image: GDAL puts its python into
Yes, I'm sorry I can't find the NEWS item but it's since 3.9 or 3.10 (see note) https://docs.posit.co/resources/install-python-source/ note: (at any rate I have a system with 3.8 and that's my VM for reticulate atm) Again, reticulate is less important to me in this context than the fact that this image already has common support with a latest version of the libs GDAL, GEOS, PROJ. That alone makes this PR extremely valuable. I think those broader topics need flushing out, but probably not here. Thanks! |
Thanks all, sounds like this is in good shape. To summarize:
|
I do not have a strong opinion on moving directories. (I believe there are no strict divisions)
|
One of my personal goals is to get more involved in this project to help with better python support :) |
Ok, let's merge this for now. |
Great stuff! Note to self: use these updated recipes as basis for geocompx docker images. |
This provides a more complete source-build of OSGeo with wider support for optional drivers. Notably, this addresses functionality that was already present in the Ubuntu LTS repo versions but missing from the current osgeo source-build recipe, such as virtual filesystem access for NetCDF.
A few other changes are made here as well:
install_geospatial.sh
. This also does not disable binary installs by default, meaning that users can benefit from quick binary installs for most other (spatial or non-spatial) R packages. The downside risk is that installing/upgrading a binary version ofsf
,terra
,gdalcubes
, orstars
will create a broken installation.Still some open points for discussion:
some users suggested that having the recipe in
scripts/experimental
rather thanscripts
was discouraging for regular use. We have never outlined a policy for promoting a script from 'experimental', and changing those paths could potentially break downstream functionality.We might want to tweak the recipe of the corresponding
rocker/geospatial:dev-osgeo
Dockerfile to includeinstall_python.sh
step first? (most of those python libraries are in fact included here).sf
&terra
do not install when PROJ is available both from a source build (i.e./usr/local/lib
) and from the deb repos (i.e./usr/lib
). Having different versions of a library like this is not a problem for the OSGeo libraries or for most software afaik (@eddelbuettel am I right this isn't usually an issue since config should link to only one version?), but apparently a well-documented problem forsf
andterra
. This can create some unexpected problems for users -- if they install any deb that happens to depend onlibproj-dev
, suddenly these R packages won't build from source (they will simply through a segfault on the configure step, leaving users no idea for the reason). Maybe we just live with this, but I thought it was worth flagging. (This script will first try and remove those libs to avoid conflicts).Perhaps this entire script should be done as a 'staged build', where the resulting binaries of both the osgeo libs, cli tools, and binary versions of the R packages are copied over, but all the dev libs needed to compile are jettisoned (as the official osgeo/gdal Dockerfile does). That would create a much smaller Docker image, but adds complexity (i.e. users couldn't upgrade
sf
/terra
etc even with a source-install, they'd have to run this whole script again first!), and complexity in our build setup.Users can run this script to add latest osgeo builds to any image in the stack (i.e. run
/rocker_scripts/experimental/install_dev-osgeo.sh
on any rocker-versioned image). This should install the requested version, defaulting to the latest release. Perhaps this script should be calledinstall_osgeo-latest.sh
instead?Wondering if it would make more sense to create a renv "profile" and install these R packages binding OSGeo libraries under that profile? This might make it possible to have binary and non-binary builds on the same image (could even be a way to have latest OSGeo versions available on the standard
rocker/geospatial
image). But I think that approach needs some more testing first.cc @mdsumner, @yuvipanda, @Robinlovelace, others -- thoughts?