Code Monkey home page Code Monkey logo

smallest-binder's Introduction

smallest-binder

Attempts at different versions of the "smallest" image for Binder

Try it out: Binder

Strategies

  • use alpine linux for base image (not the alpine-based python images!)

  • two-stage builds to avoid installer files in runtime image (runtime has no pip)

  • PYTHONOPTIMIZE=2

  • pyc-wheel to include only .pyc files in installed packages

  • remove .dist-info package metadata (small savings)

  • remove __pycache__ for stdlib (ideally, we would keep only .opt-2, but I haven't figured that out yet) Result (analyzed dive): 81MB total

  • 5.6MB for alpine base image

  • 27MB for apk-installed python, pyzmq

  • 48MB for pip-installed packages

Simple version

A much simpler version can be found in the simple branch, which only does the simplest version of installation based on alpine. This version has:

  • 48MB to install python from api (not post-slimmed)
  • 52MB to install notebook with pip ()

totalling out to 105MB, so the slimming strategy saves ~20MB at the expense of being much more complicated and actually slower to build and slower at runtime.

Why this might not make sense

The main reason to make a tiny image is launch time, but the removal of __pycache__ for the stdlib should actually greatly increase launch time of everything after image pull, in exchange for an only slightly reduced image size (~20-25MB saved).

smallest-binder's People

Contributors

minrk avatar

Stargazers

 avatar

Watchers

 avatar  avatar  avatar

Forkers

betatim

smallest-binder's Issues

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.