j1-template 2022.4.0 → 2022.4.3

Sign up to get free protection for your applications and to get access to all the features.
Files changed (104) hide show
  1. checksums.yaml +4 -4
  2. data/_includes/themes/j1/layouts/content_generator_article_navigator.html +1 -1
  3. data/_includes/themes/j1/layouts/content_generator_blog_archive.html +1 -1
  4. data/_includes/themes/j1/layouts/content_generator_news_panel_posts.html +1 -1
  5. data/assets/themes/j1/adapter/js/nbinteract.js +21 -10
  6. data/assets/themes/j1/core/js/template.min.js.map +1 -1
  7. data/assets/themes/j1/modules/bokeh/README.md +380 -0
  8. data/assets/themes/j1/modules/bokeh/js/v2.4.3/bokeh.min.js +596 -0
  9. data/assets/themes/j1/modules/nbInteract/css/theme/uno/nbinteract-core.css +7 -0
  10. data/assets/themes/j1/modules/nbInteract/css/theme/uno/nbinteract-core.min.css +1 -1
  11. data/assets/themes/j1/modules/vega/js/vega/LICENSE +27 -0
  12. data/assets/themes/j1/modules/vega/js/vega/README.md +42 -0
  13. data/assets/themes/j1/modules/vega/js/vega/vega-core.js +34550 -0
  14. data/assets/themes/j1/modules/vega/js/vega/vega-core.min.js +2 -0
  15. data/assets/themes/j1/modules/vega/js/vega/vega-core.min.js.map +1 -0
  16. data/assets/themes/j1/modules/vega/js/vega/vega.js +49095 -0
  17. data/assets/themes/j1/modules/vega/js/vega/vega.min.js +2 -0
  18. data/assets/themes/j1/modules/vega/js/vega/vega.min.js.map +1 -0
  19. data/assets/themes/j1/modules/vega/js/vega-embed/LICENSE +27 -0
  20. data/assets/themes/j1/modules/vega/js/vega-embed/README.md +230 -0
  21. data/assets/themes/j1/modules/vega/js/vega-embed/vega-embed.js +6607 -0
  22. data/assets/themes/j1/modules/vega/js/vega-embed/vega-embed.js.map +1 -0
  23. data/assets/themes/j1/modules/vega/js/vega-embed/vega-embed.min.js +21 -0
  24. data/assets/themes/j1/modules/vega/js/vega-embed/vega-embed.min.js.map +1 -0
  25. data/assets/themes/j1/modules/vega/js/vega-lite/LICENSE +27 -0
  26. data/assets/themes/j1/modules/vega/js/vega-lite/README.md +21 -0
  27. data/assets/themes/j1/modules/vega/js/vega-lite/vega-lite-schema.json +30999 -0
  28. data/assets/themes/j1/modules/vega/js/vega-lite/vega-lite.js +24585 -0
  29. data/assets/themes/j1/modules/vega/js/vega-lite/vega-lite.js.map +1 -0
  30. data/assets/themes/j1/modules/vega/js/vega-lite/vega-lite.min.js +2 -0
  31. data/assets/themes/j1/modules/vega/js/vega-lite/vega-lite.min.js.map +1 -0
  32. data/lib/j1/version.rb +1 -1
  33. data/lib/starter_web/Gemfile +1 -1
  34. data/lib/starter_web/_config.yml +1 -1
  35. data/lib/starter_web/_data/modules/defaults/nbinteract.yml +5 -1
  36. data/lib/starter_web/_data/modules/navigator_menu.yml +60 -56
  37. data/lib/starter_web/_data/modules/nbinteract.yml +83 -87
  38. data/lib/starter_web/_data/resources.yml +101 -0
  39. data/lib/starter_web/_plugins/lunr_index.rb +1 -1
  40. data/lib/starter_web/assets/images/modules/attics/shubham-dhage-2-1920x1280.jpg +0 -0
  41. data/lib/starter_web/assets/images/modules/attics/wrongtog-1920x1280.jpg +0 -0
  42. data/lib/starter_web/assets/images/modules/attics/yellow-cactus-1920x1280.jpg +0 -0
  43. data/lib/starter_web/assets/images/modules/icons/bokeh/bokeh-32x32.ico +0 -0
  44. data/lib/starter_web/assets/images/modules/icons/bokeh/bokeh.ico +0 -0
  45. data/lib/starter_web/assets/images/modules/icons/bokeh/logo-160x160.png +0 -0
  46. data/lib/starter_web/package.json +1 -1
  47. data/lib/starter_web/pages/public/jupyter/examples/{j1-circular-times-table.adoc → distributed/j1-circular-times-table.adoc} +7 -2
  48. data/lib/starter_web/pages/public/jupyter/examples/{j1-interactive-widgets.adoc → distributed/j1-common-used-widgets.adoc} +14 -6
  49. data/lib/starter_web/pages/public/jupyter/examples/{j1-odes-in-python.adoc → distributed/j1-odes-in-python.adoc} +7 -2
  50. data/lib/starter_web/pages/public/jupyter/examples/{j1_climate-change-forecast.adoc → localized/j1_climate-change-forecast.adoc} +10 -5
  51. data/lib/starter_web/pages/public/jupyter/notebooks/textbooks/j1_altair_interactive.html +2216 -0
  52. data/lib/starter_web/pages/public/jupyter/notebooks/textbooks/j1_altair_non_interactive.html +1170 -0
  53. data/lib/starter_web/pages/public/jupyter/notebooks/textbooks/j1_bokeh_01_basic_plotting.html +1479 -0
  54. data/lib/starter_web/pages/public/jupyter/notebooks/textbooks/j1_bokeh_02_styling_and_theming.html +1524 -0
  55. data/lib/starter_web/pages/public/jupyter/notebooks/textbooks/j1_bokeh_03_data_sources_and_transformations.html +983 -0
  56. data/lib/starter_web/pages/public/jupyter/notebooks/textbooks/j1_bokeh_04_adding_annotations.html +1280 -0
  57. data/lib/starter_web/pages/public/jupyter/notebooks/textbooks/j1_bokeh_05_presentation_layouts.html +660 -0
  58. data/lib/starter_web/pages/public/jupyter/notebooks/textbooks/j1_bokeh_06_linking_and_interactions.html +1563 -0
  59. data/lib/starter_web/pages/public/jupyter/notebooks/textbooks/j1_bokeh_07_bar_and_categorical_data_plots.html +1888 -0
  60. data/lib/starter_web/pages/public/jupyter/notebooks/textbooks/j1_bokeh_08_graph_and_network_plots.html +689 -0
  61. data/lib/starter_web/pages/public/jupyter/notebooks/textbooks/j1_bokeh_09_geographic_plots.html +767 -0
  62. data/lib/starter_web/pages/public/jupyter/notebooks/textbooks/j1_circular_times_table.html +2 -1
  63. data/lib/starter_web/pages/public/jupyter/notebooks/textbooks/j1_interactive_widgets.html +21 -0
  64. data/lib/starter_web/pages/public/jupyter/where_to_go.adoc +239 -0
  65. data/lib/starter_web/pages/public/learn/where_to_go.adoc +23 -7
  66. data/lib/starter_web/utilsrv/_defaults/package.json +1 -1
  67. data/lib/starter_web/utilsrv/package.json +1 -1
  68. metadata +47 -42
  69. data/lib/starter_web/pages/public/jupyter/docs/_includes/attributes.asciidoc +0 -58
  70. data/lib/starter_web/pages/public/jupyter/docs/_includes/documents/j1_docs_example_static.asciidoc +0 -232
  71. data/lib/starter_web/pages/public/jupyter/docs/j1-nbinteract-doc.adoc +0 -563
  72. data/lib/starter_web/pages/public/jupyter/docs/nbi-widget-manual.adoc +0 -465
  73. data/lib/starter_web/pages/public/jupyter/docs/nbinteract-doc.adoc +0 -473
  74. data/lib/starter_web/pages/public/jupyter/examples/j1-testing-plotly.adoc +0 -94
  75. data/lib/starter_web/pages/public/jupyter/notebooks/j1/.ipynb_checkpoints/j1_circular_times_table-checkpoint.ipynb +0 -12387
  76. data/lib/starter_web/pages/public/jupyter/notebooks/j1/.ipynb_checkpoints/j1_climate_change_forecast-checkpoint.ipynb +0 -1058
  77. data/lib/starter_web/pages/public/jupyter/notebooks/j1/.ipynb_checkpoints/j1_docs_example_dynamic-checkpoint.ipynb +0 -14478
  78. data/lib/starter_web/pages/public/jupyter/notebooks/j1/.ipynb_checkpoints/j1_interactive_widgets-checkpoint.ipynb +0 -738
  79. data/lib/starter_web/pages/public/jupyter/notebooks/j1/.ipynb_checkpoints/j1_ode_selected-checkpoint.ipynb +0 -14478
  80. data/lib/starter_web/pages/public/jupyter/notebooks/j1/.ipynb_checkpoints/j1_odes_in_python-checkpoint.ipynb +0 -15227
  81. data/lib/starter_web/pages/public/jupyter/notebooks/j1/factor_by_factor.mp4 +0 -0
  82. data/lib/starter_web/pages/public/jupyter/notebooks/j1/line_by_line.mp4 +0 -0
  83. data/lib/starter_web/pages/public/jupyter/notebooks/j1/point_by_point.mp4 +0 -0
  84. data/lib/starter_web/pages/public/jupyter/notebooks/nbi-docs/.ipynb_checkpoints/nbi_docs_examples_central_limit_theorem-checkpoint.ipynb +0 -247
  85. data/lib/starter_web/pages/public/jupyter/notebooks/nbi-docs/.ipynb_checkpoints/nbi_docs_examples_variability_of_the_sample_mean-checkpoint.ipynb +0 -323
  86. data/lib/starter_web/pages/public/jupyter/notebooks/nbi-docs/.ipynb_checkpoints/nbi_docs_recipes_graphing-checkpoint.ipynb +0 -387
  87. data/lib/starter_web/pages/public/jupyter/notebooks/nbi-docs/.ipynb_checkpoints/nbi_docs_recipes_interactive_questions-checkpoint.ipynb +0 -185
  88. data/lib/starter_web/pages/public/jupyter/notebooks/nbi-docs/.ipynb_checkpoints/nbi_docs_recipes_layout-checkpoint.ipynb +0 -384
  89. data/lib/starter_web/pages/public/jupyter/notebooks/nbi-docs/.ipynb_checkpoints/nbi_docs_tutorial_interact-checkpoint.ipynb +0 -254
  90. data/lib/starter_web/pages/public/jupyter/notebooks/nbi-docs/.ipynb_checkpoints/nbi_docs_tutorial_monty_hall-checkpoint.ipynb +0 -732
  91. data/lib/starter_web/pages/public/jupyter/notebooks/textbooks/nbi_docs_examples_central_limit_theorem.html +0 -290
  92. data/lib/starter_web/pages/public/jupyter/notebooks/textbooks/nbi_docs_examples_correlation.html +0 -818
  93. data/lib/starter_web/pages/public/jupyter/notebooks/textbooks/nbi_docs_examples_empirical_distributions.html +0 -351
  94. data/lib/starter_web/pages/public/jupyter/notebooks/textbooks/nbi_docs_examples_linear_regression.html +0 -106
  95. data/lib/starter_web/pages/public/jupyter/notebooks/textbooks/nbi_docs_examples_probability_distribution_plots.html +0 -228
  96. data/lib/starter_web/pages/public/jupyter/notebooks/textbooks/nbi_docs_examples_sampling_from_a_population.html +0 -518
  97. data/lib/starter_web/pages/public/jupyter/notebooks/textbooks/nbi_docs_examples_variability_of_the_sample_mean.html +0 -372
  98. data/lib/starter_web/pages/public/jupyter/notebooks/textbooks/nbi_docs_recipes_graphing.html +0 -473
  99. data/lib/starter_web/pages/public/jupyter/notebooks/textbooks/nbi_docs_recipes_interactive_questions.html +0 -242
  100. data/lib/starter_web/pages/public/jupyter/notebooks/textbooks/nbi_docs_recipes_layout.html +0 -496
  101. data/lib/starter_web/pages/public/jupyter/notebooks/textbooks/nbi_docs_tutorial_interact.html +0 -329
  102. data/lib/starter_web/pages/public/jupyter/notebooks/textbooks/nbi_docs_tutorial_monty_hall.html +0 -866
  103. data/lib/starter_web/pages/public/jupyter/services/binderhub.adoc +0 -564
  104. data/lib/starter_web/pages/public/jupyter/services/jupyterhub.adoc +0 -244
