Giter VIP home page Giter VIP logo

sage-binder-env's Introduction

A SageMath-based computing environment for binder

This repository illustrates Binder use cases for SageMath.

What is Binder?

Have a repository full of Jupyter notebooks? With Binder, you can add a badge that opens those notebooks in an executable environment, making your code immediately reproducible by anyone, anywhere.

What is SageMath?

A general purpose, community developed open source software for computational mathematics.

Demo notebooks

This repository provides some simple live demos for SageMath and other software included in the SageMath distribution.

TODO

Develop a collection of striking demo notebooks, and link from http://sagemath.org/, maybe as try.sagemath.org.

Examples of binder-enabled repository for SageMath

Have a repository full of Jupyter notebooks using SageMath? It's easy to setup Binder to let anyone run them. Just copy the short Dockerfile from this repository, and adapt it to your needs. You probably also want to insert the Binder badge in your READ ME.

Examples: - Some live slides for a talk - A research paper logbook

Computing backend for live documents with Thebe

Have HTML pages (e.g. documentation) containing chunks of SageMath code? With Thebe, it's easy to turn them into live code cells that will use Binder and the executable environment defined by this repository.

See this Thebe example.

For the Sphinx-generated documentation of a Sage based project, you can use the Sphinx extension provided by the Sage package authoring utilities. For an example, see this demo page, and click Activate.

Note: Thebe is similar in principle to SageMath Cell. It introduces additional flexibility by enabling the customization of the programming language (kernel), computing backend (e.g. local Jupyter server, ...) and executable environment (e.g. via Binder). It also targets a much broader community, with the potential to relieve the SageMath community from maintaining a custom solution. On the other hand it's still relatively recent and quickly evolving technology with less settled sustainability. Also the SageMath Cell has been optimized to be more reactive on startup and reduceapt resource consumption. Those optimizations have not yet been ported to Thebe+binder.

See also thebe.rst for additional reader-oriented notes.

Extending the sagemath Docker image

The sample Dockerfile in this repository is based on the official sagemath/sagemath Docker image. It includes Sage itself, and all the software packages typically included in a standard Sage installation, though not everything (in particular not optional Sage SPKGs, or other system software packages).

So in order to install additional Sage SPKGs it is possible to include a line like:

RUN sage -i <spkg-name>

in the Dockerfile. Note, due to a current shortcoming in the official Docker image it is also necessary to install the make system package before running sage -i. See the next section.

Installing additional system packages

To add additional software packages a couple more steps are involved, albeit relatively simple. The thing to understand about the sagemath/sagemath image is that by default it puts you in a user called sage, so in order to install system packages it is necessary, when extending the image, to first switch back to the root user. Then, because the image is based on Ubuntu, the apt-get command can be used to install Ubuntu packages. The canonical way to do this in a Dockerfile involves updating the APT cache, installing the packages, and then cleaning up the APT cache again all within a single command (this is in order to keep cache files out of the image):

USER root
RUN apt-get -qq update \
 && apt-get -qq install -y --no-install-recommends <packages-to-install> \
 && apt-get -qq clean
USER sage

Finally, just make sure toward the end of the Dockerfile that you switch the image user back to sage (so that when users run the container they are not running it as root.

Authors

Nicolas M. Thiéry E. Madison Bray

The demo notebooks for GAP, Singular, and Pari were written by the authors of the respective kernels. See the report on their implementation.

Contributions most welcome!

sage-binder-env's People

Contributors

nthiery avatar embray avatar slel avatar

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.