Skip to content
This repository has been archived by the owner on Dec 17, 2019. It is now read-only.

Optimize the size of the images #3

Open
nthiery opened this issue Jan 29, 2016 · 7 comments
Open

Optimize the size of the images #3

nthiery opened this issue Jan 29, 2016 · 7 comments

Comments

@nthiery
Copy link
Collaborator

nthiery commented Jan 29, 2016

In theory we should be able to make them smaller than that the current virtual machines (2Gb, which is already huge).

@sebasguts
Copy link
Collaborator

You are right. I will have a look at Unikernel, which might help us to strip down the OS.

@vbraun How do you create the VM image, do you have some script we could look at? I am not sure what blows up the image that much. From my point of view we are doing everything right. But maybe Sage can somehow strip down its installation by removing unneeded files?

Also, VirtualBox seems to be able to compress its images. In fact, Docker compresses for upload and download, too, but the images seem to be stored uncompressed, I think maybe for speed.

@vbraun
Copy link
Member

vbraun commented Jan 29, 2016

The VM build script is here: https://bitbucket.org/vbraun/sage-virtual-appliance-buildscript

Further possibilities:

  • delete .git
  • delete sources
  • delete documentation doctrees
  • delete logs
  • delete entire documentation if web links are used
  • strip binaries

@embray
Copy link
Collaborator

embray commented Feb 10, 2016

@vbraun I'll see about applying that script to the docker images and see if that helps reduce their size.

@embray
Copy link
Collaborator

embray commented Feb 24, 2016

@vbraun It seems to me that running sage -t -a breaks if the sources are deleted. I think it's good for users to be run at least a portion of the test suite to test their installation, regardless of how it was installed or if the full sources are still available. This is something I'd like to pursue fixing.

You also wrote "strip binaries"--what do you mean in this case?

@embray
Copy link
Collaborator

embray commented Feb 24, 2016

The .git directory only adds about 21 MB right now, so I might not bother deleting it. Though if you're sure it's not at all useful to have then we could do that--shaving off every little bit helps.

Also, when building the images we apt-get install wget build-essential automake m4 dpkg-dev sudo python libssl-dev git, which adds about 187 MB, but it's not clear that all of those are required at runtime. Obviously some are, like Python. But we could probably uninstall some packages that are no longer needed after build.

@vbraun
Copy link
Member

vbraun commented Feb 25, 2016

  • Deleting unused artifacts should go upstream. I'm pretty sure some of your rm -rf's are already outdated paths on the latest beta
  • System python is a build-time dependency but you don't need it to run Sage
  • Strip binaries: man strip

@embray
Copy link
Collaborator

embray commented Feb 25, 2016

Ah okay, that's what I thought you meant just wanted to be sure. For the -develop images we'll want to leave symbols intact for debugging, but for the release images we can do that.

I agree the deletion of unused build artifacts should be improved upstream. In fact I would like to the entire src/ dir be treated as an artifact and improve the test runner so that the tests can be run without src/ (tests in all .py modules should be possible be run out of ./local/lib/python2.7/site-packages/sage; it's been suggested to me that this won't work for tests in Cython modules but I have ideas about that--still need to investigate further).

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants