-
Notifications
You must be signed in to change notification settings - Fork 164
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
Binary builds from RSPM blow up image size #340
Comments
FYI, since |
@benz0li No idea. I am not all that involved with rspm and use it little. You could try to strip post-installation... Reason may be a simple |
@eddelbuettel Thanks for your feedback. Stripping the dynamic libraries post-installation reduces the size of
root@769bd0aff019:/# du -sh /usr/local/lib/R/site-library/
732M /usr/local/lib/R/site-library/
root@769bd0aff019:/# find /usr/local/lib/R/site-library/*/libs/ -name \*.so | xargs strip -s -p
root@769bd0aff019:/# du -sh /usr/local/lib/R/site-library/
198M /usr/local/lib/R/site-library/ @eitsupi If you include stripping [the dynamic libraries] in your Dockerfiles/installation-scripts, it would reduce the image size significantly. |
I will contact RStudio and ask if there is a particular reason why the dynamic libraries of the RSPM binaries are not stripped. |
🎉 Thanks for the report, the suggestion to strip the shared libs on the images here and the follow up with RStudio :-) |
@jjallaire made sure this information gets to the right person. |
I'm not sure on the reason here, and I'm checking with the team. You're also welcome to tag myself or @tylfin in the future and we can try to answer public package manager questions that come up. |
It may be a side-effect of how 'default' compilation on Linux is setup. Debian, for example, always builds with
but lets just say that I didn't manage to get So my suggestion above to do it locally (after RSPMs are unpacked) may be best for Rocker users; you guys could and should look into stripping at source. It will make things smaller and hence faster to ship across the wire and install. |
This has started an interesting conversation here, so thanks for bringing this up. The thoughts here are that this wasn't originally a conscious choice, that we just run R's package install command with mostly default flags/options. @glin found the commend about --strip interesting but also noted the R extensions manual about CRAN prohibiting the stripping of debug symbols:
Our suggestion right now would be to have you strip this as part of building your images, but we're still discussing it. |
Thanks for all the additional information. Very interesting, indeed. The following has no effect on package installations from RSPM when building the rocker images: rocker-versioned2/scripts/bin/install2.r Lines 73 to 74 in ea351bc
Regarding 1.6 Writing portable packages: As RSPM serves pre-compiled binaries that are specific per Linux distribution + version, is there any harm in stripping the .so files then? |
Yes. It only would if you compiled and linked so that a Maybe at this point you could test the is there any harm question via a locally-modified container? There shouldn't ... |
Not actively using rocker images myself as I have moved to Jupyter (JupyterHub with JupyterLab + code-server) for some time now. |
Closing due to inactivity. |
I was hoping to hear from @bdeitte about his future plans rather than strip every installation in this repository now. |
IMHO 1.6 Writing portable packages does not apply for RSPM. RSPM isn't CRAN and serves pre-compiled binaries that are specific per Linux distribution + version. |
@bdeitte Seems to be quite a lengthy discussion. Have you come to a conclusion yet? |
Hi @benz0li the key part of the conversation was above. We asked some other groups on their thoughts here, but there wasn't any conclusion to it. We haven't made any changes here, and I've now checked with the team to make sure others have seen the replies in here. |
Then stripping post-installation it remains. |
Please keep it open as I will do that after #441 is merged. |
Hey all, one more update from RSPM here - we're now stripping debug symbols from binary packages by setting Since existing packages were left as-is, we still recommend leaving in the manual post-install strip step, but the latest CRAN packages will eventually get smaller by default as packages update over time. And any newly added distros or R versions from now on will have all their binaries stripped, including older packages down to 2017. Sorry for taking so long, and the hold up came down to being unsure of whether any users would miss the debug symbols in the binaries. And then thinking of ways to provide both stripped and un-stripped versions of binaries, which makes things more complicated. In the end, we were convinced that users probably wouldn't miss the debug symbols, and would likely have to compile from source anyway for debugging. Or even if so, all the benefits from significantly smaller binaries (bandwidth, performance, storage costs, etc.) outweigh those niche debugging cases. Thanks for bringing up the issue originally. |
This is wonderful. Thanks @glin for the great work you do and for taking the time to share the update with us. We really appreciate it! |
Reason: The dynamic libraries are not stripped.
rocker/tidyverse
(Ubuntu 20.04, RSPM, binary install):custom build
(Debian 11, CRAN, source install):Total size of
/usr/local/lib/R/site-library
:rocker/tidyverse
: 732 MBcustom build
: 198 MB@eddelbuettel Can you think of a reason why the dynamic libraries of the RSPM binaries are not stripped?
The text was updated successfully, but these errors were encountered: