pangeo-data / pangeo-stacks

Curated Docker images for use with Jupyter and Pangeo
https://pangeo-data.github.io/pangeo-stacks/
BSD 3-Clause "New" or "Revised" License
17 stars 20 forks source link

Clean up after postBuild #116

Closed TomAugspurger closed 4 years ago

TomAugspurger commented 4 years ago

I was looking into pangeo's docker images using dive and noticed that the ./binder/postBuild step increased the size of the image by 455MB.

  Size  Filetree
206 MB  ├─⊕ home
242 MB  ├─⊕ srv
7.4 MB  └─⊕ tmp

About the only think we do is the jupyter labextension install of dask-labextension and jupyterlab-manger. This left behind a few sizable files

  1. NPM (and yarn?) caches
  2. jupyter/lab/staging
  3. js.map sourcemaps, which I believe are primarily useful for debugging.

jupyter labextension install has a --clean flag but that didn't seem to clear everything. npm cache clean --force didn't seem to do anything at all. So I resorted to just rming some things.

@ian-r-rose do you think deleting this files is safe to do? Is lab/staging safe to remove after building (IIUC, just everything is put in /static and served from there.

Here are the image sizes after (r2d3) and before (r2d2)

pangeo/base-notebook-r2d3                 latest              99e040cd761c        2 hours ago         2.04GB
pangeo/base-notebook-r2d2                 latest              35583dc7cc67        16 hours ago        2.48GB
ian-r-rose commented 4 years ago

@TomAugspurger Yes, this should be safe to do. The docs need to be improved around this (and the clean command can probably be more aggressive than it is), but you can find some discussion around this here

scottyhq commented 4 years ago

Thanks @TomAugspurger ! I'm all for merging this.

tjcrone commented 4 years ago

This is great! Also for merging!

scottyhq commented 4 years ago

@TomAugspurger - can you push one more commit on this branch to trigger rebuilding the images with CI? Thanks!

jhamman commented 4 years ago

I've synced this with master. I'll watch the build and merge on green.