|
1 |
| -A SageMath-based computing environment for binder |
2 |
| -================================================= |
| 1 | +Binder computing environment using SageMath |
| 2 | +=========================================== |
3 | 3 |
|
4 | 4 | .. image:: https://mybinder.org/badge_logo.svg
|
5 | 5 | :target: https://mybinder.org/v2/gh/kwankyu/sage-binder-env/master
|
6 | 6 |
|
7 |
| -This repository illustrates Binder use cases for |
| 7 | +This repository provides a `Binder <http://mybinder.org>`_ repo based on |
8 | 8 | `SageMath <http://sagemath.org>`_.
|
9 | 9 |
|
10 |
| -.. TOPIC:: What is `Binder <http://mybinder.org>`_? |
11 | 10 |
|
12 |
| - Have a repository full of Jupyter notebooks? With `Binder |
13 |
| - <http://mybinder.org>`_, you can add a badge that opens those |
14 |
| - notebooks in an executable environment, making your code |
15 |
| - immediately reproducible by anyone, anywhere. |
16 |
| - |
17 |
| -.. TOPIC:: What is `SageMath <http://sagemath.org>`_? |
18 |
| - |
19 |
| - A general purpose, community developed open source software for |
20 |
| - computational mathematics. |
21 |
| - |
22 |
| -Demo notebooks |
23 |
| --------------- |
24 |
| - |
25 |
| -This repository provides some simple live demos for SageMath and other |
26 |
| -software included in the SageMath distribution. |
27 |
| - |
28 |
| -- `index.ipynb <index.ipynb>`_: starter notebook / brief SageMath demo |
29 |
| -- `demo-gap.ipynb <demo-gap.ipynb>`_: brief GAP demo |
30 |
| -- `demo-pari.ipynb <demo-pari.ipynb>`_: brief Pari/GP demo |
31 |
| -- `demo-singular.ipynb <demo-singular.ipynb>`_: brief Singular demo |
32 |
| - |
33 |
| -.. TOPIC:: TODO |
34 |
| - |
35 |
| - Develop a collection of striking demo notebooks, and link from |
36 |
| - `http://sagemath.org/`, maybe as try.sagemath.org. |
37 |
| - |
38 |
| -Examples of binder-enabled repository for SageMath |
39 |
| --------------------------------------------------- |
| 11 | +An example of binder repository for SageMath |
| 12 | +-------------------------------------------- |
40 | 13 |
|
41 | 14 | Have a repository full of Jupyter notebooks using SageMath? It's easy
|
42 | 15 | to setup Binder to let anyone run them. Just copy the short
|
43 | 16 | `Dockerfile <Dockerfile>`_ from this repository, and adapt it to your needs. You
|
44 |
| -probably also want to insert the Binder badge in your `READ ME`. |
45 |
| - |
46 |
| -Examples: |
47 |
| -- `Some live slides for a talk <https://mybinder.org/v2/gh/nthiery/harmonic-modules/master?filepath=talk.ipynb>`_ |
48 |
| -- `A research paper logbook <https://mybinder.org/v2/gh/defeo/ffisom/master?filepath=notebooks>`_ |
49 |
| - |
50 |
| -Computing backend for live documents with Thebe |
51 |
| ------------------------------------------------ |
52 |
| - |
53 |
| -Have HTML pages (e.g. documentation) containing chunks of `SageMath <http://sagemath.org>`_ code? |
54 |
| -With `Thebe <https://github.com/minrk/thebelab>`_, it's easy to turn |
55 |
| -them into live code cells that will use `Binder <http://mybinder.org>`_ |
56 |
| -and the executable environment defined by this repository. |
57 |
| - |
58 |
| -See this `Thebe example <https://minrk.github.io/thebelab/prompts.html>`_. |
| 17 | +probably also want to insert the Binder badge in your `README.rst`. |
59 | 18 |
|
60 |
| -For the Sphinx-generated documentation of a Sage based project, |
61 |
| -you can use the Sphinx extension provided by the |
62 |
| -`Sage package authoring utilities <https://github.com/sagemath/sage-package>`_. |
63 |
| -For an example, see this |
64 |
| -`demo page <http://sage-package.readthedocs.io/en/latest/sage_package/sphinx-demo.html>`_, |
65 |
| -and click `Activate`. |
66 |
| - |
67 |
| -Note: `Thebe` is similar in principle to `SageMath Cell <http://sagecell.sagemath.org/>`_. |
68 |
| -It introduces additional flexibility by enabling the customization of |
69 |
| -the programming language (kernel), computing backend (e.g. local |
70 |
| -Jupyter server, ...) and executable environment (e.g. via Binder). |
71 |
| -It also targets a much broader community, with the potential to |
72 |
| -relieve the SageMath community from maintaining a custom solution. |
73 |
| -On the other hand it's still relatively recent and quickly evolving |
74 |
| -technology with less settled sustainability. Also the SageMath Cell |
75 |
| -has been optimized to be more reactive on startup and reduceapt |
76 |
| -resource consumption. Those optimizations have not yet been ported to |
77 |
| -Thebe+binder. |
78 |
| - |
79 |
| -See also `thebe.rst <thebe.rst>`_ for additional reader-oriented notes. |
80 | 19 |
|
81 | 20 | Extending the sagemath Docker image
|
82 | 21 | -----------------------------------
|
83 | 22 |
|
84 |
| -The sample `Dockerfile <https://github.com/sagemath/sage-binder-env/blob/master/Dockerfile>`_ |
85 |
| -in this repository is based on the official ``sagemath/sagemath`` Docker image. It includes |
86 |
| -Sage itself, and all the software packages typically included in a standard Sage installation, |
87 |
| -though not *everything* (in particular not optional Sage SPKGs, or other system software |
88 |
| -packages). |
| 23 | +The sample `Dockerfile` in this repository is based on the official sagemath |
| 24 | +Docker image. It includes Sage itself, and all the software packages typically |
| 25 | +included in a standard Sage installation, though not *everything* (in |
| 26 | +particular not optional Sage SPKGs, or other system software packages). |
89 | 27 |
|
90 | 28 | So in order to install additional Sage SPKGs it is possible to include a line like::
|
91 | 29 |
|
92 | 30 | RUN sage -i <spkg-name>
|
93 | 31 |
|
94 |
| -in the ``Dockerfile``. Note, due to a current shortcoming in the official Docker image it is |
95 |
| -also necessary to install the `make` system package before running ``sage -i``. See the |
96 |
| -next section. |
97 |
| - |
98 |
| -Installing additional system packages |
99 |
| -^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ |
100 |
| - |
101 |
| -To add additional software packages a couple more steps are involved, |
102 |
| -albeit relatively simple. The thing to understand about the ``sagemath/sagemath`` image is |
103 |
| -that by default it puts you in a user called `sage`, so in order to install system packages |
104 |
| -it is necessary, when extending the image, to first switch back to the `root` user. |
105 |
| -Then, because the image is based on Ubuntu, the `apt-get` command can be used to install |
106 |
| -Ubuntu packages. The canonical way to do this in a `Dockerfile` involves updating the |
107 |
| -APT cache, installing the packages, and then cleaning up the APT cache again all within |
108 |
| -a single command (this is in order to keep cache files out of the image):: |
109 |
| - |
110 |
| - USER root |
111 |
| - RUN apt-get -qq update \ |
112 |
| - && apt-get -qq install -y --no-install-recommends <packages-to-install> \ |
113 |
| - && apt-get -qq clean |
114 |
| - USER sage |
115 |
| - |
116 |
| -Finally, just make sure toward the end of the ``Dockerfile`` that you switch the image |
117 |
| -user back to ``sage`` (so that when users run the container they are not running it as |
118 |
| -``root``. |
119 |
| - |
120 |
| - |
121 |
| -Authors |
122 |
| -------- |
123 |
| - |
124 |
| -Nicolas M. Thiéry |
125 |
| -E. Madison Bray |
126 |
| - |
127 |
| -The demo notebooks for GAP, Singular, and Pari were written by the |
128 |
| -authors of the respective kernels. See the |
129 |
| -`report on their implementation <https://github.com/OpenDreamKit/OpenDreamKit/tree/master/WP4/D4.4>`_. |
130 |
| - |
131 |
| -Contributions most welcome! |
| 32 | +in the ``Dockerfile``. |
0 commit comments