@@ -1,564 +0,0 @@
1
- ---
2
- title: Binder
3
- tagline: BinderHub
4
- date: 2022-03-28 00:00:00
5
- description: >
6
- Binder allows you to create custom computing environments that can be
7
- shared and used by many remote users. A Binder service is powered by
8
- BinderHub, an open-source tool that runs on Kubernetes, a portable,
9
- extensible, open-source platform for managing containerized services.
10
- keywords: >
11
- opensource, free, load, download, start, starter, example,
12
- high, easy, use, secure, encrypt, standard, popular,
13
- generate, create, learn, distribute, publish, deploy,
14
- beginner, advanced, expert, student, learner, writer, reader, visitor
15
- framework, toolkit, integration, extension, module, api,
16
- dynamic, static, generator, client, server, internet, local, localhost
17
- page, web, website, webdesign, material, design, responsive,
18
- javascript, nodejs, ruby, windows, linux, osx, mac, os,
19
- http, https, html, html5, css, scss, style,
20
- browser, firefox, chrome, edge, opera, safari,
21
- configuration, generator, navigation, menu, dropdown, fab, action, button
22
- application, interface, provider, api, repository,
23
- cookie, language, translation, gdpr, dsgvo, privacy,
24
- asciidoc, aciidoctor, bootstrap, jekyll, liquid,
25
- hyvor, disqus, git, github, netlify, heroku, apple, microsoft,
26
- provider, service, internet, support,
27
- google, analytics, advertising, search, console, silverlight, score,
28
- j1, template, jekyllone, comment,
29
- python, jupyter, notebook, textbook, api, app, nbinteract,
30
- nbi, integration, binder, binderhub, jupyterhub
31
-
32
- categories: [ Software, Python ]
33
- tags: [ Binder, API ]
34
-
35
- scrollbar: false
36
- personalization: true
37
-
38
- permalink: /pages/public/jupyter/docs/binderhub/
39
- regenerate: false
40
-
41
- resources: [ animate, clipboard, lightbox, rouge ]
42
- resource_options:
43
- - attic:
44
- padding_top: 400
45
- padding_bottom: 50
46
- opacity: 0.5
47
- slides:
48
- - url: /assets/images/modules/attics/runner-1920x1200.jpg
49
- ---
50
-
51
- // Page Initializer
52
- // =============================================================================
53
- // Enable the Liquid Preprocessor
54
- :page-liquid:
55
-
56
- // Set (local) page attributes here
57
- // -----------------------------------------------------------------------------
58
- // :page--attr: <attr-value>
59
- :badges-enabled: false
60
- :binder-badge-enabled: false
61
- :binder-app-launch--tree: https://mybinder.org/v2/gh/jekyll-one/j1-binder-repo/main?urlpath=/tree
62
- :jupyterlab-docs--getting-started: https://jupyterlab.readthedocs.io/en/latest/getting_started/starting.html
63
- :jupyter-discourse--startup-time: https://discourse.jupyter.org/t/how-to-reduce-mybinder-org-repository-startup-time/4956
64
-
65
- :binder--home: https://mybinder.org/
66
- :binder-sre--analytics: https://mybinder-sre.readthedocs.io/en/latest/analytics/events-archive.html
67
- :binder--binderlyzer: {binder--home}v2/gh/betatim/binderlyzer/master
68
-
69
- :binderhub-docs--reference: https://binderhub.readthedocs.io/en/latest/reference/ref-index.html
70
-
71
- :github-repo--binderhub: https://github.com/jupyterhub/binderhub
72
- :github-repo--binderlyzer: https://github.com/betatim/binderlyzer
73
-
74
- // Load Liquid procedures
75
- // -----------------------------------------------------------------------------
76
- {% capture load_attributes %}themes/{{site.template.name}}/procedures/global/attributes_loader.proc{%endcapture%}
77
-
78
- // Load page attributes
79
- // -----------------------------------------------------------------------------
80
- {% include {{load_attributes}} scope="global" %}
81
-
82
-
83
- // Page content
84
- // ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
85
- ifeval::[{badges-enabled} == true]
86
- {badge-j1--license} {badge-j1--version-latest} {badge-j1-gh--last-commit} {badge-j1--downloads}
87
- endif::[]
88
-
89
- // Include sub-documents (if any)
90
- // -----------------------------------------------------------------------------
91
- ifeval::[{binder-badge-enabled} == true]
92
- image:/assets/images/badges/myBinder.png[[Binder, link="{binder--home}", {browser-window--new}]
93
- image:/assets/images/badges/docsBinder.png[[Binder, link="https://mybinder.readthedocs.io/en/latest/", {browser-window--new}]
94
- endif::[]
95
-
96
- Binder allows you to create custom computing environments that can be
97
- shared and used by many remote users. You can use many open source languages,
98
- <<Configure the user interface>>, and more. A Binder service is powered by
99
- link:{github-repo--binderhub}[BinderHub Repo on Github, {browser-window--new}],
100
- an open-source tool that runs on Kubernetes, a portable, extensible,
101
- open-source platform for managing containerized services. One such deployment
102
- lives at link:{binder--home}[Binder Home, {browser-window--new}], and is free
103
- to use.
104
-
105
- == Configuration Files
106
-
107
- The `repo2docker` CLI looks for configuration files in the repository being
108
- built to determine how to build it. In general, repo2docker uses the same
109
- configuration files as other software installation tools, rather than
110
- creating new custom configuration files. A number of repo2docker configuration
111
- files can be combined to compose more complex setups.
112
-
113
- The https://github.com/binder-examples[binder examples, {browser-window--new}]
114
- organization on GitHub contains a list of sample repositories for common
115
- configurations that repo2docker can build with various configuration files
116
- such as Python and R installation in a repository.
117
-
118
- Binder examples:
119
-
120
- * https://github.com/jupyterlab/jupyterlab-demo[JupyterLab Demonstration, {browser-window--new}]
121
- * https://github.com/binder-examples/jupyterlab[JupyterLab + Binder, {browser-window--new}]
122
- // * https://github.com/binder-examples/remote_storage[Remote Storage with Binder, {browser-window--new}]
123
- * https://github.com/binder-examples/python-conda_pip[Using conda with pip in the same build, {browser-window--new}]
124
- * https://github.com/binder-examples/pipfile[Python environment with Pipfile, {browser-window--new}]
125
-
126
- A list of supported
127
- configuration files (roughly in the order of build priority) can be found
128
- below.
129
-
130
- === environment.yml
131
-
132
- The `environment.yml` configuration is the standard configuration file used
133
- by *Conda* that lets you install any kind of package, including Python, R,
134
- and C/C++ packages. The `repo2docker` does *not* use your environment.yml
135
- to create and activate a new conda environment. Rather, it updates a base
136
- conda environment defined here with the packages listed in your
137
- `environment.yml`. This means that the environment will always have the
138
- same default name, not the name specified in your `environment.yml`.
139
-
140
- [source, yaml]
141
- ----
142
- dependencies:
143
- - ipywidgets
144
- - matplotlib
145
- - numpy
146
- - scipy
147
- - pandas
148
- - seaborn
149
- - statsmodels
150
- ----
151
-
152
- If you use `environment.yml`, then Binder will use a *Miniconda* distribution
153
- to install your packages. However, you may still want to use *pip*. In this
154
- case, you should *not* use a `requirements.txt` file, but instead use a pip
155
- *section* in `environment.yml`. This repository is an example of how to
156
- construct your configuration to accomplish this.
157
-
158
- [source, yaml]
159
- ----
160
- channels:
161
- - conda-forge
162
- - defaults
163
- dependencies:
164
- - python
165
- - numpy
166
- - pip
167
- - pip:
168
- - nbgitpuller
169
- - sphinx-gallery
170
- - pandas
171
- - matplotlib
172
- ----
173
-
174
- === requirements.txt
175
-
176
- This configuration specifies a list of *Python packages* that should be
177
- installed in your environment. Our requirements.txt example on GitHub shows
178
- a typical requirements file.
179
-
180
- For Binder, the requirements.txt file should list all Python libraries that
181
- your notebooks depend on, and they will be installed using:
182
-
183
- [source, sh, role="noclip"]
184
- ----
185
- pip install -r requirements.txt
186
- ----
187
-
188
- The base Binder image contains *no extra* dependencies, so be as explicit
189
- as possible in defining the packages that you need. This includes specifying
190
- explicit versions wherever possible.
191
-
192
- WARNING: If you do specify *strict versions*, it is important to do so
193
- for all your dependencies, not just direct dependencies. Strictly specifying
194
- only some dependencies is a recipe for environments breaking over time.
195
-
196
- You can also specify which Python *version* to install in your built
197
- environment with `environment.yml`. By default, repo2docker installs
198
- *default_python* (Python 3.7) with your `environment.yml` unless you
199
- include the version of Python in this file. The package manager *conda*
200
- supports all versions of Python, though repo2docker support is best with
201
- Python `3.7`, `3.6`, `3.5` and `2.7`.
202
-
203
- WARNING: If you include a Python version in a `runtime.txt` file in
204
- *addition* to your `environment.yml`, your `runtime.txt` will be
205
- *ignored*.
206
-
207
- === runtime.txt
208
-
209
- Sometimes you want to specify the *version* of the runtime (e.g. the version
210
- of Python), but the environment specification format will not let you
211
- specify this information (e.g. requirements.txt). For these cases, we have a
212
- special file, runtime.txt.
213
-
214
- NOTE: runtime.txt is only supported when used with environment specifications
215
- that do not already support specifying the runtime. If using environment.yml
216
- for conda, runtime.txt will be ignored.
217
-
218
-
219
- == Configure the user interface
220
-
221
- You can build several user interfaces into the resulting Docker image. This
222
- is controlled with various <<Configuration Files>>.
223
-
224
- === JupyterLab Interface
225
-
226
- JupyterLab is the *default* interface for repo2docker. The following
227
- Binder URL will open the *jekyll-one* repository and begin a JupyterLab
228
- session opening the path `notebooks`:
229
-
230
- [source, txt]
231
- ----
232
- https://mybinder.org/v2/gh/jekyll-one/j1-binder-repo/main?filepath=notebooks
233
- ----
234
-
235
- The filepath notebooks above is how JupyterLab directs you to a specific file
236
- or folder. To learn more about URLs in JupyterLab and Jupyter Notebook, visit
237
- link:{jupyterlab-docs--getting-started}[Starting JupyterLab, {browser-window--new}].
238
-
239
- === Classic Notebook Interface
240
-
241
- The classic notebook is also available without any configuration. To switch
242
- to the classic notebook interface, you do not need any extra configuration
243
- in order to allow the use of the classic notebook interface. You can launch
244
- the classic notebook interface from within a user session by opening
245
- JupyterLab and replacing the path `/lab/` with `/tree/` in the JuptyerLab URL
246
- like so:
247
-
248
- ----
249
- https://mybinder.org/v2/<repo-provider>/<repo>/<branch>?urlpath=/tree
250
- ----
251
-
252
- .Example
253
- [source, txt]
254
- ----
255
- https://mybinder.org/v2/gh/jekyll-one/j1-binder-repo/main?urlpath=/tree
256
- ----
257
-
258
-
259
- /////
260
- === nteract
261
-
262
- nteract is a notebook interface built with *React*. It is similar to a
263
- more feature-filled version of the traditional Jupyter Notebook interface.
264
- *nteract* comes pre-installed in any session that has been built from a
265
- Python repository.
266
-
267
- You can launch nteract from within a user session by replacing `/tree` with
268
- `/nteract` at the end of a notebook server’s URL like so:
269
-
270
- http(s)://<server:port>/nteract
271
-
272
- For example, the following Binder URL will open the pyTudes repository and
273
- begin an nteract session in the ipynb folder:
274
-
275
- https://mybinder.org/v2/gh/norvig/pytudes/HEAD?urlpath=nteract/tree/ipynb
276
-
277
- The `/tree/ipynb` above is how nteract directs you to a specific file
278
- or folder. To learn more about nteract, visit the
279
- https://nteract.io/about[nteract website, {browser-window--new}].
280
-
281
-
282
- === Use different repositories for content and environment
283
-
284
- // See: https://mybinder.readthedocs.io/en/latest/howto/external_binder_setup.html
285
-
286
- Separating your Binder setup files from your repository content can be
287
- useful for a variety of reasons. Maybe they need different access permissions
288
- or you manage your working environment external to your code repository.
289
- Whatever the reason, with a custom Binder URL you can store your environment
290
- independent of your content.
291
-
292
- The form on the mybinder.org home page only allows you to select a repository
293
- branch to build from. To create a BinderHub deployment link for situations
294
- where the environment and content are housed in separate repositories or on
295
- different branches of the same repository, you can use the
296
- https://jupyterhub.github.io/nbgitpuller/link?tab=binder[nbgitpuller link generator, {browser-window--new}]
297
- to generate a formatted URL. Note that `nbgitpuller` must be included in your
298
- hub environment for this to work.
299
-
300
- For some background on this how-to guide, see this
301
- https://discourse.jupyter.org/t/improve-documentation-for-new-users-not-working-on-the-master-branch/5509[community forum post, {browser-window--new}].
302
- Here is an example repository using a JupyterHub environment configuration
303
- stored in a https://github.com/ICESAT-2HackWeek/jupyter-image-2020[separate repository, {browser-window--new}].
304
- The environment was set up for a community workshop and the tutorial content
305
- was compiled and released after the workshop.
306
- /////
307
-
308
- // === Speed up repository launch time
309
- //
310
- // People often ask how they can speed up the launches for their Binder
311
- // repositories. Binder is a bit different from other cloud services because
312
- // it builds and launches arbitrary environments that are defined in Git
313
- // repositories, rather than only serving a single environment for launches.
314
- // The extra time it takes to launch is often a result of these extra steps.
315
- //
316
- // For some background and tips about how you can speed up your repository
317
- // launch times, see this
318
- // link:{jupyter-discourse--startup-time}[community forum post, {browser-window--new}].
319
-
320
- === Track repository data on Binder
321
-
322
- The mybinder.org team runs a service that provides repository-level data
323
- about all of the binders that run each day. This is called the mybinder.org
324
- event analytics archive. You can use this to track how often people are
325
- clicking your Binder links and launching your Binder repository (or, for
326
- aggregating activity across many repositories).
327
-
328
- === Access the event analytics archive
329
-
330
- You can access the event analytics archive at `archive.analytics.mybinder.org`.
331
- For information about the structure of this dataset, and a description of
332
- how you can read-in the data in order to analyze it, see the
333
- link:{binder-sre--analytics}[Binder Site Reliability Guide (SRE), {browser-window--new}].
334
- instructions.
335
-
336
- ==== Example repository to show off analyses
337
-
338
- To give you a little inspiration, check out the
339
- link:{binder--binderlyzer}[binderlyzer binder, {browser-window--new}].
340
- This is a Binder that goes through a simple analysis of Binder repositories
341
- using the events archive. It shows how to access it, and gives an idea for
342
- questions you can ask with this data!
343
-
344
- If you do something interesting or fun with the event analytics archive,
345
- please let us know! We provide this resource in the hopes that it gives
346
- people insight into the activity going on in Binder land, and would love
347
- to hear about anything interesting you find.
348
-
349
-
350
- == Binder API Reference
351
-
352
- // https://binderhub.readthedocs.io/en/latest/developer/index.html
353
-
354
- BinderHub connects several services together to provide on-the-fly
355
- creation and registry of Docker images. It utilizes the following
356
- tools:
357
-
358
- * A cloud provider such Google Cloud, Microsoft Azure, Amazon EC2,
359
- and others
360
- * Kubernetes to manage resources on the cloud
361
- * Helm to configure and control Kubernetes
362
- * Docker to use containers that standardize computing environments
363
- * A BinderHub UI that users can access to specify Git repos they want built
364
- repo2docker to generate Docker images using the URL of a Git repository
365
- * A Docker registry (such as gcr.io) that hosts container images
366
- * JupyterHub to deploy temporary containers for users
367
-
368
- After a user clicks a Binder link, the following chain of events happens:
369
-
370
- . BinderHub resolves the link to the repository.
371
- . BinderHub determines whether a Docker image already exists for the
372
- repository at the latest ref (git commit hash, branch, or tag).
373
- . If the image *doesn’t* exist, BinderHub creates a build pod that uses
374
- repo2docker to do the following:
375
-
376
- .. Fetch the repository associated with the link
377
- .. Build a Docker container image containing the *environment*
378
- specified in configuration files in the repository.
379
- .. Push that image to a *Docker registry*, and send the registry
380
- information to the BinderHub for future reference.
381
-
382
- . BinderHub sends the Docker image registry to *JupyterHub*.
383
- . JupyterHub creates a *Kubernetes pod* for the user that serves
384
- the *built* Docker image for the repository.
385
- . JupyterHub *monitors* the user’s pod for activity, and *destroys*
386
- it after a short period of inactivity.
387
-
388
- // See: https://www.vmware.com/topics/glossary/content/kubernetes-pods.html
389
- //
390
- NOTE: *Pods* (smallest compute unit that can be defined, deployed,
391
- and managed in Kubernetes) are the rough equivalent of a machine instance
392
- (physical or virtual) to a container. Each pod is allocated its own internal
393
- IP address, therefore owning its entire port space, and containers within
394
- pods can share their local storage and networking.
395
-
396
- .Binderhub Architecture
397
- lightbox::binderhub--architecture[ 800, {data-binderhub--architecture}, role="mt-3 mb-4" ]
398
-
399
-
400
- === API Endpoint
401
-
402
- There’s one API endpoint, which is:
403
-
404
- [source, text]
405
- ----
406
- /build/<provider_prefix>/<spec>
407
- ----
408
-
409
- Even though it says build it actually performs launch.
410
-
411
- * provider_prefix identifies the provider
412
- * spec defines the source of the computing environment to be built
413
- and served using the given provider.
414
-
415
- NOTE: The provider_prefix can be any of the supported repository providers
416
- in BinderHub, see the Repository Providers section for supported inputs.
417
-
418
- To use this endpoint, construct an appropriate URL and send a request.
419
- You’ll get back an Event Stream. It’s pretty much just a long-lived HTTP
420
- connection with a well known JSON based data protocol. It’s one-way
421
- communication only (server to client) and is straightforward to implement
422
- across multiple languages.
423
-
424
- When the request is received, the following happens:
425
-
426
- . Check if this image exists in our cached image registry. If so,
427
- launch it.
428
- . If it doesn’t exist in the image registry, we check if a build
429
- is currently running. If it is, we attach to it and start streaming
430
- logs from it to the user.
431
- . If there is no build in progress, we start a build and start streaming
432
- logs from it to the user.
433
- . If the build succeeds, we contact the JupyterHub API and start launching
434
- the server.
435
-
436
- === Events
437
-
438
- This section catalogs the different events you might receive.
439
-
440
- .Events
441
- [cols="2,4a,6a", options="header", width="100%", role="rtable mt-3"]
442
- |===
443
- |Event |Response |Description
444
-
445
- |*Failed*
446
- |`{"phase": "failed", "message": "Reason"}`
447
- |Emitted whenever a build or launch fails. You must *close* your
448
- *EventStream* when you receive this event.
449
-
450
- |*Built*
451
- |`{"phase": "built", "message": "Human readable message", "imageName": "Full name of the image that is in the cached docker registry"}`
452
- |Emitted after the image has been built, before launching begins.
453
- This is emitted in the start if the image has been found in the cache
454
- registry, or after build completes successfully if we had to do a build.
455
-
456
- Note that clients shouldn’t rely on the imageName field for anything
457
- specific. It should be considered an internal implementation detail.
458
-
459
- |*Waiting*
460
- |`{"phase": "waiting", "message": "Human readable message"}`
461
- |Emitted when we started a build pod and are waiting for it to start.
462
-
463
- |*Building*
464
- |`{"phase": "building", "message": "Log message"}`
465
- |Emitted during the actual building process. Direct stream of logs
466
- from the build pod from *repo2docker*, in the same form as logs from
467
- a normal *docker build*.
468
-
469
-
470
- |`Fetching`
471
- |`{"phase": "fetching", "message": "log messages from fetching process"}`
472
- |Emitted when fetching the repository to be built from its source (GitHub, GitLab, wherever).
473
-
474
- |*Pushing*
475
- |`{"phase": "pushing", "message": "Human readable message", "progress": {"layer1": {"current": <bytes-pushed>, "total": <full-bytes>}, "layer2": {"current": <bytes-pushed>, "total": <full-bytes>}, "layer3": "Pushed", "layer4": "Layer already exists"}}`
476
- |Emitted when the image is being pushed to the cache registry. This
477
- provides structured status info that could be in a progressbar. It’s
478
- structured similar to the output of *docker push*.
479
-
480
- |*Launching*
481
- |`{"phase": "launching", "message": "user friendly message"}`
482
- |When the repo has been built, and we’re in the process of waiting
483
- for the hub to launch. This could end up succeeding and emitting a
484
- *ready* event or failing and emitting a *failed* event.
485
-
486
- |*Ready*
487
- |`{"phase": "ready", "message": "Human readable message", "url": "full-url-of-notebook-server", "token": "notebook-server-token"}`
488
- |When your notebook is ready! You get a endpoint URL and a token
489
- used to access it. You can access the notebook\|API by using the
490
- token in one of the ways the notebook accepts security tokens.
491
-
492
- |===
493
-
494
- === Heartbeat
495
-
496
- In EventSource, all lines beginning with `:` are considered comments.
497
- We send a `:heartbeat` every 30s to make sure that we can pass through
498
- proxies without our request being killed.
499
-
500
- === Repository Providers
501
-
502
- Repository Providers (or RepoProviders) are locations where repositories
503
- are stored (e.g., GitHub). BinderHub supports a number of providers out
504
- of the box, and can be extended to support new providers. For a complete
505
- listing of the provider classes, see table below.
506
-
507
- .Provider
508
- [cols="1,1a,6a,4a", options="header", width="100%", role="rtable mt-3"]
509
- |===
510
- |Provider |Prefix |Spec |Description
511
-
512
- |GitHub
513
- |*gh*
514
- |`<user>/<repo>/<commit-sha-or-tag-or-branch>`
515
- |GitHub is a website for hosting and sharing git repositories.
516
-
517
- |GitLab
518
- |*gl*
519
- |`<url-escaped-namespace>/<unresolved_ref>`
520
- (e.g. group%2Fproject%2Frepo/master)
521
- |GitLab offers hosted as well as self-hosted git repositories.
522
-
523
- |Gist
524
- |*gist*
525
- |`<github-username>/<gist-id><commit-sha-or-tag>`
526
- |Gists are small collections of files stored on GitHub. They behave
527
- like lightweight *repositories*.
528
-
529
- |Zenodo
530
- |*zenodo*
531
- |`<zenodo-DOI>`
532
- |Zenodo is a non-profit provider of scholarly artifacts (such as code
533
- repositories) run in partnership with CERN.
534
-
535
- |Figshare
536
- |*figshare*
537
- |`<figshare-DOI>`
538
- |FigShare is a company that offers hosting for scholarly artifacts
539
- (such as code repositories).
540
-
541
- |HydroShare
542
- |*hydroshare*
543
- |`<hydroshare-DOI-or-ResourceID>`
544
- |HydroShare is a hydrologic information system for users to share
545
- and publish data and models.
546
-
547
- |Dataverse
548
- |*dataverse*
549
- |`<dataverse-DOI>`
550
- |Dataverse is open source research data repository software installed
551
- all over the world.
552
-
553
- |Git
554
- |*git*
555
- |`<url-escaped-url>/<commit-sha>`
556
- |A generic repository provider for URLs that point directly to
557
- a git repository.
558
-
559
- |===
560
-
561
- === Configuration and Source Code Reference
562
-
563
- Find details for all code references on:
564
- link:{binderhub-docs--reference}[BinderHub Docs - Reference, {browser-window--new}]