Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Precompilation doesn't finish and reconnecting to Binder #24

Open
BoundaryValueProblems opened this issue Sep 22, 2024 · 4 comments
Open

Comments

@BoundaryValueProblems
Copy link

In my Pluto notebook file, I have the following line in the very beginning:

using Markdown, InteractiveUtils, PlutoUI, Plots, LaTeXStrings, LinearAlgebra, FFTW

When I first connect this notebook file to binder, it got stuck at precompilation, and before finishing the precompilation stage, it is disconnected and always says the following:

A new server was started - this notebook session is no longer running.

Would you like to go back to the main menu?


[Go back](https://boundaryvalueproblems.github.io/EACHABook/)
[Stay here](https://boundaryvalueproblems.github.io/EACHABook/lecture02.html#)

How can I resolve this precompilation problem?

@fonsp
Copy link
Member

fonsp commented Oct 4, 2024

Very strange! I tried your notebook now with binder, and it also failed. I notice that it disconnects while precompiling packages. I sometimes see a binder crash when the pod runs out of memory, but in this case the binder session remains active, you can still click the Pluto logo and go back to the main menu and start another notebook.

That means that the session suddenly got removed... but I don't think it is possible for an error to cause a session to be removed.

I launched a second notebook in parallel. The second notebook (1+1) works, but when the first notebook precompiles, both sessions are removed.

So I think that it is in fact a new session. This might be a Docker thing, were the crashed session is quitely swapped out for a new one.

@fonsp
Copy link
Member

fonsp commented Oct 4, 2024

I think the conclusion is that the packages in this notebook require too much RAM to precompile, at least when precompilation happens in parallel. I can't really think of an easy to way to work around this, other than to try to use fewer heavy packages.

@BoundaryValueProblems
Copy link
Author

@fonsp, thanks for your feedback. Is there any way to precompile these packages sequentially, not in parallel?

@fonsp
Copy link
Member

fonsp commented Oct 7, 2024

Yes and no. Normally you could set https://docs.julialang.org/en/v1/manual/environment-variables/#JULIA_NUM_PRECOMPILE_TASKS to 1, but I don't think it is possible for you to set this for your notebook.

Binder on Pluto works different from normal binder projects, to make it possible to have the binder button on any notebook without setup. We just have one repository: https://github.com/fonsp/pluto-on-binder that is used by every notebook. This repo contains Pluto and some binder configuration to make it possible to use pluto on binder (which is not trivial).

The downside is that the binder does not have the precompilation cache ready for your notebooks. This would be possible if you had a binder repository just for your notebook(s). Then precompilation would happen once, during the binder build phase, and later launches would use the cache. But I'm not sure how to set this up.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants