Repository navigation
Contender 1 (Dev-Ready Slim): Cut pythonr to 3.16 GB (-49.1%) and python to 1.49 GB (-26.1%) while retaining C/C++ -dev headers - #141
Merged
Conversation
…ilds, and multi-threaded OpenBLAS/GDAL/Arrow defaults
…-26% on python) retaining C/C++ -dev headers
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary — Contender 1: Dev-Ready Slim (
python1.49 GB,pythonr3.16 GB)Following a 12-combination deep-dive optimization study across
geocompx/docker, this PR implements Contender 1 (Dev-Ready Slim), which achieves a 49.1% (-3.05 GB) reduction ongeocompx/pythonrand a 26.1% (-526.2 MB) reduction ongeocompx/python(compared to pre-PR #140master) while retaining all C/C++-devheader packages (libgdal-dev,libgeos-dev,libproj-dev,libudunits2-dev, etc.) for users who compile custom C/C++ spatial packages from source at runtime.Key Optimizations Added (on top of #140)
python/Dockerfile(1.76 GB -> 1.49 GB, -268.6 MB additional / -526.2 MB total):/etc/dpkg/dpkg.cfg.d/docker-no-doc(path-excludefor/usr/share/doc/*,/usr/share/man/*,/usr/share/locale/*,/usr/share/info/*) and combineapt-get+gh+quartoinstallation in a single layer.binutilsin theuv pip installlayer, strip debug symbols (strip --strip-unneeded) fromsite-packages/**/*.so*(-147.4 MB), prune bundled package unit test suites (*/tests), C++ headers (pyarrow/include,numpy/_core/include),jupyterlab/galata,jedi/third_party/django-stubs, and*.js.map(-100.7 MB), hardlink duplicate files >4 KB (proj.db,libarrow_python.so*, Quarto assets) via SHA-256 inode linking (-38.8 MB), andapt-get purge -y --auto-remove binutilsin the same layer.pythonr/Dockerfile(4.15 GB -> 3.16 GB, -988.9 MB additional / -3.05 GB total):libomp-dev(which pulled in 184 MB oflibllvm19+libz3-4; R uses GCC'slibgomp1)..aarchives in/usr/lib/*-linux-gnu(libopenblasp.a,libicudata.a,libspatialite.a,liblapack*.a, etc. — -330 MB) while preserving/usr/lib/gcc(libgcc.a,libstdc++.a,libgfortran.a) and*nonshared.asoR CMD SHLIB/pkgbuild::check_build_tools()works out of the box.library/*/doc= 149 MB) andgooglePolylines/iBoost header cache (47 MB) while preservinglibrary/*/helpso interactive?funchelp in RStudio/VS Code works normally.MAKEFLAGS="-j$(nproc)"for parallel C++ compilation, run SHA-256 inode hardlinking across/opt/R/current/lib/R/library, and assert zero missing shared libraries (ldd ... | grep "not found") at build time.minimal,minimal-slim,suggests,osgeo,rocker-rpy:.so--strip-unneeded,site-library/*/docvignette pruning, third-party.acleanup, and Pythondist-packages.so/test pruning in-layer.Verified Benchmarks Across All 12 Experimental Combinations
geocompx/pythonSizegeocompx/pythonrSizemaster)