elastic-kernel 0.0.26__tar.gz → 0.0.28__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {elastic_kernel-0.0.26/elastic_kernel.egg-info → elastic_kernel-0.0.28}/PKG-INFO +114 -34
- elastic_kernel-0.0.28/README.md +130 -0
- {elastic_kernel-0.0.26 → elastic_kernel-0.0.28/elastic_kernel.egg-info}/PKG-INFO +114 -34
- elastic_kernel-0.0.28/elastic_notebook/__init__.py +4 -0
- {elastic_kernel-0.0.26 → elastic_kernel-0.0.28}/elastic_notebook/algorithm/baseline.py +3 -0
- {elastic_kernel-0.0.26 → elastic_kernel-0.0.28}/elastic_notebook/algorithm/optimizer_exact.py +3 -0
- {elastic_kernel-0.0.26 → elastic_kernel-0.0.28}/elastic_notebook/algorithm/selector.py +3 -0
- {elastic_kernel-0.0.26 → elastic_kernel-0.0.28}/elastic_notebook/core/common/checkpoint_file.py +3 -0
- {elastic_kernel-0.0.26 → elastic_kernel-0.0.28}/elastic_notebook/core/common/profile_graph_size.py +3 -0
- {elastic_kernel-0.0.26 → elastic_kernel-0.0.28}/elastic_notebook/core/common/profile_migration_speed.py +3 -0
- {elastic_kernel-0.0.26 → elastic_kernel-0.0.28}/elastic_notebook/core/common/profile_variable_size.py +3 -0
- {elastic_kernel-0.0.26 → elastic_kernel-0.0.28}/elastic_notebook/core/graph/cell_execution.py +3 -0
- {elastic_kernel-0.0.26 → elastic_kernel-0.0.28}/elastic_notebook/core/graph/graph.py +3 -0
- {elastic_kernel-0.0.26 → elastic_kernel-0.0.28}/elastic_notebook/core/graph/variable_snapshot.py +4 -0
- {elastic_kernel-0.0.26 → elastic_kernel-0.0.28}/elastic_notebook/core/io/filesystem_adapter.py +3 -0
- {elastic_kernel-0.0.26 → elastic_kernel-0.0.28}/elastic_notebook/core/io/migrate.py +3 -0
- {elastic_kernel-0.0.26 → elastic_kernel-0.0.28}/elastic_notebook/core/io/pickle.py +3 -0
- {elastic_kernel-0.0.26 → elastic_kernel-0.0.28}/elastic_notebook/core/io/recover.py +8 -0
- {elastic_kernel-0.0.26 → elastic_kernel-0.0.28}/elastic_notebook/core/mutation/fingerprint.py +3 -0
- {elastic_kernel-0.0.26 → elastic_kernel-0.0.28}/elastic_notebook/core/mutation/id_graph.py +3 -0
- {elastic_kernel-0.0.26 → elastic_kernel-0.0.28}/elastic_notebook/core/mutation/object_hash.py +3 -0
- {elastic_kernel-0.0.26 → elastic_kernel-0.0.28}/elastic_notebook/core/notebook/checkpoint.py +3 -0
- {elastic_kernel-0.0.26 → elastic_kernel-0.0.28}/elastic_notebook/core/notebook/find_input_vars.py +3 -0
- {elastic_kernel-0.0.26 → elastic_kernel-0.0.28}/elastic_notebook/core/notebook/find_output_vars.py +4 -0
- {elastic_kernel-0.0.26 → elastic_kernel-0.0.28}/elastic_notebook/core/notebook/restore_notebook.py +3 -0
- {elastic_kernel-0.0.26 → elastic_kernel-0.0.28}/elastic_notebook/core/notebook/update_graph.py +3 -0
- {elastic_kernel-0.0.26 → elastic_kernel-0.0.28}/elastic_notebook/elastic_notebook.py +3 -0
- {elastic_kernel-0.0.26 → elastic_kernel-0.0.28}/pyproject.toml +1 -1
- elastic_kernel-0.0.26/README.md +0 -50
- elastic_kernel-0.0.26/elastic_notebook/__init__.py +0 -1
- {elastic_kernel-0.0.26 → elastic_kernel-0.0.28}/LICENSE +0 -0
- {elastic_kernel-0.0.26 → elastic_kernel-0.0.28}/MANIFEST.in +0 -0
- {elastic_kernel-0.0.26 → elastic_kernel-0.0.28}/elastic_kernel/__init__.py +0 -0
- {elastic_kernel-0.0.26 → elastic_kernel-0.0.28}/elastic_kernel/command.py +0 -0
- {elastic_kernel-0.0.26 → elastic_kernel-0.0.28}/elastic_kernel/kernel.json +0 -0
- {elastic_kernel-0.0.26 → elastic_kernel-0.0.28}/elastic_kernel/kernel.py +0 -0
- {elastic_kernel-0.0.26 → elastic_kernel-0.0.28}/elastic_kernel.egg-info/SOURCES.txt +0 -0
- {elastic_kernel-0.0.26 → elastic_kernel-0.0.28}/elastic_kernel.egg-info/dependency_links.txt +0 -0
- {elastic_kernel-0.0.26 → elastic_kernel-0.0.28}/elastic_kernel.egg-info/entry_points.txt +0 -0
- {elastic_kernel-0.0.26 → elastic_kernel-0.0.28}/elastic_kernel.egg-info/requires.txt +0 -0
- {elastic_kernel-0.0.26 → elastic_kernel-0.0.28}/elastic_kernel.egg-info/top_level.txt +0 -0
- {elastic_kernel-0.0.26 → elastic_kernel-0.0.28}/elastic_notebook/algorithm/__init__.py +0 -0
- {elastic_kernel-0.0.26 → elastic_kernel-0.0.28}/elastic_notebook/core/__init__.py +0 -0
- {elastic_kernel-0.0.26 → elastic_kernel-0.0.28}/elastic_notebook/core/common/__init__.py +0 -0
- {elastic_kernel-0.0.26 → elastic_kernel-0.0.28}/elastic_notebook/core/graph/__init__.py +0 -0
- {elastic_kernel-0.0.26 → elastic_kernel-0.0.28}/elastic_notebook/core/io/__init__.py +0 -0
- {elastic_kernel-0.0.26 → elastic_kernel-0.0.28}/elastic_notebook/core/io/adapter.py +0 -0
- {elastic_kernel-0.0.26 → elastic_kernel-0.0.28}/elastic_notebook/core/mutation/__init__.py +0 -0
- {elastic_kernel-0.0.26 → elastic_kernel-0.0.28}/elastic_notebook/core/notebook/__init__.py +0 -0
- {elastic_kernel-0.0.26 → elastic_kernel-0.0.28}/setup.cfg +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: elastic-kernel
|
|
3
|
-
Version: 0.0.
|
|
3
|
+
Version: 0.0.28
|
|
4
4
|
Summary: An IPython Kernel that automatically saves and restores Jupyter Notebook execution states.
|
|
5
5
|
Author-email: ryutarom <m2002r1028@icloud.com>
|
|
6
6
|
License: Apache License
|
|
@@ -238,51 +238,131 @@ Dynamic: license-file
|
|
|
238
238
|
|
|
239
239
|
# ElasticKernel
|
|
240
240
|
|
|
241
|
-
|
|
241
|
+
**Never lose your Jupyter variables to a kernel restart again.**
|
|
242
242
|
|
|
243
|
-
|
|
243
|
+
ElasticKernel is a custom IPython kernel that **automatically checkpoints your notebook's execution state and restores it after a restart or crash** — no manual `pickle.dump` required. Pick up exactly where you left off.
|
|
244
244
|
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
```
|
|
245
|
+
[](https://pypi.org/project/elastic-kernel/)
|
|
246
|
+
[](https://pepy.tech/projects/elastic-kernel)
|
|
247
|
+
[](https://pepy.tech/projects/elastic-kernel)
|
|
248
|
+
[](LICENSE)
|
|
250
249
|
|
|
251
|
-
|
|
252
|
-
```sh
|
|
253
|
-
docker run -p 8888:8888 ghcr.io/mryutaro/elastickernel
|
|
254
|
-
```
|
|
250
|
+
> 🇯🇵 日本語版は [README.ja.md](README.ja.md) を参照してください。
|
|
255
251
|
|
|
256
|
-
|
|
252
|
+
<!--
|
|
253
|
+
TODO: Add a ~15s demo GIF at the top showing the core value:
|
|
254
|
+
heavy computation → kernel restart/crash → variables are still there.
|
|
255
|
+
A demo GIF here dramatically improves shareability.
|
|
256
|
+

|
|
257
|
+
-->
|
|
257
258
|
|
|
258
|
-
|
|
259
|
+
## Why ElasticKernel?
|
|
259
260
|
|
|
260
|
-
|
|
261
|
+
Every Jupyter user has been there: a long computation finishes, then an accidental kernel
|
|
262
|
+
restart (or an out-of-memory crash) wipes **every variable in your session**. The usual
|
|
263
|
+
workaround is scattering `pickle.dump` / `joblib.dump` calls everywhere and remembering to
|
|
264
|
+
reload them by hand.
|
|
261
265
|
|
|
262
|
-
|
|
263
|
-
```sh
|
|
264
|
-
$ uv pip install elastic-kernel
|
|
265
|
-
```
|
|
266
|
+
ElasticKernel removes that chore entirely:
|
|
266
267
|
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
268
|
+
- 🔄 **Automatic state recovery** — your variables survive kernel restarts and shutdowns, with zero changes to your code.
|
|
269
|
+
- 🧠 **Dependency-aware** — tracks how cells and variables depend on one another to restore a consistent state.
|
|
270
|
+
- ⚡ **Cost-optimized checkpoints** — for each variable it decides whether to *serialize* it or *recompute* it on restore, based on serialization size vs. recomputation cost (a min-cut optimization).
|
|
271
|
+
- 🪄 **Drop-in** — just pick the `Python 3 (ElasticKernel)` kernel; the rest of your workflow is unchanged.
|
|
272
|
+
|
|
273
|
+
## Installation & Usage
|
|
274
|
+
|
|
275
|
+
### Local
|
|
276
|
+
|
|
277
|
+
1. Install the package:
|
|
278
|
+
```sh
|
|
279
|
+
$ pip install elastic-kernel
|
|
280
|
+
```
|
|
281
|
+
|
|
282
|
+
2. Install the kernel:
|
|
283
|
+
```sh
|
|
284
|
+
$ elastic-kernel install
|
|
285
|
+
Elastic Kernel installed from: /path/to/elastic_kernel
|
|
286
|
+
```
|
|
287
|
+
|
|
288
|
+
3. Verify the kernel is installed:
|
|
289
|
+
```sh
|
|
290
|
+
$ jupyter kernelspec list
|
|
291
|
+
Available kernels:
|
|
292
|
+
elastic_kernel /path/to/Jupyter/kernels/elastic_kernel
|
|
293
|
+
```
|
|
294
|
+
|
|
295
|
+
4. Launch JupyterLab:
|
|
296
|
+
```sh
|
|
297
|
+
$ jupyter lab --ip=0.0.0.0
|
|
298
|
+
```
|
|
299
|
+
|
|
300
|
+
5. Open JupyterLab in your browser.
|
|
301
|
+
|
|
302
|
+
6. Select the **Python 3 (ElasticKernel)** kernel.
|
|
303
|
+
|
|
304
|
+
### Docker
|
|
305
|
+
|
|
306
|
+
1. Pull the image:
|
|
307
|
+
```sh
|
|
308
|
+
docker pull ghcr.io/mryutaro/elastickernel
|
|
309
|
+
```
|
|
310
|
+
|
|
311
|
+
2. Start a container:
|
|
312
|
+
```sh
|
|
313
|
+
docker run -p 8888:8888 ghcr.io/mryutaro/elastickernel
|
|
314
|
+
```
|
|
315
|
+
|
|
316
|
+
3. Open JupyterLab in your browser.
|
|
317
|
+
|
|
318
|
+
4. Select the **Python 3 (ElasticKernel)** kernel.
|
|
319
|
+
|
|
320
|
+
## How It Works
|
|
321
|
+
|
|
322
|
+
ElasticKernel extends the IPython kernel to observe each cell execution. As you run cells it
|
|
323
|
+
builds a **dependency graph** of variables and the cell executions that produce them. When the
|
|
324
|
+
kernel shuts down or restarts, it profiles serialization speed, runs a cost optimizer to split
|
|
325
|
+
variables into a *migrate* set (serialized to disk) and a *recompute* set (regenerated by
|
|
326
|
+
re-running cells), and writes a checkpoint. On the next start it loads the checkpoint, injects
|
|
327
|
+
the migrated variables back into your namespace, and recomputes the rest.
|
|
328
|
+
|
|
329
|
+
## Documentation
|
|
330
|
+
|
|
331
|
+
- **Developer guide:** [docs/DEVELOPERS.md](docs/DEVELOPERS.md)
|
|
332
|
+
- **日本語 README:** [README.ja.md](README.ja.md)
|
|
333
|
+
|
|
334
|
+
## Publication
|
|
335
|
+
|
|
336
|
+
This project was presented in the following paper. If you use ElasticKernel in your research,
|
|
337
|
+
please cite:
|
|
338
|
+
|
|
339
|
+
> R. Matsumoto, K. Taniguchi, T. Hayami, K. Takahashi, and S. Date.
|
|
340
|
+
> "ElasticHub: A Cost-Efficient JupyterHub Platform via Automated Scaling with Kubernetes on Hybrid Cloud."
|
|
341
|
+
> Proceedings of the 16th International Conference on Cloud Computing and Services Science, pp. 261–268, 2026.
|
|
342
|
+
> DOI: [10.5220/0014840200004039](https://doi.org/10.5220/0014840200004039)
|
|
272
343
|
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
344
|
+
```bibtex
|
|
345
|
+
@inproceedings{matsumoto2026elastichub,
|
|
346
|
+
author = {Matsumoto, R. and Taniguchi, K. and Hayami, T. and Takahashi, K. and Date, S.},
|
|
347
|
+
title = {ElasticHub: A Cost-Efficient JupyterHub Platform via Automated Scaling with Kubernetes on Hybrid Cloud},
|
|
348
|
+
booktitle = {Proceedings of the 16th International Conference on Cloud Computing and Services Science},
|
|
349
|
+
year = {2026},
|
|
350
|
+
pages = {261--268},
|
|
351
|
+
isbn = {978-989-758-829-7},
|
|
352
|
+
issn = {2184-5042},
|
|
353
|
+
doi = {10.5220/0014840200004039}
|
|
354
|
+
}
|
|
278
355
|
```
|
|
279
356
|
|
|
280
|
-
|
|
357
|
+
## Acknowledgments
|
|
281
358
|
|
|
282
|
-
|
|
359
|
+
This project includes code from [ElasticNotebook](https://github.com/illinoisdata/ElasticNotebook),
|
|
360
|
+
developed at the University of Illinois. ElasticNotebook is licensed under the Apache License 2.0.
|
|
283
361
|
|
|
284
|
-
|
|
362
|
+
> Zhaoheng Li, Pranav Gor, Rahul Prabhu, Hui Yu, Yuzhou Mao, Yongjoo Park.
|
|
363
|
+
> "ElasticNotebook: Enabling Live Migration for Computational Notebooks."
|
|
364
|
+
> Proceedings of the VLDB Endowment, Vol. 17, No. 2, pp. 119-133, 2023.
|
|
285
365
|
|
|
286
|
-
##
|
|
366
|
+
## License
|
|
287
367
|
|
|
288
|
-
[
|
|
368
|
+
Licensed under the [Apache License 2.0](LICENSE).
|
|
@@ -0,0 +1,130 @@
|
|
|
1
|
+
# ElasticKernel
|
|
2
|
+
|
|
3
|
+
**Never lose your Jupyter variables to a kernel restart again.**
|
|
4
|
+
|
|
5
|
+
ElasticKernel is a custom IPython kernel that **automatically checkpoints your notebook's execution state and restores it after a restart or crash** — no manual `pickle.dump` required. Pick up exactly where you left off.
|
|
6
|
+
|
|
7
|
+
[](https://pypi.org/project/elastic-kernel/)
|
|
8
|
+
[](https://pepy.tech/projects/elastic-kernel)
|
|
9
|
+
[](https://pepy.tech/projects/elastic-kernel)
|
|
10
|
+
[](LICENSE)
|
|
11
|
+
|
|
12
|
+
> 🇯🇵 日本語版は [README.ja.md](README.ja.md) を参照してください。
|
|
13
|
+
|
|
14
|
+
<!--
|
|
15
|
+
TODO: Add a ~15s demo GIF at the top showing the core value:
|
|
16
|
+
heavy computation → kernel restart/crash → variables are still there.
|
|
17
|
+
A demo GIF here dramatically improves shareability.
|
|
18
|
+

|
|
19
|
+
-->
|
|
20
|
+
|
|
21
|
+
## Why ElasticKernel?
|
|
22
|
+
|
|
23
|
+
Every Jupyter user has been there: a long computation finishes, then an accidental kernel
|
|
24
|
+
restart (or an out-of-memory crash) wipes **every variable in your session**. The usual
|
|
25
|
+
workaround is scattering `pickle.dump` / `joblib.dump` calls everywhere and remembering to
|
|
26
|
+
reload them by hand.
|
|
27
|
+
|
|
28
|
+
ElasticKernel removes that chore entirely:
|
|
29
|
+
|
|
30
|
+
- 🔄 **Automatic state recovery** — your variables survive kernel restarts and shutdowns, with zero changes to your code.
|
|
31
|
+
- 🧠 **Dependency-aware** — tracks how cells and variables depend on one another to restore a consistent state.
|
|
32
|
+
- ⚡ **Cost-optimized checkpoints** — for each variable it decides whether to *serialize* it or *recompute* it on restore, based on serialization size vs. recomputation cost (a min-cut optimization).
|
|
33
|
+
- 🪄 **Drop-in** — just pick the `Python 3 (ElasticKernel)` kernel; the rest of your workflow is unchanged.
|
|
34
|
+
|
|
35
|
+
## Installation & Usage
|
|
36
|
+
|
|
37
|
+
### Local
|
|
38
|
+
|
|
39
|
+
1. Install the package:
|
|
40
|
+
```sh
|
|
41
|
+
$ pip install elastic-kernel
|
|
42
|
+
```
|
|
43
|
+
|
|
44
|
+
2. Install the kernel:
|
|
45
|
+
```sh
|
|
46
|
+
$ elastic-kernel install
|
|
47
|
+
Elastic Kernel installed from: /path/to/elastic_kernel
|
|
48
|
+
```
|
|
49
|
+
|
|
50
|
+
3. Verify the kernel is installed:
|
|
51
|
+
```sh
|
|
52
|
+
$ jupyter kernelspec list
|
|
53
|
+
Available kernels:
|
|
54
|
+
elastic_kernel /path/to/Jupyter/kernels/elastic_kernel
|
|
55
|
+
```
|
|
56
|
+
|
|
57
|
+
4. Launch JupyterLab:
|
|
58
|
+
```sh
|
|
59
|
+
$ jupyter lab --ip=0.0.0.0
|
|
60
|
+
```
|
|
61
|
+
|
|
62
|
+
5. Open JupyterLab in your browser.
|
|
63
|
+
|
|
64
|
+
6. Select the **Python 3 (ElasticKernel)** kernel.
|
|
65
|
+
|
|
66
|
+
### Docker
|
|
67
|
+
|
|
68
|
+
1. Pull the image:
|
|
69
|
+
```sh
|
|
70
|
+
docker pull ghcr.io/mryutaro/elastickernel
|
|
71
|
+
```
|
|
72
|
+
|
|
73
|
+
2. Start a container:
|
|
74
|
+
```sh
|
|
75
|
+
docker run -p 8888:8888 ghcr.io/mryutaro/elastickernel
|
|
76
|
+
```
|
|
77
|
+
|
|
78
|
+
3. Open JupyterLab in your browser.
|
|
79
|
+
|
|
80
|
+
4. Select the **Python 3 (ElasticKernel)** kernel.
|
|
81
|
+
|
|
82
|
+
## How It Works
|
|
83
|
+
|
|
84
|
+
ElasticKernel extends the IPython kernel to observe each cell execution. As you run cells it
|
|
85
|
+
builds a **dependency graph** of variables and the cell executions that produce them. When the
|
|
86
|
+
kernel shuts down or restarts, it profiles serialization speed, runs a cost optimizer to split
|
|
87
|
+
variables into a *migrate* set (serialized to disk) and a *recompute* set (regenerated by
|
|
88
|
+
re-running cells), and writes a checkpoint. On the next start it loads the checkpoint, injects
|
|
89
|
+
the migrated variables back into your namespace, and recomputes the rest.
|
|
90
|
+
|
|
91
|
+
## Documentation
|
|
92
|
+
|
|
93
|
+
- **Developer guide:** [docs/DEVELOPERS.md](docs/DEVELOPERS.md)
|
|
94
|
+
- **日本語 README:** [README.ja.md](README.ja.md)
|
|
95
|
+
|
|
96
|
+
## Publication
|
|
97
|
+
|
|
98
|
+
This project was presented in the following paper. If you use ElasticKernel in your research,
|
|
99
|
+
please cite:
|
|
100
|
+
|
|
101
|
+
> R. Matsumoto, K. Taniguchi, T. Hayami, K. Takahashi, and S. Date.
|
|
102
|
+
> "ElasticHub: A Cost-Efficient JupyterHub Platform via Automated Scaling with Kubernetes on Hybrid Cloud."
|
|
103
|
+
> Proceedings of the 16th International Conference on Cloud Computing and Services Science, pp. 261–268, 2026.
|
|
104
|
+
> DOI: [10.5220/0014840200004039](https://doi.org/10.5220/0014840200004039)
|
|
105
|
+
|
|
106
|
+
```bibtex
|
|
107
|
+
@inproceedings{matsumoto2026elastichub,
|
|
108
|
+
author = {Matsumoto, R. and Taniguchi, K. and Hayami, T. and Takahashi, K. and Date, S.},
|
|
109
|
+
title = {ElasticHub: A Cost-Efficient JupyterHub Platform via Automated Scaling with Kubernetes on Hybrid Cloud},
|
|
110
|
+
booktitle = {Proceedings of the 16th International Conference on Cloud Computing and Services Science},
|
|
111
|
+
year = {2026},
|
|
112
|
+
pages = {261--268},
|
|
113
|
+
isbn = {978-989-758-829-7},
|
|
114
|
+
issn = {2184-5042},
|
|
115
|
+
doi = {10.5220/0014840200004039}
|
|
116
|
+
}
|
|
117
|
+
```
|
|
118
|
+
|
|
119
|
+
## Acknowledgments
|
|
120
|
+
|
|
121
|
+
This project includes code from [ElasticNotebook](https://github.com/illinoisdata/ElasticNotebook),
|
|
122
|
+
developed at the University of Illinois. ElasticNotebook is licensed under the Apache License 2.0.
|
|
123
|
+
|
|
124
|
+
> Zhaoheng Li, Pranav Gor, Rahul Prabhu, Hui Yu, Yuzhou Mao, Yongjoo Park.
|
|
125
|
+
> "ElasticNotebook: Enabling Live Migration for Computational Notebooks."
|
|
126
|
+
> Proceedings of the VLDB Endowment, Vol. 17, No. 2, pp. 119-133, 2023.
|
|
127
|
+
|
|
128
|
+
## License
|
|
129
|
+
|
|
130
|
+
Licensed under the [Apache License 2.0](LICENSE).
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: elastic-kernel
|
|
3
|
-
Version: 0.0.
|
|
3
|
+
Version: 0.0.28
|
|
4
4
|
Summary: An IPython Kernel that automatically saves and restores Jupyter Notebook execution states.
|
|
5
5
|
Author-email: ryutarom <m2002r1028@icloud.com>
|
|
6
6
|
License: Apache License
|
|
@@ -238,51 +238,131 @@ Dynamic: license-file
|
|
|
238
238
|
|
|
239
239
|
# ElasticKernel
|
|
240
240
|
|
|
241
|
-
|
|
241
|
+
**Never lose your Jupyter variables to a kernel restart again.**
|
|
242
242
|
|
|
243
|
-
|
|
243
|
+
ElasticKernel is a custom IPython kernel that **automatically checkpoints your notebook's execution state and restores it after a restart or crash** — no manual `pickle.dump` required. Pick up exactly where you left off.
|
|
244
244
|
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
```
|
|
245
|
+
[](https://pypi.org/project/elastic-kernel/)
|
|
246
|
+
[](https://pepy.tech/projects/elastic-kernel)
|
|
247
|
+
[](https://pepy.tech/projects/elastic-kernel)
|
|
248
|
+
[](LICENSE)
|
|
250
249
|
|
|
251
|
-
|
|
252
|
-
```sh
|
|
253
|
-
docker run -p 8888:8888 ghcr.io/mryutaro/elastickernel
|
|
254
|
-
```
|
|
250
|
+
> 🇯🇵 日本語版は [README.ja.md](README.ja.md) を参照してください。
|
|
255
251
|
|
|
256
|
-
|
|
252
|
+
<!--
|
|
253
|
+
TODO: Add a ~15s demo GIF at the top showing the core value:
|
|
254
|
+
heavy computation → kernel restart/crash → variables are still there.
|
|
255
|
+
A demo GIF here dramatically improves shareability.
|
|
256
|
+

|
|
257
|
+
-->
|
|
257
258
|
|
|
258
|
-
|
|
259
|
+
## Why ElasticKernel?
|
|
259
260
|
|
|
260
|
-
|
|
261
|
+
Every Jupyter user has been there: a long computation finishes, then an accidental kernel
|
|
262
|
+
restart (or an out-of-memory crash) wipes **every variable in your session**. The usual
|
|
263
|
+
workaround is scattering `pickle.dump` / `joblib.dump` calls everywhere and remembering to
|
|
264
|
+
reload them by hand.
|
|
261
265
|
|
|
262
|
-
|
|
263
|
-
```sh
|
|
264
|
-
$ uv pip install elastic-kernel
|
|
265
|
-
```
|
|
266
|
+
ElasticKernel removes that chore entirely:
|
|
266
267
|
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
268
|
+
- 🔄 **Automatic state recovery** — your variables survive kernel restarts and shutdowns, with zero changes to your code.
|
|
269
|
+
- 🧠 **Dependency-aware** — tracks how cells and variables depend on one another to restore a consistent state.
|
|
270
|
+
- ⚡ **Cost-optimized checkpoints** — for each variable it decides whether to *serialize* it or *recompute* it on restore, based on serialization size vs. recomputation cost (a min-cut optimization).
|
|
271
|
+
- 🪄 **Drop-in** — just pick the `Python 3 (ElasticKernel)` kernel; the rest of your workflow is unchanged.
|
|
272
|
+
|
|
273
|
+
## Installation & Usage
|
|
274
|
+
|
|
275
|
+
### Local
|
|
276
|
+
|
|
277
|
+
1. Install the package:
|
|
278
|
+
```sh
|
|
279
|
+
$ pip install elastic-kernel
|
|
280
|
+
```
|
|
281
|
+
|
|
282
|
+
2. Install the kernel:
|
|
283
|
+
```sh
|
|
284
|
+
$ elastic-kernel install
|
|
285
|
+
Elastic Kernel installed from: /path/to/elastic_kernel
|
|
286
|
+
```
|
|
287
|
+
|
|
288
|
+
3. Verify the kernel is installed:
|
|
289
|
+
```sh
|
|
290
|
+
$ jupyter kernelspec list
|
|
291
|
+
Available kernels:
|
|
292
|
+
elastic_kernel /path/to/Jupyter/kernels/elastic_kernel
|
|
293
|
+
```
|
|
294
|
+
|
|
295
|
+
4. Launch JupyterLab:
|
|
296
|
+
```sh
|
|
297
|
+
$ jupyter lab --ip=0.0.0.0
|
|
298
|
+
```
|
|
299
|
+
|
|
300
|
+
5. Open JupyterLab in your browser.
|
|
301
|
+
|
|
302
|
+
6. Select the **Python 3 (ElasticKernel)** kernel.
|
|
303
|
+
|
|
304
|
+
### Docker
|
|
305
|
+
|
|
306
|
+
1. Pull the image:
|
|
307
|
+
```sh
|
|
308
|
+
docker pull ghcr.io/mryutaro/elastickernel
|
|
309
|
+
```
|
|
310
|
+
|
|
311
|
+
2. Start a container:
|
|
312
|
+
```sh
|
|
313
|
+
docker run -p 8888:8888 ghcr.io/mryutaro/elastickernel
|
|
314
|
+
```
|
|
315
|
+
|
|
316
|
+
3. Open JupyterLab in your browser.
|
|
317
|
+
|
|
318
|
+
4. Select the **Python 3 (ElasticKernel)** kernel.
|
|
319
|
+
|
|
320
|
+
## How It Works
|
|
321
|
+
|
|
322
|
+
ElasticKernel extends the IPython kernel to observe each cell execution. As you run cells it
|
|
323
|
+
builds a **dependency graph** of variables and the cell executions that produce them. When the
|
|
324
|
+
kernel shuts down or restarts, it profiles serialization speed, runs a cost optimizer to split
|
|
325
|
+
variables into a *migrate* set (serialized to disk) and a *recompute* set (regenerated by
|
|
326
|
+
re-running cells), and writes a checkpoint. On the next start it loads the checkpoint, injects
|
|
327
|
+
the migrated variables back into your namespace, and recomputes the rest.
|
|
328
|
+
|
|
329
|
+
## Documentation
|
|
330
|
+
|
|
331
|
+
- **Developer guide:** [docs/DEVELOPERS.md](docs/DEVELOPERS.md)
|
|
332
|
+
- **日本語 README:** [README.ja.md](README.ja.md)
|
|
333
|
+
|
|
334
|
+
## Publication
|
|
335
|
+
|
|
336
|
+
This project was presented in the following paper. If you use ElasticKernel in your research,
|
|
337
|
+
please cite:
|
|
338
|
+
|
|
339
|
+
> R. Matsumoto, K. Taniguchi, T. Hayami, K. Takahashi, and S. Date.
|
|
340
|
+
> "ElasticHub: A Cost-Efficient JupyterHub Platform via Automated Scaling with Kubernetes on Hybrid Cloud."
|
|
341
|
+
> Proceedings of the 16th International Conference on Cloud Computing and Services Science, pp. 261–268, 2026.
|
|
342
|
+
> DOI: [10.5220/0014840200004039](https://doi.org/10.5220/0014840200004039)
|
|
272
343
|
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
344
|
+
```bibtex
|
|
345
|
+
@inproceedings{matsumoto2026elastichub,
|
|
346
|
+
author = {Matsumoto, R. and Taniguchi, K. and Hayami, T. and Takahashi, K. and Date, S.},
|
|
347
|
+
title = {ElasticHub: A Cost-Efficient JupyterHub Platform via Automated Scaling with Kubernetes on Hybrid Cloud},
|
|
348
|
+
booktitle = {Proceedings of the 16th International Conference on Cloud Computing and Services Science},
|
|
349
|
+
year = {2026},
|
|
350
|
+
pages = {261--268},
|
|
351
|
+
isbn = {978-989-758-829-7},
|
|
352
|
+
issn = {2184-5042},
|
|
353
|
+
doi = {10.5220/0014840200004039}
|
|
354
|
+
}
|
|
278
355
|
```
|
|
279
356
|
|
|
280
|
-
|
|
357
|
+
## Acknowledgments
|
|
281
358
|
|
|
282
|
-
|
|
359
|
+
This project includes code from [ElasticNotebook](https://github.com/illinoisdata/ElasticNotebook),
|
|
360
|
+
developed at the University of Illinois. ElasticNotebook is licensed under the Apache License 2.0.
|
|
283
361
|
|
|
284
|
-
|
|
362
|
+
> Zhaoheng Li, Pranav Gor, Rahul Prabhu, Hui Yu, Yuzhou Mao, Yongjoo Park.
|
|
363
|
+
> "ElasticNotebook: Enabling Live Migration for Computational Notebooks."
|
|
364
|
+
> Proceedings of the VLDB Endowment, Vol. 17, No. 2, pp. 119-133, 2023.
|
|
285
365
|
|
|
286
|
-
##
|
|
366
|
+
## License
|
|
287
367
|
|
|
288
|
-
[
|
|
368
|
+
Licensed under the [Apache License 2.0](LICENSE).
|
|
@@ -1,3 +1,11 @@
|
|
|
1
|
+
#!/usr/bin/env python
|
|
2
|
+
# -*- coding: utf-8 -*-
|
|
3
|
+
#
|
|
4
|
+
# Copyright 2021-2022 University of Illinois
|
|
5
|
+
#
|
|
6
|
+
# This file has been modified from the original ElasticNotebook.
|
|
7
|
+
# Original: https://github.com/illinoisdata/ElasticNotebook
|
|
8
|
+
|
|
1
9
|
import logging
|
|
2
10
|
import time
|
|
3
11
|
from collections import defaultdict
|
{elastic_kernel-0.0.26 → elastic_kernel-0.0.28}/elastic_notebook/core/notebook/find_output_vars.py
RENAMED
|
@@ -1,3 +1,7 @@
|
|
|
1
|
+
# This file has been modified from the original ElasticNotebook.
|
|
2
|
+
# Original: https://github.com/illinoisdata/ElasticNotebook
|
|
3
|
+
|
|
4
|
+
|
|
1
5
|
def find_created_deleted_vars(pre_execution, post_execution):
|
|
2
6
|
"""
|
|
3
7
|
Find created and deleted variables through computing a difference of the user namespace pre and post execution.
|
|
@@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta"
|
|
|
4
4
|
|
|
5
5
|
[project]
|
|
6
6
|
name = "elastic-kernel"
|
|
7
|
-
version = "0.0.
|
|
7
|
+
version = "0.0.28"
|
|
8
8
|
description = "An IPython Kernel that automatically saves and restores Jupyter Notebook execution states."
|
|
9
9
|
authors = [
|
|
10
10
|
{ name = "ryutarom", email = "m2002r1028@icloud.com" }
|
elastic_kernel-0.0.26/README.md
DELETED
|
@@ -1,50 +0,0 @@
|
|
|
1
|
-
# ElasticKernel
|
|
2
|
-
|
|
3
|
-
ElasticKernel: An IPython Kernel that automatically saves and restores Jupyter Notebook execution states.
|
|
4
|
-
|
|
5
|
-
## 使用方法
|
|
6
|
-
|
|
7
|
-
### Dockerを用いた方法
|
|
8
|
-
1. イメージをプルする
|
|
9
|
-
```sh
|
|
10
|
-
docker pull ghcr.io/mryutaro/elastickernel
|
|
11
|
-
```
|
|
12
|
-
|
|
13
|
-
2. コンテナを起動する
|
|
14
|
-
```sh
|
|
15
|
-
docker run -p 8888:8888 ghcr.io/mryutaro/elastickernel
|
|
16
|
-
```
|
|
17
|
-
|
|
18
|
-
3. ブラウザからJupyterLabにアクセスする
|
|
19
|
-
|
|
20
|
-
4. Python 3 (Elastic)のカーネルを選択する
|
|
21
|
-
|
|
22
|
-
### ローカルでの使用方法
|
|
23
|
-
|
|
24
|
-
1. ライブラリをインストールする
|
|
25
|
-
```sh
|
|
26
|
-
$ uv pip install elastic-kernel
|
|
27
|
-
```
|
|
28
|
-
|
|
29
|
-
2. カーネルをインストールする
|
|
30
|
-
```sh
|
|
31
|
-
$ elastic-kernel install
|
|
32
|
-
Elastic Kernel installed from: /path/to/elastic_kernel
|
|
33
|
-
```
|
|
34
|
-
|
|
35
|
-
3. カーネルがインストールされたか確認する
|
|
36
|
-
```sh
|
|
37
|
-
$ jupyter kernelspec list
|
|
38
|
-
Available kernels:
|
|
39
|
-
elastic_kernel /Users/matsumotoryutaro/Library/Jupyter/kernels/elastic_kernel
|
|
40
|
-
```
|
|
41
|
-
|
|
42
|
-
4. JupyterLabを起動する
|
|
43
|
-
|
|
44
|
-
5. ブラウザからJupyterLabにアクセスする
|
|
45
|
-
|
|
46
|
-
6. Python 3 (Elastic)のカーネルを選択する
|
|
47
|
-
|
|
48
|
-
## 開発者向け資料
|
|
49
|
-
|
|
50
|
-
[ここ](/docs/developers.md)を参考にしてください.
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
from .elastic_notebook import ElasticNotebook # noqa
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{elastic_kernel-0.0.26 → elastic_kernel-0.0.28}/elastic_kernel.egg-info/dependency_links.txt
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|